Skip to content

Commit

Permalink
Merge pull request systemd#30843 from keszybz/test-relative-paths
Browse files Browse the repository at this point in the history
Use relative paths in test units
  • Loading branch information
bluca authored Jan 9, 2024
2 parents bed41c4 + 6795352 commit b4a85f7
Show file tree
Hide file tree
Showing 209 changed files with 296 additions and 296 deletions.
2 changes: 1 addition & 1 deletion test/test-execute/exec-ambientcapabilities-dynuser.service
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Description=Test for AmbientCapabilities (dynamic user)

[Service]
ExecStart=/bin/sh -x -c 'c=$$(grep "CapAmb:" /proc/self/status); test "$$c" = "CapAmb: 0000000000002081"'
ExecStart=sh -x -c 'c=$$(grep "CapAmb:" /proc/self/status); test "$$c" = "CapAmb: 0000000000002081"'
Type=oneshot
AmbientCapabilities=CAP_CHOWN CAP_SETUID CAP_NET_RAW
DynamicUser=yes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Description=Test for AmbientCapabilities

[Service]
ExecStart=/bin/sh -x -c 'c=$$(grep "CapAmb:" /proc/self/status); test "$$c" = "CapAmb: 0000000000002001"'
ExecStart=sh -x -c 'c=$$(grep "CapAmb:" /proc/self/status); test "$$c" = "CapAmb: 0000000000002001"'
Type=oneshot
User=nfsnobody
AmbientCapabilities=CAP_CHOWN
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Description=Test for AmbientCapabilities

[Service]
ExecStart=/bin/sh -x -c 'c=$$(grep "CapAmb:" /proc/self/status); test "$$c" = "CapAmb: 0000000000002001"'
ExecStart=sh -x -c 'c=$$(grep "CapAmb:" /proc/self/status); test "$$c" = "CapAmb: 0000000000002001"'
Type=oneshot
User=nobody
AmbientCapabilities=CAP_CHOWN
Expand Down
2 changes: 1 addition & 1 deletion test/test-execute/exec-ambientcapabilities-merge.service
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Description=Test for AmbientCapabilities (daemon)

[Service]
ExecStart=/bin/sh -x -c 'c=$$(grep "CapAmb:" /proc/self/status); test "$$c" = "CapAmb: 0000000000002001"'
ExecStart=sh -x -c 'c=$$(grep "CapAmb:" /proc/self/status); test "$$c" = "CapAmb: 0000000000002001"'
Type=oneshot
User=daemon
AmbientCapabilities=CAP_CHOWN
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Description=Test for AmbientCapabilities

[Service]
ExecStart=/bin/sh -x -c 'c=$$(grep "CapAmb:" /proc/self/status); test "$$c" = "CapAmb: 0000000000002001"'
ExecStart=sh -x -c 'c=$$(grep "CapAmb:" /proc/self/status); test "$$c" = "CapAmb: 0000000000002001"'
Type=oneshot
User=nfsnobody
AmbientCapabilities=CAP_CHOWN CAP_NET_RAW
2 changes: 1 addition & 1 deletion test/test-execute/exec-ambientcapabilities-nobody.service
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Description=Test for AmbientCapabilities

[Service]
ExecStart=/bin/sh -x -c 'c=$$(grep "CapAmb:" /proc/self/status); test "$$c" = "CapAmb: 0000000000002001"'
ExecStart=sh -x -c 'c=$$(grep "CapAmb:" /proc/self/status); test "$$c" = "CapAmb: 0000000000002001"'
Type=oneshot
User=nobody
AmbientCapabilities=CAP_CHOWN CAP_NET_RAW
2 changes: 1 addition & 1 deletion test/test-execute/exec-ambientcapabilities.service
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Description=Test for AmbientCapabilities (daemon)

[Service]
ExecStart=/bin/sh -x -c 'c=$$(grep "CapAmb:" /proc/self/status); test "$$c" = "CapAmb: 0000000000002001"'
ExecStart=sh -x -c 'c=$$(grep "CapAmb:" /proc/self/status); test "$$c" = "CapAmb: 0000000000002001"'
Type=oneshot
User=daemon
AmbientCapabilities=CAP_CHOWN CAP_NET_RAW
2 changes: 1 addition & 1 deletion test/test-execute/exec-bindpaths.service
Original file line number Diff line number Diff line change
Expand Up @@ -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=/bin/sh -x -c '! touch /tmp/test-exec-bindreadonlypaths/thisisasimpletest'
ExecStart=sh -x -c '! touch /tmp/test-exec-bindreadonlypaths/thisisasimpletest'
# Cleanup
ExecStart=rm /tmp/thisisasimpletest
BindPaths=/tmp:/tmp/test-exec-bindpaths
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ Description=Test for CapabilityBoundingSet

[Service]
# sed: remove dropped (cap_xxx-[epi]) and IAB capabilities from the output
ExecStart=/bin/sh -x -c '! capsh --print | sed -re "s/[^ ]+?\-[epi]+//g" -e '/IAB/d' | grep "^Bounding set .*cap_chown"'
ExecStart=sh -x -c '! capsh --print | sed -re "s/[^ ]+?\-[epi]+//g" -e '/IAB/d' | grep "^Bounding set .*cap_chown"'
Type=oneshot
CapabilityBoundingSet=~CAP_CHOWN
2 changes: 1 addition & 1 deletion test/test-execute/exec-capabilityboundingset-merge.service
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Description=Test for CapabilityBoundingSet

[Service]
ExecStart=/bin/sh -x -c 'c=$$(capsh --print | grep "Bounding set "); test "$$c" = "Bounding set =cap_chown,cap_fowner,cap_kill"'
ExecStart=sh -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
2 changes: 1 addition & 1 deletion test/test-execute/exec-capabilityboundingset-reset.service
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Description=Test for CapabilityBoundingSet

[Service]
ExecStart=/bin/sh -x -c 'c=$$(capsh --print | grep "Bounding set "); test "$$c" = "Bounding set ="'
ExecStart=sh -x -c 'c=$$(capsh --print | grep "Bounding set "); test "$$c" = "Bounding set ="'
Type=oneshot
CapabilityBoundingSet=CAP_FOWNER CAP_KILL
CapabilityBoundingSet=
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
Description=Test for CapabilityBoundingSet

[Service]
ExecStart=/bin/sh -x -c 'c=$$(capsh --print | grep "Bounding set "); test "$$c" = "Bounding set =cap_fowner,cap_kill"'
ExecStart=sh -x -c 'c=$$(capsh --print | grep "Bounding set "); test "$$c" = "Bounding set =cap_fowner,cap_kill"'
Type=oneshot
CapabilityBoundingSet=CAP_FOWNER CAP_KILL
2 changes: 1 addition & 1 deletion test/test-execute/exec-condition-failed.service
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ Type=oneshot
ExecCondition=/bin/sh -c 'exit 255'

# This should not get run
ExecStart=/bin/sh -c 'true'
ExecStart=sh -c 'true'
2 changes: 1 addition & 1 deletion test/test-execute/exec-condition-skip.service
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ ExecCondition=/bin/sh -c 'exit 254'
ExecCondition=/bin/sh -c 'exit 255'

# This should not get run
ExecStart=/bin/sh -c 'true'
ExecStart=sh -c 'true'
2 changes: 1 addition & 1 deletion test/test-execute/exec-cpuaffinity1.service
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
Description=Test for CPUAffinity (simple)

[Service]
ExecStart=/bin/sh -c 'test $$(cat /proc/self/status | grep Cpus_allowed: | rev | cut -c 1) = 1'
ExecStart=sh -c 'test $$(cat /proc/self/status | grep Cpus_allowed: | rev | cut -c 1) = 1'
CPUAffinity=0
2 changes: 1 addition & 1 deletion test/test-execute/exec-cpuaffinity2.service
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Description=Test for CPUAffinity (reset)

[Service]
ExecStart=/bin/sh -c 'test $$(cat /proc/self/status | grep Cpus_allowed: | rev | cut -c 1) = 1'
ExecStart=sh -c 'test $$(cat /proc/self/status | grep Cpus_allowed: | rev | cut -c 1) = 1'
CPUAffinity=0-1 3
CPUAffinity=
CPUAffinity=0
2 changes: 1 addition & 1 deletion test/test-execute/exec-cpuaffinity3.service
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
Description=Test for CPUAffinity (merge)

[Service]
ExecStart=/bin/sh -c 'test $$(cat /proc/self/status | grep Cpus_allowed: | rev | cut -c 1) = 7'
ExecStart=sh -c 'test $$(cat /proc/self/status | grep Cpus_allowed: | rev | cut -c 1) = 7'
CPUAffinity=0,1
CPUAffinity=1-2
4 changes: 2 additions & 2 deletions test/test-execute/exec-dynamicuser-fixeduser-adm.service
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ Description=Test DynamicUser with static User= whose uid and gid are different

[Service]
Type=oneshot
ExecStart=/bin/sh -x -c 'test "$$(id -nG)" = "adm" && test "$$(id -ng)" = "adm" && test "$$(id -nu)" = "adm"'
ExecStart=sh -x -c 'test "$$(id -nG)" = "adm" && test "$$(id -ng)" = "adm" && test "$$(id -nu)" = "adm"'
# Multiple ExecStart= lines causes the issue #9702.
ExecStart=/bin/sh -x -c 'test "$$(id -nG)" = "adm" && test "$$(id -ng)" = "adm" && test "$$(id -nu)" = "adm"'
ExecStart=sh -x -c 'test "$$(id -nG)" = "adm" && test "$$(id -ng)" = "adm" && test "$$(id -nu)" = "adm"'
DynamicUser=yes
User=adm
4 changes: 2 additions & 2 deletions test/test-execute/exec-dynamicuser-fixeduser-games.service
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ Description=Test DynamicUser with static User= whose uid and gid are different

[Service]
Type=oneshot
ExecStart=/bin/sh -x -c 'test "$$(id -nG)" = "games" && test "$$(id -ng)" = "games" && test "$$(id -nu)" = "games"'
ExecStart=sh -x -c 'test "$$(id -nG)" = "games" && test "$$(id -ng)" = "games" && test "$$(id -nu)" = "games"'
# Multiple ExecStart= lines causes the issue #9702.
ExecStart=/bin/sh -x -c 'test "$$(id -nG)" = "games" && test "$$(id -ng)" = "games" && test "$$(id -nu)" = "games"'
ExecStart=sh -x -c 'test "$$(id -nG)" = "games" && test "$$(id -ng)" = "games" && test "$$(id -nu)" = "games"'
DynamicUser=yes
User=games
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
Description=Test DynamicUser with User= and SupplementaryGroups=

[Service]
ExecStart=/bin/sh -x -c 'for g in $$(id -G); do test "$$g" = "1" && exit 0; done; exit 1'
ExecStart=/bin/sh -x -c 'test "$$(id -g)" = "1" && test "$$(id -u)" = "1"'
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"'
Type=oneshot
User=1
DynamicUser=yes
Expand Down
4 changes: 2 additions & 2 deletions test/test-execute/exec-dynamicuser-fixeduser.service
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
Description=Test DynamicUser with User=

[Service]
ExecStart=/bin/sh -x -c 'for g in $$(id -G); do test "$$g" = "1" && exit 0; done; exit 1'
ExecStart=/bin/sh -x -c 'test "$$(id -g)" = "1" && test "$$(id -u)" = "1"'
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"'
Type=oneshot
User=1
DynamicUser=yes
6 changes: 3 additions & 3 deletions test/test-execute/exec-dynamicuser-runtimedirectory1.service
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
Description=Test for RuntimeDirectory with RuntimeDirectoryPreserve=yes and DynamicUser=yes

[Service]
ExecStart=/bin/sh -x -c 'test -d %t/test-exec_runtimedirectorypreserve'
ExecStart=/bin/sh -x -c 'test "$$RUNTIME_DIRECTORY" = "%t/test-exec_runtimedirectorypreserve"'
ExecStart=/bin/sh -x -c 'touch $$RUNTIME_DIRECTORY/test'
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'
Type=oneshot
RuntimeDirectory=test-exec_runtimedirectorypreserve
RuntimeDirectoryPreserve=yes
Expand Down
8 changes: 4 additions & 4 deletions test/test-execute/exec-dynamicuser-runtimedirectory2.service
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
Description=Test for RuntimeDirectory with RuntimeDirectoryPreserve=yes and DynamicUser=yes 2nd trial

[Service]
ExecStart=/bin/sh -x -c 'test -d %t/test-exec_runtimedirectorypreserve'
ExecStart=/bin/sh -x -c 'test "$$RUNTIME_DIRECTORY" = "%t/test-exec_runtimedirectorypreserve"'
ExecStart=/bin/sh -x -c 'test -f $$RUNTIME_DIRECTORY/test'
ExecStart=/bin/sh -x -c 'touch $$RUNTIME_DIRECTORY/test'
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'
Type=oneshot
RuntimeDirectory=test-exec_runtimedirectorypreserve
RuntimeDirectoryPreserve=yes
Expand Down
8 changes: 4 additions & 4 deletions test/test-execute/exec-dynamicuser-runtimedirectory3.service
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
Description=Test for RuntimeDirectory with DynamicUser=yes migrated from RuntimeDirectoryPreserve=yes

[Service]
ExecStart=/bin/sh -x -c 'test -d %t/test-exec_runtimedirectorypreserve'
ExecStart=/bin/sh -x -c 'test "$$RUNTIME_DIRECTORY" = "%t/test-exec_runtimedirectorypreserve"'
ExecStart=/bin/sh -x -c 'test -f $$RUNTIME_DIRECTORY/test'
ExecStart=/bin/sh -x -c 'touch $$RUNTIME_DIRECTORY/test'
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'
Type=oneshot
RuntimeDirectory=test-exec_runtimedirectorypreserve
DynamicUser=yes
Original file line number Diff line number Diff line change
Expand Up @@ -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=/bin/sh -x -c 'test "$$STATE_DIRECTORY" = "%S/test-dynamicuser-migrate:%S/test-dynamicuser-migrate2/hoge"'
ExecStart=sh -x -c 'test "$$STATE_DIRECTORY" = "%S/test-dynamicuser-migrate:%S/test-dynamicuser-migrate2/hoge"'

Type=oneshot
DynamicUser=no
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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=/bin/sh -x -c 'test "$$STATE_DIRECTORY" = "%S/test-dynamicuser-migrate:%S/test-dynamicuser-migrate2/hoge"'
ExecStart=sh -x -c 'test "$$STATE_DIRECTORY" = "%S/test-dynamicuser-migrate:%S/test-dynamicuser-migrate2/hoge"'

Type=oneshot
DynamicUser=yes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
Description=Test DynamicUser with SupplementaryGroups=

[Service]
ExecStart=/bin/sh -x -c 'for g in $$(id -G); do test "$$g" = "1" && exit 0; done; exit 1'
ExecStart=/bin/sh -x -c 'for g in $$(id -G); do test "$$g" = "2" && 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'
Type=oneshot
DynamicUser=yes
SupplementaryGroups=1 2
2 changes: 1 addition & 1 deletion test/test-execute/exec-environment-empty.service
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Description=Test for Environment

[Service]
ExecStart=/bin/sh -x -c 'test "$${VAR1-unset}" = "unset" && test "$${VAR2-unset}" = "unset" && test "$${VAR3-unset}" = "unset"'
ExecStart=sh -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=
2 changes: 1 addition & 1 deletion test/test-execute/exec-environment-multiple.service
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Description=Test for Environment

[Service]
ExecStart=/bin/sh -x -c 'test "$$VAR1" = "word1 word2" && test "$$VAR2" = word3 && test "$$VAR3" = foobar'
ExecStart=sh -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"
2 changes: 1 addition & 1 deletion test/test-execute/exec-environment-no-substitute.service
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Description=Test for No Environment Variable Substitution

[Service]
ExecStart=/bin/sh -x -c 'test "$${VAR1-unset}" = "unset" && test "$${VAR2}" = "word3" && test "$${VAR3-unset}" = \'$word 5 6\''
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\''
Type=oneshot
Environment="VAR2=word3" "VAR3=$word 5 6"
2 changes: 1 addition & 1 deletion test/test-execute/exec-environment.service
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
Description=Test for Environment

[Service]
ExecStart=/bin/sh -x -c 'test "$$VAR1" = "word1 word2" && test "$$VAR2" = word3 && test "$$VAR3" = "\\$$word 5 6"'
ExecStart=sh -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"
2 changes: 1 addition & 1 deletion test/test-execute/exec-environmentfile.service
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
Description=Test for EnvironmentFile

[Service]
ExecStart=/bin/sh -x -c 'test "$$VAR1" = "word1 word2" && test "$$VAR2" = word3 && test "$$VAR3" = "\\$$word 5 6" && test "$$VAR4" = "new\nline" && test "$$VAR5" = passwordwithbackslashes'
ExecStart=sh -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
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# SPDX-License-Identifier: LGPL-2.1-or-later
[Service]
ExecStart=/bin/sh -x -c 'test "$$PATH" = "/usr" && test "$$VAR1" = word3 && test "$$VAR2" = "\\$$word 5 6"'
ExecStart=sh -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"
2 changes: 1 addition & 1 deletion test/test-execute/exec-execsearchpath-environment.service
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# SPDX-License-Identifier: LGPL-2.1-or-later
[Service]
ExecStart=/bin/sh -x -c 'test "$$VAR1" = "word1 word2" && test "$$VAR2" = word3 && test "$$VAR3" = "\\$$word 5 6" && test "$$PATH" = "/tmp:/bin"'
ExecStart=sh -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"
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Description=Test for ExecSearchPath with EnvironmentFile where EnvironmentFile sets PATH

[Service]
ExecStart=/bin/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=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'
Type=oneshot
EnvironmentFile=/tmp/test-exec_execsearchpath_environmentfile-set.conf
ExecSearchPath=/tmp:/bin
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Description=Test for ExecSearchPath with EnvironmentFile where EnvironmentFile does not set PATH

[Service]
ExecStart=/bin/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=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"'
Type=oneshot
ExecSearchPath=/tmp:/bin
EnvironmentFile=/tmp/test-exec_execsearchpath_environmentfile.conf
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Description=Test for PassEnvironment with ExecSearchPath with PATH set by user

[Service]
ExecStart=/bin/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=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"'
Type=oneshot
PassEnvironment=VAR1 VAR2 VAR3 VAR4 VAR5 PATH
ExecSearchPath=/tmp:/bin
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Description=Test for PassEnvironment with ExecSearchPath with PATH not set by user

[Service]
ExecStart=/bin/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=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"'
Type=oneshot
PassEnvironment=VAR1 VAR2 VAR3 VAR4 VAR5
ExecSearchPath=/tmp:/bin
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ Description=Test for specifiers with exec search path
[Service]
Type=oneshot
ExecSearchPath=/tmp:/bin:/usr/bin:%V
ExecStart=/bin/sh -x -c 'test %V = /var/tmp && test "$$PATH" = "/tmp:/bin:/usr/bin:/var/tmp"'
ExecStart=sh -x -c 'test %V = /var/tmp && test "$$PATH" = "/tmp:/bin:/usr/bin:/var/tmp"'
2 changes: 1 addition & 1 deletion test/test-execute/exec-group-nfsnobody.service
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
Description=Test for Group

[Service]
ExecStart=/bin/sh -x -c 'test "$$(id -n -g)" = "nfsnobody"'
ExecStart=sh -x -c 'test "$$(id -n -g)" = "nfsnobody"'
Type=oneshot
Group=nfsnobody
2 changes: 1 addition & 1 deletion test/test-execute/exec-group-nobody.service
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
Description=Test for Group

[Service]
ExecStart=/bin/sh -x -c 'test "$$(id -n -g)" = "nobody"'
ExecStart=sh -x -c 'test "$$(id -n -g)" = "nobody"'
Type=oneshot
Group=nobody
2 changes: 1 addition & 1 deletion test/test-execute/exec-group-nogroup.service
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
Description=Test for Group

[Service]
ExecStart=/bin/sh -x -c 'test "$$(id -n -g)" = "nogroup"'
ExecStart=sh -x -c 'test "$$(id -n -g)" = "nogroup"'
Type=oneshot
Group=nogroup
2 changes: 1 addition & 1 deletion test/test-execute/exec-group.service
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
Description=Test for Group (daemon)

[Service]
ExecStart=/bin/sh -x -c 'test "$$(id -n -g)" = "daemon"'
ExecStart=sh -x -c 'test "$$(id -n -g)" = "daemon"'
Type=oneshot
Group=daemon
2 changes: 1 addition & 1 deletion test/test-execute/exec-ignoresigpipe-no.service
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
Description=Test for IgnoreSIGPIPE=no

[Service]
ExecStart=/bin/sh -x -c 'kill -PIPE 0'
ExecStart=sh -x -c 'kill -PIPE 0'
Type=oneshot
IgnoreSIGPIPE=no
Loading

0 comments on commit b4a85f7

Please sign in to comment.