bonding lacp: replace slave string with member

- Replace textual string slave with member except APIs.
- For APIs, mark the existing APIs as deprecated and introduce new APIs
- While introducing sw_bond_interface_dump, add the optional filter by
  sw_if_index and enhance the testcases to make use of it.

Type: improvement

Signed-off-by: Steven Luong <sluong@cisco.com>
Change-Id: Ib6626c514e45350308aeeda0decb70f3aba2f63e
diff --git a/test/test_bond.py b/test/test_bond.py
index dd4a645..911b1fb 100644
--- a/test/test_bond.py
+++ b/test/test_bond.py
@@ -51,11 +51,11 @@
         #
         # RX->              TX->
         #
-        # pg2 ------+        +------pg0 (slave)
+        # pg2 ------+        +------pg0 (member)
         #           |        |
         #          BondEthernet0 (10.10.10.1)
         #           |        |
-        # pg3 ------+        +------pg1 (slave)
+        # pg3 ------+        +------pg1 (memberx)
         #
 
         # create interface (BondEthernet0)
@@ -83,14 +83,14 @@
         self.logger.info(self.vapi.cli("show interface address"))
         self.logger.info(self.vapi.cli("show ip neighbors"))
 
-        # enslave pg0 and pg1 to BondEthernet0
-        self.logger.info("bond enslave interface pg0 to BondEthernet0")
-        bond0.enslave_vpp_bond_interface(sw_if_index=self.pg0.sw_if_index)
-        self.logger.info("bond enslave interface pg1 to BondEthernet0")
-        bond0.enslave_vpp_bond_interface(sw_if_index=self.pg1.sw_if_index)
+        # add member pg0 and pg1 to BondEthernet0
+        self.logger.info("bond add member interface pg0 to BondEthernet0")
+        bond0.add_member_vpp_bond_interface(sw_if_index=self.pg0.sw_if_index)
+        self.logger.info("bond add_member interface pg1 to BondEthernet0")
+        bond0.add_member_vpp_bond_interface(sw_if_index=self.pg1.sw_if_index)
 
-        # verify both slaves in BondEthernet0
-        if_dump = self.vapi.sw_interface_slave_dump(bond0.sw_if_index)
+        # verify both members in BondEthernet0
+        if_dump = self.vapi.sw_member_interface_dump(bond0.sw_if_index)
         self.assertTrue(self.pg0.is_interface_config_in_dump(if_dump))
         self.assertTrue(self.pg1.is_interface_config_in_dump(if_dump))
 
@@ -163,8 +163,8 @@
 
         bond0.remove_vpp_config()
 
-    def test_bond_enslave(self):
-        """ Bond enslave/detach slave test """
+    def test_bond_add_member(self):
+        """ Bond add_member/detach member test """
 
         # create interface (BondEthernet0) and set bond mode to LACP
         self.logger.info("create bond")
@@ -172,25 +172,27 @@
         bond0.add_vpp_config()
         bond0.admin_up()
 
-        # verify that interfaces can be enslaved and detached two times
+        # verify that interfaces can be added as_member and detached two times
         for i in range(2):
             # verify pg0 and pg1 not in BondEthernet0
-            if_dump = self.vapi.sw_interface_slave_dump(bond0.sw_if_index)
+            if_dump = self.vapi.sw_member_interface_dump(bond0.sw_if_index)
             self.assertFalse(self.pg0.is_interface_config_in_dump(if_dump))
             self.assertFalse(self.pg1.is_interface_config_in_dump(if_dump))
 
-            # enslave pg0 and pg1 to BondEthernet0
-            self.logger.info("bond enslave interface pg0 to BondEthernet0")
-            bond0.enslave_vpp_bond_interface(sw_if_index=self.pg0.sw_if_index,
-                                             is_passive=0,
-                                             is_long_timeout=0)
+            # add_member pg0 and pg1 to BondEthernet0
+            self.logger.info("bond add_member interface pg0 to BondEthernet0")
+            bond0.add_member_vpp_bond_interface(
+                sw_if_index=self.pg0.sw_if_index,
+                is_passive=0,
+                is_long_timeout=0)
 
-            self.logger.info("bond enslave interface pg1 to BondEthernet0")
-            bond0.enslave_vpp_bond_interface(sw_if_index=self.pg1.sw_if_index,
-                                             is_passive=0,
-                                             is_long_timeout=0)
-            # verify both slaves in BondEthernet0
-            if_dump = self.vapi.sw_interface_slave_dump(bond0.sw_if_index)
+            self.logger.info("bond add_member interface pg1 to BondEthernet0")
+            bond0.add_member_vpp_bond_interface(
+                sw_if_index=self.pg1.sw_if_index,
+                is_passive=0,
+                is_long_timeout=0)
+            # verify both members in BondEthernet0
+            if_dump = self.vapi.sw_member_interface_dump(bond0.sw_if_index)
             self.assertTrue(self.pg0.is_interface_config_in_dump(if_dump))
             self.assertTrue(self.pg1.is_interface_config_in_dump(if_dump))
 
@@ -199,7 +201,7 @@
             bond0.detach_vpp_bond_interface(sw_if_index=self.pg0.sw_if_index)
 
             # verify pg0 is not in BondEthernet0, but pg1 is
-            if_dump = self.vapi.sw_interface_slave_dump(bond0.sw_if_index)
+            if_dump = self.vapi.sw_member_interface_dump(bond0.sw_if_index)
             self.assertFalse(self.pg0.is_interface_config_in_dump(if_dump))
             self.assertTrue(self.pg1.is_interface_config_in_dump(if_dump))
 
@@ -208,7 +210,7 @@
             bond0.detach_vpp_bond_interface(sw_if_index=self.pg1.sw_if_index)
 
             # verify pg0 and pg1 not in BondEthernet0
-            if_dump = self.vapi.sw_interface_slave_dump(bond0.sw_if_index)
+            if_dump = self.vapi.sw_member_interface_dump(bond0.sw_if_index)
             self.assertFalse(self.pg0.is_interface_config_in_dump(if_dump))
             self.assertFalse(self.pg1.is_interface_config_in_dump(if_dump))
 
@@ -234,7 +236,7 @@
         self.assertIn('BondEthernet1', ifs)
 
         # verify they are in the dump also
-        if_dump = self.vapi.sw_interface_bond_dump()
+        if_dump = self.vapi.sw_bond_interface_dump(sw_if_index=0xFFFFFFFF)
         self.assertTrue(bond0.is_interface_config_in_dump(if_dump))
         self.assertTrue(bond1.is_interface_config_in_dump(if_dump))
 
@@ -252,7 +254,7 @@
         self.assertNotIn('BondEthernet1', ifs)
 
         # verify BondEthernet1 is not in the dump
-        if_dump = self.vapi.sw_interface_bond_dump()
+        if_dump = self.vapi.sw_bond_interface_dump(sw_if_index=0xFFFFFFFF)
         self.assertFalse(bond1.is_interface_config_in_dump(if_dump))
 
         # verify BondEthernet0 is still in the dump
@@ -269,7 +271,8 @@
         self.assertNotIn('BondEthernet0', ifs)
 
         # verify BondEthernet0 is not in the dump
-        if_dump = self.vapi.sw_interface_bond_dump()
+        if_dump = self.vapi.sw_bond_interface_dump(
+            sw_if_index=bond0.sw_if_index)
         self.assertFalse(bond0.is_interface_config_in_dump(if_dump))