示例#1
0
    def testFlowSnapshotMatch(self):
        cls = self.__class__
        assert_bridge_snapshot_match(self, self.UPLINK_BRIDGE, self.service_manager,
                                     include_stats=False)
        self.assertEqual(get_ovsdb_port_tag(cls.UPLINK_BRIDGE), cls.VLAN_TAG)

        self.assertIn(cls.SGi_IP, get_iface_ipv4(cls.UPLINK_BRIDGE), "ip not found")
示例#2
0
 def testFlowSnapshotMatch(self):
     cls = self.__class__
     assert_bridge_snapshot_match(self,
                                  self.UPLINK_BRIDGE,
                                  self.service_manager,
                                  include_stats=False)
     self.assertEqual(get_ovsdb_port_tag(cls.UPLINK_BRIDGE), '[]')
示例#3
0
 def testFlowSnapshotMatch(self):
     cls = self.__class__
     assert_bridge_snapshot_match(self, self.UPLINK_BRIDGE, self.service_manager,
                                  include_stats=False)
     self.assertEqual(get_ovsdb_port_tag(cls.UPLINK_BRIDGE), '[]')
     # after Non NAT init, router shld be accessible.
     # manually start DHCP client on up-br
     check_connectivity(cls.ROUTER_IP, cls.UPLINK_BRIDGE)
示例#4
0
    def setUpClass(cls):
        """
        Starts the thread which launches ryu apps

        Create a testing bridge, add a port, setup the port interfaces. Then
        launch the ryu apps for testing pipelined. Gets the references
        to apps launched by using futures.
        """
        super(UplinkBridgeWithNonNATTest_IP_VLAN_GW, cls).setUpClass()
        warnings.simplefilter('ignore')
        cls.service_manager = create_service_manager([])

        uplink_bridge_controller_reference = Future()
        testing_controller_reference = Future()
        test_setup = TestSetup(
            apps=[
                PipelinedController.UplinkBridge,
                PipelinedController.Testing,
                PipelinedController.StartupFlows,
            ],
            references={
                PipelinedController.UplinkBridge:
                uplink_bridge_controller_reference,
                PipelinedController.Testing: testing_controller_reference,
                PipelinedController.StartupFlows: Future(),
            },
            config={
                'bridge_name': cls.BRIDGE,
                'bridge_ip_address': cls.BRIDGE_IP,
                'ovs_gtp_port_number': 32768,
                'clean_restart': True,
                'enable_nat': False,
                'uplink_bridge': cls.UPLINK_BRIDGE,
                'uplink_eth_port_name': cls.UPLINK_ETH_PORT,
                'virtual_mac': '02:bb:5e:36:06:4b',
                'uplink_patch': cls.UPLINK_PATCH,
                'uplink_dhcp_port': cls.UPLINK_DHCP,
                'sgi_management_iface_vlan': cls.VLAN_TAG,
                'sgi_management_iface_ip_addr': cls.SGi_IP,
                'sgi_management_iface_gw': cls.SGi_GW,
                'dev_vlan_in': "test_v_in",
                'dev_vlan_out': "test_v_out",
            },
            mconfig=None,
            loop=None,
            service_manager=cls.service_manager,
            integ_test=False,
        )

        BridgeTools.create_bridge(cls.BRIDGE, cls.BRIDGE)
        # validate vlan id set
        vlan = "10"
        BridgeTools.create_bridge(cls.UPLINK_BRIDGE, cls.UPLINK_BRIDGE)
        subprocess.Popen([
            "ovs-vsctl",
            "set",
            "port",
            cls.UPLINK_BRIDGE,
            "tag=" + vlan,
        ]).wait()
        assert get_ovsdb_port_tag(cls.UPLINK_BRIDGE) == vlan

        set_ip_cmd = [
            "ip",
            "addr",
            "replace",
            "2.33.44.6",
            "dev",
            cls.UPLINK_BRIDGE,
        ]
        subprocess.check_call(set_ip_cmd)

        BridgeTools.create_internal_iface(
            cls.UPLINK_BRIDGE,
            cls.UPLINK_DHCP,
            None,
        )
        BridgeTools.create_internal_iface(
            cls.UPLINK_BRIDGE,
            cls.UPLINK_PATCH,
            None,
        )
        BridgeTools.create_internal_iface(
            cls.UPLINK_BRIDGE,
            cls.UPLINK_ETH_PORT,
            None,
        )

        cls.thread = start_ryu_app_thread(test_setup)
        cls.uplink_br_controller = uplink_bridge_controller_reference.result()

        cls.testing_controller = testing_controller_reference.result()
示例#5
0
    def setUpClass(cls):
        """
        Starts the thread which launches ryu apps

        Create a testing bridge, add a port, setup the port interfaces. Then
        launch the ryu apps for testing pipelined. Gets the references
        to apps launched by using futures.
        """
        super(UplinkBridgeWithNonNATTest, cls).setUpClass()
        warnings.simplefilter('ignore')
        cls.service_manager = create_service_manager([])

        uplink_bridge_controller_reference = Future()
        testing_controller_reference = Future()
        test_setup = TestSetup(
            apps=[PipelinedController.UplinkBridge,
                  PipelinedController.Testing,
                  PipelinedController.StartupFlows],
            references={
                PipelinedController.UplinkBridge:
                    uplink_bridge_controller_reference,
                PipelinedController.Testing:
                    testing_controller_reference,
                PipelinedController.StartupFlows:
                    Future(),
            },
            config={
                'bridge_name': cls.BRIDGE,
                'bridge_ip_address': cls.BRIDGE_IP,
                'ovs_gtp_port_number': 32768,
                'clean_restart': True,
                'enable_nat': False,
                'uplink_bridge': cls.UPLINK_BRIDGE,
                'uplink_eth_port_name': cls.UPLINK_ETH_PORT,
                'virtual_mac': '02:bb:5e:36:06:4b',
                'uplink_patch': cls.UPLINK_PATCH,
                'uplink_dhcp_port': cls.UPLINK_DHCP,
                'sgi_management_iface_vlan': "",
                'dev_vlan_in': cls.VLAN_DEV_IN,
                'dev_vlan_out': cls.VLAN_DEV_OUT,
                'ovs_vlan_workaround': False,
                'sgi_management_iface_ip_addr': '1.1.11.1',
            },
            mconfig=None,
            loop=None,
            service_manager=cls.service_manager,
            integ_test=False,
        )

        BridgeTools.create_bridge(cls.BRIDGE, cls.BRIDGE)
        BridgeTools.create_bridge(cls.UPLINK_BRIDGE, cls.UPLINK_BRIDGE)

        BridgeTools.create_veth_pair(cls.VLAN_DEV_IN,
                                     cls.VLAN_DEV_OUT)
        # Add to OVS,
        BridgeTools.add_ovs_port(cls.UPLINK_BRIDGE,
                                 cls.VLAN_DEV_IN, "70")
        BridgeTools.add_ovs_port(cls.UPLINK_BRIDGE,
                                 cls.VLAN_DEV_OUT, "71")

        # dummy uplink interface
        vlan = "10"
        subprocess.Popen(["ovs-vsctl", "set", "port", cls.UPLINK_BRIDGE,
                          "tag=" + vlan]).wait()
        assert get_ovsdb_port_tag(cls.UPLINK_BRIDGE) == vlan

        BridgeTools.create_internal_iface(cls.UPLINK_BRIDGE,
                                          cls.UPLINK_DHCP, None)
        BridgeTools.create_internal_iface(cls.UPLINK_BRIDGE,
                                          cls.UPLINK_PATCH, None)
        BridgeTools.create_internal_iface(cls.UPLINK_BRIDGE,
                                          cls.UPLINK_ETH_PORT, None)

        cls.thread = start_ryu_app_thread(test_setup)
        cls.uplink_br_controller = uplink_bridge_controller_reference.result()

        cls.testing_controller = testing_controller_reference.result()