Exemplo n.º 1
0
 def setUp(self):
     host_desc = [
         environment.HostDescription(l3_agent=False,
                                     l2_agent_type=self.l2_agent_type)
     ]
     env_desc = environment.EnvironmentDescription(
         network_type='vlan',
         l2_pop=False,
         mech_drivers=self.mech_drivers,
         report_bandwidths=True,
         has_placement=True,
         placement_port=self.placement_port)
     env = environment.Environment(env_desc, host_desc)
     super(TestPlacementBandwidthReport, self).setUp(env)
Exemplo n.º 2
0
 def setUp(self):
     host_descriptions = [
         # There's value in enabling L3 agents registration when l2pop
         # is enabled, because l2pop code makes assumptions about the
         # agent types present on machines.
         environment.HostDescription(
             l3_agent=self.l2_pop,
             of_interface=self.of_interface) for _ in range(3)]
     env = environment.Environment(
         environment.EnvironmentDescription(
             network_type=self.network_type,
             l2_pop=self.l2_pop),
         host_descriptions)
     super(TestConnectivitySameNetwork, self).setUp(env)
Exemplo n.º 3
0
 def setUp(self):
     # We limit this test to using the openvswitch mech driver, because DSCP
     # is presently not implemented for Linux Bridge.  The 'rule_types' API
     # call only returns rule types that are supported by all configured
     # mech drivers.  So in a fullstack scenario, where both the OVS and the
     # Linux Bridge mech drivers are configured, the DSCP rule type will be
     # unavailable since it is not implemented in Linux Bridge.
     mech_driver = 'openvswitch'
     host_desc = []  # No need to register agents for this test case
     env_desc = environment.EnvironmentDescription(qos=True,
                                                   l2_pop=True,
                                                   mech_drivers=mech_driver)
     env = environment.Environment(env_desc, host_desc)
     super(TestQoSWithL2Population, self).setUp(env)
Exemplo n.º 4
0
    def setUp(self):
        host_descriptions = [
            environment.HostDescription(dhcp_agent=True,
                                        l2_agent_type=self.l2_agent_type)
        ]

        env = environment.Environment(
            environment.EnvironmentDescription(l2_pop=False,
                                               arp_responder=False),
            host_descriptions)

        super(TestDhcpAgent, self).setUp(env)
        self.project_id = uuidutils.generate_uuid()
        self._create_network_subnet_and_vm()
Exemplo n.º 5
0
 def setUp(self):
     host_descriptions = [
         environment.HostDescription(l3_agent=True,
                                     dhcp_agent=True,
                                     l3_agent_extensions="fip_qos"),
         # None(obondarev): dhcp agent is added to workaround bug 1930401,
         # to be removed in scope of proper bug fix:
         # https://review.opendev.org/c/openstack/neutron/+/794994
         environment.HostDescription(dhcp_agent=True)
     ]
     env = environment.Environment(
         environment.EnvironmentDescription(network_type='vlan',
                                            l2_pop=False,
                                            qos=True), host_descriptions)
     super(TestLegacyL3Agent, self).setUp(env)
Exemplo n.º 6
0
    def setUp(self):
        host_descriptions = [
            environment.HostDescription(l2_agent_type=self.l2_agent_type)
        ]
        env = environment.Environment(
            environment.EnvironmentDescription(
                agent_down_time=10,
                ml2_extension_drivers=['uplink_status_propagation']),
            host_descriptions)
        super(TestPortsApi, self).setUp(env)

        self.tenant_id = uuidutils.generate_uuid()
        self.network = self.safe_client.create_network(self.tenant_id)
        self.safe_client.create_subnet(self.tenant_id, self.network['id'],
                                       '20.0.0.0/24')
Exemplo n.º 7
0
 def setUp(self):
     host_descriptions = [
         environment.HostDescription(
             l3_agent=False,
             l2_agent_type=constants.AGENT_TYPE_OVS,
             firewall_driver='iptables_hybrid',
             dhcp_agent=False,
         )
     ]
     env = environment.Environment(environment.EnvironmentDescription(),
                                   host_descriptions)
     super(FirewallMigrationTestCase, self).setUp(env)
     # fullstack doesn't separate nodes running ovs agent so iptables rules
     # are implemented in root namespace
     self.iptables_manager = iptables_manager.IptablesManager()
Exemplo n.º 8
0
    def setUp(self):
        host_descriptions = [
            environment.HostDescription(dhcp_agent=True,
                                        l2_agent_type=self.l2_agent_type)
            for _ in range(self.number_of_hosts)
        ]

        env = environment.Environment(
            environment.EnvironmentDescription(
                l2_pop=False,
                arp_responder=False,
                agent_down_time=self.agent_down_time), host_descriptions)

        super(BaseDhcpAgentTest, self).setUp(env)
        self.project_id = uuidutils.generate_uuid()
        self._create_network_subnet_and_vm()
Exemplo n.º 9
0
 def setUp(self):
     if (self.firewall_driver == 'openvswitch'
             and not OVSVersionChecker.supports_ovsfirewall()):
         self.skipTest("Open vSwitch firewall_driver doesn't work "
                       "with this version of ovs.")
     host_descriptions = [
         environment.HostDescription(of_interface=self.of_interface,
                                     ovsdb_interface=self.ovsdb_interface,
                                     l2_agent_type=self.l2_agent_type,
                                     firewall_driver=self.firewall_driver,
                                     dhcp_agent=True) for _ in range(2)
     ]
     env = environment.Environment(
         environment.EnvironmentDescription(network_type=self.network_type),
         host_descriptions)
     super(BaseSecurityGroupsSameNetworkTest, self).setUp(env)
Exemplo n.º 10
0
 def setUp(self):
     host_descriptions = [
         # There's value in enabling L3 agents registration when l2pop
         # is enabled, because l2pop code makes assumptions about the
         # agent types present on machines.
         environment.HostDescription(
             l3_agent=self.l2_pop,
             l2_agent_type=self.l2_agent_type,
             dhcp_agent=self.use_dhcp,
         ) for _ in range(self.num_hosts)
     ]
     env = environment.Environment(
         environment.EnvironmentDescription(
             network_type=self.network_type,
             l2_pop=self.l2_pop,
             arp_responder=self.arp_responder), host_descriptions)
     super(BaseConnectivitySameNetworkTest, self).setUp(env)
Exemplo n.º 11
0
    def setUp(self):
        host_desc = [environment.HostDescription(
            l3_agent=False,
            l2_agent_type=self.l2_agent_type)]
        env_desc = environment.EnvironmentDescription(qos=True)
        env = environment.Environment(env_desc, host_desc)
        super(BaseQoSRuleTestCase, self).setUp(env)

        self.tenant_id = uuidutils.generate_uuid()
        self.network = self.safe_client.create_network(self.tenant_id,
                                                       'network-test')
        self.subnet = self.safe_client.create_subnet(
            self.tenant_id, self.network['id'],
            cidr='10.0.0.0/24',
            gateway_ip='10.0.0.1',
            name='subnet-test',
            enable_dhcp=False)
Exemplo n.º 12
0
    def setUp(self):
        debug_iptables = self.firewall_driver.startswith("iptables")
        host_descriptions = [
            environment.HostDescription(l2_agent_type=self.l2_agent_type,
                                        firewall_driver=self.firewall_driver,
                                        dhcp_agent=True)
            for _ in range(self.num_hosts)
        ]
        env = environment.Environment(
            environment.EnvironmentDescription(network_type=self.network_type,
                                               debug_iptables=debug_iptables),
            host_descriptions)
        super(BaseSecurityGroupsSameNetworkTest, self).setUp(env)

        if (self.firewall_driver == 'openvswitch'
                and not OVSVersionChecker.supports_ovsfirewall()):
            self.skipTest("Open vSwitch firewall_driver doesn't work "
                          "with this version of ovs.")
Exemplo n.º 13
0
    def setUp(self):
        host_desc = [environment.HostDescription(
            l3_agent=False,
            l2_agent_type=constants.AGENT_TYPE_OVS)]
        env_desc = environment.EnvironmentDescription(service_plugins='trunk')
        env = environment.Environment(env_desc, host_desc)
        super(TestTrunkPlugin, self).setUp(env)

        self.tenant_id = uuidutils.generate_uuid()
        self.trunk_network = Network('trunk', '10.0.0.0/24')
        self.vlan1_network = Network('vlan1', '192.168.0.0/24', tag=10)
        self.vlan2_network = Network('vlan2', '192.168.1.0/24', tag=20)

        self.host = self.environment.hosts[0]

        for network in (
                self.trunk_network, self.vlan1_network, self.vlan2_network):
            self.create_network_and_subnet(network)
Exemplo n.º 14
0
    def setUp(self):
        host_desc = [
            environment.HostDescription(l3_agent=False,
                                        of_interface=self.of_interface,
                                        ovsdb_interface=self.ovsdb_interface,
                                        l2_agent_type=self.l2_agent_type)
            for _ in range(self.number_of_hosts)
        ]
        env_desc = environment.EnvironmentDescription()
        env = environment.Environment(env_desc, host_desc)
        super(MTUNetworkTestSetup, self).setUp(env)

        self.tenant_id = uuidutils.generate_uuid()
        self.subnet = self.safe_client.create_subnet(self.tenant_id,
                                                     self.network['id'],
                                                     cidr='10.0.0.0/24',
                                                     gateway_ip='10.0.0.1',
                                                     name='subnet-test',
                                                     enable_dhcp=False)
Exemplo n.º 15
0
    def setUp(self):
        host_desc = [
            environment.HostDescription(
                l2_agent_type=constants.AGENT_TYPE_OVS,
                firewall_driver='openvswitch',
                dhcp_agent=True) for _ in range(self.number_of_hosts)]
        env_desc = environment.EnvironmentDescription(
            mech_drivers='openvswitch', log=True)
        env = environment.Environment(env_desc, host_desc)
        super(BaseLoggingTestCase, self).setUp(env)

        self.tenant_id = uuidutils.generate_uuid()
        self.network = self.safe_client.create_network(
            self.tenant_id, 'network-test')
        self.subnet = self.safe_client.create_subnet(
            self.tenant_id, self.network['id'],
            cidr='10.0.0.0/24',
            gateway_ip='10.0.0.1',
            name='subnet-test')
Exemplo n.º 16
0
    def setUp(self):
        host_descriptions = [
            environment.HostDescription(l2_agent_type=self.l2_agent_type,
                                        l3_agent=self.use_l3_agent)
        ]
        env = environment.Environment(
            environment.EnvironmentDescription(agent_down_time=10),
            host_descriptions)

        super(TestPortsRebind, self).setUp(env)

        self.l2_agent_process = self.environment.hosts[0].l2_agent
        self.l2_agent = self.safe_client.client.list_agents(
            agent_type=self.l2_agent_type)['agents'][0]

        self.tenant_id = uuidutils.generate_uuid()
        self.network = self.safe_client.create_network(self.tenant_id)
        self.subnet = self.safe_client.create_subnet(self.tenant_id,
                                                     self.network['id'],
                                                     '20.0.0.0/24')
Exemplo n.º 17
0
    def setUp(self):
        host_desc = [
            environment.HostDescription(l3_agent=False,
                                        of_interface=self.of_interface,
                                        l2_agent_type=self.l2_agent_type)
            for _ in range(self.number_of_hosts)
        ]
        env_desc = environment.EnvironmentDescription(agent_down_time=10,
                                                      qos=True)
        env = environment.Environment(env_desc, host_desc)
        super(BaseQoSRuleTestCase, self).setUp(env)
        self.l2_agent_process = self.environment.hosts[0].l2_agent
        self.l2_agent = self.safe_client.client.list_agents(
            agent_type=self.l2_agent_type)['agents'][0]

        self.tenant_id = uuidutils.generate_uuid()
        self.network = self.safe_client.create_network(self.tenant_id,
                                                       'network-test')
        self.subnet = self.safe_client.create_subnet(self.tenant_id,
                                                     self.network['id'],
                                                     cidr='10.0.0.0/24',
                                                     gateway_ip='10.0.0.1',
                                                     name='subnet-test',
                                                     enable_dhcp=False)
Exemplo n.º 18
0
    def setUp(self):
        host_descriptions = [
            environment.HostDescription(
                dhcp_agent=True, l2_agent_type=constants.AGENT_TYPE_OVS),
            environment.HostDescription(
                dhcp_agent=False,
                l2_agent_type=constants.AGENT_TYPE_LINUXBRIDGE)
        ]

        env = environment.Environment(
            environment.EnvironmentDescription(
                network_type='vlan',
                mech_drivers='openvswitch,linuxbridge',
                l2_pop=False,
                arp_responder=False,
                agent_down_time=self.agent_down_time,
                service_plugins='router,segments'), host_descriptions)

        # Note(lajoskatona): Here, call grandparent's (BaseFullStackTestCase)
        # setup(), to avoid BaseDhcpAgentTest mess up environment.
        super(BaseDhcpAgentTest, self).setUp(env)
        self.project_id = uuidutils.generate_uuid()
        if self.boot_vm_for_test:
            self._create_network_subnet_and_vm()
Exemplo n.º 19
0
 def setUp(self):
     host_desc = []  # No need to register agents for this test case
     env_desc = environment.EnvironmentDescription(qos=True)
     env = environment.Environment(env_desc, host_desc)
     super(TestQoSPolicyIsDefault, self).setUp(env)
Exemplo n.º 20
0
 def setUp(self):
     host_desc = []  # No need to register agents for this test case
     env_desc = environment.EnvironmentDescription(
         qos=True, l2_pop=True, mech_drivers=self.mech_drivers)
     env = environment.Environment(env_desc, host_desc)
     super(TestQoSWithL2Population, self).setUp(env)
Exemplo n.º 21
0
    def setUp(self):
        host_desc = [
            environment.HostDescription(
                l2_agent_type=constants.AGENT_TYPE_OVS,
                firewall_driver='openvswitch',
                # VM needs to receive the RA notification
                # from radvd which is handled by router and L3 agent.
                l3_agent=True,
                dhcp_agent=False) for _ in range(self.number_of_hosts)
        ]
        env_desc = environment.EnvironmentDescription(
            mech_drivers='openvswitch', enable_traditional_dhcp=False)
        env = environment.Environment(env_desc, host_desc)
        super(OvsDHCPExtensionTestCase, self).setUp(env)
        self.tenant_id = uuidutils.generate_uuid()

        network = self.safe_client.create_network(self.tenant_id,
                                                  name='public',
                                                  external=True)
        cidr = self.useFixture(
            ip_network.ExclusiveIPNetwork("240.0.0.0", "240.255.255.255",
                                          "24")).network
        self.safe_client.create_subnet(self.tenant_id, network['id'], cidr)

        router = self.safe_client.create_router(self.tenant_id,
                                                external_network=network['id'])

        self.network = self.safe_client.create_network(self.tenant_id,
                                                       'network-test')
        subnet_routes_v4 = [{
            "destination": "1.1.1.0/24",
            "nexthop": "10.0.0.100"
        }, {
            "destination": "2.2.2.2/32",
            "nexthop": "10.0.0.101"
        }]
        self.subnet_v4 = self.safe_client.create_subnet(
            self.tenant_id,
            self.network['id'],
            cidr='10.0.0.0/24',
            gateway_ip='10.0.0.1',
            name='subnet-v4-test',
            host_routes=subnet_routes_v4)

        router_interface_info = self.safe_client.add_router_interface(
            router['id'], self.subnet_v4['id'])
        self.block_until_port_status_active(router_interface_info['port_id'])

        subnet_routes_v6 = [{
            "destination": "2001:4860:4860::8888/128",
            "nexthop": "fda7:a5cc:3460:1::1"
        }, {
            "destination": "1234:5678:abcd::/64",
            "nexthop": "fda7:a5cc:3460:1::fff"
        }]
        self.subnet_v6 = self.safe_client.create_subnet(
            self.tenant_id,
            self.network['id'],
            cidr='fda7:a5cc:3460:1::/64',
            gateway_ip='fda7:a5cc:3460:1::1',
            enable_dhcp=True,
            ipv6_address_mode="dhcpv6-stateful",
            ipv6_ra_mode="dhcpv6-stateful",
            ip_version=6,
            name='subnet-v6-test',
            host_routes=subnet_routes_v6)

        # Need router radvd to send IPv6 address prefix to make the default
        # route work.
        router_interface_info = self.safe_client.add_router_interface(
            router['id'], self.subnet_v6['id'])
        self.block_until_port_status_active(router_interface_info['port_id'])
Exemplo n.º 22
0
 def setUp(self):
     host_descriptions = [environment.HostDescription()]
     env = environment.Environment(environment.EnvironmentDescription(),
                                   host_descriptions)
     super(SecurityGroupRulesTest, self).setUp(env)
Exemplo n.º 23
0
 def setUp(self):
     host_descriptions = [environment.HostDescription(l3_agent=True)]
     env = environment.Environment(environment.EnvironmentDescription(),
                                   host_descriptions)
     super(TestLegacyL3Agent, self).setUp(env)
Exemplo n.º 24
0
 def setUp(self):
     host_desc = [environment.HostDescription(l3_agent=False)]
     env_desc = environment.EnvironmentDescription(qos=True)
     env = environment.Environment(env_desc, host_desc)
     super(TestQoSWithOvsAgent, self).setUp(env)
Exemplo n.º 25
0
 def setUp(self):
     host_descriptions = [environment.HostDescription() for _ in range(2)]
     env = environment.Environment(environment.EnvironmentDescription(),
                                   host_descriptions)
     super(TestConnectivitySameNetwork, self).setUp(env)
Exemplo n.º 26
0
 def _restart_neutron_server(self):
     env_desc = environment.EnvironmentDescription(global_mtu=9000)
     env = environment.Environment(env_desc, self.host_desc)
     env.test_name = self.get_name()
     self.useFixture(env)
     env.neutron_server.restart()