summaryrefslogtreecommitdiff
path: root/smoketest/scripts
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2024-02-16 11:06:27 +0100
committerGitHub <noreply@github.com>2024-02-16 11:06:27 +0100
commitdb8b115301d5476151e7d0910ba674a683683122 (patch)
tree8181127e90e5a8ca6e19a6b1af624acf56482eb4 /smoketest/scripts
parentcefa21ae6425355cf22fbe5123b720c5881d9174 (diff)
parent42e83b8b2cca6ba73c2663629cf92b3b2b225898 (diff)
downloadvyos-1x-db8b115301d5476151e7d0910ba674a683683122.tar.gz
vyos-1x-db8b115301d5476151e7d0910ba674a683683122.zip
Merge pull request #3017 from vyos/mergify/bp/sagitta/pr-3016
T6001: add option to disable next-hop-tracking resolve-via-default (backport #3016)
Diffstat (limited to 'smoketest/scripts')
-rwxr-xr-xsmoketest/scripts/cli/test_system_ip.py15
-rwxr-xr-xsmoketest/scripts/cli/test_system_ipv6.py15
-rwxr-xr-xsmoketest/scripts/cli/test_vrf.py35
3 files changed, 62 insertions, 3 deletions
diff --git a/smoketest/scripts/cli/test_system_ip.py b/smoketest/scripts/cli/test_system_ip.py
index 567416774..ac8b74236 100755
--- a/smoketest/scripts/cli/test_system_ip.py
+++ b/smoketest/scripts/cli/test_system_ip.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python3
#
-# Copyright (C) 2020-2023 VyOS maintainers and contributors
+# Copyright (C) 2020-2024 VyOS maintainers and contributors
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 or later as
@@ -120,5 +120,18 @@ class TestSystemIP(VyOSUnitTestSHIM.TestCase):
# Commit again
self.cli_commit()
+ def test_system_ip_nht(self):
+ self.cli_set(base_path + ['nht', 'no-resolve-via-default'])
+ self.cli_commit()
+ # Verify CLI config applied to FRR
+ frrconfig = self.getFRRconfig('', end='', daemon='zebra')
+ self.assertIn(f'no ip nht resolve-via-default', frrconfig)
+
+ self.cli_delete(base_path + ['nht', 'no-resolve-via-default'])
+ self.cli_commit()
+ # Verify CLI config removed to FRR
+ frrconfig = self.getFRRconfig('', end='', daemon='zebra')
+ self.assertNotIn(f'no ip nht resolve-via-default', frrconfig)
+
if __name__ == '__main__':
unittest.main(verbosity=2)
diff --git a/smoketest/scripts/cli/test_system_ipv6.py b/smoketest/scripts/cli/test_system_ipv6.py
index 225c2d666..bc0f7aa8c 100755
--- a/smoketest/scripts/cli/test_system_ipv6.py
+++ b/smoketest/scripts/cli/test_system_ipv6.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python3
#
-# Copyright (C) 2021-2023 VyOS maintainers and contributors
+# Copyright (C) 2021-2024 VyOS maintainers and contributors
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 or later as
@@ -131,5 +131,18 @@ class TestSystemIPv6(VyOSUnitTestSHIM.TestCase):
# Commit again
self.cli_commit()
+ def test_system_ipv6_nht(self):
+ self.cli_set(base_path + ['nht', 'no-resolve-via-default'])
+ self.cli_commit()
+ # Verify CLI config applied to FRR
+ frrconfig = self.getFRRconfig('', end='', daemon='zebra')
+ self.assertIn(f'no ipv6 nht resolve-via-default', frrconfig)
+
+ self.cli_delete(base_path + ['nht', 'no-resolve-via-default'])
+ self.cli_commit()
+ # Verify CLI config removed to FRR
+ frrconfig = self.getFRRconfig('', end='', daemon='zebra')
+ self.assertNotIn(f'no ipv6 nht resolve-via-default', frrconfig)
+
if __name__ == '__main__':
unittest.main(verbosity=2)
diff --git a/smoketest/scripts/cli/test_vrf.py b/smoketest/scripts/cli/test_vrf.py
index a3090ee41..438387f2d 100755
--- a/smoketest/scripts/cli/test_vrf.py
+++ b/smoketest/scripts/cli/test_vrf.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python3
#
-# Copyright (C) 2020-2023 VyOS maintainers and contributors
+# Copyright (C) 2020-2024 VyOS maintainers and contributors
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 or later as
@@ -495,6 +495,39 @@ class VRFTest(VyOSUnitTestSHIM.TestCase):
frrconfig = self.getFRRconfig(f'vrf {vrf}')
self.assertNotIn('vni', frrconfig)
+ def test_vrf_ip_ipv6_nht(self):
+ table = '6910'
+
+ for vrf in vrfs:
+ base = base_path + ['name', vrf]
+ self.cli_set(base + ['table', table])
+ self.cli_set(base + ['ip', 'nht', 'no-resolve-via-default'])
+ self.cli_set(base + ['ipv6', 'nht', 'no-resolve-via-default'])
+
+ table = str(int(table) + 1)
+
+ self.cli_commit()
+
+ # Verify route-map properly applied to FRR
+ for vrf in vrfs:
+ frrconfig = self.getFRRconfig(f'vrf {vrf}', daemon='zebra')
+ self.assertIn(f'vrf {vrf}', frrconfig)
+ self.assertIn(f' no ip nht resolve-via-default', frrconfig)
+ self.assertIn(f' no ipv6 nht resolve-via-default', frrconfig)
+
+ # Delete route-maps
+ for vrf in vrfs:
+ base = base_path + ['name', vrf]
+ self.cli_delete(base + ['ip'])
+ self.cli_delete(base + ['ipv6'])
+
+ self.cli_commit()
+
+ # Verify route-map properly is removed from FRR
+ for vrf in vrfs:
+ frrconfig = self.getFRRconfig(f'vrf {vrf}', daemon='zebra')
+ self.assertNotIn(f' no ip nht resolve-via-default', frrconfig)
+ self.assertNotIn(f' no ipv6 nht resolve-via-default', frrconfig)
if __name__ == '__main__':
unittest.main(verbosity=2)