From: Frantisek Sumsal Date: Tue, 30 Jul 2019 12:27:44 +0000 (+0200) Subject: test: use `useradd` instead of `adduser` X-Git-Tag: v243-rc2~71^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2de705cd1c7089e106be75ea094b996dd9e1f856;p=thirdparty%2Fsystemd.git test: use `useradd` instead of `adduser` `adduser` is in certain cases a standalone package which provides a better user experience. In other cases it's just a symlink to `useradd`. And some distributions don't have `adduser` at all, like Arch Linux. Let's use the `useradd` binary instead, which should provide the same functionality everywhere. --- diff --git a/test/networkd-test.py b/test/networkd-test.py index 8b1aeeda35b..c971570346c 100755 --- a/test/networkd-test.py +++ b/test/networkd-test.py @@ -66,7 +66,8 @@ def setUpModule(): # create static systemd-network user for networkd-test-router.service (it # needs to do some stuff as root and can't start as user; but networkd # still insists on the user) - subprocess.call(['adduser', '--system', '--no-create-home', 'systemd-network']) + if subprocess.call(['getent', 'passwd', 'systemd-network']) != 0: + subprocess.call(['useradd', '--system', '--no-create-home', 'systemd-network']) for d in ['/etc/systemd/network', '/run/systemd/network', '/run/systemd/netif', '/run/systemd/resolve']: