summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrantisek Sumsal <frantisek@sumsal.cz>2019-07-30 14:27:44 +0200
committerFrantisek Sumsal <frantisek@sumsal.cz>2019-07-30 20:26:25 +0200
commit2de705cd1c7089e106be75ea094b996dd9e1f856 (patch)
treefb100e91a563d100e43f38f85f944406af5e53f8
parent4c858c6fd5d588b30d9851bb576520e74b041739 (diff)
downloadsystemd-2de705cd1c7089e106be75ea094b996dd9e1f856.tar.gz
systemd-2de705cd1c7089e106be75ea094b996dd9e1f856.tar.bz2
systemd-2de705cd1c7089e106be75ea094b996dd9e1f856.zip
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.
-rwxr-xr-xtest/networkd-test.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/test/networkd-test.py b/test/networkd-test.py
index 8b1aeeda35..c971570346 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']: