test-network: verify json format about DHCPv6 client status
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user