def test_list_show_extensions(self):
        # List available extensions for the tenant
        expected_alias = ['security-group', 'l3_agent_scheduler',
                          'ext-gw-mode', 'binding', 'quotas',
                          'agent', 'dhcp_agent_scheduler', 'provider',
                          'router', 'extraroute', 'external-net',
                          'allowed-address-pairs', 'extra_dhcp_opt']
        expected_alias = [ext for ext in expected_alias if
                          test.is_extension_enabled(ext, 'network')]
        actual_alias = list()
        extensions = self.client.list_extensions()
        list_extensions = extensions['extensions']
        # Show and verify the details of the available extensions
        for ext in list_extensions:
            ext_name = ext['name']
            ext_alias = ext['alias']
            actual_alias.append(ext['alias'])
            ext_details = self.client.show_extension(ext_alias)
            ext_details = ext_details['extension']

            self.assertIsNotNone(ext_details)
            self.assertIn('updated', ext_details.keys())
            self.assertIn('name', ext_details.keys())
            self.assertIn('description', ext_details.keys())
            self.assertIn('links', ext_details.keys())
            self.assertIn('alias', ext_details.keys())
            self.assertEqual(ext_details['name'], ext_name)
            self.assertEqual(ext_details['alias'], ext_alias)
            self.assertEqual(ext_details, ext)
        # Verify if expected extensions are present in the actual list
        # of extensions returned, but only for those that have been
        # enabled via configuration
        for e in expected_alias:
            if test.is_extension_enabled(e, 'network'):
                self.assertIn(e, actual_alias)
Ejemplo n.º 2
0
 def resource_setup(cls):
     super(L3AgentSchedulerTestJSON, cls).resource_setup()
     body = cls.admin_client.list_agents()
     agents = body['agents']
     for agent in agents:
         # TODO(armax): falling back on default _agent_mode can be
         # dropped as soon as Icehouse is dropped.
         agent_mode = (
             agent['configurations'].get('agent_mode', cls._agent_mode))
         if agent['agent_type'] == AGENT_TYPE and agent_mode in AGENT_MODES:
             cls.agent = agent
             break
     else:
         msg = "L3 Agent Scheduler enabled in conf, but L3 Agent not found"
         raise exceptions.InvalidConfiguration(msg)
     cls.router = cls.create_router(data_utils.rand_name('router'))
     # NOTE(armax): If DVR is an available extension, and the created router
     # is indeed a distributed one, more resources need to be provisioned
     # in order to bind the router to the L3 agent.
     # That said, let's preserve the existing test logic, where the extra
     # query and setup steps are only required if the extension is available
     # and only if the router's default type is distributed.
     if test.is_extension_enabled('dvr', 'network'):
         is_dvr_router = cls.admin_client.show_router(
             cls.router['id'])['router'].get('distributed', False)
         if is_dvr_router:
             cls.network = cls.create_network()
             cls.create_subnet(cls.network)
             cls.port = cls.create_port(cls.network)
             cls.client.add_router_interface_with_port_id(
                 cls.router['id'], cls.port['id'])
Ejemplo n.º 3
0
 def resource_setup(cls):
     super(FWaaSExtensionTestJSON, cls).resource_setup()
     if not test.is_extension_enabled('fwaas', 'network'):
         msg = "FWaaS Extension not enabled."
         raise cls.skipException(msg)
     cls.fw_rule = cls.create_firewall_rule("allow", "tcp")
     cls.fw_policy = cls.create_firewall_policy()
Ejemplo n.º 4
0
    def resource_setup(cls):
        super(TestFlavorsJson, cls).resource_setup()
        if not test.is_extension_enabled('flavors', 'network'):
            msg = "flavors extension not enabled."
            raise cls.skipException(msg)

        # Use flavors service type as know this is loaded
        service_type = "FLAVORS"
        description_flavor = "flavor is created by tempest"
        name_flavor = "Best flavor created by tempest"

        # The check above will pass if api_extensions=all, which does
        # not mean flavors extension itself is present.
        try:
            cls.flavor = cls.create_flavor(name_flavor, description_flavor,
                                           service_type)
        except lib_exc.NotFound:
            msg = "flavors plugin not enabled."
            raise cls.skipException(msg)

        description_sp = "service profile created by tempest"
        # Drivers are supported as is an empty driver field.  Use an
        # empty field for now since otherwise driver is validated against the
        # servicetype configuration which may differ in test scenarios.
        driver = ""
        metainfo = '{"data": "value"}'
        cls.service_profile = cls.create_service_profile(
            description=description_sp, metainfo=metainfo, driver=driver)
 def resource_setup(cls):
     super(RBACSharedNetworksTest, cls).resource_setup()
     if not test.is_extension_enabled('rbac_policies', 'network'):
         msg = "rbac extension not enabled."
         raise cls.skipException(msg)
     creds = cls.isolated_creds.get_alt_creds()
     cls.client2 = clients.Manager(credentials=creds).network_client
Ejemplo n.º 6
0
 def resource_setup(cls):
     super(AgentManagementTestJSON, cls).resource_setup()
     if not test.is_extension_enabled('agent', 'network'):
         msg = "agent extension not enabled."
         raise cls.skipException(msg)
     body = cls.admin_client.list_agents()
     agents = body['agents']
     cls.agent = agents[0]
Ejemplo n.º 7
0
 def resource_setup(cls):
     super(AgentManagementTestJSON, cls).resource_setup()
     if not test.is_extension_enabled('agent', 'network'):
         msg = "agent extension not enabled."
         raise cls.skipException(msg)
     body = cls.admin_client.list_agents()
     agents = body['agents']
     cls.agent = agents[0]
 def test_show_network(self):
     # Verify the details of a network
     body = self.client.show_network(self.network['id'])
     network = body['network']
     fields = ['id', 'name']
     if test.is_extension_enabled('net-mtu', 'network'):
         fields.append('mtu')
     for key in fields:
         self.assertEqual(network[key], self.network[key])
 def resource_setup(cls):
     super(L2GatewayExtensionTestJSON, cls).resource_setup()
     # Atleast one switch detail should be provided to run the tests
     if (len(CONF.network.l2gw_switch) < 0):
         msg = ('Atleast one switch detail must be defined.')
         raise cls.skipException(msg)
     if not test.is_extension_enabled('l2gateway', 'network'):
         msg = "L2Gateway Extension not enabled."
         raise cls.skipException(msg)
 def test_list_networks_fields(self):
     # Verify specific fields of the networks
     fields = ['id', 'name']
     if test.is_extension_enabled('net-mtu', 'network'):
         fields.append('mtu')
     body = self.client.list_networks(fields=fields)
     networks = body['networks']
     self.assertNotEmpty(networks, "Network list returned is empty")
     for network in networks:
         self.assertEqual(sorted(network.keys()), sorted(fields))
Ejemplo n.º 11
0
 def resource_setup(cls):
     super(AllowedAddressPairTestJSON, cls).resource_setup()
     if not test.is_extension_enabled('allowed-address-pairs', 'network'):
         msg = "Allowed Address Pairs extension not enabled."
         raise cls.skipException(msg)
     cls.network = cls.create_network()
     cls.create_subnet(cls.network)
     port = cls.create_port(cls.network)
     cls.ip_address = port['fixed_ips'][0]['ip_address']
     cls.mac_address = port['mac_address']
Ejemplo n.º 12
0
 def resource_setup(cls):
     super(AllowedAddressPairTestJSON, cls).resource_setup()
     if not test.is_extension_enabled('allowed-address-pairs', 'network'):
         msg = "Allowed Address Pairs extension not enabled."
         raise cls.skipException(msg)
     cls.network = cls.create_network()
     cls.create_subnet(cls.network)
     port = cls.create_port(cls.network)
     cls.ip_address = port['fixed_ips'][0]['ip_address']
     cls.mac_address = port['mac_address']
 def resource_setup(cls):
     super(LBaaSAgentSchedulerTestJSON, cls).resource_setup()
     if not test.is_extension_enabled('lbaas_agent_scheduler', 'network'):
         msg = "LBaaS Agent Scheduler Extension not enabled."
         raise cls.skipException(msg)
     cls.network = cls.create_network()
     cls.subnet = cls.create_subnet(cls.network)
     pool_name = data_utils.rand_name('pool-')
     cls.pool = cls.create_pool(pool_name, "ROUND_ROBIN",
                                "HTTP", cls.subnet)
Ejemplo n.º 14
0
 def resource_setup(cls):
     super(RoutersNegativeTest, cls).resource_setup()
     if not test.is_extension_enabled('router', 'network'):
         msg = "router extension not enabled."
         raise cls.skipException(msg)
     cls.router = cls.create_router(data_utils.rand_name('router-'))
     cls.network = cls.create_network()
     cls.subnet = cls.create_subnet(cls.network)
     cls.tenant_cidr = (CONF.network.tenant_network_cidr if cls._ip_version
                        == 4 else CONF.network.tenant_network_v6_cidr)
Ejemplo n.º 15
0
 def resource_setup(cls):
     super(RoutersTest, cls).resource_setup()
     if not test.is_extension_enabled('router', 'network'):
         msg = "router extension not enabled."
         raise cls.skipException(msg)
     admin_manager = clients.AdminManager()
     cls.identity_admin_client = admin_manager.identity_client
     cls.tenant_cidr = (CONF.network.tenant_network_cidr
                        if cls._ip_version == 4 else
                        CONF.network.tenant_network_v6_cidr)
 def test_show_network_fields(self):
     # Verify specific fields of a network
     fields = ['id', 'name']
     if test.is_extension_enabled('net-mtu', 'network'):
         fields.append('mtu')
     body = self.client.show_network(self.network['id'],
                                     fields=fields)
     network = body['network']
     self.assertEqual(sorted(network.keys()), sorted(fields))
     for field_name in fields:
         self.assertEqual(network[field_name], self.network[field_name])
Ejemplo n.º 17
0
 def resource_setup(cls):
     super(RoutersNegativeTest, cls).resource_setup()
     if not test.is_extension_enabled('router', 'network'):
         msg = "router extension not enabled."
         raise cls.skipException(msg)
     cls.router = cls.create_router(data_utils.rand_name('router-'))
     cls.network = cls.create_network()
     cls.subnet = cls.create_subnet(cls.network)
     cls.tenant_cidr = (CONF.network.tenant_network_cidr
                        if cls._ip_version == 4 else
                        CONF.network.tenant_network_v6_cidr)
Ejemplo n.º 18
0
 def resource_setup(cls):
     super(DHCPAgentSchedulersTestJSON, cls).resource_setup()
     if not test.is_extension_enabled('dhcp_agent_scheduler', 'network'):
         msg = "dhcp_agent_scheduler extension not enabled."
         raise cls.skipException(msg)
     # Create a network and make sure it will be hosted by a
     # dhcp agent: this is done by creating a regular port
     cls.network = cls.create_network()
     cls.subnet = cls.create_subnet(cls.network)
     cls.cidr = cls.subnet['cidr']
     cls.port = cls.create_port(cls.network)
Ejemplo n.º 19
0
 def resource_setup(cls):
     super(FloatingIPNegativeTestJSON, cls).resource_setup()
     if not test.is_extension_enabled('router', 'network'):
         msg = "router extension not enabled."
         raise cls.skipException(msg)
     cls.ext_net_id = CONF.network.public_network_id
     # Create a network with a subnet connected to a router.
     cls.network = cls.create_network()
     cls.subnet = cls.create_subnet(cls.network)
     cls.router = cls.create_router(data_utils.rand_name('router'))
     cls.create_router_interface(cls.router['id'], cls.subnet['id'])
     cls.port = cls.create_port(cls.network)
Ejemplo n.º 20
0
 def resource_setup(cls):
     super(FloatingIPNegativeTestJSON, cls).resource_setup()
     if not test.is_extension_enabled('router', 'network'):
         msg = "router extension not enabled."
         raise cls.skipException(msg)
     cls.ext_net_id = CONF.network.public_network_id
     # Create a network with a subnet connected to a router.
     cls.network = cls.create_network()
     cls.subnet = cls.create_subnet(cls.network)
     cls.router = cls.create_router(data_utils.rand_name('router'))
     cls.create_router_interface(cls.router['id'], cls.subnet['id'])
     cls.port = cls.create_port(cls.network)
Ejemplo n.º 21
0
 def resource_setup(cls):
     super(AddressScopeTestBase, cls).resource_setup()
     if not test.is_extension_enabled("address-scope", "network"):
         msg = "address-scope extension not enabled."
         raise cls.skipException(msg)
     try:
         creds = cls.isolated_creds.get_admin_creds()
         cls.os_adm = clients.Manager(credentials=creds)
     except NotImplementedError:
         msg = "Missing Administrative Network API credentials " "in configuration."
         raise cls.skipException(msg)
     cls.admin_client = cls.os_adm.network_client
 def resource_setup(cls):
     super(LoadBalancerAdminTestJSON, cls).resource_setup()
     if not test.is_extension_enabled('lbaas', 'network'):
         msg = "lbaas extension not enabled."
         raise cls.skipException(msg)
     cls.force_tenant_isolation = True
     manager = cls.get_client_manager()
     cls.client = manager.network_client
     cls.tenant_id = cls.isolated_creds.get_primary_creds().tenant_id
     cls.network = cls.create_network()
     cls.subnet = cls.create_subnet(cls.network)
     cls.pool = cls.create_pool(data_utils.rand_name('pool-'),
                                "ROUND_ROBIN", "HTTP", cls.subnet)
 def resource_setup(cls):
     super(LoadBalancerAdminTestJSON, cls).resource_setup()
     if not test.is_extension_enabled('lbaas', 'network'):
         msg = "lbaas extension not enabled."
         raise cls.skipException(msg)
     cls.force_tenant_isolation = True
     manager = cls.get_client_manager()
     cls.client = manager.network_client
     cls.tenant_id = cls.isolated_creds.get_primary_creds().tenant_id
     cls.network = cls.create_network()
     cls.subnet = cls.create_subnet(cls.network)
     cls.pool = cls.create_pool(data_utils.rand_name('pool-'),
                                "ROUND_ROBIN", "HTTP", cls.subnet)
Ejemplo n.º 24
0
    def test_list_show_extensions(self):
        # List available extensions for the tenant
        expected_alias = [
            'security-group', 'l3_agent_scheduler', 'ext-gw-mode', 'binding',
            'quotas', 'agent', 'dhcp_agent_scheduler', 'provider', 'router',
            'extraroute', 'external-net', 'allowed-address-pairs',
            'extra_dhcp_opt'
        ]
        expected_alias = [
            ext for ext in expected_alias
            if test.is_extension_enabled(ext, 'network')
        ]
        actual_alias = list()
        extensions = self.client.list_extensions()
        list_extensions = extensions['extensions']
        # Show and verify the details of the available extensions
        for ext in list_extensions:
            ext_name = ext['name']
            ext_alias = ext['alias']
            actual_alias.append(ext['alias'])
            ext_details = self.client.show_extension(ext_alias)
            ext_details = ext_details['extension']

            self.assertIsNotNone(ext_details)
            self.assertIn('updated', ext_details.keys())
            self.assertIn('name', ext_details.keys())
            self.assertIn('description', ext_details.keys())
            self.assertIn('namespace', ext_details.keys())
            self.assertIn('links', ext_details.keys())
            self.assertIn('alias', ext_details.keys())
            self.assertEqual(ext_details['name'], ext_name)
            self.assertEqual(ext_details['alias'], ext_alias)
            self.assertEqual(ext_details, ext)
        # Verify if expected extensions are present in the actual list
        # of extensions returned, but only for those that have been
        # enabled via configuration
        for e in expected_alias:
            if test.is_extension_enabled(e, 'network'):
                self.assertIn(e, actual_alias)
 def resource_setup(cls):
     super(AddressScopeTestBase, cls).resource_setup()
     if not test.is_extension_enabled('address-scope', 'network'):
         msg = "address-scope extension not enabled."
         raise cls.skipException(msg)
     try:
         creds = cls.isolated_creds.get_admin_creds()
         cls.os_adm = clients.Manager(credentials=creds)
     except NotImplementedError:
         msg = ("Missing Administrative Network API credentials "
                "in configuration.")
         raise cls.skipException(msg)
     cls.admin_client = cls.os_adm.network_client
Ejemplo n.º 26
0
 def resource_setup(cls):
     super(MeteringTestJSON, cls).resource_setup()
     if not test.is_extension_enabled('metering', 'network'):
         msg = "metering extension not enabled."
         raise cls.skipException(msg)
     description = "metering label created by tempest"
     name = data_utils.rand_name("metering-label")
     cls.metering_label = cls.create_metering_label(name, description)
     remote_ip_prefix = ("10.0.0.0/24" if cls._ip_version == 4
                         else "fd02::/64")
     direction = "ingress"
     cls.metering_label_rule = cls.create_metering_label_rule(
         remote_ip_prefix, direction,
         metering_label_id=cls.metering_label['id'])
Ejemplo n.º 27
0
 def resource_setup(cls):
     super(L3AgentSchedulerTestJSON, cls).resource_setup()
     if not test.is_extension_enabled('l3_agent_scheduler', 'network'):
         msg = "L3 Agent Scheduler Extension not enabled."
         raise cls.skipException(msg)
     # Trying to get agent details for L3 Agent
     body = cls.admin_client.list_agents()
     agents = body['agents']
     for agent in agents:
         if agent['agent_type'] == 'L3 agent':
             cls.agent = agent
             break
     else:
         msg = "L3 Agent not found"
         raise cls.skipException(msg)
 def resource_setup(cls):
     super(RBACSharedNetworksTest, cls).resource_setup()
     extensions = cls.admin_client.list_extensions()
     if not test.is_extension_enabled('rbac_policies', 'network'):
         msg = "rbac extension not enabled."
         raise cls.skipException(msg)
     # NOTE(kevinbenton): the following test seems to be necessary
     # since the default is 'all' for the above check and these tests
     # need to get into the gate and be disabled until the service plugin
     # is enabled in devstack. Is there a better way to do this?
     if 'rbac-policies' not in [x['alias']
                                for x in extensions['extensions']]:
         msg = "rbac extension is not in extension listing."
         raise cls.skipException(msg)
     creds = cls.isolated_creds.get_alt_creds()
     cls.client2 = clients.Manager(credentials=creds).network_client
 def test_rbac_policy_quota(self):
     if not test.is_extension_enabled('quotas', 'network'):
         msg = "quotas extension not enabled."
         raise self.skipException(msg)
     quota = self.client.show_quotas(self.client.tenant_id)['quota']
     max_policies = quota['rbac_policy']
     self.assertGreater(max_policies, 0)
     net = self.client.create_network(
         name=data_utils.rand_name('test-network-'))['network']
     self.addCleanup(self.client.delete_network, net['id'])
     with testtools.ExpectedException(lib_exc.Conflict):
         for i in range(0, max_policies + 1):
             self.admin_client.create_rbac_policy(
                 object_type='network', object_id=net['id'],
                 action='access_as_shared',
                 target_tenant=str(uuid.uuid4()).replace('-', ''))
 def test_rbac_policy_quota(self):
     if not test.is_extension_enabled("quotas", "network"):
         msg = "quotas extension not enabled."
         raise self.skipException(msg)
     quota = self.client.show_quotas(self.client.tenant_id)["quota"]
     max_policies = quota["rbac_policy"]
     self.assertGreater(max_policies, 0)
     net = self.client.create_network(name=data_utils.rand_name("test-network-"))["network"]
     self.addCleanup(self.client.delete_network, net["id"])
     with testtools.ExpectedException(lib_exc.Conflict):
         for i in range(0, max_policies + 1):
             self.admin_client.create_rbac_policy(
                 object_type="network",
                 object_id=net["id"],
                 action="access_as_shared",
                 target_tenant=str(uuid.uuid4()).replace("-", ""),
             )
 def resource_setup(cls):
     super(TestFlavorsJson, cls).resource_setup()
     if not test.is_extension_enabled('flavors', 'network'):
         msg = "flavors extension not enabled."
         raise cls.skipException(msg)
     service_type = "LOADBALANCER"
     description_flavor = "flavor is created by tempest"
     name_flavor = "Best flavor created by tempest"
     cls.flavor = cls.create_flavor(name_flavor, description_flavor,
                                    service_type)
     description_sp = "service profile created by tempest"
     # Future TODO(madhu_ak): Right now the dummy driver is loaded. Will
     # make changes as soon I get to know the flavor supported drivers
     driver = ""
     metainfo = '{"data": "value"}'
     cls.service_profile = cls.create_service_profile(
         description=description_sp, metainfo=metainfo, driver=driver)
 def resource_setup(cls):
     super(RBACSharedNetworksTest, cls).resource_setup()
     extensions = cls.admin_client.list_extensions()
     if not test.is_extension_enabled('rbac_policies', 'network'):
         msg = "rbac extension not enabled."
         raise cls.skipException(msg)
     # NOTE(kevinbenton): the following test seems to be necessary
     # since the default is 'all' for the above check and these tests
     # need to get into the gate and be disabled until the service plugin
     # is enabled in devstack. Is there a better way to do this?
     if 'rbac-policies' not in [
             x['alias'] for x in extensions['extensions']
     ]:
         msg = "rbac extension is not in extension listing."
         raise cls.skipException(msg)
     creds = cls.isolated_creds.get_alt_creds()
     cls.client2 = clients.Manager(credentials=creds).network_client
Ejemplo n.º 33
0
 def resource_setup(cls):
     super(TestFlavorsJson, cls).resource_setup()
     if not test.is_extension_enabled('flavors', 'network'):
         msg = "flavors extension not enabled."
         raise cls.skipException(msg)
     service_type = "LOADBALANCER"
     description_flavor = "flavor is created by tempest"
     name_flavor = "Best flavor created by tempest"
     cls.flavor = cls.create_flavor(name_flavor, description_flavor,
                                    service_type)
     description_sp = "service profile created by tempest"
     # Future TODO(madhu_ak): Right now the dummy driver is loaded. Will
     # make changes as soon I get to know the flavor supported drivers
     driver = ""
     metainfo = '{"data": "value"}'
     cls.service_profile = cls.create_service_profile(
         description=description_sp, metainfo=metainfo, driver=driver)
Ejemplo n.º 34
0
    def resource_setup(cls):
        super(FloatingIPTestJSON, cls).resource_setup()
        if not test.is_extension_enabled('router', 'network'):
            msg = "router extension not enabled."
            raise cls.skipException(msg)
        cls.ext_net_id = CONF.network.public_network_id

        # Create network, subnet, router and add interface
        cls.network = cls.create_network()
        cls.subnet = cls.create_subnet(cls.network)
        cls.router = cls.create_router(data_utils.rand_name('router-'),
                                       external_network_id=cls.ext_net_id)
        cls.create_router_interface(cls.router['id'], cls.subnet['id'])
        cls.port = list()
        # Create two ports one each for Creation and Updating of floatingIP
        for i in range(2):
            cls.create_port(cls.network)
Ejemplo n.º 35
0
 def resource_setup(cls):
     super(ExtraDHCPOptionsTestJSON, cls).resource_setup()
     if not test.is_extension_enabled('extra_dhcp_opt', 'network'):
         msg = "Extra DHCP Options extension not enabled."
         raise cls.skipException(msg)
     cls.network = cls.create_network()
     cls.subnet = cls.create_subnet(cls.network)
     cls.port = cls.create_port(cls.network)
     cls.ip_tftp = ('123.123.123.123' if cls._ip_version == 4
                    else '2015::dead')
     cls.ip_server = ('123.123.123.45' if cls._ip_version == 4
                      else '2015::badd')
     cls.extra_dhcp_opts = [
         {'opt_value': 'pxelinux.0', 'opt_name': 'bootfile-name'},
         {'opt_value': cls.ip_tftp, 'opt_name': 'tftp-server'},
         {'opt_value': cls.ip_server, 'opt_name': 'server-ip-address'}
     ]
Ejemplo n.º 36
0
    def resource_setup(cls):
        super(FloatingIPTestJSON, cls).resource_setup()
        if not test.is_extension_enabled('router', 'network'):
            msg = "router extension not enabled."
            raise cls.skipException(msg)
        cls.ext_net_id = CONF.network.public_network_id

        # Create network, subnet, router and add interface
        cls.network = cls.create_network()
        cls.subnet = cls.create_subnet(cls.network)
        cls.router = cls.create_router(data_utils.rand_name('router-'),
                                       external_network_id=cls.ext_net_id)
        cls.create_router_interface(cls.router['id'], cls.subnet['id'])
        cls.port = list()
        # Create two ports one each for Creation and Updating of floatingIP
        for i in range(2):
            cls.create_port(cls.network)
Ejemplo n.º 37
0
 def resource_setup(cls):
     for ext in ['router', 'dvr']:
         if not test.is_extension_enabled(ext, 'network'):
             msg = "%s extension not enabled." % ext
             raise cls.skipException(msg)
     # The check above will pass if api_extensions=all, which does
     # not mean DVR extension itself is present.
     # Instead, we have to check whether DVR is actually present by using
     # admin credentials to create router with distributed=True attribute
     # and checking for BadRequest exception and that the resulting router
     # has a distributed attribute.
     super(RoutersTestDVR, cls).resource_setup()
     name = data_utils.rand_name('pretest-check')
     router = cls.admin_client.create_router(name)
     if 'distributed' not in router['router']:
         msg = "'distributed' attribute not found. DVR Possibly not enabled"
         raise cls.skipException(msg)
     cls.admin_client.delete_router(router['router']['id'])
Ejemplo n.º 38
0
 def resource_setup(cls):
     for ext in ["router", "dvr"]:
         if not test.is_extension_enabled(ext, "network"):
             msg = "%s extension not enabled." % ext
             raise cls.skipException(msg)
     # The check above will pass if api_extensions=all, which does
     # not mean DVR extension itself is present.
     # Instead, we have to check whether DVR is actually present by using
     # admin credentials to create router with distributed=True attribute
     # and checking for BadRequest exception and that the resulting router
     # has a distributed attribute.
     super(RoutersTestDVR, cls).resource_setup()
     name = data_utils.rand_name("pretest-check")
     router = cls.admin_client.create_router(name)
     if "distributed" not in router["router"]:
         msg = "'distributed' attribute not found. DVR Possibly not enabled"
         raise cls.skipException(msg)
     cls.admin_client.delete_router(router["router"]["id"])
Ejemplo n.º 39
0
    def resource_setup(cls):
        if not test.is_extension_enabled('vpnaas', 'network'):
            msg = "vpnaas extension not enabled."
            raise cls.skipException(msg)
        super(VPNaaSTestJSON, cls).resource_setup()
        cls.ext_net_id = CONF.network.public_network_id
        cls.network = cls.create_network()
        cls.subnet = cls.create_subnet(cls.network)
        cls.router = cls.create_router(
            data_utils.rand_name("router"),
            external_network_id=CONF.network.public_network_id)
        cls.create_router_interface(cls.router['id'], cls.subnet['id'])
        cls.vpnservice = cls.create_vpnservice(cls.subnet['id'],
                                               cls.router['id'])

        cls.ikepolicy = cls.create_ikepolicy(
            data_utils.rand_name("ike-policy-"))
        cls.ipsecpolicy = cls.create_ipsecpolicy(
            data_utils.rand_name("ipsec-policy-"))
Ejemplo n.º 40
0
 def resource_setup(cls):
     super(ExtraDHCPOptionsTestJSON, cls).resource_setup()
     if not test.is_extension_enabled('extra_dhcp_opt', 'network'):
         msg = "Extra DHCP Options extension not enabled."
         raise cls.skipException(msg)
     cls.network = cls.create_network()
     cls.subnet = cls.create_subnet(cls.network)
     cls.port = cls.create_port(cls.network)
     cls.ip_tftp = ('123.123.123.123'
                    if cls._ip_version == 4 else '2015::dead')
     cls.ip_server = ('123.123.123.45'
                      if cls._ip_version == 4 else '2015::badd')
     cls.extra_dhcp_opts = [{
         'opt_value': 'pxelinux.0',
         'opt_name': 'bootfile-name'
     }, {
         'opt_value': cls.ip_tftp,
         'opt_name': 'tftp-server'
     }, {
         'opt_value': cls.ip_server,
         'opt_name': 'server-ip-address'
     }]
Ejemplo n.º 41
0
    def resource_setup(cls):
        super(ESXNetworksTestJSON, cls).resource_setup()
        admin_manager = clients.AdminManager()
        cls.identity_admin_client = admin_manager.identity_client
        cls.auth_provider = manager.get_auth_provider(
            cls.isolated_creds.get_primary_creds())
        if not test.is_extension_enabled('router', 'network'):
            msg = "router extension not enabled."
            raise cls.skipException(msg)
        cls.ext_net_id = CONF.network.public_network_id

        # Create network, subnet, router and add interface
        cls.network = cls.create_network()
        cls.subnet = cls.create_subnet(cls.network)
        cls.tenant_cidr = (CONF.network.tenant_network_cidr
                           if cls._ip_version == 4 else
                           CONF.network.tenant_network_v6_cidr)
        cls.router = cls.create_router(data_utils.rand_name('router-'),
                                       external_network_id=cls.ext_net_id,
                                       admin_state_up="true")
        cls.create_router_interface(cls.router['id'], cls.subnet['id'])
        cls.port = list()
        cls.floating_ip = cls.create_floatingip(cls.ext_net_id)
        tempest_config.register_options()
Ejemplo n.º 42
0
 def resource_setup(cls):
     super(LoadBalancerTestJSON, cls).resource_setup()
     if not test.is_extension_enabled('lbaas', 'network'):
         msg = "lbaas extension not enabled."
         raise cls.skipException(msg)
     cls.network = cls.create_network()
     cls.name = cls.network['name']
     cls.subnet = cls.create_subnet(cls.network)
     pool_name = data_utils.rand_name('pool-')
     vip_name = data_utils.rand_name('vip-')
     cls.pool = cls.create_pool(pool_name, "ROUND_ROBIN",
                                "HTTP", cls.subnet)
     cls.vip = cls.create_vip(name=vip_name,
                              protocol="HTTP",
                              protocol_port=80,
                              subnet=cls.subnet,
                              pool=cls.pool)
     cls.member = cls.create_member(80, cls.pool, cls._ip_version)
     cls.member_address = ("10.0.9.47" if cls._ip_version == 4
                           else "2015::beef")
     cls.health_monitor = cls.create_health_monitor(delay=4,
                                                    max_retries=3,
                                                    Type="TCP",
                                                    timeout=1)