diff options
author | Michael Biebl <biebl@debian.org> | 2020-08-28 17:21:27 +0200 |
---|---|---|
committer | Michael Biebl <biebl@debian.org> | 2020-08-28 21:03:09 +0200 |
commit | 3aa645f0c0bb7697ef397ffef4647ff105d98fda (patch) | |
tree | e71e95363509c847ff48f59aeba95a510cede3cc /test/networkd-test.py | |
parent | 2c0dffe82db574b6b9e850e48f444674e4e1d7ea (diff) | |
download | systemd-3aa645f0c0bb7697ef397ffef4647ff105d98fda.tar.gz |
test-network: stop networkd and its socket
With the changes from 2c0dffe82db574b6b9e850e48f444674e4e1d7ea, starting
systemd-networkd.service will also activate systemd-networkd.socket.
When tearing down a test, we need to stop the socket as well, to make
sure networkd can't be activated accidentally with the wrong
configuration.
Diffstat (limited to 'test/networkd-test.py')
-rwxr-xr-x | test/networkd-test.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/test/networkd-test.py b/test/networkd-test.py index 140561d25d..4116995f8c 100755 --- a/test/networkd-test.py +++ b/test/networkd-test.py @@ -223,7 +223,8 @@ Gateway=192.168.250.1''') subprocess.check_call(['systemctl', 'start', 'systemd-networkd']) def tearDown(self): - subprocess.check_call(['systemctl', 'stop', 'systemd-networkd']) + subprocess.check_call(['systemctl', 'stop', 'systemd-networkd.socket']) + subprocess.check_call(['systemctl', 'stop', 'systemd-networkd.service']) subprocess.check_call(['ip', 'link', 'del', 'mybridge']) subprocess.check_call(['ip', 'link', 'del', 'port1']) subprocess.check_call(['ip', 'link', 'del', 'port2']) @@ -309,7 +310,8 @@ class ClientTestBase(NetworkdTestingUtilities): def tearDown(self): self.shutdown_iface() - subprocess.call(['systemctl', 'stop', 'systemd-networkd']) + subprocess.call(['systemctl', 'stop', 'systemd-networkd.socket']) + subprocess.call(['systemctl', 'stop', 'systemd-networkd.service']) subprocess.call(['ip', 'link', 'del', 'dummy0'], stderr=subprocess.DEVNULL) @@ -987,7 +989,8 @@ class MatchClientTest(unittest.TestCase, NetworkdTestingUtilities): def tearDown(self): """Stop networkd.""" - subprocess.call(['systemctl', 'stop', 'systemd-networkd']) + subprocess.call(['systemctl', 'stop', 'systemd-networkd.socket']) + subprocess.call(['systemctl', 'stop', 'systemd-networkd.service']) def test_basic_matching(self): """Verify the Name= line works throughout this class.""" @@ -1037,7 +1040,8 @@ class UnmanagedClientTest(unittest.TestCase, NetworkdTestingUtilities): def tearDown(self): """Stop networkd.""" - subprocess.call(['systemctl', 'stop', 'systemd-networkd']) + subprocess.call(['systemctl', 'stop', 'systemd-networkd.socket']) + subprocess.call(['systemctl', 'stop', 'systemd-networkd.service']) def create_iface(self): """Create temporary veth pairs for interface matching.""" |