diff --git a/test/integration-tests/TEST-04-JOURNAL/TEST-04-JOURNAL.units/forever-print-hola.service b/test/integration-tests/TEST-04-JOURNAL/TEST-04-JOURNAL.units/forever-print-hola.service index 9273d6d3fb..6858ceb29b 100644 --- a/test/integration-tests/TEST-04-JOURNAL/TEST-04-JOURNAL.units/forever-print-hola.service +++ b/test/integration-tests/TEST-04-JOURNAL/TEST-04-JOURNAL.units/forever-print-hola.service @@ -4,4 +4,4 @@ Description=ForeverPrintHola service [Service] Type=exec -ExecStart=sh -x -c 'while :; do printf "Hola\n" || touch /tmp/i-lose-my-logs; sleep 1; done' +ExecStart=bash -x -c 'while :; do printf "Hola\n" || touch /tmp/i-lose-my-logs; sleep 1; done' diff --git a/test/integration-tests/TEST-07-PID1/TEST-07-PID1.units/defer-reactivation.service b/test/integration-tests/TEST-07-PID1/TEST-07-PID1.units/defer-reactivation.service index 9c7332d6c9..de30aff603 100644 --- a/test/integration-tests/TEST-07-PID1/TEST-07-PID1.units/defer-reactivation.service +++ b/test/integration-tests/TEST-07-PID1/TEST-07-PID1.units/defer-reactivation.service @@ -3,4 +3,4 @@ Description=Test for DeferReactivation=yes (service) [Service] Type=simple -ExecStart=sh -c 'date +%%s >>/tmp/defer-reactivation.log; sleep 5' +ExecStart=bash -c 'date +%%s >>/tmp/defer-reactivation.log; sleep 5' diff --git a/test/integration-tests/TEST-07-PID1/TEST-07-PID1.units/issue27953.service b/test/integration-tests/TEST-07-PID1/TEST-07-PID1.units/issue27953.service index f441067822..ca75d37add 100644 --- a/test/integration-tests/TEST-07-PID1/TEST-07-PID1.units/issue27953.service +++ b/test/integration-tests/TEST-07-PID1/TEST-07-PID1.units/issue27953.service @@ -4,4 +4,4 @@ Description=This unit should not remain active once the shell process exits [Service] Type=oneshot -ExecStart=sh -c 'sleep infinity & exit 0' +ExecStart=bash -c 'sleep infinity & exit 0' diff --git a/test/integration-tests/TEST-07-PID1/meson.build b/test/integration-tests/TEST-07-PID1/meson.build index 678fc5f0ec..39077437a0 100644 --- a/test/integration-tests/TEST-07-PID1/meson.build +++ b/test/integration-tests/TEST-07-PID1/meson.build @@ -7,7 +7,7 @@ integration_tests += [ 'service' : integration_test_template['configuration']['service'] + { 'NotifyAccess' : 'all', # Issue: https://github.com/systemd/systemd/issues/2691 - 'ExecStop' : 'sh -c \'kill -SEGV $$$$\'', + 'ExecStop' : 'bash -c \'kill -SEGV $$$$\'', 'RemainAfterExit' : 'yes', 'TimeoutStopSec' : '270s', }, diff --git a/test/integration-tests/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-namespaced.service b/test/integration-tests/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-namespaced.service index 82eb74c0bd..3823614504 100644 --- a/test/integration-tests/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-namespaced.service +++ b/test/integration-tests/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-namespaced.service @@ -10,4 +10,4 @@ PrivateTmp=yes BindPaths=/run/TEST-23-UNIT-FILE-marker-fixed:/tmp/testfile-marker-fixed InaccessiblePaths=/run/inaccessible ExecStartPre=grep -q -F MARKER_FIXED /tmp/testfile-marker-fixed -ExecStart=sh -c 'systemd-notify --ready; until grep -q -F MARKER_RUNTIME /tmp/testfile-marker-runtime; do sleep 0.1; done; test ! -f /run/inaccessible/testfile-marker-fixed' +ExecStart=bash -c 'systemd-notify --ready; until grep -q -F MARKER_RUNTIME /tmp/testfile-marker-runtime; do sleep 0.1; done; test ! -f /run/inaccessible/testfile-marker-fixed' diff --git a/test/integration-tests/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-non-namespaced.service b/test/integration-tests/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-non-namespaced.service index 699b6080d3..bb94a4629e 100644 --- a/test/integration-tests/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-non-namespaced.service +++ b/test/integration-tests/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-non-namespaced.service @@ -3,4 +3,4 @@ RuntimeMaxSec=5 Type=notify RemainAfterExit=yes -ExecStart=sh -c 'systemd-notify --ready; until grep -q -F MARKER_RUNTIME /tmp/testfile-marker-runtime; do sleep 0.1; done; exit 0' +ExecStart=bash -c 'systemd-notify --ready; until grep -q -F MARKER_RUNTIME /tmp/testfile-marker-runtime; do sleep 0.1; done; exit 0' diff --git a/test/integration-tests/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-retry-fail.service b/test/integration-tests/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-retry-fail.service index 319757a44d..bf68ca2dda 100644 --- a/test/integration-tests/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-retry-fail.service +++ b/test/integration-tests/TEST-23-UNIT-FILE/TEST-23-UNIT-FILE.units/TEST-23-UNIT-FILE-retry-fail.service @@ -5,5 +5,5 @@ Description=Failed Dependency Unit [Service] Type=oneshot RemainAfterExit=yes -ExecStart=sh -c "if [ -f /tmp/TEST-23-UNIT-FILE-retry-fail ]; then exit 0; else exit 1; fi" +ExecStart=bash -c "if [ -f /tmp/TEST-23-UNIT-FILE-retry-fail ]; then exit 0; else exit 1; fi" Restart=no diff --git a/test/integration-tests/TEST-52-HONORFIRSTSHUTDOWN/TEST-52-HONORFIRSTSHUTDOWN.units/test-honor-first-shutdown.service b/test/integration-tests/TEST-52-HONORFIRSTSHUTDOWN/TEST-52-HONORFIRSTSHUTDOWN.units/test-honor-first-shutdown.service index bbeac3a74e..687d749156 100644 --- a/test/integration-tests/TEST-52-HONORFIRSTSHUTDOWN/TEST-52-HONORFIRSTSHUTDOWN.units/test-honor-first-shutdown.service +++ b/test/integration-tests/TEST-52-HONORFIRSTSHUTDOWN/TEST-52-HONORFIRSTSHUTDOWN.units/test-honor-first-shutdown.service @@ -5,7 +5,7 @@ After=multi-user.target [Service] ExecStart=/usr/lib/systemd/tests/testdata/TEST-52-HONORFIRSTSHUTDOWN.units/%N.sh -ExecStop=sh -c 'kill -KILL $MAINPID' +ExecStop=bash -c 'kill -KILL $MAINPID' FailureAction=reboot [Install] diff --git a/test/integration-tests/TEST-62-RESTRICT-IFACES/TEST-62-RESTRICT-IFACES.units/TEST-62-RESTRICT-IFACES-1.service b/test/integration-tests/TEST-62-RESTRICT-IFACES/TEST-62-RESTRICT-IFACES.units/TEST-62-RESTRICT-IFACES-1.service index 16695c18a2..dc0bea2c50 100644 --- a/test/integration-tests/TEST-62-RESTRICT-IFACES/TEST-62-RESTRICT-IFACES.units/TEST-62-RESTRICT-IFACES-1.service +++ b/test/integration-tests/TEST-62-RESTRICT-IFACES/TEST-62-RESTRICT-IFACES.units/TEST-62-RESTRICT-IFACES-1.service @@ -2,8 +2,8 @@ [Unit] Description=TEST-62-RESTRICT-IFACES-all-pings-work [Service] -ExecStart=sh -c 'ping -c 1 -W 0.2 192.168.113.1' -ExecStart=sh -c 'ping -c 1 -W 0.2 192.168.113.5' -ExecStart=sh -c 'ping -c 1 -W 0.2 192.168.113.9' +ExecStart=bash -c 'ping -c 1 -W 0.2 192.168.113.1' +ExecStart=bash -c 'ping -c 1 -W 0.2 192.168.113.5' +ExecStart=bash -c 'ping -c 1 -W 0.2 192.168.113.9' RestrictNetworkInterfaces= Type=oneshot diff --git a/test/integration-tests/TEST-62-RESTRICT-IFACES/TEST-62-RESTRICT-IFACES.units/TEST-62-RESTRICT-IFACES-2.service b/test/integration-tests/TEST-62-RESTRICT-IFACES/TEST-62-RESTRICT-IFACES.units/TEST-62-RESTRICT-IFACES-2.service index bce7e8e6cb..7bbb2149fd 100644 --- a/test/integration-tests/TEST-62-RESTRICT-IFACES/TEST-62-RESTRICT-IFACES.units/TEST-62-RESTRICT-IFACES-2.service +++ b/test/integration-tests/TEST-62-RESTRICT-IFACES/TEST-62-RESTRICT-IFACES.units/TEST-62-RESTRICT-IFACES-2.service @@ -2,9 +2,9 @@ [Unit] Description=TEST-62-RESTRICT-IFACES-allow-list [Service] -ExecStart=sh -c 'ping -c 1 -W 0.2 192.168.113.1' -ExecStart=sh -c 'ping -c 1 -W 0.2 192.168.113.5' -ExecStart=sh -c '! ping -c 1 -W 0.2 192.168.113.9' +ExecStart=bash -c 'ping -c 1 -W 0.2 192.168.113.1' +ExecStart=bash -c 'ping -c 1 -W 0.2 192.168.113.5' +ExecStart=bash -c '! ping -c 1 -W 0.2 192.168.113.9' RestrictNetworkInterfaces=veth0 RestrictNetworkInterfaces=veth1 Type=oneshot diff --git a/test/integration-tests/TEST-62-RESTRICT-IFACES/TEST-62-RESTRICT-IFACES.units/TEST-62-RESTRICT-IFACES-3.service b/test/integration-tests/TEST-62-RESTRICT-IFACES/TEST-62-RESTRICT-IFACES.units/TEST-62-RESTRICT-IFACES-3.service index 116530bad3..bf70ab24a7 100644 --- a/test/integration-tests/TEST-62-RESTRICT-IFACES/TEST-62-RESTRICT-IFACES.units/TEST-62-RESTRICT-IFACES-3.service +++ b/test/integration-tests/TEST-62-RESTRICT-IFACES/TEST-62-RESTRICT-IFACES.units/TEST-62-RESTRICT-IFACES-3.service @@ -2,9 +2,9 @@ [Unit] Description=TEST-62-RESTRICT-IFACES-deny-list [Service] -ExecStart=sh -c '! ping -c 1 -W 0.2 192.168.113.1' -ExecStart=sh -c '! ping -c 1 -W 0.2 192.168.113.5' -ExecStart=sh -c 'ping -c 1 -W 0.2 192.168.113.9' +ExecStart=bash -c '! ping -c 1 -W 0.2 192.168.113.1' +ExecStart=bash -c '! ping -c 1 -W 0.2 192.168.113.5' +ExecStart=bash -c 'ping -c 1 -W 0.2 192.168.113.9' RestrictNetworkInterfaces=~veth0 RestrictNetworkInterfaces=~veth1 Type=oneshot diff --git a/test/integration-tests/TEST-62-RESTRICT-IFACES/TEST-62-RESTRICT-IFACES.units/TEST-62-RESTRICT-IFACES-4.service b/test/integration-tests/TEST-62-RESTRICT-IFACES/TEST-62-RESTRICT-IFACES.units/TEST-62-RESTRICT-IFACES-4.service index 200a38355a..7e22a32b0c 100644 --- a/test/integration-tests/TEST-62-RESTRICT-IFACES/TEST-62-RESTRICT-IFACES.units/TEST-62-RESTRICT-IFACES-4.service +++ b/test/integration-tests/TEST-62-RESTRICT-IFACES/TEST-62-RESTRICT-IFACES.units/TEST-62-RESTRICT-IFACES-4.service @@ -2,9 +2,9 @@ [Unit] Description=TEST-62-RESTRICT-IFACES-empty-assignment [Service] -ExecStart=sh -c 'ping -c 1 -W 0.2 192.168.113.1' -ExecStart=sh -c 'ping -c 1 -W 0.2 192.168.113.5' -ExecStart=sh -c 'ping -c 1 -W 0.2 192.168.113.9' +ExecStart=bash -c 'ping -c 1 -W 0.2 192.168.113.1' +ExecStart=bash -c 'ping -c 1 -W 0.2 192.168.113.5' +ExecStart=bash -c 'ping -c 1 -W 0.2 192.168.113.9' RestrictNetworkInterfaces=veth0 RestrictNetworkInterfaces= Type=oneshot diff --git a/test/integration-tests/TEST-62-RESTRICT-IFACES/TEST-62-RESTRICT-IFACES.units/TEST-62-RESTRICT-IFACES-5.service b/test/integration-tests/TEST-62-RESTRICT-IFACES/TEST-62-RESTRICT-IFACES.units/TEST-62-RESTRICT-IFACES-5.service index 51761ba27e..20fe462918 100644 --- a/test/integration-tests/TEST-62-RESTRICT-IFACES/TEST-62-RESTRICT-IFACES.units/TEST-62-RESTRICT-IFACES-5.service +++ b/test/integration-tests/TEST-62-RESTRICT-IFACES/TEST-62-RESTRICT-IFACES.units/TEST-62-RESTRICT-IFACES-5.service @@ -2,9 +2,9 @@ [Unit] Description=TEST-62-RESTRICT-IFACES-invert-assignment [Service] -ExecStart=sh -c '! ping -c 1 -W 0.2 192.168.113.1' -ExecStart=sh -c 'ping -c 1 -W 0.2 192.168.113.5' -ExecStart=sh -c '! ping -c 1 -W 0.2 192.168.113.9' +ExecStart=bash -c '! ping -c 1 -W 0.2 192.168.113.1' +ExecStart=bash -c 'ping -c 1 -W 0.2 192.168.113.5' +ExecStart=bash -c '! ping -c 1 -W 0.2 192.168.113.9' RestrictNetworkInterfaces=veth0 RestrictNetworkInterfaces=veth0 veth1 RestrictNetworkInterfaces=~veth0 diff --git a/test/integration-tests/TEST-62-RESTRICT-IFACES/TEST-62-RESTRICT-IFACES.units/TEST-62-RESTRICT-IFACES-6.service b/test/integration-tests/TEST-62-RESTRICT-IFACES/TEST-62-RESTRICT-IFACES.units/TEST-62-RESTRICT-IFACES-6.service index b7e91f7e68..e0c13ca5d1 100644 --- a/test/integration-tests/TEST-62-RESTRICT-IFACES/TEST-62-RESTRICT-IFACES.units/TEST-62-RESTRICT-IFACES-6.service +++ b/test/integration-tests/TEST-62-RESTRICT-IFACES/TEST-62-RESTRICT-IFACES.units/TEST-62-RESTRICT-IFACES-6.service @@ -2,9 +2,9 @@ [Unit] Description=TEST-62-RESTRICT-IFACES-altname [Service] -ExecStart=sh -c 'ping -c 1 -W 0.2 192.168.113.1' -ExecStart=sh -c 'ping -c 1 -W 0.2 192.168.113.5' -ExecStart=sh -c '! ping -c 1 -W 0.2 192.168.113.9' +ExecStart=bash -c 'ping -c 1 -W 0.2 192.168.113.1' +ExecStart=bash -c 'ping -c 1 -W 0.2 192.168.113.5' +ExecStart=bash -c '! ping -c 1 -W 0.2 192.168.113.9' RestrictNetworkInterfaces=veth0-altname-with-more-than-15-chars RestrictNetworkInterfaces=veth1-altname-with-more-than-15-chars Type=oneshot diff --git a/test/integration-tests/TEST-63-PATH/TEST-63-PATH.units/test63-glob.service b/test/integration-tests/TEST-63-PATH/TEST-63-PATH.units/test63-glob.service index 3f49dd4620..50818a8d10 100644 --- a/test/integration-tests/TEST-63-PATH/TEST-63-PATH.units/test63-glob.service +++ b/test/integration-tests/TEST-63-PATH/TEST-63-PATH.units/test63-glob.service @@ -1,7 +1,7 @@ # SPDX-License-Identifier: LGPL-2.1-or-later [Service] -ExecStartPre=sh -c 'test "$TRIGGER_PATH" = /tmp/test63-glob-foo' -ExecStartPre=sh -c 'test "$TRIGGER_UNIT" = test63-glob.path' +ExecStartPre=bash -c 'test "$TRIGGER_PATH" = /tmp/test63-glob-foo' +ExecStartPre=bash -c 'test "$TRIGGER_UNIT" = test63-glob.path' ExecStart=systemd-notify --ready RemainAfterExit=yes Type=notify diff --git a/test/integration-tests/TEST-63-PATH/TEST-63-PATH.units/test63.service b/test/integration-tests/TEST-63-PATH/TEST-63-PATH.units/test63.service index 01a928b8d6..b6360f7794 100644 --- a/test/integration-tests/TEST-63-PATH/TEST-63-PATH.units/test63.service +++ b/test/integration-tests/TEST-63-PATH/TEST-63-PATH.units/test63.service @@ -3,6 +3,6 @@ ConditionPathExists=/tmp/nonexistent [Service] -ExecStartPre=sh -c 'test "$TRIGGER_PATH" = /tmp/test63' -ExecStartPre=sh -c 'test "$TRIGGER_UNIT" = test63.path' +ExecStartPre=bash -c 'test "$TRIGGER_PATH" = /tmp/test63' +ExecStartPre=bash -c 'test "$TRIGGER_UNIT" = test63.path' ExecStart=true diff --git a/test/test-execute/exec-ambientcapabilities-dynuser.service b/test/test-execute/exec-ambientcapabilities-dynuser.service index b927c7dbca..7e3faffcc7 100644 --- a/test/test-execute/exec-ambientcapabilities-dynuser.service +++ b/test/test-execute/exec-ambientcapabilities-dynuser.service @@ -3,7 +3,7 @@ Description=Test for AmbientCapabilities (dynamic user) [Service] -ExecStart=sh -x -c 'c=$$(grep "CapAmb:" /proc/self/status); test "$$c" = "CapAmb: 0000000000002081"' +ExecStart=bash -x -c 'c=$$(grep "CapAmb:" /proc/self/status); test "$$c" = "CapAmb: 0000000000002081"' Type=oneshot AmbientCapabilities=CAP_CHOWN CAP_SETUID CAP_NET_RAW DynamicUser=yes diff --git a/test/test-execute/exec-ambientcapabilities-merge-nfsnobody.service b/test/test-execute/exec-ambientcapabilities-merge-nfsnobody.service index a170b3d7b6..d2a30ef851 100644 --- a/test/test-execute/exec-ambientcapabilities-merge-nfsnobody.service +++ b/test/test-execute/exec-ambientcapabilities-merge-nfsnobody.service @@ -3,7 +3,7 @@ Description=Test for AmbientCapabilities [Service] -ExecStart=sh -x -c 'c=$$(grep "CapAmb:" /proc/self/status); test "$$c" = "CapAmb: 0000000000002001"' +ExecStart=bash -x -c 'c=$$(grep "CapAmb:" /proc/self/status); test "$$c" = "CapAmb: 0000000000002001"' Type=oneshot User=nfsnobody AmbientCapabilities=CAP_CHOWN diff --git a/test/test-execute/exec-ambientcapabilities-merge-nobody.service b/test/test-execute/exec-ambientcapabilities-merge-nobody.service index 2e21bbc58a..af6cf01771 100644 --- a/test/test-execute/exec-ambientcapabilities-merge-nobody.service +++ b/test/test-execute/exec-ambientcapabilities-merge-nobody.service @@ -3,7 +3,7 @@ Description=Test for AmbientCapabilities [Service] -ExecStart=sh -x -c 'c=$$(grep "CapAmb:" /proc/self/status); test "$$c" = "CapAmb: 0000000000002001"' +ExecStart=bash -x -c 'c=$$(grep "CapAmb:" /proc/self/status); test "$$c" = "CapAmb: 0000000000002001"' Type=oneshot User=nobody AmbientCapabilities=CAP_CHOWN diff --git a/test/test-execute/exec-ambientcapabilities-merge.service b/test/test-execute/exec-ambientcapabilities-merge.service index c4bb21b2ac..fc5e9b1ffe 100644 --- a/test/test-execute/exec-ambientcapabilities-merge.service +++ b/test/test-execute/exec-ambientcapabilities-merge.service @@ -3,7 +3,7 @@ Description=Test for AmbientCapabilities (daemon) [Service] -ExecStart=sh -x -c 'c=$$(grep "CapAmb:" /proc/self/status); test "$$c" = "CapAmb: 0000000000002001"' +ExecStart=bash -x -c 'c=$$(grep "CapAmb:" /proc/self/status); test "$$c" = "CapAmb: 0000000000002001"' Type=oneshot User=daemon AmbientCapabilities=CAP_CHOWN diff --git a/test/test-execute/exec-ambientcapabilities-nfsnobody.service b/test/test-execute/exec-ambientcapabilities-nfsnobody.service index 0bf91cc98f..6670018baa 100644 --- a/test/test-execute/exec-ambientcapabilities-nfsnobody.service +++ b/test/test-execute/exec-ambientcapabilities-nfsnobody.service @@ -3,7 +3,7 @@ Description=Test for AmbientCapabilities [Service] -ExecStart=sh -x -c 'c=$$(grep "CapAmb:" /proc/self/status); test "$$c" = "CapAmb: 0000000000002001"' +ExecStart=bash -x -c 'c=$$(grep "CapAmb:" /proc/self/status); test "$$c" = "CapAmb: 0000000000002001"' Type=oneshot User=nfsnobody AmbientCapabilities=CAP_CHOWN CAP_NET_RAW diff --git a/test/test-execute/exec-ambientcapabilities-nobody.service b/test/test-execute/exec-ambientcapabilities-nobody.service index 8bd7ac4f90..c8438f2ee1 100644 --- a/test/test-execute/exec-ambientcapabilities-nobody.service +++ b/test/test-execute/exec-ambientcapabilities-nobody.service @@ -3,7 +3,7 @@ Description=Test for AmbientCapabilities [Service] -ExecStart=sh -x -c 'c=$$(grep "CapAmb:" /proc/self/status); test "$$c" = "CapAmb: 0000000000002001"' +ExecStart=bash -x -c 'c=$$(grep "CapAmb:" /proc/self/status); test "$$c" = "CapAmb: 0000000000002001"' Type=oneshot User=nobody AmbientCapabilities=CAP_CHOWN CAP_NET_RAW diff --git a/test/test-execute/exec-ambientcapabilities.service b/test/test-execute/exec-ambientcapabilities.service index 1bbc727031..1481ce0716 100644 --- a/test/test-execute/exec-ambientcapabilities.service +++ b/test/test-execute/exec-ambientcapabilities.service @@ -3,7 +3,7 @@ Description=Test for AmbientCapabilities (daemon) [Service] -ExecStart=sh -x -c 'c=$$(grep "CapAmb:" /proc/self/status); test "$$c" = "CapAmb: 0000000000002001"' +ExecStart=bash -x -c 'c=$$(grep "CapAmb:" /proc/self/status); test "$$c" = "CapAmb: 0000000000002001"' Type=oneshot User=daemon AmbientCapabilities=CAP_CHOWN CAP_NET_RAW diff --git a/test/test-execute/exec-basic.service b/test/test-execute/exec-basic.service index c29d46c2df..b6cdb10391 100644 --- a/test/test-execute/exec-basic.service +++ b/test/test-execute/exec-basic.service @@ -27,7 +27,7 @@ ConditionVersion=glibc " >= 2" " <= 9000 " "!= 1" ConditionVersion=glibc " >= 2" " * " [Service] -ExecStart=touch /tmp/a ; /bin/sh -c 'touch /tmp/b' ; touch /tmp/c +ExecStart=touch /tmp/a ; bash -c 'touch /tmp/b' ; touch /tmp/c ExecStart=test -f /tmp/a ExecStart=!test -f /tmp/b ExecStart=!!test -f /tmp/c diff --git a/test/test-execute/exec-bindpaths.service b/test/test-execute/exec-bindpaths.service index 12e92e2ac5..bc68058868 100644 --- a/test/test-execute/exec-bindpaths.service +++ b/test/test-execute/exec-bindpaths.service @@ -11,7 +11,7 @@ ExecStart=test -f /tmp/thisisasimpletest # Also, through /tmp/test-exec-bindreadonlypaths ExecStart=test -f /tmp/test-exec-bindreadonlypaths/thisisasimpletest # The file cannot modify through /tmp/test-exec-bindreadonlypaths -ExecStart=sh -x -c '! touch /tmp/test-exec-bindreadonlypaths/thisisasimpletest' +ExecStart=bash -x -c '! touch /tmp/test-exec-bindreadonlypaths/thisisasimpletest' # Cleanup ExecStart=rm /tmp/thisisasimpletest BindPaths=/tmp:/tmp/test-exec-bindpaths diff --git a/test/test-execute/exec-capabilityboundingset-invert.service b/test/test-execute/exec-capabilityboundingset-invert.service index 14f16c6b56..92aabc5875 100644 --- a/test/test-execute/exec-capabilityboundingset-invert.service +++ b/test/test-execute/exec-capabilityboundingset-invert.service @@ -4,6 +4,6 @@ Description=Test for CapabilityBoundingSet [Service] # sed: remove dropped (cap_xxx-[epi]) and IAB capabilities from the output -ExecStart=sh -x -c '! capsh --print | sed -re "s/[^ ]+?\-[epi]+//g" -e '/IAB/d' | grep "^Bounding set .*cap_chown"' +ExecStart=bash -x -c '! capsh --print | sed -re "s/[^ ]+?\-[epi]+//g" -e '/IAB/d' | grep "^Bounding set .*cap_chown"' Type=oneshot CapabilityBoundingSet=~CAP_CHOWN diff --git a/test/test-execute/exec-capabilityboundingset-merge.service b/test/test-execute/exec-capabilityboundingset-merge.service index d3a23706ee..30746a93af 100644 --- a/test/test-execute/exec-capabilityboundingset-merge.service +++ b/test/test-execute/exec-capabilityboundingset-merge.service @@ -3,7 +3,7 @@ Description=Test for CapabilityBoundingSet [Service] -ExecStart=sh -x -c 'c=$$(capsh --print | grep "Bounding set "); test "$$c" = "Bounding set =cap_chown,cap_fowner,cap_kill"' +ExecStart=bash -x -c 'c=$$(capsh --print | grep "Bounding set "); test "$$c" = "Bounding set =cap_chown,cap_fowner,cap_kill"' Type=oneshot CapabilityBoundingSet=CAP_FOWNER CapabilityBoundingSet=CAP_KILL CAP_CHOWN diff --git a/test/test-execute/exec-capabilityboundingset-reset.service b/test/test-execute/exec-capabilityboundingset-reset.service index 2443951651..7354a1cb83 100644 --- a/test/test-execute/exec-capabilityboundingset-reset.service +++ b/test/test-execute/exec-capabilityboundingset-reset.service @@ -3,7 +3,7 @@ Description=Test for CapabilityBoundingSet [Service] -ExecStart=sh -x -c 'c=$$(capsh --print | grep "Bounding set "); test "$$c" = "Bounding set ="' +ExecStart=bash -x -c 'c=$$(capsh --print | grep "Bounding set "); test "$$c" = "Bounding set ="' Type=oneshot CapabilityBoundingSet=CAP_FOWNER CAP_KILL CapabilityBoundingSet= diff --git a/test/test-execute/exec-capabilityboundingset-simple.service b/test/test-execute/exec-capabilityboundingset-simple.service index 3df3e6d9ae..9c149264d3 100644 --- a/test/test-execute/exec-capabilityboundingset-simple.service +++ b/test/test-execute/exec-capabilityboundingset-simple.service @@ -3,6 +3,6 @@ Description=Test for CapabilityBoundingSet [Service] -ExecStart=sh -x -c 'c=$$(capsh --print | grep "Bounding set "); test "$$c" = "Bounding set =cap_fowner,cap_kill"' +ExecStart=bash -x -c 'c=$$(capsh --print | grep "Bounding set "); test "$$c" = "Bounding set =cap_fowner,cap_kill"' Type=oneshot CapabilityBoundingSet=CAP_FOWNER CAP_KILL diff --git a/test/test-execute/exec-condition-failed.service b/test/test-execute/exec-condition-failed.service index eb136fff5d..6c6f6cfd12 100644 --- a/test/test-execute/exec-condition-failed.service +++ b/test/test-execute/exec-condition-failed.service @@ -6,7 +6,7 @@ Description=Test for exec condition that fails the unit Type=oneshot # exit 255 will fail the unit -ExecCondition=/bin/sh -c 'exit 255' +ExecCondition=bash -c 'exit 255' # This should not get run -ExecStart=sh -c 'true' +ExecStart=bash -c 'true' diff --git a/test/test-execute/exec-condition-skip.service b/test/test-execute/exec-condition-skip.service index 4ee58b9c11..554e7c6fbd 100644 --- a/test/test-execute/exec-condition-skip.service +++ b/test/test-execute/exec-condition-skip.service @@ -6,11 +6,11 @@ Description=Test for exec condition that triggers skipping Type=oneshot # exit codes [1, 254] will result in skipping the rest of execution -ExecCondition=/bin/sh -c 'exit 0' -ExecCondition=/bin/sh -c 'exit 254' +ExecCondition=bash -c 'exit 0' +ExecCondition=bash -c 'exit 254' # This would normally fail the unit but will not get run due to the skip above -ExecCondition=/bin/sh -c 'exit 255' +ExecCondition=bash -c 'exit 255' # This should not get run -ExecStart=sh -c 'true' +ExecStart=bash -c 'true' diff --git a/test/test-execute/exec-cpuaffinity1.service b/test/test-execute/exec-cpuaffinity1.service index c0941a5579..4229ebee4e 100644 --- a/test/test-execute/exec-cpuaffinity1.service +++ b/test/test-execute/exec-cpuaffinity1.service @@ -3,5 +3,5 @@ Description=Test for CPUAffinity (simple) [Service] -ExecStart=sh -c 'test $$(cat /proc/self/status | grep Cpus_allowed: | rev | cut -c 1) = 1' +ExecStart=bash -c 'test $$(cat /proc/self/status | grep Cpus_allowed: | rev | cut -c 1) = 1' CPUAffinity=0 diff --git a/test/test-execute/exec-cpuaffinity2.service b/test/test-execute/exec-cpuaffinity2.service index d699ecc031..e0d8e76d3b 100644 --- a/test/test-execute/exec-cpuaffinity2.service +++ b/test/test-execute/exec-cpuaffinity2.service @@ -3,7 +3,7 @@ Description=Test for CPUAffinity (reset) [Service] -ExecStart=sh -c 'test $$(cat /proc/self/status | grep Cpus_allowed: | rev | cut -c 1) = 1' +ExecStart=bash -c 'test $$(cat /proc/self/status | grep Cpus_allowed: | rev | cut -c 1) = 1' CPUAffinity=0-1 3 CPUAffinity= CPUAffinity=0 diff --git a/test/test-execute/exec-cpuaffinity3.service b/test/test-execute/exec-cpuaffinity3.service index 8e8f782ac3..61ebd5b2ea 100644 --- a/test/test-execute/exec-cpuaffinity3.service +++ b/test/test-execute/exec-cpuaffinity3.service @@ -3,6 +3,6 @@ Description=Test for CPUAffinity (merge) [Service] -ExecStart=sh -c 'test $$(cat /proc/self/status | grep Cpus_allowed: | rev | cut -c 1) = 7' +ExecStart=bash -c 'test $$(cat /proc/self/status | grep Cpus_allowed: | rev | cut -c 1) = 7' CPUAffinity=0,1 CPUAffinity=1-2 diff --git a/test/test-execute/exec-credentials-dir-specifier.service b/test/test-execute/exec-credentials-dir-specifier.service index 5e71eee246..2bc8f07248 100644 --- a/test/test-execute/exec-credentials-dir-specifier.service +++ b/test/test-execute/exec-credentials-dir-specifier.service @@ -9,10 +9,10 @@ Environment=TOP_SECRET=%d/very_top_secret ExecStart=test %d/very_top_secret = "${CREDENTIALS_DIRECTORY}/very_top_secret" LoadCredential=very_top_secret ExecStart=test %d/very_top_secret = "${CREDENTIALS_DIRECTORY}/very_top_secret" -ExecStart=sh -c 'test %d/very_top_secret = "$TOP_SECRET"' +ExecStart=bash -c 'test %d/very_top_secret = "$TOP_SECRET"' ExecStartPost=test %d/very_top_secret = "${CREDENTIALS_DIRECTORY}/very_top_secret" -ExecStartPost=sh -c 'test %d/very_top_secret = "$TOP_SECRET"' +ExecStartPost=bash -c 'test %d/very_top_secret = "$TOP_SECRET"' ExecStop=test %d/very_top_secret = "${CREDENTIALS_DIRECTORY}/very_top_secret" -ExecStop=sh -c 'test %d/very_top_secret = "$TOP_SECRET"' +ExecStop=bash -c 'test %d/very_top_secret = "$TOP_SECRET"' ExecStopPost=test %d/very_top_secret = "${CREDENTIALS_DIRECTORY}/very_top_secret" -ExecStopPost=sh -c 'test %d/very_top_secret = "$TOP_SECRET"' +ExecStopPost=bash -c 'test %d/very_top_secret = "$TOP_SECRET"' diff --git a/test/test-execute/exec-dynamicuser-fixeduser-adm.service b/test/test-execute/exec-dynamicuser-fixeduser-adm.service index 3a7f8aef60..5255a010ca 100644 --- a/test/test-execute/exec-dynamicuser-fixeduser-adm.service +++ b/test/test-execute/exec-dynamicuser-fixeduser-adm.service @@ -5,9 +5,9 @@ Description=Test DynamicUser with static User= whose uid and gid are different [Service] Type=oneshot -ExecStart=sh -x -c 'test "$$(id -nG)" = "adm" && test "$$(id -ng)" = "adm" && test "$$(id -nu)" = "adm"' +ExecStart=bash -x -c 'test "$$(id -nG)" = "adm" && test "$$(id -ng)" = "adm" && test "$$(id -nu)" = "adm"' # Multiple ExecStart= lines causes the issue #9702. -ExecStart=sh -x -c 'test "$$(id -nG)" = "adm" && test "$$(id -ng)" = "adm" && test "$$(id -nu)" = "adm"' +ExecStart=bash -x -c 'test "$$(id -nG)" = "adm" && test "$$(id -ng)" = "adm" && test "$$(id -nu)" = "adm"' DynamicUser=yes User=adm ReadWritePaths=-/coverage diff --git a/test/test-execute/exec-dynamicuser-fixeduser-games.service b/test/test-execute/exec-dynamicuser-fixeduser-games.service index 40048d27a8..29b712c9aa 100644 --- a/test/test-execute/exec-dynamicuser-fixeduser-games.service +++ b/test/test-execute/exec-dynamicuser-fixeduser-games.service @@ -5,9 +5,9 @@ Description=Test DynamicUser with static User= whose uid and gid are different [Service] Type=oneshot -ExecStart=sh -x -c 'test "$$(id -nG)" = "games" && test "$$(id -ng)" = "games" && test "$$(id -nu)" = "games"' +ExecStart=bash -x -c 'test "$$(id -nG)" = "games" && test "$$(id -ng)" = "games" && test "$$(id -nu)" = "games"' # Multiple ExecStart= lines causes the issue #9702. -ExecStart=sh -x -c 'test "$$(id -nG)" = "games" && test "$$(id -ng)" = "games" && test "$$(id -nu)" = "games"' +ExecStart=bash -x -c 'test "$$(id -nG)" = "games" && test "$$(id -ng)" = "games" && test "$$(id -nu)" = "games"' DynamicUser=yes User=games ReadWritePaths=-/coverage diff --git a/test/test-execute/exec-dynamicuser-fixeduser-one-supplementarygroup.service b/test/test-execute/exec-dynamicuser-fixeduser-one-supplementarygroup.service index e58b524033..8a4eabb894 100644 --- a/test/test-execute/exec-dynamicuser-fixeduser-one-supplementarygroup.service +++ b/test/test-execute/exec-dynamicuser-fixeduser-one-supplementarygroup.service @@ -3,8 +3,8 @@ Description=Test DynamicUser with User= and SupplementaryGroups= [Service] -ExecStart=sh -x -c 'for g in $$(id -G); do test "$$g" = "1" && exit 0; done; exit 1' -ExecStart=sh -x -c 'test "$$(id -g)" = "1" && test "$$(id -u)" = "1"' +ExecStart=bash -x -c 'for g in $$(id -G); do test "$$g" = "1" && exit 0; done; exit 1' +ExecStart=bash -x -c 'test "$$(id -g)" = "1" && test "$$(id -u)" = "1"' Type=oneshot User=1 DynamicUser=yes diff --git a/test/test-execute/exec-dynamicuser-fixeduser.service b/test/test-execute/exec-dynamicuser-fixeduser.service index 8e5244d891..412198b887 100644 --- a/test/test-execute/exec-dynamicuser-fixeduser.service +++ b/test/test-execute/exec-dynamicuser-fixeduser.service @@ -3,8 +3,8 @@ Description=Test DynamicUser with User= [Service] -ExecStart=sh -x -c 'for g in $$(id -G); do test "$$g" = "1" && exit 0; done; exit 1' -ExecStart=sh -x -c 'test "$$(id -g)" = "1" && test "$$(id -u)" = "1"' +ExecStart=bash -x -c 'for g in $$(id -G); do test "$$g" = "1" && exit 0; done; exit 1' +ExecStart=bash -x -c 'test "$$(id -g)" = "1" && test "$$(id -u)" = "1"' Type=oneshot User=1 DynamicUser=yes diff --git a/test/test-execute/exec-dynamicuser-runtimedirectory1.service b/test/test-execute/exec-dynamicuser-runtimedirectory1.service index 671b316736..30d28aee07 100644 --- a/test/test-execute/exec-dynamicuser-runtimedirectory1.service +++ b/test/test-execute/exec-dynamicuser-runtimedirectory1.service @@ -3,9 +3,9 @@ Description=Test for RuntimeDirectory with RuntimeDirectoryPreserve=yes and DynamicUser=yes [Service] -ExecStart=sh -x -c 'test -d %t/test-exec_runtimedirectorypreserve' -ExecStart=sh -x -c 'test "$$RUNTIME_DIRECTORY" = "%t/test-exec_runtimedirectorypreserve"' -ExecStart=sh -x -c 'touch $$RUNTIME_DIRECTORY/test' +ExecStart=bash -x -c 'test -d %t/test-exec_runtimedirectorypreserve' +ExecStart=bash -x -c 'test "$$RUNTIME_DIRECTORY" = "%t/test-exec_runtimedirectorypreserve"' +ExecStart=bash -x -c 'touch $$RUNTIME_DIRECTORY/test' Type=oneshot RuntimeDirectory=test-exec_runtimedirectorypreserve RuntimeDirectoryPreserve=yes diff --git a/test/test-execute/exec-dynamicuser-runtimedirectory2.service b/test/test-execute/exec-dynamicuser-runtimedirectory2.service index cdb80848e3..ef9ba35c06 100644 --- a/test/test-execute/exec-dynamicuser-runtimedirectory2.service +++ b/test/test-execute/exec-dynamicuser-runtimedirectory2.service @@ -3,10 +3,10 @@ Description=Test for RuntimeDirectory with RuntimeDirectoryPreserve=yes and DynamicUser=yes 2nd trial [Service] -ExecStart=sh -x -c 'test -d %t/test-exec_runtimedirectorypreserve' -ExecStart=sh -x -c 'test "$$RUNTIME_DIRECTORY" = "%t/test-exec_runtimedirectorypreserve"' -ExecStart=sh -x -c 'test -f $$RUNTIME_DIRECTORY/test' -ExecStart=sh -x -c 'touch $$RUNTIME_DIRECTORY/test' +ExecStart=bash -x -c 'test -d %t/test-exec_runtimedirectorypreserve' +ExecStart=bash -x -c 'test "$$RUNTIME_DIRECTORY" = "%t/test-exec_runtimedirectorypreserve"' +ExecStart=bash -x -c 'test -f $$RUNTIME_DIRECTORY/test' +ExecStart=bash -x -c 'touch $$RUNTIME_DIRECTORY/test' Type=oneshot RuntimeDirectory=test-exec_runtimedirectorypreserve RuntimeDirectoryPreserve=yes diff --git a/test/test-execute/exec-dynamicuser-runtimedirectory3.service b/test/test-execute/exec-dynamicuser-runtimedirectory3.service index 51a9e44c6f..a8ee6facf9 100644 --- a/test/test-execute/exec-dynamicuser-runtimedirectory3.service +++ b/test/test-execute/exec-dynamicuser-runtimedirectory3.service @@ -3,10 +3,10 @@ Description=Test for RuntimeDirectory with DynamicUser=yes migrated from RuntimeDirectoryPreserve=yes [Service] -ExecStart=sh -x -c 'test -d %t/test-exec_runtimedirectorypreserve' -ExecStart=sh -x -c 'test "$$RUNTIME_DIRECTORY" = "%t/test-exec_runtimedirectorypreserve"' -ExecStart=sh -x -c 'test -f $$RUNTIME_DIRECTORY/test' -ExecStart=sh -x -c 'touch $$RUNTIME_DIRECTORY/test' +ExecStart=bash -x -c 'test -d %t/test-exec_runtimedirectorypreserve' +ExecStart=bash -x -c 'test "$$RUNTIME_DIRECTORY" = "%t/test-exec_runtimedirectorypreserve"' +ExecStart=bash -x -c 'test -f $$RUNTIME_DIRECTORY/test' +ExecStart=bash -x -c 'touch $$RUNTIME_DIRECTORY/test' Type=oneshot RuntimeDirectory=test-exec_runtimedirectorypreserve DynamicUser=yes diff --git a/test/test-execute/exec-dynamicuser-statedir-migrate-step1.service b/test/test-execute/exec-dynamicuser-statedir-migrate-step1.service index 12375afbb5..855a3aa64e 100644 --- a/test/test-execute/exec-dynamicuser-statedir-migrate-step1.service +++ b/test/test-execute/exec-dynamicuser-statedir-migrate-step1.service @@ -11,7 +11,7 @@ ExecStart=test -d %S/test-dynamicuser-migrate ExecStart=test -d %S/test-dynamicuser-migrate2/hoge ExecStart=touch %S/test-dynamicuser-migrate/yay ExecStart=touch %S/test-dynamicuser-migrate2/hoge/yayyay -ExecStart=sh -x -c 'test "$$STATE_DIRECTORY" = "%S/test-dynamicuser-migrate:%S/test-dynamicuser-migrate2/hoge"' +ExecStart=bash -x -c 'test "$$STATE_DIRECTORY" = "%S/test-dynamicuser-migrate:%S/test-dynamicuser-migrate2/hoge"' Type=oneshot DynamicUser=no diff --git a/test/test-execute/exec-dynamicuser-statedir-migrate-step2.service b/test/test-execute/exec-dynamicuser-statedir-migrate-step2.service index f22862378c..92a421bfc1 100644 --- a/test/test-execute/exec-dynamicuser-statedir-migrate-step2.service +++ b/test/test-execute/exec-dynamicuser-statedir-migrate-step2.service @@ -19,7 +19,7 @@ ExecStart=touch %S/test-dynamicuser-migrate/yay ExecStart=touch %S/test-dynamicuser-migrate2/hoge/yayyay ExecStart=touch %S/private/test-dynamicuser-migrate/yay ExecStart=touch %S/private/test-dynamicuser-migrate2/hoge/yayyay -ExecStart=sh -x -c 'test "$$STATE_DIRECTORY" = "%S/test-dynamicuser-migrate:%S/test-dynamicuser-migrate2/hoge"' +ExecStart=bash -x -c 'test "$$STATE_DIRECTORY" = "%S/test-dynamicuser-migrate:%S/test-dynamicuser-migrate2/hoge"' Type=oneshot DynamicUser=yes diff --git a/test/test-execute/exec-dynamicuser-statedir.service b/test/test-execute/exec-dynamicuser-statedir.service index 1e4fe818ac..d52684ebde 100644 --- a/test/test-execute/exec-dynamicuser-statedir.service +++ b/test/test-execute/exec-dynamicuser-statedir.service @@ -78,7 +78,7 @@ ExecStart=test -f %S/private/xxx/foo ExecStart=test -f %S/private/xxx/yyy/foo ExecStart=test -f %S/private/xxx/zzz/foo -ExecStart=sh -x -c 'test "$$STATE_DIRECTORY" = "%S/aaa:%S/aaa/bbb:%S/aaa/ccc:%S/abc:%S/quux/pief:%S/waldo:%S/xxx:%S/xxx/yyy:%S/xxx/zzz"' +ExecStart=bash -x -c 'test "$$STATE_DIRECTORY" = "%S/aaa:%S/aaa/bbb:%S/aaa/ccc:%S/abc:%S/quux/pief:%S/waldo:%S/xxx:%S/xxx/yyy:%S/xxx/zzz"' Type=oneshot DynamicUser=yes diff --git a/test/test-execute/exec-dynamicuser-supplementarygroups.service b/test/test-execute/exec-dynamicuser-supplementarygroups.service index fd88a790e4..13fc61599e 100644 --- a/test/test-execute/exec-dynamicuser-supplementarygroups.service +++ b/test/test-execute/exec-dynamicuser-supplementarygroups.service @@ -3,8 +3,8 @@ Description=Test DynamicUser with SupplementaryGroups= [Service] -ExecStart=sh -x -c 'for g in $$(id -G); do test "$$g" = "1" && exit 0; done; exit 1' -ExecStart=sh -x -c 'for g in $$(id -G); do test "$$g" = "2" && exit 0; done; exit 1' +ExecStart=bash -x -c 'for g in $$(id -G); do test "$$g" = "1" && exit 0; done; exit 1' +ExecStart=bash -x -c 'for g in $$(id -G); do test "$$g" = "2" && exit 0; done; exit 1' Type=oneshot DynamicUser=yes SupplementaryGroups=1 2 diff --git a/test/test-execute/exec-environment-empty.service b/test/test-execute/exec-environment-empty.service index e5af6ffe68..ff373d51b0 100644 --- a/test/test-execute/exec-environment-empty.service +++ b/test/test-execute/exec-environment-empty.service @@ -3,7 +3,7 @@ Description=Test for Environment [Service] -ExecStart=sh -x -c 'test "$${VAR1-unset}" = "unset" && test "$${VAR2-unset}" = "unset" && test "$${VAR3-unset}" = "unset"' +ExecStart=bash -x -c 'test "$${VAR1-unset}" = "unset" && test "$${VAR2-unset}" = "unset" && test "$${VAR3-unset}" = "unset"' Type=oneshot Environment="VAR1=word1 word2" VAR2=word3 "VAR3=$word 5 6" Environment= diff --git a/test/test-execute/exec-environment-multiple.service b/test/test-execute/exec-environment-multiple.service index 4199a46d84..c6565f492b 100644 --- a/test/test-execute/exec-environment-multiple.service +++ b/test/test-execute/exec-environment-multiple.service @@ -3,7 +3,7 @@ Description=Test for Environment [Service] -ExecStart=sh -x -c 'test "$$VAR1" = "word1 word2" && test "$$VAR2" = word3 && test "$$VAR3" = foobar' +ExecStart=bash -x -c 'test "$$VAR1" = "word1 word2" && test "$$VAR2" = word3 && test "$$VAR3" = foobar' Type=oneshot Environment="VAR1=word1 word2" VAR2=word3 "VAR3=$word 5 6" Environment="VAR3=foobar" diff --git a/test/test-execute/exec-environment-no-substitute.service b/test/test-execute/exec-environment-no-substitute.service index 7396576d7d..6748c1292a 100644 --- a/test/test-execute/exec-environment-no-substitute.service +++ b/test/test-execute/exec-environment-no-substitute.service @@ -3,7 +3,7 @@ Description=Test for No Environment Variable Substitution [Service] -ExecStart=sh -x -c 'test "$${VAR1-unset}" = "unset" && test "$${VAR2}" = "word3" && test "$${VAR3-unset}" = \'$word 5 6\'' -ExecStart=:/bin/sh -x -c 'test "$${VAR1-unset}" != "unset" && test "$${VAR2}" != "word3" && test "$${VAR3-unset}" != \'$word 5 6\'' +ExecStart=bash -x -c 'test "$${VAR1-unset}" = "unset" && test "$${VAR2}" = "word3" && test "$${VAR3-unset}" = \'$word 5 6\'' +ExecStart=:bash -x -c 'test "$${VAR1-unset}" != "unset" && test "$${VAR2}" != "word3" && test "$${VAR3-unset}" != \'$word 5 6\'' Type=oneshot Environment="VAR2=word3" "VAR3=$word 5 6" diff --git a/test/test-execute/exec-environment.service b/test/test-execute/exec-environment.service index 7e3cb0ef42..d20875840c 100644 --- a/test/test-execute/exec-environment.service +++ b/test/test-execute/exec-environment.service @@ -3,6 +3,6 @@ Description=Test for Environment [Service] -ExecStart=sh -x -c 'test "$$VAR1" = "word1 word2" && test "$$VAR2" = word3 && test "$$VAR3" = "\\$$word 5 6"' +ExecStart=bash -x -c 'test "$$VAR1" = "word1 word2" && test "$$VAR2" = word3 && test "$$VAR3" = "\\$$word 5 6"' Type=oneshot Environment="VAR1=word1 word2" VAR2=word3 "VAR3=$word 5 6" diff --git a/test/test-execute/exec-environmentfile.service b/test/test-execute/exec-environmentfile.service index 3f739fa1e0..4331dd2109 100644 --- a/test/test-execute/exec-environmentfile.service +++ b/test/test-execute/exec-environmentfile.service @@ -3,6 +3,6 @@ Description=Test for EnvironmentFile [Service] -ExecStart=sh -x -c 'test "$$VAR1" = "word1 word2" && test "$$VAR2" = word3 && test "$$VAR3" = "\\$$word 5 6" && test "$$VAR4" = "new\nline" && test "$$VAR5" = passwordwithbackslashes' +ExecStart=bash -x -c 'test "$$VAR1" = "word1 word2" && test "$$VAR2" = word3 && test "$$VAR3" = "\\$$word 5 6" && test "$$VAR4" = "new\nline" && test "$$VAR5" = passwordwithbackslashes' Type=oneshot EnvironmentFile=/tmp/test-exec_environmentfile.conf diff --git a/test/test-execute/exec-execsearchpath-environment-path-set.service b/test/test-execute/exec-execsearchpath-environment-path-set.service index 424c4ac7b6..b6d3481d27 100644 --- a/test/test-execute/exec-execsearchpath-environment-path-set.service +++ b/test/test-execute/exec-execsearchpath-environment-path-set.service @@ -1,6 +1,6 @@ # SPDX-License-Identifier: LGPL-2.1-or-later [Service] -ExecStart=sh -x -c 'test "$$PATH" = "/usr" && test "$$VAR1" = word3 && test "$$VAR2" = "\\$$word 5 6"' +ExecStart=bash -x -c 'test "$$PATH" = "/usr" && test "$$VAR1" = word3 && test "$$VAR2" = "\\$$word 5 6"' Type=oneshot ExecSearchPath=/tmp:/bin Environment="PATH=/usr" VAR1=word3 "VAR2=$word 5 6" diff --git a/test/test-execute/exec-execsearchpath-environment.service b/test/test-execute/exec-execsearchpath-environment.service index 5c39d9ca63..aed95cbe9e 100644 --- a/test/test-execute/exec-execsearchpath-environment.service +++ b/test/test-execute/exec-execsearchpath-environment.service @@ -1,6 +1,6 @@ # SPDX-License-Identifier: LGPL-2.1-or-later [Service] -ExecStart=sh -x -c 'test "$$VAR1" = "word1 word2" && test "$$VAR2" = word3 && test "$$VAR3" = "\\$$word 5 6" && test "$$PATH" = "/tmp:/bin"' +ExecStart=bash -x -c 'test "$$VAR1" = "word1 word2" && test "$$VAR2" = word3 && test "$$VAR3" = "\\$$word 5 6" && test "$$PATH" = "/tmp:/bin"' Type=oneshot ExecSearchPath=/tmp:/bin Environment="VAR1=word1 word2" VAR2=word3 "VAR3=$word 5 6" diff --git a/test/test-execute/exec-execsearchpath-environmentfile-set.service b/test/test-execute/exec-execsearchpath-environmentfile-set.service index 8741582231..279c83da10 100644 --- a/test/test-execute/exec-execsearchpath-environmentfile-set.service +++ b/test/test-execute/exec-execsearchpath-environmentfile-set.service @@ -3,7 +3,7 @@ Description=Test for ExecSearchPath with EnvironmentFile where EnvironmentFile sets PATH [Service] -ExecStart=sh -x -c 'test "$$VAR1" = "word1 word2" && test "$$VAR2" = word3 && test "$$VAR3" = "\\$$word 5 6" && test "$$VAR4" = "new\nline" && test "$$VAR5" = passwordwithbackslashes && test "$$PATH" = /usr' +ExecStart=bash -x -c 'test "$$VAR1" = "word1 word2" && test "$$VAR2" = word3 && test "$$VAR3" = "\\$$word 5 6" && test "$$VAR4" = "new\nline" && test "$$VAR5" = passwordwithbackslashes && test "$$PATH" = /usr' Type=oneshot EnvironmentFile=/tmp/test-exec_execsearchpath_environmentfile-set.conf ExecSearchPath=/tmp:/bin diff --git a/test/test-execute/exec-execsearchpath-environmentfile.service b/test/test-execute/exec-execsearchpath-environmentfile.service index 53cede8f1b..29150f4b9f 100644 --- a/test/test-execute/exec-execsearchpath-environmentfile.service +++ b/test/test-execute/exec-execsearchpath-environmentfile.service @@ -3,7 +3,7 @@ Description=Test for ExecSearchPath with EnvironmentFile where EnvironmentFile does not set PATH [Service] -ExecStart=sh -x -c 'test "$$VAR1" = "word1 word2" && test "$$VAR2" = word3 && test "$$VAR3" = "\\$$word 5 6" && test "$$VAR4" = "new\nline" && test "$$VAR5" = passwordwithbackslashes && test "$$PATH" = "/tmp:/bin"' +ExecStart=bash -x -c 'test "$$VAR1" = "word1 word2" && test "$$VAR2" = word3 && test "$$VAR3" = "\\$$word 5 6" && test "$$VAR4" = "new\nline" && test "$$VAR5" = passwordwithbackslashes && test "$$PATH" = "/tmp:/bin"' Type=oneshot ExecSearchPath=/tmp:/bin EnvironmentFile=/tmp/test-exec_execsearchpath_environmentfile.conf diff --git a/test/test-execute/exec-execsearchpath-passenvironment-set.service b/test/test-execute/exec-execsearchpath-passenvironment-set.service index 2d4e75a0c8..05e8f93dbd 100644 --- a/test/test-execute/exec-execsearchpath-passenvironment-set.service +++ b/test/test-execute/exec-execsearchpath-passenvironment-set.service @@ -3,7 +3,7 @@ Description=Test for PassEnvironment with ExecSearchPath with PATH set by user [Service] -ExecStart=sh -x -c 'test "$$VAR1" = "word1 word2" && test "$$VAR2" = word3 && test "$$VAR3" = "\\$$word 5 6" && test "$$VAR4" = "new\nline" && test "$$VAR5" = passwordwithbackslashes && test "$$PATH" = "/usr"' +ExecStart=bash -x -c 'test "$$VAR1" = "word1 word2" && test "$$VAR2" = word3 && test "$$VAR3" = "\\$$word 5 6" && test "$$VAR4" = "new\nline" && test "$$VAR5" = passwordwithbackslashes && test "$$PATH" = "/usr"' Type=oneshot PassEnvironment=VAR1 VAR2 VAR3 VAR4 VAR5 PATH ExecSearchPath=/tmp:/bin diff --git a/test/test-execute/exec-execsearchpath-passenvironment.service b/test/test-execute/exec-execsearchpath-passenvironment.service index 5bdab47193..373afcee7b 100644 --- a/test/test-execute/exec-execsearchpath-passenvironment.service +++ b/test/test-execute/exec-execsearchpath-passenvironment.service @@ -3,7 +3,7 @@ Description=Test for PassEnvironment with ExecSearchPath with PATH not set by user [Service] -ExecStart=sh -x -c 'test "$$VAR1" = "word1 word2" && test "$$VAR2" = word3 && test "$$VAR3" = "\\$$word 5 6" && test "$$VAR4" = "new\nline" && test "$$VAR5" = passwordwithbackslashes && test "$$PATH" = "/tmp:/bin"' +ExecStart=bash -x -c 'test "$$VAR1" = "word1 word2" && test "$$VAR2" = word3 && test "$$VAR3" = "\\$$word 5 6" && test "$$VAR4" = "new\nline" && test "$$VAR5" = passwordwithbackslashes && test "$$PATH" = "/tmp:/bin"' Type=oneshot PassEnvironment=VAR1 VAR2 VAR3 VAR4 VAR5 ExecSearchPath=/tmp:/bin diff --git a/test/test-execute/exec-execsearchpath-unit-specifier.service b/test/test-execute/exec-execsearchpath-unit-specifier.service index a2037e930d..56e4f3f563 100644 --- a/test/test-execute/exec-execsearchpath-unit-specifier.service +++ b/test/test-execute/exec-execsearchpath-unit-specifier.service @@ -5,4 +5,4 @@ Description=Test for specifiers with exec search path [Service] Type=oneshot ExecSearchPath=/tmp:/bin:/usr/bin:%V -ExecStart=sh -x -c 'test %V = /var/tmp && test "$$PATH" = "/tmp:/bin:/usr/bin:/var/tmp"' +ExecStart=bash -x -c 'test %V = /var/tmp && test "$$PATH" = "/tmp:/bin:/usr/bin:/var/tmp"' diff --git a/test/test-execute/exec-group-nfsnobody.service b/test/test-execute/exec-group-nfsnobody.service index aebb1984a1..b9d0ac9a8b 100644 --- a/test/test-execute/exec-group-nfsnobody.service +++ b/test/test-execute/exec-group-nfsnobody.service @@ -3,6 +3,6 @@ Description=Test for Group [Service] -ExecStart=sh -x -c 'test "$$(id -n -g)" = "nfsnobody"' +ExecStart=bash -x -c 'test "$$(id -n -g)" = "nfsnobody"' Type=oneshot Group=nfsnobody diff --git a/test/test-execute/exec-group-nobody.service b/test/test-execute/exec-group-nobody.service index cf283cb657..c4adb5f8fa 100644 --- a/test/test-execute/exec-group-nobody.service +++ b/test/test-execute/exec-group-nobody.service @@ -3,6 +3,6 @@ Description=Test for Group [Service] -ExecStart=sh -x -c 'test "$$(id -n -g)" = "nobody"' +ExecStart=bash -x -c 'test "$$(id -n -g)" = "nobody"' Type=oneshot Group=nobody diff --git a/test/test-execute/exec-group-nogroup.service b/test/test-execute/exec-group-nogroup.service index 46c3dd3acf..bfdc9afa66 100644 --- a/test/test-execute/exec-group-nogroup.service +++ b/test/test-execute/exec-group-nogroup.service @@ -3,6 +3,6 @@ Description=Test for Group [Service] -ExecStart=sh -x -c 'test "$$(id -n -g)" = "nogroup"' +ExecStart=bash -x -c 'test "$$(id -n -g)" = "nogroup"' Type=oneshot Group=nogroup diff --git a/test/test-execute/exec-group.service b/test/test-execute/exec-group.service index bd5ac2db34..5bfc4e9a2d 100644 --- a/test/test-execute/exec-group.service +++ b/test/test-execute/exec-group.service @@ -3,6 +3,6 @@ Description=Test for Group (daemon) [Service] -ExecStart=sh -x -c 'test "$$(id -n -g)" = "daemon"' +ExecStart=bash -x -c 'test "$$(id -n -g)" = "daemon"' Type=oneshot Group=daemon diff --git a/test/test-execute/exec-ignoresigpipe-no.service b/test/test-execute/exec-ignoresigpipe-no.service index ce8b258712..caedab1447 100644 --- a/test/test-execute/exec-ignoresigpipe-no.service +++ b/test/test-execute/exec-ignoresigpipe-no.service @@ -3,6 +3,6 @@ Description=Test for IgnoreSIGPIPE=no [Service] -ExecStart=sh -x -c 'kill -PIPE 0' +ExecStart=bash -x -c 'kill -PIPE 0' Type=oneshot IgnoreSIGPIPE=no diff --git a/test/test-execute/exec-ignoresigpipe-yes.service b/test/test-execute/exec-ignoresigpipe-yes.service index a26f53c413..bc093c0c0a 100644 --- a/test/test-execute/exec-ignoresigpipe-yes.service +++ b/test/test-execute/exec-ignoresigpipe-yes.service @@ -3,6 +3,6 @@ Description=Test for IgnoreSIGPIPE=yes [Service] -ExecStart=sh -x -c 'kill -PIPE 0' +ExecStart=bash -x -c 'kill -PIPE 0' Type=oneshot IgnoreSIGPIPE=yes diff --git a/test/test-execute/exec-inaccessiblepaths-mount-propagation.service b/test/test-execute/exec-inaccessiblepaths-mount-propagation.service index 8580f5208e..fbe754455c 100644 --- a/test/test-execute/exec-inaccessiblepaths-mount-propagation.service +++ b/test/test-execute/exec-inaccessiblepaths-mount-propagation.service @@ -4,5 +4,5 @@ Description=Test to make sure that InaccessiblePaths= disconnect mount propagati [Service] InaccessiblePaths=-/i-dont-exist -ExecStart=sh -x -c 'd=$$(mktemp -d -p /tmp); trap "umount \'$$d\' && rmdir \'$$d\'" EXIT; mount -t tmpfs tmpfs "$$d"; grep "$$d" /proc/self/mountinfo && ! grep "$$d" /proc/$${PPID}/mountinfo && ! grep "$$d" /proc/1/mountinfo' +ExecStart=bash -x -c 'd=$$(mktemp -d -p /tmp); trap "umount \'$$d\' && rmdir \'$$d\'" EXIT; mount -t tmpfs tmpfs "$$d"; grep "$$d" /proc/self/mountinfo && ! grep "$$d" /proc/$${PPID}/mountinfo && ! grep "$$d" /proc/1/mountinfo' Type=oneshot diff --git a/test/test-execute/exec-inaccessiblepaths-sys.service b/test/test-execute/exec-inaccessiblepaths-sys.service index 64a570ce4d..599b7c854c 100644 --- a/test/test-execute/exec-inaccessiblepaths-sys.service +++ b/test/test-execute/exec-inaccessiblepaths-sys.service @@ -4,5 +4,5 @@ Description=Test to make sure that mount namespace setup works properly with the [Service] InaccessiblePaths=/sys -ExecStart=sh -x -c 'test "$$(stat -c %%a /sys)" = "0"' +ExecStart=bash -x -c 'test "$$(stat -c %%a /sys)" = "0"' Type=oneshot diff --git a/test/test-execute/exec-ioschedulingclass-best-effort.service b/test/test-execute/exec-ioschedulingclass-best-effort.service index 569183f173..a98d54c7cf 100644 --- a/test/test-execute/exec-ioschedulingclass-best-effort.service +++ b/test/test-execute/exec-ioschedulingclass-best-effort.service @@ -3,6 +3,6 @@ Description=Test for IOSchedulingClass=best-effort [Service] -ExecStart=sh -x -c 'c=$$(LC_ALL=C ionice); test "$${c%%:*}" = "best-effort"' +ExecStart=bash -x -c 'c=$$(LC_ALL=C ionice); test "$${c%%:*}" = "best-effort"' Type=oneshot IOSchedulingClass=best-effort diff --git a/test/test-execute/exec-ioschedulingclass-idle.service b/test/test-execute/exec-ioschedulingclass-idle.service index 93377ea0c0..7a62682478 100644 --- a/test/test-execute/exec-ioschedulingclass-idle.service +++ b/test/test-execute/exec-ioschedulingclass-idle.service @@ -3,6 +3,6 @@ Description=Test for IOSchedulingClass=idle [Service] -ExecStart=sh -x -c 'c=$$(LC_ALL=C ionice); test "$${c%%:*}" = "idle"' +ExecStart=bash -x -c 'c=$$(LC_ALL=C ionice); test "$${c%%:*}" = "idle"' Type=oneshot IOSchedulingClass=idle diff --git a/test/test-execute/exec-ioschedulingclass-none.service b/test/test-execute/exec-ioschedulingclass-none.service index b8198d16f2..313eca79c5 100644 --- a/test/test-execute/exec-ioschedulingclass-none.service +++ b/test/test-execute/exec-ioschedulingclass-none.service @@ -4,6 +4,6 @@ Description=Test for IOSchedulingClass=none [Service] # Old kernels might report "none" here, new kernels "best-effort". -ExecStart=sh -x -c 'c=$$(LC_ALL=C ionice); test "$${c%%:*}" = "none" -o "$${c%%:*}" = "best-effort"' +ExecStart=bash -x -c 'c=$$(LC_ALL=C ionice); test "$${c%%:*}" = "none" -o "$${c%%:*}" = "best-effort"' Type=oneshot IOSchedulingClass=none diff --git a/test/test-execute/exec-ioschedulingclass-realtime.service b/test/test-execute/exec-ioschedulingclass-realtime.service index a7edb6d012..83ad99e6d4 100644 --- a/test/test-execute/exec-ioschedulingclass-realtime.service +++ b/test/test-execute/exec-ioschedulingclass-realtime.service @@ -3,6 +3,6 @@ Description=Test for IOSchedulingClass=realtime [Service] -ExecStart=sh -x -c 'c=$$(LC_ALL=C ionice); test "$${c%%:*}" = "realtime"' +ExecStart=bash -x -c 'c=$$(LC_ALL=C ionice); test "$${c%%:*}" = "realtime"' Type=oneshot IOSchedulingClass=realtime diff --git a/test/test-execute/exec-load-credential.service b/test/test-execute/exec-load-credential.service index 9da19e6369..d8a0a14b86 100644 --- a/test/test-execute/exec-load-credential.service +++ b/test/test-execute/exec-load-credential.service @@ -3,9 +3,9 @@ Description=Test for LoadCredential= [Service] -ExecStart=sh -x -c 'test "$$(cat %d/test-execute.load-credential)" = "foo"' -ExecStartPost=sh -x -c 'test "$$(cat %d/test-execute.load-credential)" = "foo"' -ExecStop=sh -x -c 'test "$$(cat %d/test-execute.load-credential)" = "foo"' -ExecStopPost=sh -x -c 'test "$$(cat %d/test-execute.load-credential)" = "foo"' +ExecStart=bash -x -c 'test "$$(cat %d/test-execute.load-credential)" = "foo"' +ExecStartPost=bash -x -c 'test "$$(cat %d/test-execute.load-credential)" = "foo"' +ExecStop=bash -x -c 'test "$$(cat %d/test-execute.load-credential)" = "foo"' +ExecStopPost=bash -x -c 'test "$$(cat %d/test-execute.load-credential)" = "foo"' Type=oneshot LoadCredential=test-execute.load-credential diff --git a/test/test-execute/exec-networknamespacepath-privatemounts-no.service b/test/test-execute/exec-networknamespacepath-privatemounts-no.service index 07c0525dcc..4aad58eb69 100644 --- a/test/test-execute/exec-networknamespacepath-privatemounts-no.service +++ b/test/test-execute/exec-networknamespacepath-privatemounts-no.service @@ -3,14 +3,14 @@ Description=Test for NetworkNamespacePath= without mount namespacing [Service] -ExecStart=sh -x -c '! ip link show dummy-test-exec' -ExecStart=sh -x -c 'test ! -e /proc/sys/net/ipv4/conf/dummy-test-exec' +ExecStart=bash -x -c '! ip link show dummy-test-exec' +ExecStart=bash -x -c 'test ! -e /proc/sys/net/ipv4/conf/dummy-test-exec' # Without mount namespacing, we can access the dummy-test-exec interface through sysfs. -ExecStart=sh -x -c 'test -e /sys/class/net/dummy-test-exec' -ExecStart=sh -x -c 'ip link show dummy-test-ns' -ExecStart=sh -x -c 'test -e /proc/sys/net/ipv4/conf/dummy-test-ns' +ExecStart=bash -x -c 'test -e /sys/class/net/dummy-test-exec' +ExecStart=bash -x -c 'ip link show dummy-test-ns' +ExecStart=bash -x -c 'test -e /proc/sys/net/ipv4/conf/dummy-test-ns' # Without mount namespacing, we cannot access the dummy-test-ns interface through sysfs. -ExecStart=sh -x -c 'test ! -e /sys/class/net/dummy-test-ns' +ExecStart=bash -x -c 'test ! -e /sys/class/net/dummy-test-ns' Type=oneshot NetworkNamespacePath=/run/netns/test-execute-netns PrivateMounts=no diff --git a/test/test-execute/exec-networknamespacepath-privatemounts-yes.service b/test/test-execute/exec-networknamespacepath-privatemounts-yes.service index 10bc1923b7..9efd54ae6c 100644 --- a/test/test-execute/exec-networknamespacepath-privatemounts-yes.service +++ b/test/test-execute/exec-networknamespacepath-privatemounts-yes.service @@ -3,14 +3,14 @@ Description=Test for NetworkNamespacePath= with mount namespacing [Service] -ExecStart=sh -x -c '! ip link show dummy-test-exec' -ExecStart=sh -x -c 'test ! -e /proc/sys/net/ipv4/conf/dummy-test-exec' +ExecStart=bash -x -c '! ip link show dummy-test-exec' +ExecStart=bash -x -c 'test ! -e /proc/sys/net/ipv4/conf/dummy-test-exec' # With mount namespacing, we cannot access the dummy-test-exec interface through sysfs. -ExecStart=sh -x -c 'test ! -e /sys/class/net/dummy-test-exec' -ExecStart=sh -x -c 'ip link show dummy-test-ns' -ExecStart=sh -x -c 'test -e /proc/sys/net/ipv4/conf/dummy-test-ns' +ExecStart=bash -x -c 'test ! -e /sys/class/net/dummy-test-exec' +ExecStart=bash -x -c 'ip link show dummy-test-ns' +ExecStart=bash -x -c 'test -e /proc/sys/net/ipv4/conf/dummy-test-ns' # With mount namespacing, we can access the dummy-test-ns interface through sysfs. -ExecStart=sh -x -c 'test -e /sys/class/net/dummy-test-ns' +ExecStart=bash -x -c 'test -e /sys/class/net/dummy-test-ns' Type=oneshot NetworkNamespacePath=/run/netns/test-execute-netns # NetworkNamespacePath= implies PrivateMounts=yes diff --git a/test/test-execute/exec-noexecpaths-simple.service b/test/test-execute/exec-noexecpaths-simple.service index 503be5a770..2eb8aae6ab 100644 --- a/test/test-execute/exec-noexecpaths-simple.service +++ b/test/test-execute/exec-noexecpaths-simple.service @@ -5,7 +5,7 @@ Description=Test for NoExecPaths= [Service] Type=oneshot # This should work, as we explicitly disable the effect of NoExecPaths= -ExecStart=+/bin/sh -c '/bin/cat /dev/null' +ExecStart=+bash -c '/bin/cat /dev/null' # This should also work, as we do not disable the effect of NoExecPaths= but invert the exit code -ExecStart=sh -x -c '! /bin/cat /dev/null' +ExecStart=bash -x -c '! /bin/cat /dev/null' NoExecPaths=/bin/cat diff --git a/test/test-execute/exec-oomscoreadjust-negative.service b/test/test-execute/exec-oomscoreadjust-negative.service index 5656030796..a6d3a52d4e 100644 --- a/test/test-execute/exec-oomscoreadjust-negative.service +++ b/test/test-execute/exec-oomscoreadjust-negative.service @@ -3,6 +3,6 @@ Description=Test for OOMScoreAdjust [Service] -ExecStart=sh -x -c 'c=$$(cat /proc/self/oom_score_adj); test "$$c" -eq -100' +ExecStart=bash -x -c 'c=$$(cat /proc/self/oom_score_adj); test "$$c" -eq -100' Type=oneshot OOMScoreAdjust=-100 diff --git a/test/test-execute/exec-oomscoreadjust-positive.service b/test/test-execute/exec-oomscoreadjust-positive.service index a2079b841e..1d903d3b7a 100644 --- a/test/test-execute/exec-oomscoreadjust-positive.service +++ b/test/test-execute/exec-oomscoreadjust-positive.service @@ -3,6 +3,6 @@ Description=Test for OOMScoreAdjust [Service] -ExecStart=sh -x -c 'c=$$(cat /proc/self/oom_score_adj); test "$$c" -eq 100' +ExecStart=bash -x -c 'c=$$(cat /proc/self/oom_score_adj); test "$$c" -eq 100' Type=oneshot OOMScoreAdjust=100 diff --git a/test/test-execute/exec-passenvironment-absent.service b/test/test-execute/exec-passenvironment-absent.service index b2e5c20016..1b92df85c7 100644 --- a/test/test-execute/exec-passenvironment-absent.service +++ b/test/test-execute/exec-passenvironment-absent.service @@ -3,6 +3,6 @@ Description=Test for PassEnvironment with variables absent from the execution environment [Service] -ExecStart=sh -x -c 'test "$${VAR1-unset}" = "unset" && test "$${VAR2-unset}" = "unset" && test "$${VAR3-unset}" = "unset" && test "$${VAR4-unset}" = "unset" && test "$${VAR5-unset}" = "unset"' +ExecStart=bash -x -c 'test "$${VAR1-unset}" = "unset" && test "$${VAR2-unset}" = "unset" && test "$${VAR3-unset}" = "unset" && test "$${VAR4-unset}" = "unset" && test "$${VAR5-unset}" = "unset"' Type=oneshot PassEnvironment=VAR1 VAR2 VAR3 VAR4 VAR5 diff --git a/test/test-execute/exec-passenvironment-empty.service b/test/test-execute/exec-passenvironment-empty.service index a5fd092783..21db61cbc1 100644 --- a/test/test-execute/exec-passenvironment-empty.service +++ b/test/test-execute/exec-passenvironment-empty.service @@ -3,7 +3,7 @@ Description=Test for PassEnvironment and erasing the variable list [Service] -ExecStart=sh -x -c 'test "$${VAR1-unset}" = "unset" && test "$${VAR2-unset}" = "unset" && test "$${VAR3-unset}" = "unset" && test "$${VAR4-unset}" = "unset" && test "$${VAR5-unset}" = "unset"' +ExecStart=bash -x -c 'test "$${VAR1-unset}" = "unset" && test "$${VAR2-unset}" = "unset" && test "$${VAR3-unset}" = "unset" && test "$${VAR4-unset}" = "unset" && test "$${VAR5-unset}" = "unset"' Type=oneshot PassEnvironment=VAR1 VAR2 VAR3 VAR4 VAR5 PassEnvironment= diff --git a/test/test-execute/exec-passenvironment-repeated.service b/test/test-execute/exec-passenvironment-repeated.service index f3b886c5c6..a2067a6aff 100644 --- a/test/test-execute/exec-passenvironment-repeated.service +++ b/test/test-execute/exec-passenvironment-repeated.service @@ -3,7 +3,7 @@ Description=Test for PassEnvironment with a variable name repeated [Service] -ExecStart=sh -x -c 'test "$$VAR1" = "word1 word2" && test "$$VAR2" = word3 && test "$$VAR3" = "\\$$word 5 6" && test "$$VAR4" = "new\nline" && test "$$VAR5" = passwordwithbackslashes' +ExecStart=bash -x -c 'test "$$VAR1" = "word1 word2" && test "$$VAR2" = word3 && test "$$VAR3" = "\\$$word 5 6" && test "$$VAR4" = "new\nline" && test "$$VAR5" = passwordwithbackslashes' Type=oneshot PassEnvironment=VAR1 VAR2 PassEnvironment=VAR1 VAR3 diff --git a/test/test-execute/exec-passenvironment.service b/test/test-execute/exec-passenvironment.service index 1dcbcf97c8..5584aa3500 100644 --- a/test/test-execute/exec-passenvironment.service +++ b/test/test-execute/exec-passenvironment.service @@ -3,6 +3,6 @@ Description=Test for PassEnvironment [Service] -ExecStart=sh -x -c 'test "$$VAR1" = "word1 word2" && test "$$VAR2" = word3 && test "$$VAR3" = "\\$$word 5 6" && test "$$VAR4" = "new\nline" && test "$$VAR5" = passwordwithbackslashes' +ExecStart=bash -x -c 'test "$$VAR1" = "word1 word2" && test "$$VAR2" = word3 && test "$$VAR3" = "\\$$word 5 6" && test "$$VAR4" = "new\nline" && test "$$VAR5" = passwordwithbackslashes' Type=oneshot PassEnvironment=VAR1 VAR2 VAR3 VAR4 VAR5 diff --git a/test/test-execute/exec-personality-aarch64.service b/test/test-execute/exec-personality-aarch64.service index e4ea294dcc..72afaf386b 100644 --- a/test/test-execute/exec-personality-aarch64.service +++ b/test/test-execute/exec-personality-aarch64.service @@ -3,6 +3,6 @@ Description=Test for Personality=aarch64 [Service] -ExecStart=sh -c 'echo $(uname -m); exit $(test $(uname -m) = "aarch64")' +ExecStart=bash -c 'echo $(uname -m); exit $(test $(uname -m) = "aarch64")' Type=oneshot Personality=aarch64 diff --git a/test/test-execute/exec-personality-loongarch64.service b/test/test-execute/exec-personality-loongarch64.service index 31c6b258c7..689f35ff9e 100644 --- a/test/test-execute/exec-personality-loongarch64.service +++ b/test/test-execute/exec-personality-loongarch64.service @@ -2,6 +2,6 @@ Description=Test for Personality=loongarch64 [Service] -ExecStart=sh -c 'echo $(uname -m); exit $(test $(uname -m) = "loongarch64")' +ExecStart=bash -c 'echo $(uname -m); exit $(test $(uname -m) = "loongarch64")' Type=oneshot Personality=loongarch64 diff --git a/test/test-execute/exec-personality-ppc64.service b/test/test-execute/exec-personality-ppc64.service index dd83bf66ee..3377c6b823 100644 --- a/test/test-execute/exec-personality-ppc64.service +++ b/test/test-execute/exec-personality-ppc64.service @@ -3,6 +3,6 @@ Description=Test for Personality=ppc64 [Service] -ExecStart=sh -c 'echo $(uname -m); exit $(test $(uname -m) = "ppc64")' +ExecStart=bash -c 'echo $(uname -m); exit $(test $(uname -m) = "ppc64")' Type=oneshot Personality=ppc64 diff --git a/test/test-execute/exec-personality-ppc64le.service b/test/test-execute/exec-personality-ppc64le.service index 3f19d825db..f38c31b4c4 100644 --- a/test/test-execute/exec-personality-ppc64le.service +++ b/test/test-execute/exec-personality-ppc64le.service @@ -3,6 +3,6 @@ Description=Test for Personality=ppc64le [Service] -ExecStart=sh -c 'echo $(uname -m); exit $(test $(uname -m) = "ppc64le")' +ExecStart=bash -c 'echo $(uname -m); exit $(test $(uname -m) = "ppc64le")' Type=oneshot Personality=ppc64le diff --git a/test/test-execute/exec-personality-s390.service b/test/test-execute/exec-personality-s390.service index 7d120cde2d..d81b90bcd4 100644 --- a/test/test-execute/exec-personality-s390.service +++ b/test/test-execute/exec-personality-s390.service @@ -3,6 +3,6 @@ Description=Test for Personality=s390 [Service] -ExecStart=sh -x -c 'c=$$(uname -m); test "$$c" = "s390"' +ExecStart=bash -x -c 'c=$$(uname -m); test "$$c" = "s390"' Type=oneshot Personality=s390 diff --git a/test/test-execute/exec-personality-s390x.service b/test/test-execute/exec-personality-s390x.service index 4545dee4c3..10bcd37b69 100644 --- a/test/test-execute/exec-personality-s390x.service +++ b/test/test-execute/exec-personality-s390x.service @@ -3,6 +3,6 @@ Description=Test for Personality=s390x [Service] -ExecStart=sh -x -c 'c=$$(uname -m); test "$$c" = "s390x"' +ExecStart=bash -x -c 'c=$$(uname -m); test "$$c" = "s390x"' Type=oneshot Personality=s390x diff --git a/test/test-execute/exec-personality-x86-64.service b/test/test-execute/exec-personality-x86-64.service index e7b945ca14..d2324001b5 100644 --- a/test/test-execute/exec-personality-x86-64.service +++ b/test/test-execute/exec-personality-x86-64.service @@ -3,6 +3,6 @@ Description=Test for Personality=x86-64 [Service] -ExecStart=sh -x -c 'c=$$(uname -m); test "$$c" = "x86_64"' +ExecStart=bash -x -c 'c=$$(uname -m); test "$$c" = "x86_64"' Type=oneshot Personality=x86-64 diff --git a/test/test-execute/exec-personality-x86.service b/test/test-execute/exec-personality-x86.service index 95ec353cb1..1245d0b482 100644 --- a/test/test-execute/exec-personality-x86.service +++ b/test/test-execute/exec-personality-x86.service @@ -3,6 +3,6 @@ Description=Test for Personality=x86 [Service] -ExecStart=sh -x -c 'c=$$(uname -m); test "$$c" = "i686" -o "$$c" = "x86_64"' +ExecStart=bash -x -c 'c=$$(uname -m); test "$$c" = "i686" -o "$$c" = "x86_64"' Type=oneshot Personality=x86 diff --git a/test/test-execute/exec-privatedevices-bind.service b/test/test-execute/exec-privatedevices-bind.service index c2229a4a7a..a74a4435a4 100644 --- a/test/test-execute/exec-privatedevices-bind.service +++ b/test/test-execute/exec-privatedevices-bind.service @@ -3,8 +3,8 @@ Description=Test for PrivateDevices=yes with a bind mounted device [Service] -ExecStart=sh -c 'test -c /dev/kmsg' -ExecStart=sh -c 'test ! -w /dev/' +ExecStart=bash -c 'test -c /dev/kmsg' +ExecStart=bash -c 'test ! -w /dev/' Type=oneshot PrivateDevices=yes BindPaths=/dev/kmsg diff --git a/test/test-execute/exec-privatedevices-disabled-by-prefix.service b/test/test-execute/exec-privatedevices-disabled-by-prefix.service index 8f09c4ab95..eeea0b9355 100644 --- a/test/test-execute/exec-privatedevices-disabled-by-prefix.service +++ b/test/test-execute/exec-privatedevices-disabled-by-prefix.service @@ -3,7 +3,7 @@ Description=Test for PrivateDevices=yes with prefix [Service] -ExecStart=sh -x -c '! test -c /dev/kmsg' -ExecStart=+/bin/sh -x -c 'test -c /dev/kmsg' +ExecStart=bash -x -c '! test -c /dev/kmsg' +ExecStart=+bash -x -c 'test -c /dev/kmsg' Type=oneshot PrivateDevices=yes diff --git a/test/test-execute/exec-privatedevices-no-capability-mknod.service b/test/test-execute/exec-privatedevices-no-capability-mknod.service index 811f4ad685..dfdb5932b2 100644 --- a/test/test-execute/exec-privatedevices-no-capability-mknod.service +++ b/test/test-execute/exec-privatedevices-no-capability-mknod.service @@ -5,5 +5,5 @@ Description=Test CAP_MKNOD capability for PrivateDevices=no [Service] PrivateDevices=no # sed: remove dropped (cap_xxx-[epi]) and IAB capabilities from the output -ExecStart=sh -x -c 'capsh --print | sed -re "s/[^ ]+?\-[epi]+//g" -e '/IAB/d' | grep cap_mknod' +ExecStart=bash -x -c 'capsh --print | sed -re "s/[^ ]+?\-[epi]+//g" -e '/IAB/d' | grep cap_mknod' Type=oneshot diff --git a/test/test-execute/exec-privatedevices-no-capability-sys-rawio.service b/test/test-execute/exec-privatedevices-no-capability-sys-rawio.service index 47be622b5f..e756f83b7f 100644 --- a/test/test-execute/exec-privatedevices-no-capability-sys-rawio.service +++ b/test/test-execute/exec-privatedevices-no-capability-sys-rawio.service @@ -5,5 +5,5 @@ Description=Test CAP_SYS_RAWIO capability for PrivateDevices=no [Service] PrivateDevices=no # sed: remove dropped (cap_xxx-[epi]) and IAB capabilities from the output -ExecStart=sh -x -c 'capsh --print | sed -re "s/[^ ]+?\-[epi]+//g" -e '/IAB/d' | grep cap_sys_rawio' +ExecStart=bash -x -c 'capsh --print | sed -re "s/[^ ]+?\-[epi]+//g" -e '/IAB/d' | grep cap_sys_rawio' Type=oneshot diff --git a/test/test-execute/exec-privatedevices-no.service b/test/test-execute/exec-privatedevices-no.service index 5b8a05133b..c2b22b81c2 100644 --- a/test/test-execute/exec-privatedevices-no.service +++ b/test/test-execute/exec-privatedevices-no.service @@ -3,6 +3,6 @@ Description=Test for PrivateDevices=no [Service] -ExecStart=sh -x -c 'test -c /dev/kmsg' +ExecStart=bash -x -c 'test -c /dev/kmsg' Type=oneshot PrivateDevices=no diff --git a/test/test-execute/exec-privatedevices-yes-capability-mknod.service b/test/test-execute/exec-privatedevices-yes-capability-mknod.service index 3d29a9cb05..b3b06af605 100644 --- a/test/test-execute/exec-privatedevices-yes-capability-mknod.service +++ b/test/test-execute/exec-privatedevices-yes-capability-mknod.service @@ -5,5 +5,5 @@ Description=Test CAP_MKNOD capability for PrivateDevices=yes [Service] PrivateDevices=yes # sed: remove dropped (cap_xxx-[epi]) and IAB capabilities from the output -ExecStart=sh -x -c '! capsh --print | sed -re "s/[^ ]+?\-[epi]+//g" -e '/IAB/d' | grep cap_mknod' +ExecStart=bash -x -c '! capsh --print | sed -re "s/[^ ]+?\-[epi]+//g" -e '/IAB/d' | grep cap_mknod' Type=oneshot diff --git a/test/test-execute/exec-privatedevices-yes-capability-sys-rawio.service b/test/test-execute/exec-privatedevices-yes-capability-sys-rawio.service index b1c0617837..4233d477a2 100644 --- a/test/test-execute/exec-privatedevices-yes-capability-sys-rawio.service +++ b/test/test-execute/exec-privatedevices-yes-capability-sys-rawio.service @@ -5,5 +5,5 @@ Description=Test CAP_SYS_RAWIO capability for PrivateDevices=yes [Service] PrivateDevices=yes # sed: remove dropped (cap_xxx-[epi]) and IAB capabilities from the output -ExecStart=sh -x -c '! capsh --print | sed -re "s/[^ ]+?\-[epi]+//g" -e '/IAB/d' | grep cap_sys_rawio' +ExecStart=bash -x -c '! capsh --print | sed -re "s/[^ ]+?\-[epi]+//g" -e '/IAB/d' | grep cap_sys_rawio' Type=oneshot diff --git a/test/test-execute/exec-privatedevices-yes-with-group.service b/test/test-execute/exec-privatedevices-yes-with-group.service index 094ac22724..bdd164348c 100644 --- a/test/test-execute/exec-privatedevices-yes-with-group.service +++ b/test/test-execute/exec-privatedevices-yes-with-group.service @@ -8,10 +8,10 @@ Group=daemon Type=oneshot # Check the group applied -ExecStart=sh -x -c 'test "$$(id -n -g)" = "daemon"' +ExecStart=bash -x -c 'test "$$(id -n -g)" = "daemon"' # Check that the namespace applied -ExecStart=sh -c 'test ! -c /dev/kmsg' +ExecStart=bash -c 'test ! -c /dev/kmsg' # Check that the owning group of a node is not daemon (should be the host root) -ExecStart=sh -x -c 'test ! "$$(stat -c %%G /dev/stderr)" = "daemon"' +ExecStart=bash -x -c 'test ! "$$(stat -c %%G /dev/stderr)" = "daemon"' diff --git a/test/test-execute/exec-privatedevices-yes.service b/test/test-execute/exec-privatedevices-yes.service index 2d32753053..349fd8f974 100644 --- a/test/test-execute/exec-privatedevices-yes.service +++ b/test/test-execute/exec-privatedevices-yes.service @@ -3,6 +3,6 @@ Description=Test for PrivateDevices=yes [Service] -ExecStart=sh -c 'test ! -c /dev/kmsg' +ExecStart=bash -c 'test ! -c /dev/kmsg' Type=oneshot PrivateDevices=yes diff --git a/test/test-execute/exec-privatenetwork-yes-privatemounts-no.service b/test/test-execute/exec-privatenetwork-yes-privatemounts-no.service index c16102d07f..9c7f0a468e 100644 --- a/test/test-execute/exec-privatenetwork-yes-privatemounts-no.service +++ b/test/test-execute/exec-privatenetwork-yes-privatemounts-no.service @@ -3,10 +3,10 @@ Description=Test for PrivateNetwork= without mount namespacing [Service] -ExecStart=sh -x -c '! ip link show dummy-test-exec' -ExecStart=sh -x -c 'test ! -e /proc/sys/net/ipv4/conf/dummy-test-exec' +ExecStart=bash -x -c '! ip link show dummy-test-exec' +ExecStart=bash -x -c 'test ! -e /proc/sys/net/ipv4/conf/dummy-test-exec' # Without mount namespacing, we can access the dummy-test-exec interface through sysfs -ExecStart=sh -x -c 'test -d /sys/class/net/dummy-test-exec' +ExecStart=bash -x -c 'test -d /sys/class/net/dummy-test-exec' Type=oneshot PrivateNetwork=yes PrivateMounts=no diff --git a/test/test-execute/exec-privatenetwork-yes-privatemounts-yes.service b/test/test-execute/exec-privatenetwork-yes-privatemounts-yes.service index eb48d6e0c5..2078eff0bd 100644 --- a/test/test-execute/exec-privatenetwork-yes-privatemounts-yes.service +++ b/test/test-execute/exec-privatenetwork-yes-privatemounts-yes.service @@ -3,10 +3,10 @@ Description=Test for PrivateNetwork= with mount namespacing [Service] -ExecStart=sh -x -c '! ip link show dummy-test-exec' -ExecStart=sh -x -c 'test ! -e /proc/sys/net/ipv4/conf/dummy-test-exec' +ExecStart=bash -x -c '! ip link show dummy-test-exec' +ExecStart=bash -x -c 'test ! -e /proc/sys/net/ipv4/conf/dummy-test-exec' # With mount namespacing, we cannot access the dummy-test-exec interface through sysfs. -ExecStart=sh -x -c 'test ! -e /sys/class/net/dummy-test-exec' +ExecStart=bash -x -c 'test ! -e /sys/class/net/dummy-test-exec' Type=oneshot PrivateNetwork=yes # PrivateNetwork=yes implies PrivateMounts=yes diff --git a/test/test-execute/exec-privatetmp-disabled-by-prefix.service b/test/test-execute/exec-privatetmp-disabled-by-prefix.service index 9dfcecc02c..6437244520 100644 --- a/test/test-execute/exec-privatetmp-disabled-by-prefix.service +++ b/test/test-execute/exec-privatetmp-disabled-by-prefix.service @@ -3,7 +3,7 @@ Description=Test for PrivateTmp=yes with prefix [Service] -ExecStart=sh -x -c 'test ! -f /tmp/test-exec_privatetmp' -ExecStart=+/bin/sh -x -c 'test -f /tmp/test-exec_privatetmp' +ExecStart=bash -x -c 'test ! -f /tmp/test-exec_privatetmp' +ExecStart=+bash -x -c 'test -f /tmp/test-exec_privatetmp' Type=oneshot PrivateTmp=yes diff --git a/test/test-execute/exec-privatetmp-disconnected-after-and-requires-for-var.service b/test/test-execute/exec-privatetmp-disconnected-after-and-requires-for-var.service index 39e49c698a..39594a768e 100644 --- a/test/test-execute/exec-privatetmp-disconnected-after-and-requires-for-var.service +++ b/test/test-execute/exec-privatetmp-disconnected-after-and-requires-for-var.service @@ -6,10 +6,10 @@ After=var.mount Requires=var.mount [Service] -ExecStart=sh -x -c 'test ! -f /tmp/test-exec_privatetmp' +ExecStart=bash -x -c 'test ! -f /tmp/test-exec_privatetmp' ExecStart=touch /tmp/test-exec_privatetmp_disconnected ExecStart=touch /var/tmp/test-exec_privatetmp_disconnected -ExecStart=sh -x -c 'test x$$TMPDIR = x' +ExecStart=bash -x -c 'test x$$TMPDIR = x' Type=oneshot ProtectSystem=strict PrivateTmp=disconnected diff --git a/test/test-execute/exec-privatetmp-disconnected-after-and-wants-for-var.service b/test/test-execute/exec-privatetmp-disconnected-after-and-wants-for-var.service index b11302f5f2..79553df7f1 100644 --- a/test/test-execute/exec-privatetmp-disconnected-after-and-wants-for-var.service +++ b/test/test-execute/exec-privatetmp-disconnected-after-and-wants-for-var.service @@ -6,10 +6,10 @@ After=var.mount Wants=var.mount [Service] -ExecStart=sh -x -c 'test ! -f /tmp/test-exec_privatetmp' +ExecStart=bash -x -c 'test ! -f /tmp/test-exec_privatetmp' ExecStart=touch /tmp/test-exec_privatetmp_disconnected ExecStart=touch /var/tmp/test-exec_privatetmp_disconnected -ExecStart=sh -x -c 'test x$$TMPDIR = x' +ExecStart=bash -x -c 'test x$$TMPDIR = x' Type=oneshot ProtectSystem=strict PrivateTmp=disconnected diff --git a/test/test-execute/exec-privatetmp-disconnected-defaultdependencies-no.service b/test/test-execute/exec-privatetmp-disconnected-defaultdependencies-no.service index 2208b8e1b5..2b8693796a 100644 --- a/test/test-execute/exec-privatetmp-disconnected-defaultdependencies-no.service +++ b/test/test-execute/exec-privatetmp-disconnected-defaultdependencies-no.service @@ -4,10 +4,10 @@ Description=Test for PrivateTmp=disconnected with DefaultDependencies=no DefaultDependencies=no [Service] -ExecStart=sh -x -c 'test ! -f /tmp/test-exec_privatetmp' +ExecStart=bash -x -c 'test ! -f /tmp/test-exec_privatetmp' ExecStart=touch /tmp/test-exec_privatetmp_disconnected -ExecStart=sh -x -c '(! touch /var/tmp/test-exec_privatetmp_disconnected)' -ExecStart=sh -x -c 'test $$TMPDIR = /tmp' +ExecStart=bash -x -c '(! touch /var/tmp/test-exec_privatetmp_disconnected)' +ExecStart=bash -x -c 'test $$TMPDIR = /tmp' Type=oneshot ProtectSystem=strict PrivateTmp=disconnected diff --git a/test/test-execute/exec-privatetmp-disconnected-nodefaultdeps-nor-sandboxing.service b/test/test-execute/exec-privatetmp-disconnected-nodefaultdeps-nor-sandboxing.service index 4bff9d03f1..6fb561d0c9 100644 --- a/test/test-execute/exec-privatetmp-disconnected-nodefaultdeps-nor-sandboxing.service +++ b/test/test-execute/exec-privatetmp-disconnected-nodefaultdeps-nor-sandboxing.service @@ -5,6 +5,6 @@ DefaultDependencies=no [Service] ExecStart=+touch /tmp/test-exec_privatetmp_disconnected -ExecStart=+sh -x -c 'test x$$TMPDIR = x' +ExecStart=+bash -x -c 'test x$$TMPDIR = x' Type=oneshot PrivateTmp=disconnected diff --git a/test/test-execute/exec-privatetmp-disconnected-requires-mounts-for-var.service b/test/test-execute/exec-privatetmp-disconnected-requires-mounts-for-var.service index 349c137984..58c3ee9499 100644 --- a/test/test-execute/exec-privatetmp-disconnected-requires-mounts-for-var.service +++ b/test/test-execute/exec-privatetmp-disconnected-requires-mounts-for-var.service @@ -5,10 +5,10 @@ DefaultDependencies=no RequiresMountsFor=/var/ [Service] -ExecStart=sh -x -c 'test ! -f /tmp/test-exec_privatetmp' +ExecStart=bash -x -c 'test ! -f /tmp/test-exec_privatetmp' ExecStart=touch /tmp/test-exec_privatetmp_disconnected ExecStart=touch /var/tmp/test-exec_privatetmp_disconnected -ExecStart=sh -x -c 'test x$$TMPDIR = x' +ExecStart=bash -x -c 'test x$$TMPDIR = x' Type=oneshot ProtectSystem=strict PrivateTmp=disconnected diff --git a/test/test-execute/exec-privatetmp-disconnected-wants-mounts-for-var.service b/test/test-execute/exec-privatetmp-disconnected-wants-mounts-for-var.service index 09ac3495b8..66337df79a 100644 --- a/test/test-execute/exec-privatetmp-disconnected-wants-mounts-for-var.service +++ b/test/test-execute/exec-privatetmp-disconnected-wants-mounts-for-var.service @@ -5,10 +5,10 @@ DefaultDependencies=no WantsMountsFor=/var/ [Service] -ExecStart=sh -x -c 'test ! -f /tmp/test-exec_privatetmp' +ExecStart=bash -x -c 'test ! -f /tmp/test-exec_privatetmp' ExecStart=touch /tmp/test-exec_privatetmp_disconnected ExecStart=touch /var/tmp/test-exec_privatetmp_disconnected -ExecStart=sh -x -c 'test x$$TMPDIR = x' +ExecStart=bash -x -c 'test x$$TMPDIR = x' Type=oneshot ProtectSystem=strict PrivateTmp=disconnected diff --git a/test/test-execute/exec-privatetmp-disconnected.service b/test/test-execute/exec-privatetmp-disconnected.service index fbee568d74..470e4828cf 100644 --- a/test/test-execute/exec-privatetmp-disconnected.service +++ b/test/test-execute/exec-privatetmp-disconnected.service @@ -3,10 +3,10 @@ Description=Test for PrivateTmp=disconnected [Service] -ExecStart=sh -x -c 'test ! -f /tmp/test-exec_privatetmp' +ExecStart=bash -x -c 'test ! -f /tmp/test-exec_privatetmp' ExecStart=touch /tmp/test-exec_privatetmp_disconnected ExecStart=touch /var/tmp/test-exec_privatetmp_disconnected -ExecStart=sh -x -c 'test x$$TMPDIR = x' +ExecStart=bash -x -c 'test x$$TMPDIR = x' Type=oneshot ProtectSystem=strict PrivateTmp=disconnected diff --git a/test/test-execute/exec-privatetmp-no.service b/test/test-execute/exec-privatetmp-no.service index 599203abb8..4cf9104a64 100644 --- a/test/test-execute/exec-privatetmp-no.service +++ b/test/test-execute/exec-privatetmp-no.service @@ -3,6 +3,6 @@ Description=Test for PrivateTmp=no [Service] -ExecStart=sh -x -c 'test -f /tmp/test-exec_privatetmp' +ExecStart=bash -x -c 'test -f /tmp/test-exec_privatetmp' Type=oneshot PrivateTmp=no diff --git a/test/test-execute/exec-privatetmp-yes.service b/test/test-execute/exec-privatetmp-yes.service index 5ea52639f0..df6ec3a816 100644 --- a/test/test-execute/exec-privatetmp-yes.service +++ b/test/test-execute/exec-privatetmp-yes.service @@ -3,6 +3,6 @@ Description=Test for PrivateTmp=yes [Service] -ExecStart=sh -x -c 'test ! -f /tmp/test-exec_privatetmp' +ExecStart=bash -x -c 'test ! -f /tmp/test-exec_privatetmp' Type=oneshot PrivateTmp=yes diff --git a/test/test-execute/exec-protecthome-tmpfs-vs-protectsystem-strict.service b/test/test-execute/exec-protecthome-tmpfs-vs-protectsystem-strict.service index c51cacf40d..161acbcb12 100644 --- a/test/test-execute/exec-protecthome-tmpfs-vs-protectsystem-strict.service +++ b/test/test-execute/exec-protecthome-tmpfs-vs-protectsystem-strict.service @@ -7,4 +7,4 @@ Description=Test ProtectHome=tmpfs vs ProtectSystem=strict ProtectHome=tmpfs ProtectSystem=strict Type=oneshot -ExecStart=sh -x -c 'test "$$(stat -fc %%T /home)" = "tmpfs"' +ExecStart=bash -x -c 'test "$$(stat -fc %%T /home)" = "tmpfs"' diff --git a/test/test-execute/exec-protectkernellogs-no-capabilities.service b/test/test-execute/exec-protectkernellogs-no-capabilities.service index be64c58089..1ed350f4b1 100644 --- a/test/test-execute/exec-protectkernellogs-no-capabilities.service +++ b/test/test-execute/exec-protectkernellogs-no-capabilities.service @@ -5,5 +5,5 @@ Description=Test CAP_SYSLOG for ProtectKernelLogs=no [Service] ProtectKernelLogs=no # sed: remove dropped (cap_xxx-[epi]) and IAB capabilities from the output -ExecStart=sh -x -c 'capsh --print | sed -re "s/[^ ]+?\-[epi]+//g" -e '/IAB/d' | grep cap_syslog' +ExecStart=bash -x -c 'capsh --print | sed -re "s/[^ ]+?\-[epi]+//g" -e '/IAB/d' | grep cap_syslog' Type=oneshot diff --git a/test/test-execute/exec-protectkernellogs-yes-capabilities.service b/test/test-execute/exec-protectkernellogs-yes-capabilities.service index 646ff751a7..387a08af68 100644 --- a/test/test-execute/exec-protectkernellogs-yes-capabilities.service +++ b/test/test-execute/exec-protectkernellogs-yes-capabilities.service @@ -5,5 +5,5 @@ Description=Test CAP_SYSLOG for ProtectKernelLogs=yes [Service] ProtectKernelLogs=yes # sed: remove dropped (cap_xxx-[epi]) and IAB capabilities from the output -ExecStart=sh -x -c '! capsh --print | sed -re "s/[^ ]+?\-[epi]+//g" -e '/IAB/d' | grep cap_syslog' +ExecStart=bash -x -c '! capsh --print | sed -re "s/[^ ]+?\-[epi]+//g" -e '/IAB/d' | grep cap_syslog' Type=oneshot diff --git a/test/test-execute/exec-protectkernelmodules-no-capabilities.service b/test/test-execute/exec-protectkernelmodules-no-capabilities.service index cefdb60991..c34a474362 100644 --- a/test/test-execute/exec-protectkernelmodules-no-capabilities.service +++ b/test/test-execute/exec-protectkernelmodules-no-capabilities.service @@ -5,5 +5,5 @@ Description=Test CAP_SYS_MODULE ProtectKernelModules=no [Service] ProtectKernelModules=no # sed: remove dropped (cap_xxx-[epi]) and IAB capabilities from the output -ExecStart=sh -x -c 'capsh --print | sed -re "s/[^ ]+?\-[epi]+//g" -e '/IAB/d' | grep cap_sys_module' +ExecStart=bash -x -c 'capsh --print | sed -re "s/[^ ]+?\-[epi]+//g" -e '/IAB/d' | grep cap_sys_module' Type=oneshot diff --git a/test/test-execute/exec-protectkernelmodules-yes-capabilities.service b/test/test-execute/exec-protectkernelmodules-yes-capabilities.service index 1f327a28ab..cfd0ac1ff7 100644 --- a/test/test-execute/exec-protectkernelmodules-yes-capabilities.service +++ b/test/test-execute/exec-protectkernelmodules-yes-capabilities.service @@ -5,5 +5,5 @@ Description=Test CAP_SYS_MODULE for ProtectKernelModules=yes [Service] ProtectKernelModules=yes # sed: remove dropped (cap_xxx-[epi]) and IAB capabilities from the output -ExecStart=sh -x -c '! capsh --print | sed -re "s/[^ ]+?\-[epi]+//g" -e '/IAB/d' | grep cap_sys_module' +ExecStart=bash -x -c '! capsh --print | sed -re "s/[^ ]+?\-[epi]+//g" -e '/IAB/d' | grep cap_sys_module' Type=oneshot diff --git a/test/test-execute/exec-protectkernelmodules-yes-mount-propagation.service b/test/test-execute/exec-protectkernelmodules-yes-mount-propagation.service index 16399bd206..f134aac8af 100644 --- a/test/test-execute/exec-protectkernelmodules-yes-mount-propagation.service +++ b/test/test-execute/exec-protectkernelmodules-yes-mount-propagation.service @@ -4,5 +4,5 @@ Description=Test to make sure that passing ProtectKernelModules=yes disconnect m [Service] ProtectKernelModules=yes -ExecStart=sh -x -c 'd=$$(mktemp -d -p /tmp); trap "umount \'$$d\' && rmdir \'$$d\'" EXIT; mount -t tmpfs tmpfs "$$d"; grep "$$d" /proc/self/mountinfo && ! grep "$$d" /proc/$${PPID}/mountinfo && ! grep "$$d" /proc/1/mountinfo' +ExecStart=bash -x -c 'd=$$(mktemp -d -p /tmp); trap "umount \'$$d\' && rmdir \'$$d\'" EXIT; mount -t tmpfs tmpfs "$$d"; grep "$$d" /proc/self/mountinfo && ! grep "$$d" /proc/$${PPID}/mountinfo && ! grep "$$d" /proc/1/mountinfo' Type=oneshot diff --git a/test/test-execute/exec-readonlypaths-mount-propagation.service b/test/test-execute/exec-readonlypaths-mount-propagation.service index e896bac5fd..f3d1f2e7df 100644 --- a/test/test-execute/exec-readonlypaths-mount-propagation.service +++ b/test/test-execute/exec-readonlypaths-mount-propagation.service @@ -4,5 +4,5 @@ Description=Test to make sure that passing ReadOnlyPaths= disconnect mount propa [Service] ReadOnlyPaths=-/i-dont-exist -ExecStart=sh -x -c 'd=$$(mktemp -d -p /tmp); trap "umount \'$$d\' && rmdir \'$$d\'" EXIT; mount -t tmpfs tmpfs "$$d"; grep "$$d" /proc/self/mountinfo && ! grep "$$d" /proc/$${PPID}/mountinfo && ! grep "$$d" /proc/1/mountinfo' +ExecStart=bash -x -c 'd=$$(mktemp -d -p /tmp); trap "umount \'$$d\' && rmdir \'$$d\'" EXIT; mount -t tmpfs tmpfs "$$d"; grep "$$d" /proc/self/mountinfo && ! grep "$$d" /proc/$${PPID}/mountinfo && ! grep "$$d" /proc/1/mountinfo' Type=oneshot diff --git a/test/test-execute/exec-readonlypaths-simple.service b/test/test-execute/exec-readonlypaths-simple.service index 80e6c83bf7..53ba315770 100644 --- a/test/test-execute/exec-readonlypaths-simple.service +++ b/test/test-execute/exec-readonlypaths-simple.service @@ -5,8 +5,8 @@ Description=Test for ReadOnlyPaths= [Service] Type=oneshot # This should work, as we explicitly disable the effect of ReadOnlyPaths= -ExecStart=+/bin/sh -c 'touch /tmp/thisisasimpletest' +ExecStart=+bash -c 'touch /tmp/thisisasimpletest' # This should also work, as we do not disable the effect of ReadOnlyPaths= but invert the exit code -ExecStart=sh -x -c '! touch /tmp/thisisasimpletest' -ExecStart=+/bin/sh -c 'rm /tmp/thisisasimpletest' +ExecStart=bash -x -c '! touch /tmp/thisisasimpletest' +ExecStart=+bash -c 'rm /tmp/thisisasimpletest' ReadOnlyPaths=/tmp diff --git a/test/test-execute/exec-readonlypaths-with-bindpaths.service b/test/test-execute/exec-readonlypaths-with-bindpaths.service index 7a183672c7..2879e3d079 100644 --- a/test/test-execute/exec-readonlypaths-with-bindpaths.service +++ b/test/test-execute/exec-readonlypaths-with-bindpaths.service @@ -5,5 +5,5 @@ Description=Test for ReadOnlyPaths= [Service] ReadOnlyPaths=/etc -/i-dont-exist /usr BindPaths=/etc:/tmp/etc2 -ExecStart=sh -x -c 'test ! -w /etc && test ! -w /usr && test ! -e /i-dont-exist && test -w /var' +ExecStart=bash -x -c 'test ! -w /etc && test ! -w /usr && test ! -e /i-dont-exist && test -w /var' Type=oneshot diff --git a/test/test-execute/exec-readonlypaths.service b/test/test-execute/exec-readonlypaths.service index a0eff8bcec..b1a1e43d5f 100644 --- a/test/test-execute/exec-readonlypaths.service +++ b/test/test-execute/exec-readonlypaths.service @@ -5,6 +5,6 @@ Description=Test for ReadOnlyPaths= [Service] ReadOnlyPaths=/usr /etc /sys /dev -/i-dont-exist PrivateDevices=yes -ExecStart=sh -x -c 'test ! -w /usr && test ! -w /etc && test ! -w /sys && test ! -w /sys/fs/cgroup' -ExecStart=sh -x -c 'test ! -w /dev && test ! -w /dev/shm && test ! -e /i-dont-exist && test -w /var' +ExecStart=bash -x -c 'test ! -w /usr && test ! -w /etc && test ! -w /sys && test ! -w /sys/fs/cgroup' +ExecStart=bash -x -c 'test ! -w /dev && test ! -w /dev/shm && test ! -e /i-dont-exist && test -w /var' Type=oneshot diff --git a/test/test-execute/exec-readwritepaths-mount-propagation.service b/test/test-execute/exec-readwritepaths-mount-propagation.service index 9b844cf433..e203d13493 100644 --- a/test/test-execute/exec-readwritepaths-mount-propagation.service +++ b/test/test-execute/exec-readwritepaths-mount-propagation.service @@ -4,5 +4,5 @@ Description=Test to make sure that passing ReadWritePaths= disconnect mount prop [Service] ReadWritePaths=-/i-dont-exist -ExecStart=sh -x -c 'd=$$(mktemp -d -p /tmp); trap "umount \'$$d\' && rmdir \'$$d\'" EXIT; mount -t tmpfs tmpfs "$$d"; grep "$$d" /proc/self/mountinfo && ! grep "$$d" /proc/$${PPID}/mountinfo && ! grep "$$d" /proc/1/mountinfo' +ExecStart=bash -x -c 'd=$$(mktemp -d -p /tmp); trap "umount \'$$d\' && rmdir \'$$d\'" EXIT; mount -t tmpfs tmpfs "$$d"; grep "$$d" /proc/self/mountinfo && ! grep "$$d" /proc/$${PPID}/mountinfo && ! grep "$$d" /proc/1/mountinfo' Type=oneshot diff --git a/test/test-execute/exec-restrictnamespaces-merge-and.service b/test/test-execute/exec-restrictnamespaces-merge-and.service index fdeb3f140d..ca99dba412 100644 --- a/test/test-execute/exec-restrictnamespaces-merge-and.service +++ b/test/test-execute/exec-restrictnamespaces-merge-and.service @@ -6,5 +6,5 @@ Description=Test merging RestrictNamespaces= with AND RestrictNamespaces=mnt pid RestrictNamespaces=~mnt usr ExecStart=unshare -p -f -ExecStart=sh -c '! unshare -m -u -i -n' +ExecStart=bash -c '! unshare -m -u -i -n' Type=oneshot diff --git a/test/test-execute/exec-restrictnamespaces-merge-or.service b/test/test-execute/exec-restrictnamespaces-merge-or.service index fca3718c9d..0e2dff296e 100644 --- a/test/test-execute/exec-restrictnamespaces-merge-or.service +++ b/test/test-execute/exec-restrictnamespaces-merge-or.service @@ -6,5 +6,5 @@ Description=Test merging RestrictNamespaces= with OR RestrictNamespaces=mnt pid RestrictNamespaces=mnt uts ExecStart=unshare -m -u -p -f -ExecStart=sh -c '! unshare -u -i -n' +ExecStart=bash -c '! unshare -u -i -n' Type=oneshot diff --git a/test/test-execute/exec-runtimedirectory-mode.service b/test/test-execute/exec-runtimedirectory-mode.service index e75e0d2380..c99ac37516 100644 --- a/test/test-execute/exec-runtimedirectory-mode.service +++ b/test/test-execute/exec-runtimedirectory-mode.service @@ -3,8 +3,8 @@ Description=Test for RuntimeDirectoryMode [Service] -ExecStart=sh -x -c 'mode=$$(stat -c %%a %t/test-exec_runtimedirectory-mode); test "$$mode" = "750"' -ExecStart=sh -x -c 'test "$$RUNTIME_DIRECTORY" = "%t/test-exec_runtimedirectory-mode"' +ExecStart=bash -x -c 'mode=$$(stat -c %%a %t/test-exec_runtimedirectory-mode); test "$$mode" = "750"' +ExecStart=bash -x -c 'test "$$RUNTIME_DIRECTORY" = "%t/test-exec_runtimedirectory-mode"' Type=oneshot RuntimeDirectory=test-exec_runtimedirectory-mode RuntimeDirectoryMode=0750 diff --git a/test/test-execute/exec-runtimedirectory-owner-nfsnobody.service b/test/test-execute/exec-runtimedirectory-owner-nfsnobody.service index 4bc336167c..a08a5fdfc4 100644 --- a/test/test-execute/exec-runtimedirectory-owner-nfsnobody.service +++ b/test/test-execute/exec-runtimedirectory-owner-nfsnobody.service @@ -3,7 +3,7 @@ Description=Test for RuntimeDirectory owner (must not be the default group of the user if Group is set) [Service] -ExecStart=sh -x -c 'group=$$(stat -c %%G %t/test-exec_runtimedirectory-owner); test "$$group" = "nfsnobody"' +ExecStart=bash -x -c 'group=$$(stat -c %%G %t/test-exec_runtimedirectory-owner); test "$$group" = "nfsnobody"' Type=oneshot Group=nfsnobody User=root diff --git a/test/test-execute/exec-runtimedirectory-owner-nobody.service b/test/test-execute/exec-runtimedirectory-owner-nobody.service index 5f94bf9cd0..11afe7f57e 100644 --- a/test/test-execute/exec-runtimedirectory-owner-nobody.service +++ b/test/test-execute/exec-runtimedirectory-owner-nobody.service @@ -3,7 +3,7 @@ Description=Test for RuntimeDirectory owner (must not be the default group of the user if Group is set) [Service] -ExecStart=sh -x -c 'group=$$(stat -c %%G %t/test-exec_runtimedirectory-owner); test "$$group" = "nobody"' +ExecStart=bash -x -c 'group=$$(stat -c %%G %t/test-exec_runtimedirectory-owner); test "$$group" = "nobody"' Type=oneshot Group=nobody User=root diff --git a/test/test-execute/exec-runtimedirectory-owner-nogroup.service b/test/test-execute/exec-runtimedirectory-owner-nogroup.service index 6d508959f8..134e84ef0b 100644 --- a/test/test-execute/exec-runtimedirectory-owner-nogroup.service +++ b/test/test-execute/exec-runtimedirectory-owner-nogroup.service @@ -3,7 +3,7 @@ Description=Test for RuntimeDirectory owner (must not be the default group of the user if Group is set) [Service] -ExecStart=sh -x -c 'group=$$(stat -c %%G %t/test-exec_runtimedirectory-owner); test "$$group" = "nogroup"' +ExecStart=bash -x -c 'group=$$(stat -c %%G %t/test-exec_runtimedirectory-owner); test "$$group" = "nogroup"' Type=oneshot Group=nogroup User=root diff --git a/test/test-execute/exec-runtimedirectory-owner.service b/test/test-execute/exec-runtimedirectory-owner.service index 64d66b302e..38d581b205 100644 --- a/test/test-execute/exec-runtimedirectory-owner.service +++ b/test/test-execute/exec-runtimedirectory-owner.service @@ -3,7 +3,7 @@ Description=Test for RuntimeDirectory owner (must not be the default group of the user if Group is set) [Service] -ExecStart=sh -x -c 'group=$$(stat -c %%G %t/test-exec_runtimedirectory-owner-daemon); test "$$group" = "daemon"' +ExecStart=bash -x -c 'group=$$(stat -c %%G %t/test-exec_runtimedirectory-owner-daemon); test "$$group" = "daemon"' Type=oneshot Group=daemon User=root diff --git a/test/test-execute/exec-runtimedirectory.service b/test/test-execute/exec-runtimedirectory.service index f60110a485..1e23d6aec5 100644 --- a/test/test-execute/exec-runtimedirectory.service +++ b/test/test-execute/exec-runtimedirectory.service @@ -3,9 +3,9 @@ Description=Test for RuntimeDirectory [Service] -ExecStart=sh -x -c 'test -d %t/test-exec_runtimedirectory' -ExecStart=sh -x -c 'test -d %t/test-exec_runtimedirectory2/hogehoge' -ExecStart=sh -x -c 'test "$$RUNTIME_DIRECTORY" = "%t/test-exec_runtimedirectory:%t/test-exec_runtimedirectory2/hogehoge"' +ExecStart=bash -x -c 'test -d %t/test-exec_runtimedirectory' +ExecStart=bash -x -c 'test -d %t/test-exec_runtimedirectory2/hogehoge' +ExecStart=bash -x -c 'test "$$RUNTIME_DIRECTORY" = "%t/test-exec_runtimedirectory:%t/test-exec_runtimedirectory2/hogehoge"' Type=oneshot RuntimeDirectory=test-exec_runtimedirectory RuntimeDirectory=./test-exec_runtimedirectory2///./hogehoge/. diff --git a/test/test-execute/exec-set-credential.service b/test/test-execute/exec-set-credential.service index 7f2e87f658..ac33095cdf 100644 --- a/test/test-execute/exec-set-credential.service +++ b/test/test-execute/exec-set-credential.service @@ -3,8 +3,8 @@ Description=Test for SetCredential= [Service] -ExecStart=sh -x -c 'test "$$(cat %d/test-execute.set-credential)" = "hoge"' -ExecStartPost=sh -x -c 'test "$$(cat %d/test-execute.set-credential)" = "hoge"' +ExecStart=bash -x -c 'test "$$(cat %d/test-execute.set-credential)" = "hoge"' +ExecStartPost=bash -x -c 'test "$$(cat %d/test-execute.set-credential)" = "hoge"' ExecStop=bash -x -c '[[ ! -v CREDENTIALS_DIRECTORY ]]' ExecStopPost=bash -x -c '[[ ! -v CREDENTIALS_DIRECTORY ]]' Type=oneshot diff --git a/test/test-execute/exec-specifier-user.service b/test/test-execute/exec-specifier-user.service index ab565fb4fb..6bbc9c8953 100644 --- a/test/test-execute/exec-specifier-user.service +++ b/test/test-execute/exec-specifier-user.service @@ -4,8 +4,8 @@ Description=Test for specifiers [Service] Type=oneshot -ExecStart=sh -c 'test %t = $$XDG_RUNTIME_DIR' -ExecStart=sh -c 'test %S = %h/.local/state' -ExecStart=sh -c 'test %C = %h/.cache' -ExecStart=sh -c 'test %L = %h/.local/state/log' -ExecStart=sh -c 'test %E = %h/.config' +ExecStart=bash -c 'test %t = $$XDG_RUNTIME_DIR' +ExecStart=bash -c 'test %S = %h/.local/state' +ExecStart=bash -c 'test %C = %h/.cache' +ExecStart=bash -c 'test %L = %h/.local/state/log' +ExecStart=bash -c 'test %E = %h/.config' diff --git a/test/test-execute/exec-specifier.service b/test/test-execute/exec-specifier.service index 512f786f83..d4c23b3ace 100644 --- a/test/test-execute/exec-specifier.service +++ b/test/test-execute/exec-specifier.service @@ -16,12 +16,12 @@ ExecStart=test %f = /exec/specifier ExecStart=test %T = /tmp ExecStart=test %V = /var/tmp ExecStart=test %d = %t/credentials/%n -ExecStart=sh -c 'test %u = $$(id -un)' -ExecStart=sh -c 'test %U = $$(id -u)' -ExecStart=sh -c 'test %g = $$(id -gn)' -ExecStart=sh -c 'test %G = $$(id -g)' +ExecStart=bash -c 'test %u = $$(id -un)' +ExecStart=bash -c 'test %U = $$(id -u)' +ExecStart=bash -c 'test %g = $$(id -gn)' +ExecStart=bash -c 'test %G = $$(id -g)' ExecStart=test %h = /root -ExecStart=sh -c 'test -x %s' -ExecStart=sh -c 'test %b = $$(cat /proc/sys/kernel/random/boot_id | sed -e 's/-//g')' -ExecStart=sh -c 'test %H = $$(uname -n)' -ExecStart=sh -c 'test %v = $$(uname -r)' +ExecStart=bash -c 'test -x %s' +ExecStart=bash -c 'test %b = $$(cat /proc/sys/kernel/random/boot_id | sed -e 's/-//g')' +ExecStart=bash -c 'test %H = $$(uname -n)' +ExecStart=bash -c 'test %v = $$(uname -r)' diff --git a/test/test-execute/exec-specifier@.service b/test/test-execute/exec-specifier@.service index cb9d0a182a..4e630a711e 100644 --- a/test/test-execute/exec-specifier@.service +++ b/test/test-execute/exec-specifier@.service @@ -13,12 +13,12 @@ ExecStart=test %I = foo/bar ExecStart=test %j = specifier ExecStart=test %J = specifier ExecStart=test %f = /foo/bar -ExecStart=sh -c 'test %u = $$(id -un)' -ExecStart=sh -c 'test %U = $$(id -u)' -ExecStart=sh -c 'test %g = $$(id -gn)' -ExecStart=sh -c 'test %G = $$(id -g)' +ExecStart=bash -c 'test %u = $$(id -un)' +ExecStart=bash -c 'test %U = $$(id -u)' +ExecStart=bash -c 'test %g = $$(id -gn)' +ExecStart=bash -c 'test %G = $$(id -g)' ExecStart=test %h = /root -ExecStart=sh -c 'test -x %s' -ExecStart=sh -c 'test %b = $$(cat /proc/sys/kernel/random/boot_id | sed -e 's/-//g')' -ExecStart=sh -c 'test %H = $$(uname -n)' -ExecStart=sh -c 'test %v = $$(uname -r)' +ExecStart=bash -c 'test -x %s' +ExecStart=bash -c 'test %b = $$(cat /proc/sys/kernel/random/boot_id | sed -e 's/-//g')' +ExecStart=bash -c 'test %H = $$(uname -n)' +ExecStart=bash -c 'test %v = $$(uname -r)' diff --git a/test/test-execute/exec-standardinput-data.service b/test/test-execute/exec-standardinput-data.service index fd56f7e37b..cac9439304 100644 --- a/test/test-execute/exec-standardinput-data.service +++ b/test/test-execute/exec-standardinput-data.service @@ -3,7 +3,7 @@ Description=Test for StandardInputText= and StandardInputData= [Service] -ExecStart=sh -x -c 'd=$$(mktemp -d -p /tmp); echo -e "this is a test\nand this is more\nsomething encoded!\nsomething in multiple lines\nand some more\nand a more bas64 data\nsomething with strange\nembedded\tcharacters\nand something with a exec-stdin-data.service specifier" >$d/text ; cmp $d/text ; rm -rf $d' +ExecStart=bash -x -c 'd=$$(mktemp -d -p /tmp); echo -e "this is a test\nand this is more\nsomething encoded!\nsomething in multiple lines\nand some more\nand a more bas64 data\nsomething with strange\nembedded\tcharacters\nand something with a exec-stdin-data.service specifier" >$d/text ; cmp $d/text ; rm -rf $d' Type=oneshot StandardInput=data StandardInputText=this is a test diff --git a/test/test-execute/exec-standardoutput-append.service b/test/test-execute/exec-standardoutput-append.service index 45d29ecfdd..563d3eba77 100644 --- a/test/test-execute/exec-standardoutput-append.service +++ b/test/test-execute/exec-standardoutput-append.service @@ -3,8 +3,8 @@ Description=Test for StandardOutput=append: [Service] -ExecStartPre=sh -c 'printf "hello\n" >/tmp/test-exec-standardoutput-output' -ExecStartPre=sh -c 'printf "hello\nhello\n" >/tmp/test-exec-standardoutput-expected' +ExecStartPre=bash -c 'printf "hello\n" >/tmp/test-exec-standardoutput-output' +ExecStartPre=bash -c 'printf "hello\nhello\n" >/tmp/test-exec-standardoutput-expected' StandardInput=data StandardInputText=hello StandardOutput=append:/tmp/test-exec-standardoutput-output diff --git a/test/test-execute/exec-standardoutput-file.service b/test/test-execute/exec-standardoutput-file.service index 8b689a2494..6d14b359a3 100644 --- a/test/test-execute/exec-standardoutput-file.service +++ b/test/test-execute/exec-standardoutput-file.service @@ -3,8 +3,8 @@ Description=Test for StandardOutput=file: [Service] -ExecStartPre=sh -c 'printf "nooo\nhello\n" >/tmp/test-exec-standardoutput-output' -ExecStartPre=sh -c 'printf "hello\nello\n" >/tmp/test-exec-standardoutput-expected' +ExecStartPre=bash -c 'printf "nooo\nhello\n" >/tmp/test-exec-standardoutput-output' +ExecStartPre=bash -c 'printf "hello\nello\n" >/tmp/test-exec-standardoutput-expected' StandardInput=data StandardInputText=hello StandardOutput=file:/tmp/test-exec-standardoutput-output diff --git a/test/test-execute/exec-standardoutput-truncate.service b/test/test-execute/exec-standardoutput-truncate.service index 1a86d92d8b..4be9022a38 100644 --- a/test/test-execute/exec-standardoutput-truncate.service +++ b/test/test-execute/exec-standardoutput-truncate.service @@ -3,11 +3,11 @@ Description=Test for StandardOutput=truncate: [Service] -ExecStartPre=sh -c 'printf "hello\n" >/tmp/test-exec-standardoutput-output' -ExecStartPre=sh -c 'printf "hi\n" >/tmp/test-exec-standardoutput-expected' +ExecStartPre=bash -c 'printf "hello\n" >/tmp/test-exec-standardoutput-output' +ExecStartPre=bash -c 'printf "hi\n" >/tmp/test-exec-standardoutput-expected' StandardInput=data StandardInputText=hi StandardOutput=truncate:/tmp/test-exec-standardoutput-output StandardError=null -ExecStart=sh -c 'cat && cmp /tmp/test-exec-standardoutput-output /tmp/test-exec-standardoutput-expected' +ExecStart=bash -c 'cat && cmp /tmp/test-exec-standardoutput-output /tmp/test-exec-standardoutput-expected' Type=oneshot diff --git a/test/test-execute/exec-supplementarygroups-multiple-groups-default-group-user.service b/test/test-execute/exec-supplementarygroups-multiple-groups-default-group-user.service index 3c90124818..a46a760c0c 100644 --- a/test/test-execute/exec-supplementarygroups-multiple-groups-default-group-user.service +++ b/test/test-execute/exec-supplementarygroups-multiple-groups-default-group-user.service @@ -3,9 +3,9 @@ Description=Test for Supplementary Group with multiple groups without Group and User [Service] -ExecStart=sh -x -c 'for g in $$(id -G); do test "$$g" = "%G" && exit 0; done; exit 1' -ExecStart=sh -x -c 'for g in $$(id -G); do test "$$g" = "1" && exit 0; done; exit 1' -ExecStart=sh -x -c 'for g in $$(id -G); do test "$$g" = "2" && exit 0; done; exit 1' -ExecStart=sh -x -c 'test "$$(id -g)" = "%G" && test "$$(id -u)" = "%U"' +ExecStart=bash -x -c 'for g in $$(id -G); do test "$$g" = "%G" && exit 0; done; exit 1' +ExecStart=bash -x -c 'for g in $$(id -G); do test "$$g" = "1" && exit 0; done; exit 1' +ExecStart=bash -x -c 'for g in $$(id -G); do test "$$g" = "2" && exit 0; done; exit 1' +ExecStart=bash -x -c 'test "$$(id -g)" = "%G" && test "$$(id -u)" = "%U"' Type=oneshot SupplementaryGroups=1 2 diff --git a/test/test-execute/exec-supplementarygroups-multiple-groups-withgid.service b/test/test-execute/exec-supplementarygroups-multiple-groups-withgid.service index 0fd1c62052..c597fbce79 100644 --- a/test/test-execute/exec-supplementarygroups-multiple-groups-withgid.service +++ b/test/test-execute/exec-supplementarygroups-multiple-groups-withgid.service @@ -3,9 +3,9 @@ Description=Test for Supplementary Group with multiple groups and Group=1 [Service] -ExecStart=sh -x -c 'for g in $$(id -G); do test "$$g" = "1" && exit 0; done; exit 1' -ExecStart=sh -x -c 'for g in $$(id -G); do test "$$g" = "2" && exit 0; done; exit 1' -ExecStart=sh -x -c 'test "$$(id -g)" = "1" && test "$$(id -u)" = "%U"' +ExecStart=bash -x -c 'for g in $$(id -G); do test "$$g" = "1" && exit 0; done; exit 1' +ExecStart=bash -x -c 'for g in $$(id -G); do test "$$g" = "2" && exit 0; done; exit 1' +ExecStart=bash -x -c 'test "$$(id -g)" = "1" && test "$$(id -u)" = "%U"' Type=oneshot Group=1 SupplementaryGroups=1 2 diff --git a/test/test-execute/exec-supplementarygroups-multiple-groups-withuid.service b/test/test-execute/exec-supplementarygroups-multiple-groups-withuid.service index c430e54685..8149612b8d 100644 --- a/test/test-execute/exec-supplementarygroups-multiple-groups-withuid.service +++ b/test/test-execute/exec-supplementarygroups-multiple-groups-withuid.service @@ -3,8 +3,8 @@ Description=Test for Supplementary Group with multiple groups and Uid=1 [Service] -ExecStart=sh -x -c 'for g in $$(id -G); do test "$$g" = "1" && exit 0; done; exit 1' -ExecStart=sh -x -c 'for g in $$(id -G); do test "$$g" = "2" && exit 0; done; exit 1' +ExecStart=bash -x -c 'for g in $$(id -G); do test "$$g" = "1" && exit 0; done; exit 1' +ExecStart=bash -x -c 'for g in $$(id -G); do test "$$g" = "2" && exit 0; done; exit 1' Type=oneshot User=1 SupplementaryGroups=1 2 diff --git a/test/test-execute/exec-supplementarygroups-single-group-user.service b/test/test-execute/exec-supplementarygroups-single-group-user.service index 20a3561d08..00c29bf24b 100644 --- a/test/test-execute/exec-supplementarygroups-single-group-user.service +++ b/test/test-execute/exec-supplementarygroups-single-group-user.service @@ -3,8 +3,8 @@ Description=Test for Supplementary Group with only one group and uid 1 [Service] -ExecStart=sh -x -c 'for g in $$(id -G); do test "$$g" = "1" && exit 0; done; exit 1' -ExecStart=sh -x -c 'test "$$(id -g)" = "1" && test "$$(id -u)" = "1"' +ExecStart=bash -x -c 'for g in $$(id -G); do test "$$g" = "1" && exit 0; done; exit 1' +ExecStart=bash -x -c 'test "$$(id -g)" = "1" && test "$$(id -u)" = "1"' Type=oneshot User=1 Group=1 diff --git a/test/test-execute/exec-supplementarygroups-single-group.service b/test/test-execute/exec-supplementarygroups-single-group.service index 8c812573e4..99c821bf59 100644 --- a/test/test-execute/exec-supplementarygroups-single-group.service +++ b/test/test-execute/exec-supplementarygroups-single-group.service @@ -3,8 +3,8 @@ Description=Test for Supplementary Group with only one group [Service] -ExecStart=sh -x -c 'for g in $$(id -G); do test "$$g" = "1" && exit 0; done; exit 1' -ExecStart=sh -x -c 'test "$$(id -g)" = "1" && test "$$(id -u)" = "0"' +ExecStart=bash -x -c 'for g in $$(id -G); do test "$$g" = "1" && exit 0; done; exit 1' +ExecStart=bash -x -c 'test "$$(id -g)" = "1" && test "$$(id -u)" = "0"' Type=oneshot Group=1 SupplementaryGroups=1 diff --git a/test/test-execute/exec-supplementarygroups.service b/test/test-execute/exec-supplementarygroups.service index 0a3d370595..a147cc79f4 100644 --- a/test/test-execute/exec-supplementarygroups.service +++ b/test/test-execute/exec-supplementarygroups.service @@ -3,7 +3,7 @@ Description=Test for Supplementary Group [Service] -ExecStart=sh -x -c 'for g in $$(id -G); do test "$$g" = "%G" && exit 0; done; exit 1' -ExecStart=sh -x -c 'for g in $$(id -G); do test "$$g" = "1" && exit 0; done; exit 1' +ExecStart=bash -x -c 'for g in $$(id -G); do test "$$g" = "%G" && exit 0; done; exit 1' +ExecStart=bash -x -c 'for g in $$(id -G); do test "$$g" = "1" && exit 0; done; exit 1' Type=oneshot SupplementaryGroups=1 diff --git a/test/test-execute/exec-systemcallfilter-failing.service b/test/test-execute/exec-systemcallfilter-failing.service index 7437d30108..800e6ede0c 100644 --- a/test/test-execute/exec-systemcallfilter-failing.service +++ b/test/test-execute/exec-systemcallfilter-failing.service @@ -3,7 +3,7 @@ Description=Test for SystemCallFilter [Service] -ExecStart=sh -c '/bin/echo "This should not be seen"' +ExecStart=bash -c '/bin/echo "This should not be seen"' Type=oneshot LimitCORE=0 SystemCallFilter=ioperm diff --git a/test/test-execute/exec-systemcallfilter-failing2.service b/test/test-execute/exec-systemcallfilter-failing2.service index 92672d1eb1..1738ee93a1 100644 --- a/test/test-execute/exec-systemcallfilter-failing2.service +++ b/test/test-execute/exec-systemcallfilter-failing2.service @@ -3,7 +3,7 @@ Description=Test for SystemCallFilter [Service] -ExecStart=sh -c '/bin/echo "This should not be seen"' +ExecStart=bash -c '/bin/echo "This should not be seen"' Type=oneshot LimitCORE=0 SystemCallFilter=~write open execve fexecve execveat exit_group close mmap munmap fstat DONOTEXIST diff --git a/test/test-execute/exec-systemcallfilter-failing3.service b/test/test-execute/exec-systemcallfilter-failing3.service index 4e7b81214b..9e27c80400 100644 --- a/test/test-execute/exec-systemcallfilter-failing3.service +++ b/test/test-execute/exec-systemcallfilter-failing3.service @@ -3,7 +3,7 @@ Description=Test for SystemCallFilter [Service] -ExecStart=sh -c '/bin/echo "This should not be seen"' +ExecStart=bash -c '/bin/echo "This should not be seen"' Type=oneshot LimitCORE=0 SystemCallArchitectures=native diff --git a/test/test-execute/exec-systemcallfilter-nonewprivileges-bounding1.service b/test/test-execute/exec-systemcallfilter-nonewprivileges-bounding1.service index eaa75dfb61..e8ab9b715a 100644 --- a/test/test-execute/exec-systemcallfilter-nonewprivileges-bounding1.service +++ b/test/test-execute/exec-systemcallfilter-nonewprivileges-bounding1.service @@ -3,7 +3,7 @@ Description=Test bounding set is right with SystemCallFilter and non-root user [Service] -ExecStart=sh -x -c 'c=$$(capsh --print | grep "Bounding set "); test "$$c" = "Bounding set =cap_net_bind_service"' +ExecStart=bash -x -c 'c=$$(capsh --print | grep "Bounding set "); test "$$c" = "Bounding set =cap_net_bind_service"' Type=oneshot User=1 SystemCallFilter=@system-service diff --git a/test/test-execute/exec-systemcallfilter-nonewprivileges-bounding2.service b/test/test-execute/exec-systemcallfilter-nonewprivileges-bounding2.service index fd0e3a259d..a5734fee69 100644 --- a/test/test-execute/exec-systemcallfilter-nonewprivileges-bounding2.service +++ b/test/test-execute/exec-systemcallfilter-nonewprivileges-bounding2.service @@ -3,7 +3,7 @@ Description=Test bounding set is right with SystemCallFilter and non-root user [Service] -ExecStart=sh -x -c 'c=$$(capsh --print | grep "Bounding set "); test "$$c" = "Bounding set =cap_setpcap,cap_net_bind_service,cap_sys_admin"' +ExecStart=bash -x -c 'c=$$(capsh --print | grep "Bounding set "); test "$$c" = "Bounding set =cap_setpcap,cap_net_bind_service,cap_sys_admin"' Type=oneshot User=1 SystemCallFilter=@system-service diff --git a/test/test-execute/exec-systemcallfilter-nonewprivileges-protectclock.service b/test/test-execute/exec-systemcallfilter-nonewprivileges-protectclock.service index 76b028c82c..64a6b2adbe 100644 --- a/test/test-execute/exec-systemcallfilter-nonewprivileges-protectclock.service +++ b/test/test-execute/exec-systemcallfilter-nonewprivileges-protectclock.service @@ -3,7 +3,7 @@ Description=Test no_new_privs is unset for ProtectClock and non-root user [Service] -ExecStart=sh -x -c 'c=$$(cat /proc/self/status | grep "NoNewPrivs: "); test "$$c" = "NoNewPrivs: 0"' +ExecStart=bash -x -c 'c=$$(cat /proc/self/status | grep "NoNewPrivs: "); test "$$c" = "NoNewPrivs: 0"' Type=oneshot User=1 ProtectClock=yes diff --git a/test/test-execute/exec-systemcallfilter-nonewprivileges.service b/test/test-execute/exec-systemcallfilter-nonewprivileges.service index 2091b71db0..fcae37adc7 100644 --- a/test/test-execute/exec-systemcallfilter-nonewprivileges.service +++ b/test/test-execute/exec-systemcallfilter-nonewprivileges.service @@ -3,7 +3,7 @@ Description=Test no_new_privs is unset for SystemCallFilter and non-root user [Service] -ExecStart=sh -x -c 'c=$$(cat /proc/self/status | grep "NoNewPrivs: "); test "$$c" = "NoNewPrivs: 0"' +ExecStart=bash -x -c 'c=$$(cat /proc/self/status | grep "NoNewPrivs: "); test "$$c" = "NoNewPrivs: 0"' Type=oneshot User=1 SystemCallFilter=@system-service diff --git a/test/test-execute/exec-systemcallfilter-not-failing.service b/test/test-execute/exec-systemcallfilter-not-failing.service index bb2ea55166..ad72b57927 100644 --- a/test/test-execute/exec-systemcallfilter-not-failing.service +++ b/test/test-execute/exec-systemcallfilter-not-failing.service @@ -3,7 +3,7 @@ Description=Test for SystemCallFilter [Service] -ExecStart=sh -c 'echo "Foo bar"' +ExecStart=bash -c 'echo "Foo bar"' Type=oneshot SystemCallFilter=~read write open execve ioperm SystemCallFilter=ioctl diff --git a/test/test-execute/exec-systemcallfilter-not-failing2.service b/test/test-execute/exec-systemcallfilter-not-failing2.service index d9f0a3717c..f69998a8e8 100644 --- a/test/test-execute/exec-systemcallfilter-not-failing2.service +++ b/test/test-execute/exec-systemcallfilter-not-failing2.service @@ -3,6 +3,6 @@ Description=Test for SystemCallFilter [Service] -ExecStart=sh -c 'echo "Foo bar"' +ExecStart=bash -c 'echo "Foo bar"' Type=oneshot SystemCallFilter= diff --git a/test/test-execute/exec-systemcallfilter-not-failing3.service b/test/test-execute/exec-systemcallfilter-not-failing3.service index df4e662d40..9e7ef6da4d 100644 --- a/test/test-execute/exec-systemcallfilter-not-failing3.service +++ b/test/test-execute/exec-systemcallfilter-not-failing3.service @@ -3,7 +3,7 @@ Description=Test for SystemCallFilter [Service] -ExecStart=sh -c 'echo "Foo bar"' +ExecStart=bash -c 'echo "Foo bar"' Type=oneshot SystemCallArchitectures=native SystemCallFilter= diff --git a/test/test-execute/exec-systemcallfilter-system-user-nfsnobody.service b/test/test-execute/exec-systemcallfilter-system-user-nfsnobody.service index 19122869b1..6e97854068 100644 --- a/test/test-execute/exec-systemcallfilter-system-user-nfsnobody.service +++ b/test/test-execute/exec-systemcallfilter-system-user-nfsnobody.service @@ -3,7 +3,7 @@ Description=Test for SystemCallFilter in system mode with User set [Service] -ExecStart=sh -c 'echo "Foo bar"' +ExecStart=bash -c 'echo "Foo bar"' Type=oneshot User=nfsnobody SystemCallFilter=~read write open execve ioperm diff --git a/test/test-execute/exec-systemcallfilter-system-user-nobody.service b/test/test-execute/exec-systemcallfilter-system-user-nobody.service index 0c2ebdd83e..133ff9335a 100644 --- a/test/test-execute/exec-systemcallfilter-system-user-nobody.service +++ b/test/test-execute/exec-systemcallfilter-system-user-nobody.service @@ -3,7 +3,7 @@ Description=Test for SystemCallFilter in system mode with User set [Service] -ExecStart=sh -c 'echo "Foo bar"' +ExecStart=bash -c 'echo "Foo bar"' Type=oneshot User=nobody SystemCallFilter=~read write open execve ioperm diff --git a/test/test-execute/exec-systemcallfilter-system-user.service b/test/test-execute/exec-systemcallfilter-system-user.service index 6de39642e9..729ea4c9d8 100644 --- a/test/test-execute/exec-systemcallfilter-system-user.service +++ b/test/test-execute/exec-systemcallfilter-system-user.service @@ -3,7 +3,7 @@ Description=Test for SystemCallFilter in system mode with User set (daemon) [Service] -ExecStart=sh -c 'echo "Foo bar"' +ExecStart=bash -c 'echo "Foo bar"' Type=oneshot User=daemon SystemCallFilter=~read write open execve ioperm diff --git a/test/test-execute/exec-temporaryfilesystem-options.service b/test/test-execute/exec-temporaryfilesystem-options.service index b00030131e..a767b95308 100644 --- a/test/test-execute/exec-temporaryfilesystem-options.service +++ b/test/test-execute/exec-temporaryfilesystem-options.service @@ -10,8 +10,8 @@ Type=oneshot TemporaryFileSystem=/var:ro,mode=0700,nostrictatime # Check /proc/self/mountinfo -ExecStart=sh -x -c 'test "$$(awk \'$$5 == "/var" && $$11 !~ /(^|,)mode=700(,|$$)/ { print $$6 }\' /proc/self/mountinfo)" = ""' +ExecStart=bash -x -c 'test "$$(awk \'$$5 == "/var" && $$11 !~ /(^|,)mode=700(,|$$)/ { print $$6 }\' /proc/self/mountinfo)" = ""' -ExecStart=sh -x -c 'test "$$(awk \'$$5 == "/var" && $$6 !~ /(^|,)ro(,|$$)/ { print $$6 }\' /proc/self/mountinfo)" = ""' -ExecStart=sh -x -c 'test "$$(awk \'$$5 == "/var" && $$6 !~ /(^|,)nodev(,|$$)/ { print $$6 }\' /proc/self/mountinfo)" = ""' -ExecStart=sh -x -c 'test "$$(awk \'$$5 == "/var" && $$6 ~ /(^|,)strictatime(,|$$)/ { print $$6 }\' /proc/self/mountinfo)" = ""' +ExecStart=bash -x -c 'test "$$(awk \'$$5 == "/var" && $$6 !~ /(^|,)ro(,|$$)/ { print $$6 }\' /proc/self/mountinfo)" = ""' +ExecStart=bash -x -c 'test "$$(awk \'$$5 == "/var" && $$6 !~ /(^|,)nodev(,|$$)/ { print $$6 }\' /proc/self/mountinfo)" = ""' +ExecStart=bash -x -c 'test "$$(awk \'$$5 == "/var" && $$6 ~ /(^|,)strictatime(,|$$)/ { print $$6 }\' /proc/self/mountinfo)" = ""' diff --git a/test/test-execute/exec-temporaryfilesystem-ro.service b/test/test-execute/exec-temporaryfilesystem-ro.service index 0a4b0f2552..6735278252 100644 --- a/test/test-execute/exec-temporaryfilesystem-ro.service +++ b/test/test-execute/exec-temporaryfilesystem-ro.service @@ -6,31 +6,31 @@ Description=Test for TemporaryFileSystem with read-only mode Type=oneshot # Check directories exist -ExecStart=sh -c 'test -d /var/test-exec-temporaryfilesystem/rw && test -d /var/test-exec-temporaryfilesystem/ro' +ExecStart=bash -c 'test -d /var/test-exec-temporaryfilesystem/rw && test -d /var/test-exec-temporaryfilesystem/ro' # Check TemporaryFileSystem= are empty -ExecStart=sh -c 'for i in $$(ls -A /var); do test $$i = test-exec-temporaryfilesystem || false; done' +ExecStart=bash -c 'for i in $$(ls -A /var); do test $$i = test-exec-temporaryfilesystem || false; done' # Check default mode -ExecStart=sh -x -c 'test "$$(stat -c %%a /var)" = "755"' +ExecStart=bash -x -c 'test "$$(stat -c %%a /var)" = "755"' # Cannot create a file in /var -ExecStart=sh -c '! touch /var/hoge' +ExecStart=bash -c '! touch /var/hoge' # Create a file in /var/test-exec-temporaryfilesystem/rw -ExecStart=sh -c 'touch /var/test-exec-temporaryfilesystem/rw/thisisasimpletest-temporaryfilesystem' +ExecStart=bash -c 'touch /var/test-exec-temporaryfilesystem/rw/thisisasimpletest-temporaryfilesystem' # Then, the file can be access through /tmp -ExecStart=sh -c 'test -f /tmp/thisisasimpletest-temporaryfilesystem' +ExecStart=bash -c 'test -f /tmp/thisisasimpletest-temporaryfilesystem' # Also, through /var/test-exec-temporaryfilesystem/ro -ExecStart=sh -c 'test -f /var/test-exec-temporaryfilesystem/ro/thisisasimpletest-temporaryfilesystem' +ExecStart=bash -c 'test -f /var/test-exec-temporaryfilesystem/ro/thisisasimpletest-temporaryfilesystem' # The file cannot modify through /var/test-exec-temporaryfilesystem/ro -ExecStart=sh -c '! touch /var/test-exec-temporaryfilesystem/ro/thisisasimpletest-temporaryfilesystem' +ExecStart=bash -c '! touch /var/test-exec-temporaryfilesystem/ro/thisisasimpletest-temporaryfilesystem' # Cleanup -ExecStart=sh -c 'rm /tmp/thisisasimpletest-temporaryfilesystem' +ExecStart=bash -c 'rm /tmp/thisisasimpletest-temporaryfilesystem' TemporaryFileSystem=/var:ro BindPaths=/tmp:/var/test-exec-temporaryfilesystem/rw diff --git a/test/test-execute/exec-temporaryfilesystem-rw.service b/test/test-execute/exec-temporaryfilesystem-rw.service index ff0aa048d4..48a0b2d613 100644 --- a/test/test-execute/exec-temporaryfilesystem-rw.service +++ b/test/test-execute/exec-temporaryfilesystem-rw.service @@ -9,10 +9,10 @@ Type=oneshot ExecStart=test -d /var/test-exec-temporaryfilesystem/rw -a -d /var/test-exec-temporaryfilesystem/ro # Check TemporaryFileSystem= are empty -ExecStart=sh -c 'for i in $$(ls -A /var); do test $$i = test-exec-temporaryfilesystem || false; done' +ExecStart=bash -c 'for i in $$(ls -A /var); do test $$i = test-exec-temporaryfilesystem || false; done' # Check default mode -ExecStart=sh -x -c 'test "$$(stat -c %%a /var)" = "755"' +ExecStart=bash -x -c 'test "$$(stat -c %%a /var)" = "755"' # Create a file in /var ExecStart=touch /var/hoge @@ -27,7 +27,7 @@ ExecStart=test -f /tmp/thisisasimpletest-temporaryfilesystem ExecStart=test -f /var/test-exec-temporaryfilesystem/ro/thisisasimpletest-temporaryfilesystem # The file cannot modify through /var/test-exec-temporaryfilesystem/ro -ExecStart=sh -c '! touch /var/test-exec-temporaryfilesystem/ro/thisisasimpletest-temporaryfilesystem' +ExecStart=bash -c '! touch /var/test-exec-temporaryfilesystem/ro/thisisasimpletest-temporaryfilesystem' # Cleanup ExecStart=rm /tmp/thisisasimpletest-temporaryfilesystem diff --git a/test/test-execute/exec-temporaryfilesystem-usr.service b/test/test-execute/exec-temporaryfilesystem-usr.service index 455344e114..cae1b8b074 100644 --- a/test/test-execute/exec-temporaryfilesystem-usr.service +++ b/test/test-execute/exec-temporaryfilesystem-usr.service @@ -6,11 +6,11 @@ Description=Test for TemporaryFileSystem on /usr Type=oneshot # Check TemporaryFileSystem= are empty -ExecStart=sh -c 'for i in $$(ls -A /usr); do test $$i = lib -o $$i = lib64 -o $$i = bin -o $$i = sbin || false; done' +ExecStart=bash -c 'for i in $$(ls -A /usr); do test $$i = lib -o $$i = lib64 -o $$i = bin -o $$i = sbin || false; done' # Cannot create files under /usr -ExecStart=sh -c '! touch /usr/hoge' -ExecStart=sh -c '! touch /usr/bin/hoge' +ExecStart=bash -c '! touch /usr/hoge' +ExecStart=bash -c '! touch /usr/bin/hoge' TemporaryFileSystem=/usr:ro BindReadOnlyPaths=-/usr/lib -/usr/lib64 /usr/bin /usr/sbin diff --git a/test/test-execute/exec-umask-0177.service b/test/test-execute/exec-umask-0177.service index de9ac5a233..c8835af473 100644 --- a/test/test-execute/exec-umask-0177.service +++ b/test/test-execute/exec-umask-0177.service @@ -3,7 +3,7 @@ Description=Test for UMask [Service] -ExecStart=sh -x -c 'rm /tmp/test-exec-umask; touch /tmp/test-exec-umask; mode=$$(stat -c %%a /tmp/test-exec-umask); test "$$mode" = "600"' +ExecStart=bash -x -c 'rm /tmp/test-exec-umask; touch /tmp/test-exec-umask; mode=$$(stat -c %%a /tmp/test-exec-umask); test "$$mode" = "600"' Type=oneshot UMask=0177 PrivateTmp=yes diff --git a/test/test-execute/exec-umask-default.service b/test/test-execute/exec-umask-default.service index 6d13c0bfa2..f44f94b2b1 100644 --- a/test/test-execute/exec-umask-default.service +++ b/test/test-execute/exec-umask-default.service @@ -3,6 +3,6 @@ Description=Test for UMask default [Service] -ExecStart=sh -x -c 'rm /tmp/test-exec-umask; touch /tmp/test-exec-umask; mode=$$(stat -c %%a /tmp/test-exec-umask); test "$$mode" = "644"' +ExecStart=bash -x -c 'rm /tmp/test-exec-umask; touch /tmp/test-exec-umask; mode=$$(stat -c %%a /tmp/test-exec-umask); test "$$mode" = "644"' Type=oneshot PrivateTmp=yes diff --git a/test/test-execute/exec-unsetenvironment.service b/test/test-execute/exec-unsetenvironment.service index 9c5e277d05..e64e261072 100644 --- a/test/test-execute/exec-unsetenvironment.service +++ b/test/test-execute/exec-unsetenvironment.service @@ -3,7 +3,7 @@ Description=Test for UnsetEnvironment [Service] -ExecStart=sh -x -c 'test "$$FOO" = "bar" && test "$${QUUX-X}" = "X" && test "$$VAR3" = "value3" && test "$${VAR4-X}" = "X" && test "$$VAR5" = "value5" && test "$${X%b-X}" = "X"' +ExecStart=bash -x -c 'test "$$FOO" = "bar" && test "$${QUUX-X}" = "X" && test "$$VAR3" = "value3" && test "$${VAR4-X}" = "X" && test "$$VAR5" = "value5" && test "$${X%b-X}" = "X"' Type=oneshot Environment=FOO=bar QUUX=waldo VAR3=value3 VAR4=value4 VAR5=value5 X%b=%U UnsetEnvironment=QUUX=waldo VAR3=somethingelse VAR4 X%b=%U diff --git a/test/test-execute/exec-user-nfsnobody.service b/test/test-execute/exec-user-nfsnobody.service index 1ce5f08370..aa6a3cca87 100644 --- a/test/test-execute/exec-user-nfsnobody.service +++ b/test/test-execute/exec-user-nfsnobody.service @@ -3,6 +3,6 @@ Description=Test for User [Service] -ExecStart=sh -x -c 'test "$$USER" = "nfsnobody"' +ExecStart=bash -x -c 'test "$$USER" = "nfsnobody"' Type=oneshot User=nfsnobody diff --git a/test/test-execute/exec-user-nobody.service b/test/test-execute/exec-user-nobody.service index 003b873b39..f5f79540bd 100644 --- a/test/test-execute/exec-user-nobody.service +++ b/test/test-execute/exec-user-nobody.service @@ -3,6 +3,6 @@ Description=Test for User [Service] -ExecStart=sh -x -c 'test "$$USER" = "nobody"' +ExecStart=bash -x -c 'test "$$USER" = "nobody"' Type=oneshot User=nobody diff --git a/test/test-execute/exec-user.service b/test/test-execute/exec-user.service index 696c7e5739..c0335b74fa 100644 --- a/test/test-execute/exec-user.service +++ b/test/test-execute/exec-user.service @@ -3,6 +3,6 @@ Description=Test for User (daemon) [Service] -ExecStart=sh -x -c 'test "$$USER" = "daemon"' +ExecStart=bash -x -c 'test "$$USER" = "daemon"' Type=oneshot User=daemon diff --git a/test/test-execute/exec-workingdirectory-trailing-dot.service b/test/test-execute/exec-workingdirectory-trailing-dot.service index 3c4869d858..6fb9fd490f 100644 --- a/test/test-execute/exec-workingdirectory-trailing-dot.service +++ b/test/test-execute/exec-workingdirectory-trailing-dot.service @@ -3,6 +3,6 @@ Description=Test for WorkingDirectory with trailing dot [Service] -ExecStart=sh -x -c 'test "$$PWD" = "/tmp/test-exec_workingdirectory"' +ExecStart=bash -x -c 'test "$$PWD" = "/tmp/test-exec_workingdirectory"' Type=oneshot WorkingDirectory=/tmp///./test-exec_workingdirectory/. diff --git a/test/test-execute/exec-workingdirectory.service b/test/test-execute/exec-workingdirectory.service index 4c40fafcf1..937b957988 100644 --- a/test/test-execute/exec-workingdirectory.service +++ b/test/test-execute/exec-workingdirectory.service @@ -3,6 +3,6 @@ Description=Test for WorkingDirectory [Service] -ExecStart=sh -x -c 'test "$$PWD" = "/tmp/test-exec_workingdirectory"' +ExecStart=bash -x -c 'test "$$PWD" = "/tmp/test-exec_workingdirectory"' Type=oneshot WorkingDirectory=/tmp/test-exec_workingdirectory diff --git a/test/test-udev.py b/test/test-udev.py index 68c48fd790..49695ef739 100755 --- a/test/test-udev.py +++ b/test/test-udev.py @@ -596,7 +596,7 @@ RULES = [ not_exp_links = ["foo3", "foo4", "foo5", "foo6", "foo7", "foo8"], ), rules = r""" - SUBSYSTEMS=="scsi", PROGRAM=="/bin/sh -c 'echo foo3 foo4 foo5 foo6 foo7 foo8 foo9 | sed s/foo9/bar9/'", KERNEL=="sda5", SYMLINK+="%c{7}" + SUBSYSTEMS=="scsi", PROGRAM=="/bin/bash -c 'echo foo3 foo4 foo5 foo6 foo7 foo8 foo9 | sed s/foo9/bar9/'", KERNEL=="sda5", SYMLINK+="%c{7}" """), Rules.new( @@ -618,7 +618,7 @@ RULES = [ not_exp_links = ["foo1"], ), rules = r""" - SUBSYSTEMS=="scsi", PROGRAM=="/bin/sh -c 'printf %%s \"foo1 foo2\" | grep \"foo1 foo2\"'", KERNEL=="sda5", SYMLINK+="%c{2}" + SUBSYSTEMS=="scsi", PROGRAM=="/bin/bash -c 'printf %%s \"foo1 foo2\" | grep \"foo1 foo2\"'", KERNEL=="sda5", SYMLINK+="%c{2}" """), Rules.new( @@ -629,7 +629,7 @@ RULES = [ not_exp_links = ["foo1"], ), rules = r""" -SUBSYSTEMS=="scsi", PROGRAM=="/bin/sh -c \"printf %%s 'foo1 foo2' | grep 'foo1 foo2'\"", KERNEL=="sda5", SYMLINK+="%c{2}" +SUBSYSTEMS=="scsi", PROGRAM=="/bin/bash -c \"printf %%s 'foo1 foo2' | grep 'foo1 foo2'\"", KERNEL=="sda5", SYMLINK+="%c{2}" """), Rules.new( @@ -640,7 +640,7 @@ SUBSYSTEMS=="scsi", PROGRAM=="/bin/sh -c \"printf %%s 'foo1 foo2' | grep 'foo1 f not_exp_links = ["foo1", "foo3"], ), rules = r""" - SUBSYSTEMS=="scsi", PROGRAM=="/bin/sh -c 'printf \"%%s %%s\" \"foo1 foo2\" \"foo3\"| grep \"foo1 foo2\"'", KERNEL=="sda5", SYMLINK+="%c{2}" + SUBSYSTEMS=="scsi", PROGRAM=="/bin/bash -c 'printf \"%%s %%s\" \"foo1 foo2\" \"foo3\"| grep \"foo1 foo2\"'", KERNEL=="sda5", SYMLINK+="%c{2}" """), Rules.new( diff --git a/test/units/TEST-03-JOBS.sh b/test/units/TEST-03-JOBS.sh index 4b8b67bd57..6f7494ef2f 100755 --- a/test/units/TEST-03-JOBS.sh +++ b/test/units/TEST-03-JOBS.sh @@ -73,13 +73,13 @@ cat </run/systemd/system/wait2.service [Unit] Description=Wait for 2 seconds [Service] -ExecStart=sh -ec 'sleep 2' +ExecStart=bash -ec 'sleep 2' EOF cat </run/systemd/system/wait5fail.service [Unit] Description=Wait for 5 seconds and fail [Service] -ExecStart=sh -ec 'sleep 5; false' +ExecStart=bash -ec 'sleep 5; false' EOF # wait2 succeeds diff --git a/test/units/TEST-04-JOURNAL.journal.sh b/test/units/TEST-04-JOURNAL.journal.sh index 5473da1de8..5d2ee3a049 100755 --- a/test/units/TEST-04-JOURNAL.journal.sh +++ b/test/units/TEST-04-JOURNAL.journal.sh @@ -93,7 +93,7 @@ grep -vq "^_PID=$PID" /tmp/output # https://github.com/systemd/systemd/issues/15654 ID=$(systemd-id128 new) printf "This will\nusually fail\nand be truncated\n" >/tmp/expected -systemd-cat -t "$ID" sh -c 'env echo -n "This will";echo;env echo -n "usually fail";echo;env echo -n "and be truncated";echo;' +systemd-cat -t "$ID" bash -c 'env echo -n "This will"; echo; env echo -n "usually fail"; echo; env echo -n "and be truncated"; echo;' journalctl --sync journalctl -b -o cat -t "$ID" >/tmp/output diff /tmp/expected /tmp/output @@ -221,7 +221,7 @@ journalctl --follow --merge | head -n1 | grep . rm -f /tmp/issue-26746-log /tmp/issue-26746-cursor ID="$(systemd-id128 new)" journalctl -t "$ID" --follow --cursor-file=/tmp/issue-26746-cursor | tee /tmp/issue-26746-log & -systemd-cat -t "$ID" sh -c 'echo hogehoge' +systemd-cat -t "$ID" bash -c 'echo hogehoge' # shellcheck disable=SC2016 timeout 10 bash -c 'until [[ -f /tmp/issue-26746-log && "$(cat /tmp/issue-26746-log)" =~ hogehoge ]]; do sleep .5; done' pkill -TERM journalctl diff --git a/test/units/TEST-07-PID1.delegate-namespaces.sh b/test/units/TEST-07-PID1.delegate-namespaces.sh index 3fd1287fb2..68ade8fc41 100755 --- a/test/units/TEST-07-PID1.delegate-namespaces.sh +++ b/test/units/TEST-07-PID1.delegate-namespaces.sh @@ -39,8 +39,8 @@ testcase_pid() { # MountAPIVFS=yes always bind mounts child mounts of APIVFS filesystems, which means /proc/sys is always read-only # so we can't write to it when running in a container. if ! systemd-detect-virt --container; then - (! systemd-run -p PrivateUsersEx=self -p PrivatePIDs=yes -p MountAPIVFS=yes --wait --pipe -- sh -c 'echo 5 >/proc/sys/kernel/ns_last_pid') - systemd-run -p PrivateUsersEx=self -p PrivatePIDs=yes -p MountAPIVFS=yes -p DelegateNamespaces=pid --wait --pipe -- sh -c 'echo 5 >/proc/sys/kernel/ns_last_pid' + (! systemd-run -p PrivateUsersEx=self -p PrivatePIDs=yes -p MountAPIVFS=yes --wait --pipe -- bash -c 'echo 5 >/proc/sys/kernel/ns_last_pid') + systemd-run -p PrivateUsersEx=self -p PrivatePIDs=yes -p MountAPIVFS=yes -p DelegateNamespaces=pid --wait --pipe -- bash -c 'echo 5 >/proc/sys/kernel/ns_last_pid' fi } diff --git a/test/units/TEST-07-PID1.exec-context.sh b/test/units/TEST-07-PID1.exec-context.sh index 2ec7f018e8..d6255e21cd 100755 --- a/test/units/TEST-07-PID1.exec-context.sh +++ b/test/units/TEST-07-PID1.exec-context.sh @@ -356,7 +356,7 @@ systemd-run \ -p DynamicUser=yes \ -p EnvironmentFile=-/usr/lib/systemd/systemd-asan-env \ -p NotifyAccess=all \ - sh -c 'touch /tmp/a && touch /var/tmp/b && ! test -f /tmp/b && ! test -f /var/tmp/a && systemd-notify --ready && sleep infinity' + bash -c 'touch /tmp/a && touch /var/tmp/b && ! test -f /tmp/b && ! test -f /var/tmp/a && systemd-notify --ready && sleep infinity' (! ls /tmp/systemd-private-"$(tr -d '-' < /proc/sys/kernel/random/boot_id)"-test-07-dynamic-user-tmp.service-* &>/dev/null) (! ls /var/tmp/systemd-private-"$(tr -d '-' < /proc/sys/kernel/random/boot_id)"-test-07-dynamic-user-tmp.service-* &>/dev/null) systemctl is-active test-07-dynamic-user-tmp.service diff --git a/test/units/TEST-07-PID1.exec-timestamps.sh b/test/units/TEST-07-PID1.exec-timestamps.sh index 0211166ae3..cb602f391c 100755 --- a/test/units/TEST-07-PID1.exec-timestamps.sh +++ b/test/units/TEST-07-PID1.exec-timestamps.sh @@ -5,7 +5,7 @@ set -o pipefail # Check that timestamps of a Type=notify service are consistent -systemd-run --service-type notify --property NotifyAccess=all --unit notify.service --wait sh -c 'systemd-notify --ready; exit 1' || : +systemd-run --service-type notify --property NotifyAccess=all --unit notify.service --wait bash -c 'systemd-notify --ready; exit 1' || : start=$(systemctl show --property=ExecMainStartTimestampMonotonic --value notify.service) handoff=$(systemctl show --property=ExecMainHandoffTimestampMonotonic --value notify.service) diff --git a/test/units/TEST-07-PID1.issue-1981.sh b/test/units/TEST-07-PID1.issue-1981.sh index dcfa9b17b0..33186b7275 100755 --- a/test/units/TEST-07-PID1.issue-1981.sh +++ b/test/units/TEST-07-PID1.issue-1981.sh @@ -21,9 +21,9 @@ mkdir -p /run/systemd/system cat >/run/systemd/system/my.service <<\EOF [Service] Type=oneshot -ExecStartPre=sh -c 'test "$TRIGGER_UNIT" = my.timer' -ExecStartPre=sh -c 'test -n "$TRIGGER_TIMER_REALTIME_USEC"' -ExecStartPre=sh -c 'test -n "$TRIGGER_TIMER_MONOTONIC_USEC"' +ExecStartPre=bash -c 'test "$TRIGGER_UNIT" = my.timer' +ExecStartPre=bash -c 'test -n "$TRIGGER_TIMER_REALTIME_USEC"' +ExecStartPre=bash -c 'test -n "$TRIGGER_TIMER_MONOTONIC_USEC"' ExecStart=echo Timer runs me EOF diff --git a/test/units/TEST-07-PID1.issue-27953.sh b/test/units/TEST-07-PID1.issue-27953.sh index 8659970a5f..4b2e9507c3 100755 --- a/test/units/TEST-07-PID1.issue-27953.sh +++ b/test/units/TEST-07-PID1.issue-27953.sh @@ -7,5 +7,5 @@ set -o pipefail # Issue: https://github.com/systemd/systemd/issues/27953 systemctl start issue27953.service -timeout 10 sh -c 'while systemctl is-active issue27953.service; do sleep .5; done' +timeout 10 bash -c 'while systemctl is-active issue27953.service; do sleep .5; done' [[ "$(systemctl show -P ExitType issue27953.service)" == main ]] diff --git a/test/units/TEST-07-PID1.issue-30412.sh b/test/units/TEST-07-PID1.issue-30412.sh index c1cb00e071..afd852ea48 100755 --- a/test/units/TEST-07-PID1.issue-30412.sh +++ b/test/units/TEST-07-PID1.issue-30412.sh @@ -28,5 +28,5 @@ systemctl start badbin_assert.socket socat - ABSTRACT-CONNECT:badbin_assert.socket -timeout 10 sh -c 'while systemctl is-active badbin_assert.service; do sleep .5; done' +timeout 10 bash -c 'while systemctl is-active badbin_assert.service; do sleep .5; done' [[ "$(systemctl show -P ExecMainStatus badbin_assert.service)" == 203 ]] diff --git a/test/units/TEST-07-PID1.issue-3171.sh b/test/units/TEST-07-PID1.issue-3171.sh index e1a4b6479f..a4e0b2f1ba 100755 --- a/test/units/TEST-07-PID1.issue-3171.sh +++ b/test/units/TEST-07-PID1.issue-3171.sh @@ -24,7 +24,7 @@ cat >/run/systemd/system/issue-3171@.service </sys/fs/cgroup/cgroup.subtree_control; systemd-notify --ready; sleep infinity' + bash -c 'echo +pids >/sys/fs/cgroup/cgroup.subtree_control; systemd-notify --ready; sleep infinity' )" "0::/" } @@ -150,7 +150,7 @@ testcase_delegate_subgroup_pam() { --unit delegate-subgroup-pam \ --wait \ --pipe \ - sh -c 'echo +pids >/sys/fs/cgroup/cgroup.subtree_control' + bash -c 'echo +pids >/sys/fs/cgroup/cgroup.subtree_control' } run_testcases diff --git a/test/units/TEST-07-PID1.transient-unit-container.sh b/test/units/TEST-07-PID1.transient-unit-container.sh index a17f08bd51..03ffa91a70 100755 --- a/test/units/TEST-07-PID1.transient-unit-container.sh +++ b/test/units/TEST-07-PID1.transient-unit-container.sh @@ -121,7 +121,7 @@ After=basic.target [Service] Type=oneshot -ExecStart=sh -c 'echo "$EXPECTED_OUTPUT" > "$guest_output"' +ExecStart=bash -c 'echo "$EXPECTED_OUTPUT" > "$guest_output"' ExecStartPost=systemctl --no-block exit 0 TimeoutStopSec=15s diff --git a/test/units/TEST-13-NSPAWN.machined.sh b/test/units/TEST-13-NSPAWN.machined.sh index 7ae23558dc..50a8c142db 100755 --- a/test/units/TEST-13-NSPAWN.machined.sh +++ b/test/units/TEST-13-NSPAWN.machined.sh @@ -13,7 +13,7 @@ at_exit() { set +e machinectl status long-running &>/dev/null && machinectl kill --signal=KILL long-running - mountpoint -q /var/lib/machines && timeout 30 sh -c "until umount /var/lib/machines; do sleep .5; done" + mountpoint -q /var/lib/machines && timeout 30 bash -c "until umount /var/lib/machines; do sleep .5; done" [[ -n "${NSPAWN_FRAGMENT:-}" ]] && rm -f "/etc/systemd/nspawn/$NSPAWN_FRAGMENT" "/var/lib/machines/$NSPAWN_FRAGMENT" rm -f /run/systemd/nspawn/*.nspawn } diff --git a/test/units/TEST-13-NSPAWN.nspawn-oci.sh b/test/units/TEST-13-NSPAWN.nspawn-oci.sh index bae3e2e085..877482c0f1 100755 --- a/test/units/TEST-13-NSPAWN.nspawn-oci.sh +++ b/test/units/TEST-13-NSPAWN.nspawn-oci.sh @@ -305,7 +305,7 @@ cat >"$OCI/config.json" </prestart" @@ -325,7 +325,7 @@ cat >"$OCI/config.json" <"$OCI/config.json" <"$OCI/config.json" </etc/systemd/system/runtime-max-sec-test-3.service.d/override.conf </tmp/forking1.sh <&2' + bash -c 'echo x ; echo y >&2' cmp /tmp/stdout <&2' + bash -c 'echo z ; echo a >&2' cmp /tmp/stdout <&2' + bash -c 'echo b ; echo c >&2' cmp /tmp/stdout <&2' + bash -c 'echo a ; echo b >&2' cmp /tmp/stdout < $HOME/.local/state/foo/baz") -( ! systemd-run --user -p StateDirectory=foo:bar:ro --wait sh -c "echo foo > $HOME/.local/state/foo/baz") +( ! systemd-run --user -p StateDirectory=foo::ro --wait bash -c "echo foo > $HOME/.local/state/foo/baz") +( ! systemd-run --user -p StateDirectory=foo:bar:ro --wait bash -c "echo foo > $HOME/.local/state/foo/baz") ( ! test -f "$HOME"/.local/state/foo/baz) test -L "$HOME"/.local/state/bar diff --git a/test/units/TEST-34-DYNAMICUSERMIGRATE.sh b/test/units/TEST-34-DYNAMICUSERMIGRATE.sh index e89c012dd3..601e44098d 100755 --- a/test/units/TEST-34-DYNAMICUSERMIGRATE.sh +++ b/test/units/TEST-34-DYNAMICUSERMIGRATE.sh @@ -23,7 +23,7 @@ test_directory() { (! systemd-run --wait -p RuntimeDirectoryPreserve=yes -p DynamicUser=0 -p "${directory}"=zzz test -f "${path}"/zzz/test-missing) systemd-run --wait -p RuntimeDirectoryPreserve=yes -p DynamicUser=0 -p "${directory}"="www::ro www:ro:ro" test -d "${path}"/www systemd-run --wait -p RuntimeDirectoryPreserve=yes -p DynamicUser=0 -p "${directory}"="www::ro www:ro:ro" test -L "${path}"/ro - (! systemd-run --wait -p RuntimeDirectoryPreserve=yes -p DynamicUser=0 -p "${directory}"="www::ro www:ro:ro" sh -c "echo foo > ${path}/www/test-missing") + (! systemd-run --wait -p RuntimeDirectoryPreserve=yes -p DynamicUser=0 -p "${directory}"="www::ro www:ro:ro" bash -c "echo foo > ${path}/www/test-missing") test -d "${path}"/zzz test ! -L "${path}"/zzz @@ -50,7 +50,7 @@ test_directory() { (! systemd-run --wait -p RuntimeDirectoryPreserve=yes -p DynamicUser=1 -p "${directory}"=zzz test -f "${path}"/zzz/test-missing) systemd-run --wait -p RuntimeDirectoryPreserve=yes -p DynamicUser=1 -p "${directory}"="www::ro www:ro:ro" test -d "${path}"/www systemd-run --wait -p RuntimeDirectoryPreserve=yes -p DynamicUser=1 -p "${directory}"="www::ro www:ro:ro" test -L "${path}"/ro - (! systemd-run --wait -p RuntimeDirectoryPreserve=yes -p DynamicUser=1 -p "${directory}"="www::ro www:ro:ro" sh -c "echo foo > ${path}/www/test-missing") + (! systemd-run --wait -p RuntimeDirectoryPreserve=yes -p DynamicUser=1 -p "${directory}"="www::ro www:ro:ro" bash -c "echo foo > ${path}/www/test-missing") test -L "${path}"/zzz test -d "${path}"/private/zzz @@ -76,7 +76,7 @@ test_directory() { (! systemd-run --wait -p RuntimeDirectoryPreserve=yes -p DynamicUser=0 -p "${directory}"=zzz test -f "${path}"/zzz/test-missing) systemd-run --wait -p RuntimeDirectoryPreserve=yes -p DynamicUser=0 -p "${directory}"="www::ro www:ro:ro" test -d "${path}"/www systemd-run --wait -p RuntimeDirectoryPreserve=yes -p DynamicUser=0 -p "${directory}"="www::ro www:ro:ro" test -L "${path}"/ro - (! systemd-run --wait -p RuntimeDirectoryPreserve=yes -p DynamicUser=0 -p "${directory}"="www::ro www:ro:ro" sh -c "echo foo > ${path}/www/test-missing") + (! systemd-run --wait -p RuntimeDirectoryPreserve=yes -p DynamicUser=0 -p "${directory}"="www::ro www:ro:ro" bash -c "echo foo > ${path}/www/test-missing") test -d "${path}"/zzz test ! -L "${path}"/zzz @@ -106,7 +106,7 @@ ExecStart=test -f ${path}/x:yz/test ExecStart=test -f ${path}/zzz/test ExecStart=test -d ${path}/www ExecStart=test -L ${path}/ro -ExecStart=sh -c "! test -w ${path}/www" +ExecStart=bash -c "! test -w ${path}/www" EOF systemctl daemon-reload systemctl start --wait testservice-34.service diff --git a/test/units/TEST-43-PRIVATEUSER-UNPRIV.sh b/test/units/TEST-43-PRIVATEUSER-UNPRIV.sh index b28df65fe5..b15d62d4f9 100755 --- a/test/units/TEST-43-PRIVATEUSER-UNPRIV.sh +++ b/test/units/TEST-43-PRIVATEUSER-UNPRIV.sh @@ -84,12 +84,12 @@ runas testuser systemd-run --wait --user --unit=test-caps \ runas testuser systemd-run --wait --user --unit=test-devices \ -p PrivateDevices=yes -p PrivateIPC=yes \ - sh -c "ls -1 /dev/ | wc -l | grep -q -F 18" + bash -c "ls -1 /dev/ | wc -l | grep -q -F 18" # Same check as test/test-execute/exec-privatenetwork-yes.service runas testuser systemd-run --wait --user --unit=test-network \ -p PrivateNetwork=yes \ - sh -x -c '! ip link | grep -E "^[0-9]+: " | grep -Ev ": (lo|(erspan|gre|gretap|ip_vti|ip6_vti|ip6gre|ip6tnl|sit|tunl)0@.*):"' + bash -x -c '! ip link | grep -E "^[0-9]+: " | grep -Ev ": (lo|(erspan|gre|gretap|ip_vti|ip6_vti|ip6gre|ip6tnl|sit|tunl)0@.*):"' (! runas testuser systemd-run --wait --user --unit=test-hostname \ -p ProtectHostname=yes \ @@ -101,11 +101,11 @@ runas testuser systemd-run --wait --user --unit=test-network \ (! runas testuser systemd-run --wait --user --unit=test-kernel-tunable \ -p ProtectKernelTunables=yes \ - sh -c "echo 0 >/proc/sys/user/max_user_namespaces") + bash -c "echo 0 >/proc/sys/user/max_user_namespaces") (! runas testuser systemd-run --wait --user --unit=test-kernel-mod \ -p ProtectKernelModules=yes \ - sh -c "modprobe -r overlay && modprobe overlay") + bash -c "modprobe -r overlay && modprobe overlay") if sysctl kernel.dmesg_restrict=0; then (! runas testuser systemd-run --wait --user --unit=test-kernel-log \ diff --git a/test/units/TEST-46-HOMED.sh b/test/units/TEST-46-HOMED.sh index 15a53b18f7..8eee967d7c 100755 --- a/test/units/TEST-46-HOMED.sh +++ b/test/units/TEST-46-HOMED.sh @@ -687,20 +687,20 @@ run0 --property=SetCredential=pam.authtok.systemd-run0:quux -u subareatest cp -a run0 --property=SetCredential=pam.authtok.systemd-run0:quux -u subareatest ln -s /home/srub Areas/srub run0 --property=SetCredential=pam.authtok.systemd-run0:quux -u subareatest ln -s /root Areas/root -test "$(run0 --property=SetCredential=pam.authtok.systemd-run0:quux -u subareatest sh -c 'echo $HOME')" = "/home/subareatest" -test "$(run0 --property=SetCredential=pam.authtok.systemd-run0:quux -u subareatest sh -c 'echo x$XDG_AREA')" = "x" -test "$(run0 --property=SetCredential=pam.authtok.systemd-run0:quux -u subareatest sh -c 'echo $XDG_RUNTIME_DIR')" = "/run/user/$(id -u subareatest)" -test "$(run0 --property=SetCredential=pam.authtok.systemd-run0:quux -u subareatest --area=furb sh -c 'echo $HOME')" = "/home/subareatest/Areas/furb" -test "$(run0 --property=SetCredential=pam.authtok.systemd-run0:quux -u subareatest --area=furb sh -c 'echo $XDG_AREA')" = "furb" -test "$(run0 --property=SetCredential=pam.authtok.systemd-run0:quux -u subareatest --area=furb sh -c 'echo $XDG_RUNTIME_DIR')" = "/run/user/$(id -u subareatest)/Areas/furb" +test "$(run0 --property=SetCredential=pam.authtok.systemd-run0:quux -u subareatest bash -c 'echo $HOME')" = "/home/subareatest" +test "$(run0 --property=SetCredential=pam.authtok.systemd-run0:quux -u subareatest bash -c 'echo x$XDG_AREA')" = "x" +test "$(run0 --property=SetCredential=pam.authtok.systemd-run0:quux -u subareatest bash -c 'echo $XDG_RUNTIME_DIR')" = "/run/user/$(id -u subareatest)" +test "$(run0 --property=SetCredential=pam.authtok.systemd-run0:quux -u subareatest --area=furb bash -c 'echo $HOME')" = "/home/subareatest/Areas/furb" +test "$(run0 --property=SetCredential=pam.authtok.systemd-run0:quux -u subareatest --area=furb bash -c 'echo $XDG_AREA')" = "furb" +test "$(run0 --property=SetCredential=pam.authtok.systemd-run0:quux -u subareatest --area=furb bash -c 'echo $XDG_RUNTIME_DIR')" = "/run/user/$(id -u subareatest)/Areas/furb" PASSWORD=quux homectl update subareatest --default-area=molb -test "$(run0 --property=SetCredential=pam.authtok.systemd-run0:quux -u subareatest sh -c 'echo $HOME')" = "/home/subareatest/Areas/molb" -test "$(run0 --property=SetCredential=pam.authtok.systemd-run0:quux -u subareatest sh -c 'echo $XDG_AREA')" = "molb" -test "$(run0 --property=SetCredential=pam.authtok.systemd-run0:quux -u subareatest sh -c 'echo $XDG_RUNTIME_DIR')" = "/run/user/$(id -u subareatest)/Areas/molb" -test "$(run0 --property=SetCredential=pam.authtok.systemd-run0:quux -u subareatest --area=furb sh -c 'echo $HOME')" = "/home/subareatest/Areas/furb" -test "$(run0 --property=SetCredential=pam.authtok.systemd-run0:quux -u subareatest --area=furb sh -c 'echo $XDG_AREA')" = "furb" -test "$(run0 --property=SetCredential=pam.authtok.systemd-run0:quux -u subareatest --area=furb sh -c 'echo $XDG_RUNTIME_DIR')" = "/run/user/$(id -u subareatest)/Areas/furb" +test "$(run0 --property=SetCredential=pam.authtok.systemd-run0:quux -u subareatest bash -c 'echo $HOME')" = "/home/subareatest/Areas/molb" +test "$(run0 --property=SetCredential=pam.authtok.systemd-run0:quux -u subareatest bash -c 'echo $XDG_AREA')" = "molb" +test "$(run0 --property=SetCredential=pam.authtok.systemd-run0:quux -u subareatest bash -c 'echo $XDG_RUNTIME_DIR')" = "/run/user/$(id -u subareatest)/Areas/molb" +test "$(run0 --property=SetCredential=pam.authtok.systemd-run0:quux -u subareatest --area=furb bash -c 'echo $HOME')" = "/home/subareatest/Areas/furb" +test "$(run0 --property=SetCredential=pam.authtok.systemd-run0:quux -u subareatest --area=furb bash -c 'echo $XDG_AREA')" = "furb" +test "$(run0 --property=SetCredential=pam.authtok.systemd-run0:quux -u subareatest --area=furb bash -c 'echo $XDG_RUNTIME_DIR')" = "/run/user/$(id -u subareatest)/Areas/furb" # Install a PK rule that allows 'subareatest' user to invoke run0 without password, just for testing cat >/usr/share/polkit-1/rules.d/subareatest.rules <<'EOF' @@ -713,24 +713,24 @@ polkit.addRule(function(action, subject) { EOF # Test "recursive" operation -test "$(run0 --property=SetCredential=pam.authtok.systemd-run0:quux -u subareatest --area=furb run0 --property=SetCredential=pam.authtok.systemd-run0:quux -u subareatest --area=molb sh -c 'echo $HOME')" = "/home/subareatest/Areas/molb" -test "$(run0 --property=SetCredential=pam.authtok.systemd-run0:quux -u subareatest --area=furb run0 --property=SetCredential=pam.authtok.systemd-run0:quux -u subareatest --area=molb sh -c 'echo $XDG_AREA')" = "molb" -test "$(run0 --property=SetCredential=pam.authtok.systemd-run0:quux -u subareatest --area=furb run0 --property=SetCredential=pam.authtok.systemd-run0:quux -u subareatest --area=molb sh -c 'echo $XDG_RUNTIME_DIR')" = "/run/user/$(id -u subareatest)/Areas/molb" -test "$(run0 --property=SetCredential=pam.authtok.systemd-run0:quux -u subareatest --area=furb run0 --property=SetCredential=pam.authtok.systemd-run0:quux -u subareatest --area=molb run0 --property=SetCredential=pam.authtok.systemd-run0:quux -u subareatest --area=furb sh -c 'echo $HOME')" = "/home/subareatest/Areas/furb" -test "$(run0 --property=SetCredential=pam.authtok.systemd-run0:quux -u subareatest --area=furb run0 --property=SetCredential=pam.authtok.systemd-run0:quux -u subareatest --area=molb run0 --property=SetCredential=pam.authtok.systemd-run0:quux -u subareatest --area=furb sh -c 'echo $XDG_AREA')" = "furb" -test "$(run0 --property=SetCredential=pam.authtok.systemd-run0:quux -u subareatest --area=furb run0 --property=SetCredential=pam.authtok.systemd-run0:quux -u subareatest --area=molb run0 --property=SetCredential=pam.authtok.systemd-run0:quux -u subareatest --area=furb sh -c 'echo $XDG_RUNTIME_DIR')" = "/run/user/$(id -u subareatest)/Areas/furb" +test "$(run0 --property=SetCredential=pam.authtok.systemd-run0:quux -u subareatest --area=furb run0 --property=SetCredential=pam.authtok.systemd-run0:quux -u subareatest --area=molb bash -c 'echo $HOME')" = "/home/subareatest/Areas/molb" +test "$(run0 --property=SetCredential=pam.authtok.systemd-run0:quux -u subareatest --area=furb run0 --property=SetCredential=pam.authtok.systemd-run0:quux -u subareatest --area=molb bash -c 'echo $XDG_AREA')" = "molb" +test "$(run0 --property=SetCredential=pam.authtok.systemd-run0:quux -u subareatest --area=furb run0 --property=SetCredential=pam.authtok.systemd-run0:quux -u subareatest --area=molb bash -c 'echo $XDG_RUNTIME_DIR')" = "/run/user/$(id -u subareatest)/Areas/molb" +test "$(run0 --property=SetCredential=pam.authtok.systemd-run0:quux -u subareatest --area=furb run0 --property=SetCredential=pam.authtok.systemd-run0:quux -u subareatest --area=molb run0 --property=SetCredential=pam.authtok.systemd-run0:quux -u subareatest --area=furb bash -c 'echo $HOME')" = "/home/subareatest/Areas/furb" +test "$(run0 --property=SetCredential=pam.authtok.systemd-run0:quux -u subareatest --area=furb run0 --property=SetCredential=pam.authtok.systemd-run0:quux -u subareatest --area=molb run0 --property=SetCredential=pam.authtok.systemd-run0:quux -u subareatest --area=furb bash -c 'echo $XDG_AREA')" = "furb" +test "$(run0 --property=SetCredential=pam.authtok.systemd-run0:quux -u subareatest --area=furb run0 --property=SetCredential=pam.authtok.systemd-run0:quux -u subareatest --area=molb run0 --property=SetCredential=pam.authtok.systemd-run0:quux -u subareatest --area=furb bash -c 'echo $XDG_RUNTIME_DIR')" = "/run/user/$(id -u subareatest)/Areas/furb" # Test symlinked area mkdir -p /home/srub chown subareatest:subareatest /home/srub -test "$(run0 --property=SetCredential=pam.authtok.systemd-run0:quux -u subareatest --area=srub sh -c 'echo $HOME')" = "/home/srub" -test "$(run0 --property=SetCredential=pam.authtok.systemd-run0:quux -u subareatest --area=srub sh -c 'echo $XDG_AREA')" = "srub" -test "$(run0 --property=SetCredential=pam.authtok.systemd-run0:quux -u subareatest --area=srub sh -c 'echo $XDG_RUNTIME_DIR')" = "/run/user/$(id -u subareatest)/Areas/srub" +test "$(run0 --property=SetCredential=pam.authtok.systemd-run0:quux -u subareatest --area=srub bash -c 'echo $HOME')" = "/home/srub" +test "$(run0 --property=SetCredential=pam.authtok.systemd-run0:quux -u subareatest --area=srub bash -c 'echo $XDG_AREA')" = "srub" +test "$(run0 --property=SetCredential=pam.authtok.systemd-run0:quux -u subareatest --area=srub bash -c 'echo $XDG_RUNTIME_DIR')" = "/run/user/$(id -u subareatest)/Areas/srub" # Verify that login into an area not owned by target user will be redirected to main area -test "$(run0 --property=SetCredential=pam.authtok.systemd-run0:quux -u subareatest --area=root sh -c 'echo $HOME')" = "/home/subareatest" -test "$(run0 --property=SetCredential=pam.authtok.systemd-run0:quux -u subareatest --area=root sh -c 'echo x$XDG_AREA')" = "x" -test "$(run0 --property=SetCredential=pam.authtok.systemd-run0:quux -u subareatest --area=root sh -c 'echo $XDG_RUNTIME_DIR')" = "/run/user/$(id -u subareatest)" +test "$(run0 --property=SetCredential=pam.authtok.systemd-run0:quux -u subareatest --area=root bash -c 'echo $HOME')" = "/home/subareatest" +test "$(run0 --property=SetCredential=pam.authtok.systemd-run0:quux -u subareatest --area=root bash -c 'echo x$XDG_AREA')" = "x" +test "$(run0 --property=SetCredential=pam.authtok.systemd-run0:quux -u subareatest --area=root bash -c 'echo $XDG_RUNTIME_DIR')" = "/run/user/$(id -u subareatest)" systemctl stop user@"$(id -u subareatest)".service diff --git a/test/units/TEST-50-DISSECT.dissect.sh b/test/units/TEST-50-DISSECT.dissect.sh index 6ac4263dff..bf45489545 100755 --- a/test/units/TEST-50-DISSECT.dissect.sh +++ b/test/units/TEST-50-DISSECT.dissect.sh @@ -363,7 +363,7 @@ Type=notify RemainAfterExit=yes MountAPIVFS=yes PrivateTmp=yes -ExecStart=sh -c ' \\ +ExecStart=bash -c ' \\ systemd-notify --ready; \\ while [ ! -f /tmp/img/usr/lib/os-release ] || ! grep -q -F MARKER /tmp/img/usr/lib/os-release; do \\ sleep 0.1; \\ diff --git a/test/units/TEST-50-DISSECT.mountfsd.sh b/test/units/TEST-50-DISSECT.mountfsd.sh index a70cf6df0f..5985cbdb79 100755 --- a/test/units/TEST-50-DISSECT.mountfsd.sh +++ b/test/units/TEST-50-DISSECT.mountfsd.sh @@ -76,7 +76,7 @@ if [ "$VERITY_SIG_SUPPORTED" -eq 1 ]; then systemd-run -M testuser@ --user --pipe --wait \ --property RootImage="$MINIMAL_IMAGE.raw" \ --property ExtensionImages=/tmp/app0.raw \ - sh -c "test -e \"/dev/mapper/${MINIMAL_IMAGE_ROOTHASH}-verity\" && test -e \"/dev/mapper/$(/tmp/testfile; systemd-notify --ready; sleep infinity" +ExecStart=bash -c "echo 'Hello from test unit' >/tmp/testfile; systemd-notify --ready; sleep infinity" PrivateTmp=disconnected EOF # Start the service diff --git a/test/units/autorelabel.service b/test/units/autorelabel.service index f0f4db397d..1d94cb0a1c 100644 --- a/test/units/autorelabel.service +++ b/test/units/autorelabel.service @@ -22,7 +22,7 @@ ConditionPathExists=|/.autorelabel SuccessAction=reboot [Service] -ExecStart=sh -xec 'echo 0 >/sys/fs/selinux/enforce; fixfiles -f -F relabel; rm /.autorelabel;' +ExecStart=bash -xec 'echo 0 >/sys/fs/selinux/enforce; fixfiles -f -F relabel; rm /.autorelabel;' Type=oneshot TimeoutSec=infinity