diff options
author | Nataliia Solomko <natalirs1985@gmail.com> | 2024-03-13 19:09:21 +0200 |
---|---|---|
committer | Nataliia Solomko <natalirs1985@gmail.com> | 2024-03-13 19:09:21 +0200 |
commit | d632ce658cbe6557b17cffd3c0b17545ee3181c2 (patch) | |
tree | eda8e14158503fea24d1a9f7d94b67f6d41b4636 /smoketest | |
parent | 423a25a814ca92870399dab1c5e107732a16292d (diff) | |
download | vyos-1x-d632ce658cbe6557b17cffd3c0b17545ee3181c2.tar.gz vyos-1x-d632ce658cbe6557b17cffd3c0b17545ee3181c2.zip |
vrrp: T5504: Keepalived VRRP ability to set more than one peer-address
Diffstat (limited to 'smoketest')
-rwxr-xr-x | smoketest/scripts/cli/test_ha_vrrp.py | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/smoketest/scripts/cli/test_ha_vrrp.py b/smoketest/scripts/cli/test_ha_vrrp.py index 8af1a314c..6ab61206c 100755 --- a/smoketest/scripts/cli/test_ha_vrrp.py +++ b/smoketest/scripts/cli/test_ha_vrrp.py @@ -237,6 +237,33 @@ 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 + ['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 + ['virtual-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) |