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


Python test.is_extension_enabled函数代码示例

本文整理汇总了Python中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', 'binding', 'quotas',
                          'agent', 'router', '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)
开发者ID:ajayaa,项目名称:tempest,代码行数:34,代码来源:test_extensions.py

示例2: skip_checks

 def skip_checks(cls):
     super(LoadBalancerTestJSON, cls).skip_checks()
     if not test.is_extension_enabled('lbaas', 'network'):
         msg = "lbaas extension not enabled."
         raise cls.skipException(msg)
     if not test.is_extension_enabled('nsxv-router-type', 'network'):
         msg = "nsxv-router-type extension is not enabled"
         raise cls.skipException(msg)
开发者ID:gravity-tak,项目名称:vmware-nsx-tempest,代码行数:8,代码来源:test_v1_lbaas.py

示例3: skip_checks

 def skip_checks(cls):
     super(L2GatewayConnectionTest, cls).skip_checks()
     if not test.is_extension_enabled('l2-gateway', 'network'):
         msg = "l2-gateway extension not enabled."
         raise cls.skipException(msg)
     if not test.is_extension_enabled('l2-gateway-connection',
                                      'network'):
         msg = "l2-gateway-connection extension is not enabled"
         raise cls.skipException(msg)
     # skip test if CONF session:l2gw does not have the following opts
     cls.getattr_or_skip_test("device_one_vlan")
     cls.getattr_or_skip_test("vlan_subnet_ipv4_dict")
开发者ID:gravity-tak,项目名称:vmware-nsx-tempest,代码行数:12,代码来源:test_l2_gateway_connection.py

示例4: 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])
     project_id = self.client.tenant_id
     self.assertEqual(project_id, network['tenant_id'])
     if test.is_extension_enabled('project-id', 'network'):
         self.assertEqual(project_id, network['project_id'])
开发者ID:AradhanaSingh,项目名称:neutron,代码行数:13,代码来源:test_networks.py

示例5: setUpClass

    def setUpClass(cls):
        super(FlavorsExtraSpecsNegativeTestJSON, cls).setUpClass()
        if not test.is_extension_enabled('FlavorExtraData', 'compute'):
            msg = "FlavorExtraData extension not enabled."
            raise cls.skipException(msg)

        cls.client = cls.os_adm.flavors_client
        flavor_name = data_utils.rand_name('test_flavor')
        ram = 512
        vcpus = 1
        disk = 10
        ephemeral = 10
        cls.new_flavor_id = data_utils.rand_int_id(start=1000)
        swap = 1024
        rxtx = 1
        # Create a flavor
        resp, cls.flavor = cls.client.create_flavor(
            flavor_name,
            ram,
            vcpus,
            disk,
            cls.new_flavor_id,
            ephemeral=ephemeral,
            swap=swap,
            rxtx=rxtx)
开发者ID:JasGit,项目名称:tempest,代码行数:25,代码来源:test_flavors_extra_specs_negative.py

示例6: skip_checks

 def skip_checks(cls):
     super(L2GatewayTest, cls).skip_checks()
     if not test.is_extension_enabled('l2-gateway', 'network'):
         msg = "l2-gateway extension not enabled."
         raise cls.skipException(msg)
     # if CONF attr device_on_vlan not defined, SKIP entire test suite
     cls.getattr_or_skip_test("device_one_vlan")
开发者ID:aaronorosen,项目名称:vmware-nsx,代码行数:7,代码来源:test_l2_gateway.py

示例7: resource_setup

    def resource_setup(cls):
        super(L7PolicyRulesTestJSON, cls).resource_setup()
        if not test.is_extension_enabled('lbaasv2', 'network'):
            msg = "lbaas extension not enabled."
            raise cls.skipException(msg)
        network_name = data_utils.rand_name('network')
        cls.network = cls.create_network(network_name)
        cls.subnet = cls.create_subnet(cls.network)
        cls.create_lb_kwargs = {'tenant_id': cls.subnet['tenant_id'],
                                'vip_subnet_id': cls.subnet['id']}
        cls.load_balancer = \
            cls._create_active_load_balancer(**cls.create_lb_kwargs)
        cls.load_balancer_id = cls.load_balancer['id']

        # Create listener for tests
        cls.create_listener_kwargs = {'loadbalancer_id': cls.load_balancer_id,
                                      'protocol': "HTTP",
                                      'protocol_port': "80"}
        cls.listener = (
            cls._create_listener(**cls.create_listener_kwargs))
        cls.listener_id = cls.listener['id']

        # Create pool for tests
        cls.create_pool_kwargs = {'listener_id': cls.listener_id,
                                  'protocol': "HTTP",
                                  'lb_algorithm': "ROUND_ROBIN"}
        cls.pool = (
            cls._create_pool(**cls.create_pool_kwargs))
        cls.pool_id = cls.pool['id']

        cls.partition = 'Project_' + cls.subnet['tenant_id']
        cls.vs_name = 'Project_' + cls.listener_id
        cls.bigip = BigIpClient()
开发者ID:litmaj0r,项目名称:f5-openstack-lbaasv2-driver,代码行数:33,代码来源:test_l7policy_update.py

示例8: resource_setup

    def resource_setup(cls):
        super(BgpSpeakerTestJSONBase, cls).resource_setup()
        if not test.is_extension_enabled('bgp_speaker', 'network'):
            msg = "BGP Speaker extension is not enabled."
            raise cls.skipException(msg)

        cls.ext_net_id = CONF.network.public_network_id
开发者ID:ypraveen,项目名称:neutron,代码行数:7,代码来源:test_bgp_speaker_extensions.py

示例9: verify_flavor_response_extension

 def verify_flavor_response_extension(flavor):
     # check some extensions for the flavor create/show/detail response
     self.assertEqual(flavor['swap'], 0)
     if test.is_extension_enabled("os-flavor-rxtx", "compute_v3"):
         self.assertEqual(int(flavor['os-flavor-rxtx:rxtx_factor']), 1)
     self.assertEqual(int(flavor['ephemeral']), 0)
     self.assertEqual(flavor['flavor-access:is_public'], True)
开发者ID:arnaudleg,项目名称:tempest,代码行数:7,代码来源:test_flavors.py

示例10: 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:danielmellado,项目名称:neutron,代码行数:28,代码来源:test_flavors_extensions.py

示例11: skip_checks

 def skip_checks(cls):
     super(TestProviderDistributedRouterTenantNetwork,
           cls).skip_checks()
     for ext in ['dvr', 'nsxv-router-type']:
         if not test.is_extension_enabled(ext, 'network'):
             msg = "%s extension not enabled." % ext
             raise cls.skipException(msg)
开发者ID:aaronorosen,项目名称:vmware-nsx,代码行数:7,代码来源:test_deployments.py

示例12: skip_checks

 def skip_checks(cls):
     """
     Skip running test if we do not meet criteria to run the tests.
     """
     super(BaseL2GatewayTest, cls).skip_checks()
     if not test.is_extension_enabled("l2-gateway", "network"):
         raise cls.skipException("l2-gateway extension not enabled.")
开发者ID:ddoshiopenstack,项目名称:vmware-nsx,代码行数:7,代码来源:base_l2gw.py

示例13: resource_setup

    def resource_setup(cls):
        """Setup client fixtures for test suite."""
        super(MemberStatusTestJSON, cls).resource_setup()
        if not test.is_extension_enabled('lbaas', 'network'):
            msg = "lbaas extension not enabled."
            raise cls.skipException(msg)
        network_name = data_utils.rand_name('network')
        cls.network = cls.create_network(network_name)
        cls.subnet = cls.create_subnet(cls.network)

        cls.create_lb_kwargs = {'tenant_id': cls.subnet['tenant_id'],
                                'vip_subnet_id': cls.subnet['id']}
        cls.load_balancer = \
            cls._create_active_load_balancer(**cls.create_lb_kwargs)
        cls.load_balancer_id = cls.load_balancer['id']

        # create listener
        listener_kwargs = {'loadbalancer_id': cls.load_balancer_id,
                           'protocol': 'HTTP',
                           'protocol_port': 80}
        cls.listener = cls._create_listener(**listener_kwargs)

        # get an RPC client for calling into driver
        cls.client = cls.plugin_rpc.get_client()
        cls.context = cls.plugin_rpc.get_context()
开发者ID:litmaj0r,项目名称:f5-openstack-lbaasv2-driver,代码行数:25,代码来源:test_member_status.py

示例14: 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:kbijon,项目名称:OpenStack-CVRM,代码行数:7,代码来源:test_fwaas_extensions.py

示例15: setUpClass

 def setUpClass(cls):
     super(FWaaSExtensionTestJSON, cls).setUpClass()
     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:AminaMseddi,项目名称:tempest,代码行数:7,代码来源:test_fwaas_extensions.py


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