mirror of
https://github.com/systemd/systemd
synced 2024-10-15 04:24:19 +00:00
Merge pull request #13225 from mrc0mmand/networkd-test-replace-adduser-with-useradd
test: use `useradd` instead of `adduser`
This commit is contained in:
commit
cd826afaf3
|
@ -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']:
|
||||
|
@ -419,7 +420,9 @@ DHCP={}
|
|||
subprocess.call(['ip', 'a', 'show', 'dev', self.iface])
|
||||
print('---- networkctl status {} ----'.format(self.iface))
|
||||
sys.stdout.flush()
|
||||
subprocess.call(['networkctl', 'status', self.iface])
|
||||
rc = subprocess.call(['networkctl', 'status', self.iface])
|
||||
if rc != 0:
|
||||
print("'networkctl status' exited with an unexpected code {}".format(rc))
|
||||
self.show_journal('systemd-networkd.service')
|
||||
self.print_server_log()
|
||||
raise
|
||||
|
|
Loading…
Reference in a new issue