Compare commits

..

3 Commits

Author SHA1 Message Date
Zbigniew Jędrzejewski-Szmek 9cbf1e58f9 units: skip modprobe@.service if the unit appears to be already loaded
Possible alternative to #14819.

For me, setting RemainAfterExit=yes would be OK, but if people think that it
might cause issues, then this could be a reasonable alternative that still
let's us skip the invocation of the separate binary.
2020-03-05 18:43:50 +00:00
Jörg Thalheim ff12a7954c treewide: more portable bash shebangs
As in 2a5fcfae02
and in 3e67e5c992
using /usr/bin/env allows bash to be looked up in PATH
rather than being hard-coded.

As with the previous changes the same arguments apply
- distributions have scripts to rewrite shebangs on installation and
  they know what locations to rely on.
- For tests/compilation we should rather rely on the user to have setup
  there PATH correctly.

In particular this makes testing from git easier on NixOS where do not provide
/bin/bash to improve compose-ability.
2020-03-05 17:27:07 +01:00
Zbigniew Jędrzejewski-Szmek eda0cbf071
Use Finished instead of Started for Type=oneshot services (#14851)
UnitStatusMessageFormats.finished_job, if present,
will be called with the same arguments as
job_get_done_status_message_format() to provide a format string
appropriate for the context

This commit replaces "Started" with "Finished" for started oneshot
units, as mentioned in the referenced issue

Closes #2458.
2020-03-05 17:24:19 +01:00
98 changed files with 139 additions and 112 deletions

3
configure vendored
View File

@ -1,4 +1,5 @@
#!/bin/bash -e #!/usr/bin/env bash
set -e
cflags=CFLAGS="$CFLAGS" cflags=CFLAGS="$CFLAGS"
cxxflags=CXXFLAGS="$CXXFLAGS" cxxflags=CXXFLAGS="$CXXFLAGS"

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
set -eu set -eu

View File

@ -797,9 +797,15 @@ _pure_ static const char *job_get_done_status_message_format(Unit *u, JobType t,
assert(t < _JOB_TYPE_MAX); assert(t < _JOB_TYPE_MAX);
if (IN_SET(t, JOB_START, JOB_STOP, JOB_RESTART)) { if (IN_SET(t, JOB_START, JOB_STOP, JOB_RESTART)) {
const UnitStatusMessageFormats *formats = &UNIT_VTABLE(u)->status_message_formats;
if (formats->finished_job) {
format = formats->finished_job(u, t, result);
if (format)
return format;
}
format = t == JOB_START ? format = t == JOB_START ?
UNIT_VTABLE(u)->status_message_formats.finished_start_job[result] : formats->finished_start_job[result] :
UNIT_VTABLE(u)->status_message_formats.finished_stop_job[result]; formats->finished_stop_job[result];
if (format) if (format)
return format; return format;
} }

View File

@ -4308,6 +4308,18 @@ static int service_can_clean(Unit *u, ExecCleanMask *ret) {
return exec_context_get_clean_mask(&s->exec_context, ret); return exec_context_get_clean_mask(&s->exec_context, ret);
} }
static const char *service_finished_job(Unit *u, JobType t, JobResult result) {
if (t == JOB_START && result == JOB_DONE) {
Service *s = SERVICE(u);
if (s->type == SERVICE_ONESHOT)
return "Finished %s.";
}
/* Fall back to generic */
return NULL;
}
static const char* const service_restart_table[_SERVICE_RESTART_MAX] = { static const char* const service_restart_table[_SERVICE_RESTART_MAX] = {
[SERVICE_RESTART_NO] = "no", [SERVICE_RESTART_NO] = "no",
[SERVICE_RESTART_ON_SUCCESS] = "on-success", [SERVICE_RESTART_ON_SUCCESS] = "on-success",
@ -4455,7 +4467,6 @@ const UnitVTable service_vtable = {
[1] = "Stopping %s...", [1] = "Stopping %s...",
}, },
.finished_start_job = { .finished_start_job = {
[JOB_DONE] = "Started %s.",
[JOB_FAILED] = "Failed to start %s.", [JOB_FAILED] = "Failed to start %s.",
[JOB_SKIPPED] = "Skipped %s.", [JOB_SKIPPED] = "Skipped %s.",
}, },
@ -4463,5 +4474,6 @@ const UnitVTable service_vtable = {
[JOB_DONE] = "Stopped %s.", [JOB_DONE] = "Stopped %s.",
[JOB_FAILED] = "Stopped (with error) %s.", [JOB_FAILED] = "Stopped (with error) %s.",
}, },
.finished_job = service_finished_job,
}, },
}; };

View File

@ -382,6 +382,9 @@ typedef struct UnitStatusMessageFormats {
const char *starting_stopping[2]; const char *starting_stopping[2];
const char *finished_start_job[_JOB_RESULT_MAX]; const char *finished_start_job[_JOB_RESULT_MAX];
const char *finished_stop_job[_JOB_RESULT_MAX]; const char *finished_stop_job[_JOB_RESULT_MAX];
/* If this entry is present, it'll be called to provide a context-dependent format string,
* or NULL to fall back to finished_{start,stop}_job; if those are NULL too, fall back to generic. */
const char *(*finished_job)(Unit *u, JobType t, JobResult result);
} UnitStatusMessageFormats; } UnitStatusMessageFormats;
/* Flags used when writing drop-in files or transient unit files */ /* Flags used when writing drop-in files or transient unit files */

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- # -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# ex: ts=8 sw=4 sts=4 et filetype=sh # ex: ts=8 sw=4 sts=4 et filetype=sh

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- # -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# ex: ts=8 sw=4 sts=4 et filetype=sh # ex: ts=8 sw=4 sts=4 et filetype=sh

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- # -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# ex: ts=8 sw=4 sts=4 et filetype=sh # ex: ts=8 sw=4 sts=4 et filetype=sh

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- # -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# ex: ts=8 sw=4 sts=4 et filetype=sh # ex: ts=8 sw=4 sts=4 et filetype=sh
# SPDX-License-Identifier: LGPL-2.1+ # SPDX-License-Identifier: LGPL-2.1+

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
set -e set -e
TEST_DESCRIPTION="Basic systemd setup" TEST_DESCRIPTION="Basic systemd setup"
RUN_IN_UNPRIVILEGED_CONTAINER=${RUN_IN_UNPRIVILEGED_CONTAINER:-yes} RUN_IN_UNPRIVILEGED_CONTAINER=${RUN_IN_UNPRIVILEGED_CONTAINER:-yes}

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
set -e set -e
TEST_DESCRIPTION="cryptsetup systemd setup" TEST_DESCRIPTION="cryptsetup systemd setup"
TEST_NO_NSPAWN=1 TEST_NO_NSPAWN=1

View File

@ -1,4 +1,5 @@
#!/bin/bash -ex #!/usr/bin/env bash
set -ex
# Test merging of a --job-mode=ignore-dependencies job into a previously # Test merging of a --job-mode=ignore-dependencies job into a previously
# installed job. # installed job.

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
set -e set -e
TEST_DESCRIPTION="Job-related tests" TEST_DESCRIPTION="Job-related tests"
TEST_NO_QEMU=1 TEST_NO_QEMU=1

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
set -x set -x
set -e set -e
set -o pipefail set -o pipefail

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
set -e set -e
TEST_DESCRIPTION="Journal-related tests" TEST_DESCRIPTION="Journal-related tests"

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
set -x set -x
set -e set -e
set -o pipefail set -o pipefail

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
set -e set -e
TEST_DESCRIPTION="Resource limits-related tests" TEST_DESCRIPTION="Resource limits-related tests"

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
set -x set -x
set -e set -e
set -o pipefail set -o pipefail

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
set -e set -e
TEST_DESCRIPTION="SELinux tests" TEST_DESCRIPTION="SELinux tests"
TEST_NO_NSPAWN=1 TEST_NO_NSPAWN=1

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
set -x set -x
set -e set -e

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
set -e set -e
TEST_DESCRIPTION="https://github.com/systemd/systemd/issues/1981" TEST_DESCRIPTION="https://github.com/systemd/systemd/issues/1981"
TEST_NO_QEMU=1 TEST_NO_QEMU=1

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
set -e set -e
TEST_DESCRIPTION="https://github.com/systemd/systemd/issues/2730" TEST_DESCRIPTION="https://github.com/systemd/systemd/issues/2730"
TEST_NO_NSPAWN=1 TEST_NO_NSPAWN=1

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
set -e set -e
TEST_DESCRIPTION="https://github.com/systemd/systemd/issues/2691" TEST_DESCRIPTION="https://github.com/systemd/systemd/issues/2691"
TEST_NO_NSPAWN=1 TEST_NO_NSPAWN=1

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
set -e set -e
TEST_DESCRIPTION="https://github.com/systemd/systemd/issues/2467" TEST_DESCRIPTION="https://github.com/systemd/systemd/issues/2467"

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
set -e set -e
TEST_DESCRIPTION="https://github.com/systemd/systemd/issues/3166" TEST_DESCRIPTION="https://github.com/systemd/systemd/issues/3166"
TEST_NO_NSPAWN=1 TEST_NO_NSPAWN=1
@ -41,7 +41,8 @@ EOF
cat >$initdir/test-fail-on-restart.sh <<'EOF' cat >$initdir/test-fail-on-restart.sh <<'EOF'
#!/bin/bash -x #!/usr/bin/env bash
set -x
systemctl start fail-on-restart.service systemctl start fail-on-restart.service
active_state=$(systemctl show --property ActiveState fail-on-restart.service) active_state=$(systemctl show --property ActiveState fail-on-restart.service)

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
set -e set -e
TEST_DESCRIPTION="https://github.com/systemd/systemd/issues/3171" TEST_DESCRIPTION="https://github.com/systemd/systemd/issues/3171"
TEST_NO_QEMU=1 TEST_NO_QEMU=1
@ -29,7 +29,7 @@ Type=oneshot
EOF EOF
cat >$initdir/test-socket-group.sh <<'EOF' cat >$initdir/test-socket-group.sh <<'EOF'
#!/bin/bash #!/usr/bin/env bash
set -x set -x
set -e set -e
set -o pipefail set -o pipefail

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
set -e set -e
set -u set -u

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
set -e set -e
TEST_DESCRIPTION="systemd-nspawn smoke test" TEST_DESCRIPTION="systemd-nspawn smoke test"
TEST_NO_NSPAWN=1 TEST_NO_NSPAWN=1
@ -33,7 +33,7 @@ Type=oneshot
EOF EOF
cat >$initdir/test-nspawn.sh <<'EOF' cat >$initdir/test-nspawn.sh <<'EOF'
#!/bin/bash #!/usr/bin/env bash
set -x set -x
set -e set -e
set -u set -u

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
set -e set -e
TEST_DESCRIPTION="/etc/machine-id testing" TEST_DESCRIPTION="/etc/machine-id testing"
TEST_NO_NSPAWN=1 TEST_NO_NSPAWN=1
@ -29,7 +29,7 @@ Type=oneshot
EOF EOF
cat >$initdir/test-machine-id-setup.sh <<'EOF' cat >$initdir/test-machine-id-setup.sh <<'EOF'
#!/bin/bash #!/usr/bin/env bash
set -e set -e
set -x set -x

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
set -e set -e
TEST_DESCRIPTION="Dropin tests" TEST_DESCRIPTION="Dropin tests"
TEST_NO_QEMU=1 TEST_NO_QEMU=1

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
set -v -x set -v -x
rm -f /test.log rm -f /test.log

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
set -x set -x
set -e set -e
set -o pipefail set -o pipefail

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
set -e set -e
TEST_DESCRIPTION="EXTEND_TIMEOUT_USEC=usec start/runtime/stop tests" TEST_DESCRIPTION="EXTEND_TIMEOUT_USEC=usec start/runtime/stop tests"
SKIP_INITRD=yes SKIP_INITRD=yes

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
set -e set -e
TEST_DESCRIPTION="UDEV SYSTEMD_WANTS property" TEST_DESCRIPTION="UDEV SYSTEMD_WANTS property"
TEST_NO_NSPAWN=1 TEST_NO_NSPAWN=1

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
set -ex set -ex
set -o pipefail set -o pipefail

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
set -e set -e
TEST_DESCRIPTION="FailureAction= operation" TEST_DESCRIPTION="FailureAction= operation"

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
set -ex set -ex
set -o pipefail set -o pipefail

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
set -e set -e
TEST_DESCRIPTION="test cgroup delegation in the unified hierarchy" TEST_DESCRIPTION="test cgroup delegation in the unified hierarchy"
TEST_NO_NSPAWN=1 TEST_NO_NSPAWN=1

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
set -ex set -ex
set -o pipefail set -o pipefail

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
set -e set -e
TEST_DESCRIPTION="test changing main PID" TEST_DESCRIPTION="test changing main PID"

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
set -ex set -ex
set -o pipefail set -o pipefail
@ -55,7 +55,7 @@ systemd-notify --uid=1000 MAINPID=$$
test `systemctl show -p MainPID --value testsuite.service` -eq $$ test `systemctl show -p MainPID --value testsuite.service` -eq $$
cat >/tmp/mainpid.sh <<EOF cat >/tmp/mainpid.sh <<EOF
#!/bin/bash #!/usr/bin/env bash
set -eux set -eux
set -o pipefail set -o pipefail
@ -79,7 +79,7 @@ systemd-run --unit=mainpidsh.service -p StandardOutput=tty -p StandardError=tty
test `systemctl show -p MainPID --value mainpidsh.service` -eq `cat /run/mainpidsh/pid` test `systemctl show -p MainPID --value mainpidsh.service` -eq `cat /run/mainpidsh/pid`
cat >/tmp/mainpid2.sh <<EOF cat >/tmp/mainpid2.sh <<EOF
#!/bin/bash #!/usr/bin/env bash
set -eux set -eux
set -o pipefail set -o pipefail
@ -104,7 +104,7 @@ systemd-run --unit=mainpidsh2.service -p StandardOutput=tty -p StandardError=tty
test `systemctl show -p MainPID --value mainpidsh2.service` -eq `cat /run/mainpidsh2/pid` test `systemctl show -p MainPID --value mainpidsh2.service` -eq `cat /run/mainpidsh2/pid`
cat >/dev/shm/mainpid3.sh <<EOF cat >/dev/shm/mainpid3.sh <<EOF
#!/bin/bash #!/usr/bin/env bash
set -eux set -eux
set -o pipefail set -o pipefail

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
set -e set -e
TEST_DESCRIPTION="Sysuser-related tests" TEST_DESCRIPTION="Sysuser-related tests"

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
set -x set -x
set -e set -e

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
set -e set -e
set -x set -x

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
set -e set -e
TEST_DESCRIPTION="Tmpfiles related tests" TEST_DESCRIPTION="Tmpfiles related tests"
TEST_NO_QEMU=1 TEST_NO_QEMU=1

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
set -e set -e
TEST_DESCRIPTION="test Type=exec" TEST_DESCRIPTION="test Type=exec"

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
set -ex set -ex
set -o pipefail set -o pipefail

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
set -e set -e
TEST_DESCRIPTION="Run unit tests under containers" TEST_DESCRIPTION="Run unit tests under containers"
RUN_IN_UNPRIVILEGED_CONTAINER=yes RUN_IN_UNPRIVILEGED_CONTAINER=yes

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
#set -ex #set -ex
#set -o pipefail #set -o pipefail

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
set -e set -e
TEST_DESCRIPTION="test importd" TEST_DESCRIPTION="test importd"

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
set -ex set -ex
set -o pipefail set -o pipefail

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
set -e set -e
TEST_DESCRIPTION="test setenv" TEST_DESCRIPTION="test setenv"

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
set -ex set -ex
set -o pipefail set -o pipefail

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
set -e set -e
TEST_DESCRIPTION="test StandardOutput=file:" TEST_DESCRIPTION="test StandardOutput=file:"

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
set -ex set -ex
set -o pipefail set -o pipefail

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
set -e set -e
TEST_DESCRIPTION="Ensure %j Wants directives work" TEST_DESCRIPTION="Ensure %j Wants directives work"
RUN_IN_UNPRIVILEGED_CONTAINER=yes RUN_IN_UNPRIVILEGED_CONTAINER=yes

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
set -e set -e
TEST_DESCRIPTION="UDEV ID_RENAMING property" TEST_DESCRIPTION="UDEV ID_RENAMING property"
TEST_NO_NSPAWN=1 TEST_NO_NSPAWN=1

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
set -ex set -ex
set -o pipefail set -o pipefail

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
set -e set -e
TEST_DESCRIPTION="test OnClockChange= + OnTimezoneChange=" TEST_DESCRIPTION="test OnClockChange= + OnTimezoneChange="
TEST_NO_NSPAWN=1 TEST_NO_NSPAWN=1

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
set -ex set -ex
set -o pipefail set -o pipefail

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
set -e set -e
TEST_DESCRIPTION="plugged -> dead -> plugged issue #11997" TEST_DESCRIPTION="plugged -> dead -> plugged issue #11997"
TEST_NO_NSPAWN=1 TEST_NO_NSPAWN=1

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
set -e set -e
set -o pipefail set -o pipefail

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
set -e set -e
TEST_DESCRIPTION="test OOM killer logic" TEST_DESCRIPTION="test OOM killer logic"
TEST_NO_NSPAWN=1 TEST_NO_NSPAWN=1

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
set -ex set -ex
set -o pipefail set -o pipefail

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- # -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# ex: ts=8 sw=4 sts=4 et filetype=sh # ex: ts=8 sw=4 sts=4 et filetype=sh
set -e set -e

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- # -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# ex: ts=8 sw=4 sts=4 et filetype=sh # ex: ts=8 sw=4 sts=4 et filetype=sh
set -ex set -ex

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
set -e set -e
TEST_DESCRIPTION="test migrating state directory from DynamicUser=1 to DynamicUser=0 and back" TEST_DESCRIPTION="test migrating state directory from DynamicUser=1 to DynamicUser=0 and back"

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
set -ex set -ex
set -o pipefail set -o pipefail

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
set -e set -e
TEST_DESCRIPTION="network-generator tests" TEST_DESCRIPTION="network-generator tests"

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
set -e set -e
TEST_DESCRIPTION="test MUMAPolicy= and NUMAMask= options" TEST_DESCRIPTION="test MUMAPolicy= and NUMAMask= options"

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
set -ex set -ex
set -o pipefail set -o pipefail

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- # -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# ex: ts=8 sw=4 sts=4 et filetype=sh # ex: ts=8 sw=4 sts=4 et filetype=sh
set -e set -e

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- # -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# ex: ts=8 sw=4 sts=4 et filetype=sh # ex: ts=8 sw=4 sts=4 et filetype=sh
set -ex set -ex

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
set -e set -e
TEST_DESCRIPTION="Test ExecReload= (PR #13098)" TEST_DESCRIPTION="Test ExecReload= (PR #13098)"

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
set -ex set -ex
set -o pipefail set -o pipefail

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
set -e set -e
TEST_DESCRIPTION="test ExecXYZEx= service unit dbus hookups" TEST_DESCRIPTION="test ExecXYZEx= service unit dbus hookups"

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
set -ex set -ex
set -o pipefail set -o pipefail

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
set -e set -e
TEST_DESCRIPTION="Test oneshot unit restart on failure" TEST_DESCRIPTION="Test oneshot unit restart on failure"
. $TEST_BASE_DIR/test-functions . $TEST_BASE_DIR/test-functions

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
set -ex set -ex
set -o pipefail set -o pipefail

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
set -e set -e
TEST_DESCRIPTION="test that ExecStopPost= is always run" TEST_DESCRIPTION="test that ExecStopPost= is always run"

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
set -ex set -ex
systemd-analyze log-level debug systemd-analyze log-level debug
@ -16,7 +16,7 @@ test -f /run/exec1
test -f /run/exec2 test -f /run/exec2
cat > /tmp/forking1.sh <<EOF cat > /tmp/forking1.sh <<EOF
#!/bin/bash #!/usr/bin/env bash
set -eux set -eux
@ -32,7 +32,7 @@ systemd-run --unit=forking1.service --wait -p StandardOutput=tty -p StandardErro
test -f /run/forking1 test -f /run/forking1
cat > /tmp/forking2.sh <<EOF cat > /tmp/forking2.sh <<EOF
#!/bin/bash #!/usr/bin/env bash
set -eux set -eux
@ -62,7 +62,7 @@ test -f /run/dbus1
test -f /run/dbus2 test -f /run/dbus2
cat > /tmp/notify1.sh <<EOF cat > /tmp/notify1.sh <<EOF
#!/bin/bash #!/usr/bin/env bash
set -eux set -eux

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
set -e set -e
TEST_DESCRIPTION="Test PrivateUsers=yes on user manager" TEST_DESCRIPTION="Test PrivateUsers=yes on user manager"
. $TEST_BASE_DIR/test-functions . $TEST_BASE_DIR/test-functions

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
set -ex set -ex
set -o pipefail set -o pipefail

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
set -e set -e
TEST_DESCRIPTION="test log namespaces" TEST_DESCRIPTION="test log namespaces"

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
set -ex set -ex
systemd-analyze log-level debug systemd-analyze log-level debug

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
set -e set -e
TEST_DESCRIPTION="test systemd-repart" TEST_DESCRIPTION="test systemd-repart"

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
set -ex set -ex
# Check if repart is installed, and if it isn't bail out early instead of failing # Check if repart is installed, and if it isn't bail out early instead of failing

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
set -e set -e
TEST_DESCRIPTION="testing homed" TEST_DESCRIPTION="testing homed"
TEST_NO_QEMU=1 TEST_NO_QEMU=1

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
set -ex set -ex
set -o pipefail set -o pipefail

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
fd=0 fd=0
OPTIND=1 OPTIND=1

View File

@ -1,4 +1,5 @@
#!/bin/bash -e #!/usr/bin/env bash
set -e
BUILD_DIR="$($(dirname "$0")/../tools/find-build-dir.sh)" BUILD_DIR="$($(dirname "$0")/../tools/find-build-dir.sh)"
if [ $# -gt 0 ]; then if [ $# -gt 0 ]; then

View File

@ -1,4 +1,5 @@
#!/bin/bash -e #!/usr/bin/env bash
set -e
out="$1" out="$1"
systemd_efi="$2" systemd_efi="$2"

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- # -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# ex: ts=8 sw=4 sts=4 et filetype=sh # ex: ts=8 sw=4 sts=4 et filetype=sh
PATH=/sbin:/bin:/usr/sbin:/usr/bin PATH=/sbin:/bin:/usr/sbin:/usr/bin
@ -39,7 +39,7 @@ PATH_TO_INIT=$ROOTLIBDIR/systemd
[ "$SYSTEMD_NSPAWN" ] || SYSTEMD_NSPAWN=$(which -a $BUILD_DIR/systemd-nspawn systemd-nspawn 2>/dev/null | grep '^/' -m1) [ "$SYSTEMD_NSPAWN" ] || SYSTEMD_NSPAWN=$(which -a $BUILD_DIR/systemd-nspawn systemd-nspawn 2>/dev/null | grep '^/' -m1)
[ "$JOURNALCTL" ] || JOURNALCTL=$(which -a $BUILD_DIR/journalctl journalctl 2>/dev/null | grep '^/' -m1) [ "$JOURNALCTL" ] || JOURNALCTL=$(which -a $BUILD_DIR/journalctl journalctl 2>/dev/null | grep '^/' -m1)
BASICTOOLS="test sh bash setsid loadkeys setfont login sulogin gzip sleep echo head tail cat mount umount cryptsetup date dmsetup modprobe sed cmp tee rm true false chmod chown ln xargs" BASICTOOLS="test env sh bash setsid loadkeys setfont login sulogin gzip sleep echo head tail cat mount umount cryptsetup date dmsetup modprobe sed cmp tee rm true false chmod chown ln xargs"
DEBUGTOOLS="df free ls stty ps ln ip route dmesg dhclient mkdir cp ping dhclient strace less grep id tty touch du sort hostname find vi mv" DEBUGTOOLS="df free ls stty ps ln ip route dmesg dhclient mkdir cp ping dhclient strace less grep id tty touch du sort hostname find vi mv"
STATEDIR="${BUILD_DIR:-.}/test/$(basename $(dirname $(realpath $0)))" STATEDIR="${BUILD_DIR:-.}/test/$(basename $(dirname $(realpath $0)))"
@ -376,7 +376,7 @@ create_valgrind_wrapper() {
local _valgrind_wrapper=$initdir/$ROOTLIBDIR/systemd-under-valgrind local _valgrind_wrapper=$initdir/$ROOTLIBDIR/systemd-under-valgrind
ddebug "Create $_valgrind_wrapper" ddebug "Create $_valgrind_wrapper"
cat >$_valgrind_wrapper <<EOF cat >$_valgrind_wrapper <<EOF
#!/bin/bash #!/usr/bin/env bash
mount -t proc proc /proc mount -t proc proc /proc
exec valgrind --leak-check=full --log-file=/valgrind.out $ROOTLIBDIR/systemd "\$@" exec valgrind --leak-check=full --log-file=/valgrind.out $ROOTLIBDIR/systemd "\$@"
@ -405,7 +405,7 @@ create_asan_wrapper() {
esac esac
cat >$_asan_wrapper <<EOF cat >$_asan_wrapper <<EOF
#!/bin/bash #!/usr/bin/env bash
set -x set -x
@ -488,7 +488,7 @@ create_strace_wrapper() {
local _strace_wrapper=$initdir/$ROOTLIBDIR/systemd-under-strace local _strace_wrapper=$initdir/$ROOTLIBDIR/systemd-under-strace
ddebug "Create $_strace_wrapper" ddebug "Create $_strace_wrapper"
cat >$_strace_wrapper <<EOF cat >$_strace_wrapper <<EOF
#!/bin/bash #!/usr/bin/env bash
exec strace -D -o /strace.out $ROOTLIBDIR/systemd "\$@" exec strace -D -o /strace.out $ROOTLIBDIR/systemd "\$@"
EOF EOF
@ -675,7 +675,7 @@ strip_binaries() {
create_rc_local() { create_rc_local() {
mkdir -p $initdir/etc/rc.d mkdir -p $initdir/etc/rc.d
cat >$initdir/etc/rc.d/rc.local <<EOF cat >$initdir/etc/rc.d/rc.local <<EOF
#!/bin/bash #!/usr/bin/env bash
exit 0 exit 0
EOF EOF
chmod 0755 $initdir/etc/rc.d/rc.local chmod 0755 $initdir/etc/rc.d/rc.local

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
set -e set -e
which perl &>/dev/null || exit 77 which perl &>/dev/null || exit 77

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
# The official unmodified version of the script can be found at # The official unmodified version of the script can be found at
# https://scan.coverity.com/scripts/travisci_build_coverity_scan.sh # https://scan.coverity.com/scripts/travisci_build_coverity_scan.sh

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
set -eu set -eu
set -o pipefail set -o pipefail

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
# SPDX-License-Identifier: LGPL-2.1+ # SPDX-License-Identifier: LGPL-2.1+
set -ex set -ex

View File

@ -13,6 +13,7 @@ DefaultDependencies=no
Before=sysinit.target Before=sysinit.target
Documentation=man:modprobe(8) Documentation=man:modprobe(8)
ConditionCapability=CAP_SYS_MODULE ConditionCapability=CAP_SYS_MODULE
ConditionPathExists=!/sys/module/%I
[Service] [Service]
Type=oneshot Type=oneshot