test-network: do not directly compare two results of "ip address"
As it contains lifetime of the address.
This commit is contained in:
parent
e16ffe7954
commit
d90f4f7d91
|
@ -2282,16 +2282,19 @@ class NetworkdDHCPClientTests(unittest.TestCase, Utilities):
|
||||||
self.assertRegex(output, 'vrf table 42')
|
self.assertRegex(output, 'vrf table 42')
|
||||||
|
|
||||||
print('## ip address show vrf vrf99')
|
print('## ip address show vrf vrf99')
|
||||||
output_ip_vrf = subprocess.check_output(['ip', 'address', 'show', 'vrf', 'vrf99'], universal_newlines=True).rstrip()
|
output = subprocess.check_output(['ip', 'address', 'show', 'vrf', 'vrf99'], universal_newlines=True).rstrip()
|
||||||
print(output_ip_vrf)
|
print(output)
|
||||||
|
self.assertRegex(output, 'inet 169.254.[0-9]*.[0-9]*/16 brd 169.254.255.255 scope link veth99')
|
||||||
|
self.assertRegex(output, 'inet 192.168.5.[0-9]*/24 brd 192.168.5.255 scope global dynamic veth99')
|
||||||
|
self.assertRegex(output, 'inet6 2600::[0-9a-f]*/128 scope global (?:dynamic noprefixroute|noprefixroute dynamic)')
|
||||||
|
self.assertRegex(output, 'inet6 .* scope link')
|
||||||
|
|
||||||
print('## ip address show dev veth99')
|
print('## ip address show dev veth99')
|
||||||
output = subprocess.check_output(['ip', 'address', 'show', 'dev', 'veth99'], universal_newlines=True).rstrip()
|
output = subprocess.check_output(['ip', 'address', 'show', 'dev', 'veth99'], universal_newlines=True).rstrip()
|
||||||
print(output)
|
print(output)
|
||||||
self.assertEqual(output, output_ip_vrf)
|
|
||||||
self.assertRegex(output, 'inet 169.254.[0-9]*.[0-9]*/16 brd 169.254.255.255 scope link veth99')
|
self.assertRegex(output, 'inet 169.254.[0-9]*.[0-9]*/16 brd 169.254.255.255 scope link veth99')
|
||||||
self.assertRegex(output, 'inet 192.168.5.[0-9]*/24 brd 192.168.5.255 scope global dynamic veth99')
|
self.assertRegex(output, 'inet 192.168.5.[0-9]*/24 brd 192.168.5.255 scope global dynamic veth99')
|
||||||
self.assertRegex(output, 'inet6 2600::[0-9a-f]*/128 scope global dynamic noprefixroute')
|
self.assertRegex(output, 'inet6 2600::[0-9a-f]*/128 scope global (?:dynamic noprefixroute|noprefixroute dynamic)')
|
||||||
self.assertRegex(output, 'inet6 .* scope link')
|
self.assertRegex(output, 'inet6 .* scope link')
|
||||||
|
|
||||||
print('## ip route show vrf vrf99')
|
print('## ip route show vrf vrf99')
|
||||||
|
|
Loading…
Reference in a new issue