diff options
author | Christian Poessinger <christian@poessinger.com> | 2022-01-09 21:44:44 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-09 21:44:44 +0100 |
commit | dfb2b58e00ea0cafadeb5f63e9f82b4d61580ead (patch) | |
tree | a5bd6bf19c6c0de5f261f0144d54d3c451fc479d /smoketest/scripts | |
parent | 897510fe6fdf85ce23699a7aace187433367c2b4 (diff) | |
parent | 66d59d9e393c435fa82717d0d918955bae59ba43 (diff) | |
download | vyos-1x-dfb2b58e00ea0cafadeb5f63e9f82b4d61580ead.tar.gz vyos-1x-dfb2b58e00ea0cafadeb5f63e9f82b4d61580ead.zip |
Merge pull request #1143 from sever-sever/T1972
vrrp: T1972: Ability to set IP address on not vrrp interface
Diffstat (limited to 'smoketest/scripts')
-rwxr-xr-x | smoketest/scripts/cli/test_ha_vrrp.py | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/smoketest/scripts/cli/test_ha_vrrp.py b/smoketest/scripts/cli/test_ha_vrrp.py index a37ce7e64..68905e447 100755 --- a/smoketest/scripts/cli/test_ha_vrrp.py +++ b/smoketest/scripts/cli/test_ha_vrrp.py @@ -166,5 +166,35 @@ class TestVRRP(VyOSUnitTestSHIM.TestCase): for group in groups: self.assertIn(f'{group}', config) + def test_04_exclude_vrrp_interface(self): + group = 'VyOS-WAN' + none_vrrp_interface = 'eth2' + vlan_id = '24' + vip = '100.64.24.1/24' + vip_dev = '192.0.2.2/24' + 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', f'{vrrp_interface}.{vlan_id}']) + self.cli_set(group_base + ['address', vip]) + self.cli_set(group_base + ['address', vip_dev, 'interface', none_vrrp_interface]) + self.cli_set(group_base + ['track', 'exclude-vrrp-interface']) + self.cli_set(group_base + ['track', 'interface', none_vrrp_interface]) + self.cli_set(group_base + ['vrid', vrid]) + + # commit changes + self.cli_commit() + + config = getConfig(f'vrrp_instance {group}') + + self.assertIn(f'interface {vrrp_interface}.{vlan_id}', config) + self.assertIn(f'virtual_router_id {vrid}', config) + self.assertIn(f'dont_track_primary', config) + self.assertIn(f' {vip}', config) + self.assertIn(f' {vip_dev} dev {none_vrrp_interface}', config) + self.assertIn(f'track_interface', config) + self.assertIn(f' {none_vrrp_interface}', config) + if __name__ == '__main__': unittest.main(verbosity=2) |