Beispiel #1
0
    def test_verify(self, mock_get, mock_tempest, mock_verification):
        mock_tempest.return_value = self.tempest
        self.tempest.is_installed.return_value = True
        mock_get.return_value = self.deployment
        api.verify(self.deploy_uuid, 'image_id', 'alt_image_id', 'flavor_id',
                   'alt_flavor_id', 'smoke', None)

        self.tempest.is_installed.assert_called_once_with()
        mock_get.assert_called_once_with(self.deploy_uuid)
        self.tempest.verify.assert_called_once_with(
            set_name='smoke', regex=None,
            options=(
                ('compute', [
                    ('flavor_ref', 'flavor_id'),
                    ('flavor_ref_alt', 'alt_flavor_id'),
                    ('image_ref', 'image_id'),
                    ('image_ref_alt', 'alt_image_id')]),
                ('compute-admin', [('password', 'myadminpass')]),
                ('identity', [
                    ('username', 'admin'),
                    ('password', 'myadminpass'),
                    ('tenant_name', 'demo'),
                    ('admin_username', 'admin'),
                    ('admin_password', 'myadminpass'),
                    ('admin_tenant_name', 'demo'),
                    ('uri', 'http://example.net:5000/v2.0/'),
                    ('uri_v3', 'http://example.net:5000/v3/')])))
Beispiel #2
0
    def test_verify(self, mock_tempest, mock_verification):
        mock_tempest.return_value = self.tempest
        self.tempest.is_installed.return_value = True
        api.verify(self.deploy_uuid, 'smoke', None)

        self.tempest.is_installed.assert_called_once_with()
        self.tempest.verify.assert_called_once_with(set_name='smoke',
                                                    regex=None)
Beispiel #3
0
    def test_verify(self, mock_tempest, mock_verification):
        mock_tempest.return_value = self.tempest
        self.tempest.is_installed.return_value = True
        api.verify(self.deploy_uuid, 'smoke', None)

        self.tempest.is_installed.assert_called_once_with()
        self.tempest.verify.assert_called_once_with(set_name='smoke',
                                                    regex=None)
Beispiel #4
0
    def test_verify(self, mock_tempest, mock_verification, mock_d_get):
        mock_d_get.return_value = {"uuid": self.deploy_uuid}

        mock_tempest.return_value = self.tempest
        self.tempest.is_installed.return_value = True
        api.verify(self.deploy_uuid, "smoke", None, None)

        self.tempest.is_installed.assert_called_once_with()
        self.tempest.verify.assert_called_once_with(set_name="smoke",
                                                    regex=None)
Beispiel #5
0
    def test_verify_tempest_not_installed(self, mock_tempest,
                                          mock_verification):
        mock_tempest.return_value = self.tempest
        self.tempest.is_installed.return_value = False
        api.verify(self.deploy_uuid, "smoke", None, None)

        self.tempest.is_installed.assert_called_once_with()
        self.tempest.install.assert_called_once_with()
        self.tempest.verify.assert_called_once_with(set_name="smoke",
                                                    regex=None)
Beispiel #6
0
    def test_verify_tempest_not_installed(self, mock_tempest,
                                          mock_verification):
        mock_tempest.return_value = self.tempest
        self.tempest.is_installed.return_value = False
        api.verify(self.deploy_uuid, "smoke", None, None)

        self.tempest.is_installed.assert_called_once_with()
        self.tempest.install.assert_called_once_with()
        self.tempest.verify.assert_called_once_with(set_name="smoke",
                                                    regex=None)
Beispiel #7
0
    def start(self, deploy_id=None, set_name='smoke', regex=None):
        """Start running tempest tests against a live cloud cluster.

        :param deploy_id: a UUID of a deployment
        :param set_name: Name of tempest test set
        :param regex: Regular expression of test
        """
        if regex:
            set_name = 'full'
        if set_name not in TEMPEST_TEST_SETS:
            print('Sorry, but there are no desired tempest test set. '
                  'Please choose from: %s' % ', '.join(TEMPEST_TEST_SETS))
            return(1)

        endpoints = db.deployment_get(deploy_id)['endpoints']
        endpoint_dict = endpoints[0]
        clients = osclients.Clients(objects.Endpoint(**endpoint_dict))
        glance = clients.glance()

        image_list = []
        for image in glance.images.list():
            if 'cirros' in image.name:
                image_list.append(image)

        #TODO(miarmak): Add ability to upload new images if there are no
        #necessary images in the cloud (cirros)

        try:
            image_id = image_list[0].id
            alt_image_id = image_list[1].id
        except IndexError:
            print('Sorry, but there are no desired images or only one')
            return(1)

        nova = clients.nova()
        flavor_list = []
        for fl in sorted(nova.flavors.list(), key=lambda flavor: flavor.ram):
            flavor_list.append(fl)

        #TODO(miarmak): Add ability to create new flavors if they are missing

        try:
            flavor_id = flavor_list[0].id
            alt_flavor_id = flavor_list[1].id
        except IndexError:
            print('Sorry, but there are no desired flavors or only one')
            return(1)

        #TODO(miarmak): Add getting network and router id's from neutronclient

        api.verify(deploy_id, image_id, alt_image_id, flavor_id, alt_flavor_id,
                   set_name, regex)
Beispiel #8
0
    def start(self, deploy_id=None, set_name="smoke", regex=None):
        """Start running tempest tests against a live cloud cluster.

        :param deploy_id: a UUID of a deployment
        :param set_name: Name of tempest test set
        :param regex: Regular expression of test
        """
        if regex:
            set_name = "full"
        if set_name not in consts.TEMPEST_TEST_SETS:
            print("Sorry, but there are no desired tempest test set. Please "
                  "choose from: %s" % ", ".join(consts.TEMPEST_TEST_SETS))
            return(1)

        api.verify(deploy_id, set_name, regex)
Beispiel #9
0
    def start(self, deploy_id=None, set_name="smoke", regex=None):
        """Start running tempest tests against a live cloud cluster.

        :param deploy_id: a UUID of a deployment
        :param set_name: Name of tempest test set
        :param regex: Regular expression of test
        """
        if regex:
            set_name = "full"
        if set_name not in consts.TEMPEST_TEST_SETS:
            print("Sorry, but there are no desired tempest test set. Please "
                  "choose from: %s" % ", ".join(consts.TEMPEST_TEST_SETS))
            return (1)

        api.verify(deploy_id, set_name, regex)
Beispiel #10
0
    def start(self, deploy_id=None, set_name='smoke', regex=None):
        """Start running tempest tests against a live cloud cluster.

        :param deploy_id: a UUID of a deployment
        :param set_name: Name of tempest test set
        :param regex: Regular expression of test
        """
        if regex:
            set_name = 'full'
        if set_name not in TEMPEST_TEST_SETS:
            print('Sorry, but there are no desired tempest test set. '
                  'Please choose from: %s' % ', '.join(TEMPEST_TEST_SETS))
            return (1)

        api.verify(deploy_id, set_name, regex)
Beispiel #11
0
    def start(self, deploy_id=None, set_name='smoke', regex=None):
        """Start running tempest tests against a live cloud cluster.

        :param deploy_id: a UUID of a deployment
        :param set_name: Name of tempest test set
        :param regex: Regular expression of test
        """
        if regex:
            set_name = 'full'
        if set_name not in TEMPEST_TEST_SETS:
            print('Sorry, but there are no desired tempest test set. '
                  'Please choose from: %s' % ', '.join(TEMPEST_TEST_SETS))
            return(1)

        api.verify(deploy_id, set_name, regex)
Beispiel #12
0
    def test_verify(self, mock_get, mock_tempest):
        mock_tempest.return_value = self.tempest
        self.tempest.is_installed.return_value = True
        mock_get.return_value = self.deployment
        api.verify(self.deploy_uuid, 'image_id', 'alt_image_id', 'flavor_id',
                   'alt_flavor_id', 'smoke', None)

        self.tempest.is_installed.assert_called_once_with()
        mock_get.assert_called_once_with(self.deploy_uuid)
        self.tempest.verify.assert_called_once_with(
            image_ref='image_id',
            image_ref_alt='alt_image_id',
            flavor_ref='flavor_id',
            flavor_ref_alt='alt_flavor_id',
            username='******',
            password='******',
            tenant_name='demo',
            uri='http://example.net:5000/v2.0/',
            uri_v3='http://example.net:5000/v3/',
            set_name='smoke',
            regex=None)
    def start(self, set_name="smoke", deploy_id=None, regex=None,
              tempest_config=None, do_use=False):
        """Start set of tests.

        :param set_name: Name of tempest test set
        :param deploy_id: a UUID of a deployment
        :param regex: Regular expression of test
        :param tempest_config: User specified Tempest config file location
        """

        if regex:
            set_name = "full"
        if set_name not in consts.TEMPEST_TEST_SETS:
            print("Sorry, but there are no desired tempest test set. Please "
                  "choose from: %s" % ", ".join(consts.TEMPEST_TEST_SETS))
            return (1)
        verification = api.verify(deploy_id, set_name, regex, tempest_config)
        if do_use:
            use.UseCommands().verification(verification["uuid"])
Beispiel #14
0
    def start(self,
              set_name="smoke",
              deploy_id=None,
              regex=None,
              tempest_config=None,
              do_use=False):
        """Start set of tests.

        :param set_name: Name of tempest test set
        :param deploy_id: a UUID of a deployment
        :param regex: Regular expression of test
        :param tempest_config: User specified Tempest config file location
        """

        if regex:
            set_name = "full"
        if set_name not in consts.TEMPEST_TEST_SETS:
            print("Sorry, but there are no desired tempest test set. Please "
                  "choose from: %s" % ", ".join(consts.TEMPEST_TEST_SETS))
            return (1)
        verification = api.verify(deploy_id, set_name, regex, tempest_config)
        if do_use:
            use.UseCommands().verification(verification["uuid"])