]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
tests: compare with correct shell
authorLennart Poettering <lennart@poettering.net>
Thu, 19 Apr 2018 08:35:36 +0000 (10:35 +0200)
committerLennart Poettering <lennart@poettering.net>
Thu, 19 Apr 2018 09:41:28 +0000 (11:41 +0200)
We synthesize the passwd record for UID 0, hence we need to compare with
our synthesized data and not with the data stored in /etc/passwd

src/test/test-execute.c
test/test-execute/exec-specifier.service
test/test-execute/exec-specifier@.service

index 59d996c11b1cbd5159cb78b4e97cf087cac49c56..2b5706822c0fe34f493ccc0d987bc2d6b240a1c7 100644 (file)
@@ -686,6 +686,7 @@ int main(int argc, char *argv[]) {
 
         (void) unsetenv("USER");
         (void) unsetenv("LOGNAME");
+        (void) unsetenv("SHELL");
 
         /* It is needed otherwise cgroup creation fails */
         if (getuid() != 0) {
index 65a64bc95ed4a9bf300902402273cc620e9d4d3c..727d77f61245099f9b6288c638f82cd6603461e1 100644 (file)
@@ -17,7 +17,7 @@ ExecStart=test %L = /var/log
 ExecStart=sh -c 'test %u = $$(id -un 0)'
 ExecStart=test %U = 0
 ExecStart=sh -c 'test %h = $$(getent passwd 0 | cut -d: -f 6)'
-ExecStart=sh -c 'test %s = $$(getent passwd 0 | cut -d: -f 7)'
+ExecStart=sh -c 'test %s = /bin/sh'
 ExecStart=sh -c 'test %m = $$(cat /etc/machine-id)'
 ExecStart=sh -c 'test %b = $$(cat /proc/sys/kernel/random/boot_id | sed -e 's/-//g')'
 ExecStart=sh -c 'test %H = $$(hostname)'
index f8d7dce680a9386f46f9a9bf0811f20c8ff74de1..1b69e60843d0a4a26e34c0b5a668a05b8cc631a4 100644 (file)
@@ -17,7 +17,7 @@ ExecStart=test %L = /var/log
 ExecStart=sh -c 'test %u = $$(id -un 0)'
 ExecStart=test %U = 0
 ExecStart=sh -c 'test %h = $$(getent passwd 0 | cut -d: -f 6)'
-ExecStart=sh -c 'test %s = $$(getent passwd 0 | cut -d: -f 7)'
+ExecStart=sh -c 'test %s = /bin/sh'
 ExecStart=sh -c 'test %m = $$(cat /etc/machine-id)'
 ExecStart=sh -c 'test %b = $$(cat /proc/sys/kernel/random/boot_id | sed -e 's/-//g')'
 ExecStart=sh -c 'test %H = $$(hostname)'