summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2019-06-12 11:01:32 +0900
committerYu Watanabe <watanabe.yu+github@gmail.com>2019-06-12 11:04:10 +0900
commit4933b97d595e96408796ea5630666f4d22512eaf (patch)
tree3a7487440daffc3ac981e303e1185fc8ce200269 /test
parentb0ab85a2e4b9fe631f407c59617e89d4627ab7f7 (diff)
downloadsystemd-4933b97d595e96408796ea5630666f4d22512eaf.tar.gz
test-network: add more test cases when ipv6 is disabled
Diffstat (limited to 'test')
-rw-r--r--test/test-network/conf/25-sysctl-disable-ipv6.network12
-rwxr-xr-xtest/test-network/systemd-networkd-tests.py15
2 files changed, 25 insertions, 2 deletions
diff --git a/test/test-network/conf/25-sysctl-disable-ipv6.network b/test/test-network/conf/25-sysctl-disable-ipv6.network
index e52078e0d4..c4c5fbc129 100644
--- a/test/test-network/conf/25-sysctl-disable-ipv6.network
+++ b/test/test-network/conf/25-sysctl-disable-ipv6.network
@@ -4,3 +4,15 @@ Name=dummy98
[Network]
IPv6AcceptRA=no
Address=10.2.3.4/16
+
+# This should be ignored when ipv6 is disabled
+Gateway=2607:5300:0203:39ff:ff:ff:ff:ff
+
+[Address]
+# This should be ignored when ipv6 is disabled
+Address=2607:5300:0203:3906::/64
+
+[Route]
+# This should be ignored when ipv6 is disabled
+Destination=2607:5300:0203:39ff:ff:ff:ff:ff
+Scope=link
diff --git a/test/test-network/systemd-networkd-tests.py b/test/test-network/systemd-networkd-tests.py
index ddb2465e1d..f22fdbe5af 100755
--- a/test/test-network/systemd-networkd-tests.py
+++ b/test/test-network/systemd-networkd-tests.py
@@ -1579,7 +1579,12 @@ class NetworkdNetworkTests(unittest.TestCase, Utilities):
output = check_output('ip -6 address show dummy98')
print(output)
self.assertEqual(output, '')
- self.check_operstate('dummy98', 'routable')
+ output = check_output('ip -4 route show dev dummy98')
+ print(output)
+ self.assertEqual(output, '10.2.0.0/16 proto kernel scope link src 10.2.3.4')
+ output = check_output('ip -6 route show dev dummy98')
+ print(output)
+ self.assertEqual(output, '')
check_output('ip link del dummy98')
@@ -1595,8 +1600,14 @@ class NetworkdNetworkTests(unittest.TestCase, Utilities):
self.assertRegex(output, 'inet 10.2.3.4/16 brd 10.2.255.255 scope global dummy98')
output = check_output('ip -6 address show dummy98')
print(output)
+ self.assertRegex(output, 'inet6 2607:5300:203:3906::/64 scope global')
self.assertRegex(output, 'inet6 .* scope link')
- self.check_operstate('dummy98', 'routable')
+ output = check_output('ip -4 route show dev dummy98')
+ print(output)
+ self.assertEqual(output, '10.2.0.0/16 proto kernel scope link src 10.2.3.4')
+ output = check_output('ip -6 route show dev dummy98')
+ print(output)
+ self.assertRegex(output, 'default via 2607:5300:203:39ff:ff:ff:ff:ff proto static')
def test_bind_carrier(self):
copy_unit_to_networkd_unit_path('25-bind-carrier.network', '11-dummy.netdev')