From: Yu Watanabe Date: Wed, 8 Nov 2023 16:31:17 +0000 (+0900) Subject: test-network: verify json format about DHCPv6 client status X-Git-Tag: v255-rc2~61^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F29937%2Fhead;p=thirdparty%2Fsystemd.git test-network: verify json format about DHCPv6 client status --- diff --git a/test/test-network/systemd-networkd-tests.py b/test/test-network/systemd-networkd-tests.py index fd2906ef6b9..c77a0e0eb2d 100755 --- a/test/test-network/systemd-networkd-tests.py +++ b/test/test-network/systemd-networkd-tests.py @@ -5177,6 +5177,10 @@ class NetworkdDHCPClientTests(unittest.TestCase, Utilities): self.assertNotIn('DHCPREQUEST(veth-peer)', output) self.assertNotIn('DHCPREPLY(veth-peer)', output) + # Check json format + output = check_output(*networkctl_cmd, '--json=short', 'status', 'veth99', env=env) + check_json(output) + # solicit mode stop_dnsmasq() start_dnsmasq('--dhcp-option=108,00:00:02:00', @@ -5228,6 +5232,11 @@ class NetworkdDHCPClientTests(unittest.TestCase, Utilities): self.assertIn('DHCPREPLY(veth-peer)', output) self.assertIn('sent size: 0 option: 14 rapid-commit', output) + # Check json format + output = check_output(*networkctl_cmd, '--json=short', 'status', 'veth99', env=env) + check_json(output) + + # Testing without rapid commit support with open(os.path.join(network_unit_dir, '25-dhcp-client-ipv6-only.network'), mode='a', encoding='utf-8') as f: f.write('\n[DHCPv6]\nRapidCommit=no\n') @@ -5277,6 +5286,10 @@ class NetworkdDHCPClientTests(unittest.TestCase, Utilities): self.assertIn('DHCPREPLY(veth-peer)', output) self.assertNotIn('rapid-commit', output) + # Check json format + output = check_output(*networkctl_cmd, '--json=short', 'status', 'veth99', env=env) + check_json(output) + def test_dhcp_client_ipv6_dbus_status(self): copy_network_unit('25-veth.netdev', '25-dhcp-server-veth-peer.network', '25-dhcp-client-ipv6-only.network') start_networkd()