From e9786a5c016477c37905e4a5538f753643c672fd Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Fri, 3 Jan 2020 18:27:14 +0100 Subject: [PATCH] test: don't rely on "nobody" user for TEST-43 The name is not as universal as we want, still, hence let's use our own user we create with sysusers.d/. That should yield same behaviour everywhere (and also test sysusers a bit as side effect). --- test/TEST-43-PRIVATEUSER-UNPRIV/test.sh | 17 ++++++----- test/TEST-43-PRIVATEUSER-UNPRIV/testsuite.sh | 30 ++++++++++---------- 2 files changed, 25 insertions(+), 22 deletions(-) diff --git a/test/TEST-43-PRIVATEUSER-UNPRIV/test.sh b/test/TEST-43-PRIVATEUSER-UNPRIV/test.sh index 49d61c6a7f..fe20114756 100755 --- a/test/TEST-43-PRIVATEUSER-UNPRIV/test.sh +++ b/test/TEST-43-PRIVATEUSER-UNPRIV/test.sh @@ -15,20 +15,23 @@ test_setup() { mask_supporting_services - usermod --root $initdir -d /home/nobody -s /bin/bash nobody - mkdir $initdir/home $initdir/home/nobody - # Ubuntu's equivalent is nogroup - chown nobody:nobody $initdir/home/nobody || chown nobody:nogroup $initdir/home/nobody + # Allocate user for running test case under + mkdir -p $initdir/etc/sysusers.d + cat >$initdir/etc/sysusers.d/testuser.conf <$initdir/etc/systemd/system/testsuite.service <