Beispiel #1
0
 def initBridge(self):
     """
     creates bridge entity
     :return:
     """
     funcname = GetFunctionName(self.initBridge)
     self._bridge = BridgeConfig(SwitchDevDutInterface("br0"))
     if 'route_between_vlans' in self._testClassref.testName:
         self._bridge1 = BridgeConfig(SwitchDevDutInterface("br1"))
     #init ports
     for i in range(1,
                    len(list(self._testClassref.TGDutLinks.values())) + 1):
         self._port_list.append(
             L1PortConfig(
                 SwitchDevDutPort(
                     self._testClassref.TGDutLinks[i].DutDevPort.name)))
     self._port_list_SwitchDevDutInterface.extend(
         [x.switchdevInterface for x in self._port_list])
     ret = self._bridge.createL2Entity()
     if 'route_between_vlans' in self._testClassref.testName:
         self._bridge1 = BridgeConfig(SwitchDevDutInterface("br1"))
         ret = self._bridge1.createL2Entity()
     if ret:
         self.FailTheTest(
             f"{funcname} {ret} Could not initiate bridge {self._bridge.switchdevInterface.name}"
         )
     self.Add_Cleanup_Function_To_Stack(self._bridge.deleteEntity)
     if 'route_between_vlans' in self._testClassref.testName:
         self.Add_Cleanup_Function_To_Stack(self._bridge1.deleteEntity)
Beispiel #2
0
 def __init__(self, switchDevInterface, otherDutChannel=False):
     """
     :param switchDevInterface: the entity to be configured (e.g, bond, port, bridge)
     :param otherDutChannel: True if there is another DUT; False otherwise
     """
     super(VrrpConfig,
           self).__init__(SwitchDevDutInterface(switchDevInterface),
                          "macvlan", otherDutChannel)
Beispiel #3
0
 def _getListByInstance(self, interfacesList):
     interfacesList = list(interfacesList)
     if isinstance(interfacesList[0], GeneralEntityConfig):
         return [port.switchdevInterface for port in interfacesList]
     elif isinstance(interfacesList[0], SwitchDevDutInterface):
         return interfacesList
     elif isinstance(interfacesList[0], BaseTest._TG2DutPortLink):
         return [port.DutDevPort for port in interfacesList]
     elif isinstance(interfacesList[0], str):
         return [SwitchDevDutInterface(port) for port in interfacesList]
Beispiel #4
0
 def __init__(self,
              switchDevInterface=SwitchDevDutInterface('br0'),
              otherDutChannel=False,
              executer=True):
     super(Bridge1QConfig, self).__init__(switchDevInterface,
                                          otherDutChannel, executer)
Beispiel #5
0
 def __init__(self, testClass):
     super(RoutedAclAPI, self).__init__(testClass)
     self._bridge = Bridge1QConfig(SwitchDevDutInterface('br0'))
Beispiel #6
0
 def TestProcedure(self):
     global br0, br1, br2
     br0 = RapidSpanningTreeConfig(SwitchDevDutInterface('br0'))
     br1 = RapidSpanningTreeConfig(SwitchDevDutInterface('br1'))
     br2 = RapidSpanningTreeConfig(SwitchDevDutInterface('br2'))
     super(RstpSelectingTheRootBridgeUsingBridgePrioFlow, self).TestProcedure()