summaryrefslogtreecommitdiff
path: root/smoketest/scripts
diff options
context:
space:
mode:
authorNataliia Solomko <natalirs1985@gmail.com>2024-02-29 10:30:41 +0200
committerMergify <37929162+mergify[bot]@users.noreply.github.com>2024-02-29 10:49:46 +0000
commit195428e467c24e4bac59ea639891b0ada898bd30 (patch)
treef3fb3c800023f895eb09c60c0b19af320ebdd7c8 /smoketest/scripts
parent39a90834bad17b10e9ad5321554e6e1ceb4c9c26 (diff)
downloadvyos-1x-195428e467c24e4bac59ea639891b0ada898bd30.tar.gz
vyos-1x-195428e467c24e4bac59ea639891b0ada898bd30.zip
T5504: Added smoketest for multiple peer addresses
(cherry picked from commit 36883ebf0f820003ec86e14e7612ce113630def2)
Diffstat (limited to 'smoketest/scripts')
-rwxr-xr-xsmoketest/scripts/cli/test_high-availability_vrrp.py27
1 files changed, 27 insertions, 0 deletions
diff --git a/smoketest/scripts/cli/test_high-availability_vrrp.py b/smoketest/scripts/cli/test_high-availability_vrrp.py
index 98259d830..1bb35e422 100755
--- a/smoketest/scripts/cli/test_high-availability_vrrp.py
+++ b/smoketest/scripts/cli/test_high-availability_vrrp.py
@@ -237,5 +237,32 @@ class TestVRRP(VyOSUnitTestSHIM.TestCase):
self.assertIn(f'track_interface', config)
self.assertIn(f' {none_vrrp_interface}', config)
+ def test_05_set_multiple_peer_address(self):
+ group = 'VyOS-WAN'
+ vlan_id = '24'
+ vip = '100.64.24.1/24'
+ peer_address_1 = '192.0.2.1'
+ peer_address_2 = '192.0.2.2'
+ vrid = '150'
+ group_base = base_path + ['vrrp', 'group', group]
+
+ self.cli_set(['interfaces', 'ethernet', vrrp_interface, 'vif', vlan_id, 'address', '100.64.24.11/24'])
+ self.cli_set(group_base + ['interface', vrrp_interface])
+ self.cli_set(group_base + ['address', vip])
+ self.cli_set(group_base + ['peer-address', peer_address_1])
+ self.cli_set(group_base + ['peer-address', peer_address_2])
+ self.cli_set(group_base + ['vrid', vrid])
+
+ # commit changes
+ self.cli_commit()
+
+ config = getConfig(f'vrrp_instance {group}')
+
+ self.assertIn(f'interface {vrrp_interface}', config)
+ self.assertIn(f'virtual_router_id {vrid}', config)
+ self.assertIn(f'unicast_peer', config)
+ self.assertIn(f' {peer_address_1}', config)
+ self.assertIn(f' {peer_address_2}', config)
+
if __name__ == '__main__':
unittest.main(verbosity=2)