summaryrefslogtreecommitdiff
path: root/smoketest/scripts/cli
diff options
context:
space:
mode:
authorViacheslav Hletenko <v.gletenko@vyos.io>2022-04-14 13:52:01 +0000
committerChristian Poessinger <christian@poessinger.com>2022-05-06 21:32:41 +0200
commitd903c9b43225bc8606c72701b319cef9e39c3eb4 (patch)
tree7383ddd55eee3b5850c1acbd4f59e041c820bf15 /smoketest/scripts/cli
parent51d3c6b114262c50ca9e96bb9197bcff26ce3d9c (diff)
downloadvyos-1x-d903c9b43225bc8606c72701b319cef9e39c3eb4.tar.gz
vyos-1x-d903c9b43225bc8606c72701b319cef9e39c3eb4.zip
smoketest: T4354: Add test for uniq bonding members
Extend bonding smoketest Add descriptions to bonding members We encountered a situation where adding any configuration for member of bonding interface excludes the interface from bonding (cherry picked from commit ae815d1b11a4c17df6aea45e3fc87772a0e40e6a)
Diffstat (limited to 'smoketest/scripts/cli')
-rwxr-xr-xsmoketest/scripts/cli/test_interfaces_bonding.py22
1 files changed, 22 insertions, 0 deletions
diff --git a/smoketest/scripts/cli/test_interfaces_bonding.py b/smoketest/scripts/cli/test_interfaces_bonding.py
index 4f2fe979a..9bb561275 100755
--- a/smoketest/scripts/cli/test_interfaces_bonding.py
+++ b/smoketest/scripts/cli/test_interfaces_bonding.py
@@ -165,5 +165,27 @@ class BondingInterfaceTest(BasicInterfaceTest.TestCase):
self.cli_commit()
+ def test_bonding_uniq_member_description(self):
+ ethernet_path = ['interfaces', 'ethernet']
+ for interface in self._interfaces:
+ for option in self._options.get(interface, []):
+ self.cli_set(self._base_path + [interface] + option.split())
+
+ self.cli_commit()
+
+ # Add any changes on bonding members
+ # For example add description on separate ethX interfaces
+ for interface in self._interfaces:
+ for member in self._members:
+ self.cli_set(ethernet_path + [member, 'description', member + '_interface'])
+
+ self.cli_commit()
+
+ # verify config
+ for interface in self._interfaces:
+ slaves = read_file(f'/sys/class/net/{interface}/bonding/slaves').split()
+ for member in self._members:
+ self.assertIn(member, slaves)
+
if __name__ == '__main__':
unittest.main(verbosity=2)