当前位置: 首页>>代码示例>>Python>>正文


Python test.is_extension_enabled函数代码示例

本文整理汇总了Python中neutron.tests.tempest.test.is_extension_enabled函数的典型用法代码示例。如果您正苦于以下问题:Python is_extension_enabled函数的具体用法?Python is_extension_enabled怎么用?Python is_extension_enabled使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了is_extension_enabled函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_list_show_extensions

    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)
开发者ID:TonyChengTW,项目名称:OpenStack_Liberty_Control,代码行数:35,代码来源:test_extensions.py

示例2: resource_setup

 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()
开发者ID:RynnYeh,项目名称:neutron,代码行数:7,代码来源:test_fwaas_extensions.py

示例3: resource_setup

    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)
开发者ID:apporc,项目名称:neutron,代码行数:28,代码来源:test_flavors_extensions.py

示例4: resource_setup

 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
开发者ID:glove747,项目名称:liberty-neutron,代码行数:7,代码来源:test_shared_network_extension.py

示例5: resource_setup

 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'])
开发者ID:CloudA,项目名称:neutron,代码行数:31,代码来源:test_l3_agent_scheduler.py

示例6: resource_setup

 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]
开发者ID:insequent,项目名称:neutron,代码行数:8,代码来源:test_agent_management.py

示例7: resource_setup

 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)
开发者ID:koteswar16,项目名称:networking-l2gw,代码行数:9,代码来源:test_l2gw_extensions.py

示例8: test_show_network

 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])
开发者ID:TonyChengTW,项目名称:OpenStack_Liberty_Control,代码行数:9,代码来源:test_networks.py

示例9: resource_setup

 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)
开发者ID:Akanksha08,项目名称:neutron,代码行数:10,代码来源:test_lbaas_agent_scheduler.py

示例10: test_list_networks_fields

 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))
开发者ID:TonyChengTW,项目名称:OpenStack_Liberty_Control,代码行数:10,代码来源:test_networks.py

示例11: resource_setup

 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)
开发者ID:Akanksha08,项目名称:neutron,代码行数:10,代码来源:test_routers.py

示例12: resource_setup

 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']
开发者ID:Akanksha08,项目名称:neutron,代码行数:10,代码来源:test_allowed_address_pair.py

示例13: resource_setup

 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)
开发者ID:Akanksha08,项目名称:neutron,代码行数:11,代码来源:test_dhcp_agent_scheduler.py

示例14: resource_setup

 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)
开发者ID:Akanksha08,项目名称:neutron,代码行数:11,代码来源:test_routers_negative.py

示例15: test_show_network_fields

 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])
开发者ID:TonyChengTW,项目名称:OpenStack_Liberty_Control,代码行数:11,代码来源:test_networks.py


注:本文中的neutron.tests.tempest.test.is_extension_enabled函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。