tests: compare with correct shell

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
This commit is contained in:
Lennart Poettering 2018-04-19 10:35:36 +02:00
parent 8f63253149
commit 63d6135fea
3 changed files with 3 additions and 2 deletions

View 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) {

View 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)'

View 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)'