Beispiel #1
0
    def resource_setup(cls):
        super(BaseV2ComputeTest, cls).resource_setup()
        cls.request_microversion = (
            api_version_utils.select_request_microversion(
                cls.min_microversion,
                CONF.compute.min_microversion))
        cls.volume_request_microversion = (
            api_version_utils.select_request_microversion(
                cls.volume_min_microversion,
                CONF.volume.min_microversion))
        cls.placement_request_microversion = (
            api_version_utils.select_request_microversion(
                cls.placement_min_microversion,
                CONF.placement.min_microversion))
        cls.setup_api_microversion_fixture(
            compute_microversion=cls.request_microversion,
            volume_microversion=cls.volume_request_microversion,
            placement_microversion=cls.placement_request_microversion)

        cls.build_interval = CONF.compute.build_interval
        cls.build_timeout = CONF.compute.build_timeout
        cls.image_ref = CONF.compute.image_ref
        cls.image_ref_alt = CONF.compute.image_ref_alt
        cls.flavor_ref = CONF.compute.flavor_ref
        cls.flavor_ref_alt = CONF.compute.flavor_ref_alt
        cls.ssh_user = CONF.validation.image_ssh_user
        cls.ssh_alt_user = CONF.validation.image_alt_ssh_user
        cls.image_ssh_user = CONF.validation.image_ssh_user
        cls.image_alt_ssh_user = CONF.validation.image_alt_ssh_user
        cls.image_ssh_password = CONF.validation.image_ssh_password
        cls.image_alt_ssh_password = CONF.validation.image_alt_ssh_password
Beispiel #2
0
    def resource_setup(cls):
        super(BaseVolumeTest, cls).resource_setup()
        cls.volume_request_microversion = (
            api_version_utils.select_request_microversion(
                cls.volume_min_microversion, CONF.volume.min_microversion))
        cls.compute_request_microversion = (
            api_version_utils.select_request_microversion(
                cls.min_microversion, CONF.compute.min_microversion))

        cls.image_ref = CONF.compute.image_ref
        cls.flavor_ref = CONF.compute.flavor_ref
        cls.build_interval = CONF.volume.build_interval
        cls.build_timeout = CONF.volume.build_timeout
Beispiel #3
0
    def is_requested_microversion_compatible(cls, max_version):
        """Check the compatibility of selected request microversion

        This method will check if selected request microversion
        (cls.request_microversion) for test is compatible with respect
        to 'max_version'. Compatible means if selected request microversion
        is in the range(<=) of 'max_version'.

        :param max_version: maximum microversion to compare for compatibility.
            Example: '2.30'
        :returns: True if selected request microversion is compatible with
            'max_version'. False in other case.
        """
        try:
            req_version_obj = api_version_request.APIVersionRequest(
                cls.request_microversion)
        # NOTE(gmann): This is case where this method is used before calling
        # resource_setup(), where cls.request_microversion is set. There may
        # not be any such case but still we can handle this case.
        except AttributeError:
            request_microversion = (
                api_version_utils.select_request_microversion(
                    cls.min_microversion,
                    CONF.compute.min_microversion))
            req_version_obj = api_version_request.APIVersionRequest(
                request_microversion)
        max_version_obj = api_version_request.APIVersionRequest(max_version)
        return req_version_obj <= max_version_obj
Beispiel #4
0
    def is_requested_microversion_compatible(cls, max_version):
        """Check the compatibility of selected request microversion

        This method will check if selected request microversion
        (cls.request_microversion) for test is compatible with respect
        to 'max_version'. Compatible means if selected request microversion
        is in the range(<=) of 'max_version'.

        :param max_version: maximum microversion to compare for compatibility.
            Example: '2.30'
        :returns: True if selected request microversion is compatible with
            'max_version'. False in other case.
        """
        try:
            req_version_obj = api_version_request.APIVersionRequest(
                cls.request_microversion)
        # NOTE(gmann): This is case where this method is used before calling
        # resource_setup(), where cls.request_microversion is set. There may
        # not be any such case but still we can handle this case.
        except AttributeError:
            request_microversion = (
                api_version_utils.select_request_microversion(
                    cls.min_microversion, CONF.compute.min_microversion))
            req_version_obj = api_version_request.APIVersionRequest(
                request_microversion)
        max_version_obj = api_version_request.APIVersionRequest(max_version)
        return req_version_obj <= max_version_obj
 def resource_setup(cls):
     super(BareMetalManager, cls).resource_setup()
     cls.tenant_id = cls.manager.identity_client.tenant_id
     cls.request_microversion = (
         api_version_utils.select_request_microversion(
             cls.min_microversion,
             CONF.compute.min_microversion))
Beispiel #6
0
 def setup_credentials(cls):
     cls.request_microversion = (
         api_version_utils.select_request_microversion(
             cls.min_microversion,
             CONF.baremetal.min_microversion))
     cls.services_microversion = {
         CONF.baremetal.catalog_type: cls.request_microversion}
     super(BaseBaremetalTest, cls).setup_credentials()
Beispiel #7
0
 def setup_credentials(cls):
     cls.request_microversion = (
         api_version_utils.select_request_microversion(
             cls.min_microversion, CONF.baremetal.min_microversion))
     cls.services_microversion = {
         CONF.baremetal.catalog_type: cls.request_microversion
     }
     super(BaseBaremetalTest, cls).setup_credentials()
Beispiel #8
0
 def resource_setup(cls):
     super(BaseBaremetalTest, cls).resource_setup()
     cls.request_microversion = (
         api_version_utils.select_request_microversion(
             cls.min_microversion, CONF.baremetal.min_microversion))
     cls.driver = CONF.baremetal.driver
     cls.power_timeout = CONF.baremetal.power_timeout
     cls.unprovision_timeout = CONF.baremetal.unprovision_timeout
     cls.created_objects = {}
     for resource in RESOURCE_TYPES:
         cls.created_objects[resource] = set()
Beispiel #9
0
    def resource_setup(cls):
        super(BaseVolumeTest, cls).resource_setup()
        cls.request_microversion = (
            api_version_utils.select_request_microversion(
                cls.min_microversion,
                CONF.volume.min_microversion))

        cls.image_ref = CONF.compute.image_ref
        cls.flavor_ref = CONF.compute.flavor_ref
        cls.build_interval = CONF.volume.build_interval
        cls.build_timeout = CONF.volume.build_timeout
Beispiel #10
0
 def resource_setup(cls):
     super(BaseBaremetalTest, cls).resource_setup()
     cls.request_microversion = (
         api_version_utils.select_request_microversion(
             cls.min_microversion,
             CONF.baremetal.min_microversion))
     cls.driver = CONF.baremetal.driver
     cls.power_timeout = CONF.baremetal.power_timeout
     cls.unprovision_timeout = CONF.baremetal.unprovision_timeout
     cls.created_objects = {}
     for resource in RESOURCE_TYPES:
         cls.created_objects[resource] = set()
Beispiel #11
0
 def resource_setup(cls):
     super(BaseV2ComputeTest, cls).resource_setup()
     cls.request_microversion = (
         api_version_utils.select_request_microversion(
             cls.min_microversion,
             CONF.compute.min_microversion))
     cls.build_interval = CONF.compute.build_interval
     cls.build_timeout = CONF.compute.build_timeout
     cls.image_ref = CONF.compute.image_ref
     cls.image_ref_alt = CONF.compute.image_ref_alt
     cls.flavor_ref = CONF.compute.flavor_ref
     cls.flavor_ref_alt = CONF.compute.flavor_ref_alt
     cls.ssh_user = CONF.validation.image_ssh_user
     cls.image_ssh_user = CONF.validation.image_ssh_user
     cls.image_ssh_password = CONF.validation.image_ssh_password
Beispiel #12
0
 def resource_setup(cls):
     super(BaseV2ComputeTest, cls).resource_setup()
     cls.request_microversion = (
         api_version_utils.select_request_microversion(
             cls.min_microversion, CONF.compute.min_microversion))
     cls.build_interval = CONF.compute.build_interval
     cls.build_timeout = CONF.compute.build_timeout
     cls.image_ref = CONF.compute.image_ref
     cls.image_ref_alt = CONF.compute.image_ref_alt
     cls.flavor_ref = CONF.compute.flavor_ref
     cls.flavor_ref_alt = CONF.compute.flavor_ref_alt
     cls.ssh_user = CONF.validation.image_ssh_user
     cls.image_ssh_user = CONF.validation.image_ssh_user
     cls.image_ssh_password = CONF.validation.image_ssh_password
     cls.servers = []
     cls.images = []
     cls.security_groups = []
     cls.server_groups = []
 def resource_setup(cls):
     super(BaseV2ComputeTest, cls).resource_setup()
     cls.request_microversion = (
         api_version_utils.select_request_microversion(
             cls.min_microversion,
             CONF.compute.min_microversion))
 def _test_request_version(self, test_min_version, cfg_min_version,
                           expected_version):
     selected_version = api_version_utils.select_request_microversion(
         test_min_version, cfg_min_version)
     self.assertEqual(expected_version, selected_version)
Beispiel #15
0
 def resource_setup(cls):
     super(VolumeEncryptionTest, cls).resource_setup()
     cls.request_microversion = (
         api_version_utils.select_request_microversion(
             cls.min_microversion, CONF.compute.min_microversion))
Beispiel #16
0
 def resource_setup(cls):
     super(VolumesV3Test, cls).resource_setup()
     cls.request_microversion = (
         api_version_utils.select_request_microversion(
             cls.min_microversion,
             CONF.volume.min_microversion))
Beispiel #17
0
 def resource_setup(cls):
     super(BaseVolumeTest, cls).resource_setup()
     cls.request_microversion = (
         api_version_utils.select_request_microversion(
             cls.min_microversion, CONF.volume.min_microversion))
 def _test_request_version(self, test_min_version,
                           cfg_min_version, expected_version):
     selected_version = api_version_utils.select_request_microversion(
         test_min_version, cfg_min_version)
     self.assertEqual(expected_version, selected_version)
 def resource_setup(cls):
     super(CertificateValidationTest, cls).resource_setup()
     cls.request_microversion = (
         api_version_utils.select_request_microversion(
             cls.min_microversion, CONF.compute.min_microversion))
Beispiel #20
0
 def resource_setup(cls):
     super(ImageSigningTest, cls).resource_setup()
     cls.request_microversion = (
         api_version_utils.select_request_microversion(
             cls.min_microversion, CONF.compute.min_microversion))