コード例 #1
0
    def run_tests(self, cluster_id, skip_tests=None):
        """Method run smoke, sanity and platform Ceilometer tests."""

        LOGGER.debug('Run sanity and smoke tests')
        self.fuel_web.run_ostf(cluster_id=cluster_id,
                               test_sets=['smoke', 'sanity'],
                               timeout=60 * 15)

        LOGGER.debug('Run platform OSTF Ceilometer tests')

        test_class_main = ('fuel_health.tests.tests_platform.'
                           'test_ceilometer.'
                           'CeilometerApiPlatformTests')
        tests_names = [
            'test_check_alarm_state', 'test_create_sample',
            'test_check_volume_events', 'test_check_glance_notifications',
            'test_check_keystone_notifications',
            'test_check_neutron_notifications',
            'test_check_sahara_notifications', 'test_check_events_and_traits'
        ]

        test_classes = []

        for test_name in tests_names:
            test_classes.append('{0}.{1}'.format(test_class_main, test_name))

        all_tests = [
            test['id']
            for test in self.fuel_web.client.get_ostf_tests(cluster_id)
        ]

        for test_id in test_classes:
            if test_id in all_tests:
                if skip_tests and test_id.split('.')[-1] in skip_tests:

                    all_status = self.fuel_web.run_single_ostf_test(
                        cluster_id=cluster_id,
                        test_sets=['tests_platform'],
                        test_name=test_id,
                        retries=True,
                        timeout=60 * 20)

                    test_name = next(
                        test['name']
                        for test in self.fuel_web.client.get_ostf_tests(
                            cluster_id) if test['id'] == test_id)

                    status = next(test.values()[0] for test in all_status
                                  if test.keys()[0] == test_name)

                    assert_equal(
                        status, "skipped",
                        'Test: "{}" must be skipped status, '
                        'but his status {}'.format(test_name, status))
                else:
                    self.fuel_web.run_single_ostf_test(
                        cluster_id=cluster_id,
                        test_sets=['tests_platform'],
                        test_name=test_id,
                        timeout=60 * 20)
コード例 #2
0
    def run_tests(self, cluster_id, skip_tests=None):
        """Method run smoke, sanity and platform Ceilometer tests."""

        logger.debug('Run sanity and smoke tests')
        self.fuel_web.run_ostf(
            cluster_id=cluster_id,
            test_sets=['smoke', 'sanity'],
            timeout=60 * 15
        )

        logger.debug('Run platform OSTF Ceilometer tests')

        test_class_main = ('fuel_health.tests.tests_platform.'
                           'test_ceilometer.'
                           'CeilometerApiPlatformTests')
        tests_names = ['test_check_alarm_state',
                       'test_create_sample',
                       'test_check_volume_events',
                       'test_check_glance_notifications',
                       'test_check_keystone_notifications',
                       'test_check_neutron_notifications',
                       'test_check_sahara_notifications',
                       'test_check_events_and_traits']

        test_classes = []

        for test_name in tests_names:
            test_classes.append('{0}.{1}'.format(test_class_main,
                                                 test_name))

        all_tests = [
            test['id'] for test
            in self.fuel_web.fuel_client.ostf.get_tests(cluster_id)]

        for test_id in test_classes:
            if test_id in all_tests:
                if skip_tests and test_id.split('.')[-1] in skip_tests:

                    all_status = self.fuel_web.run_single_ostf_test(
                        cluster_id=cluster_id, test_sets=['tests_platform'],
                        test_name=test_id, retries=True, timeout=60 * 20)

                    test_name = next(
                        test['name'] for test
                        in self.fuel_web.fuel_client.ostf.get_tests(cluster_id)
                        if test['id'] == test_id)

                    status = next(test.values()[0]
                                  for test in all_status
                                  if test.keys()[0] == test_name)

                    assert_equal(
                        status, "skipped",
                        'Test: "{}" must be skipped status, '
                        'but his status {}'.format(test_name, status))
                else:
                    self.fuel_web.run_single_ostf_test(
                        cluster_id=cluster_id, test_sets=['tests_platform'],
                        test_name=test_id, timeout=60 * 20)
コード例 #3
0
ファイル: test_services.py プロジェクト: vnaboychenko/fuel-qa
    def run_tests(self, cluster_id, skip_tests=None):
        """Method run smoke, sanity and platform Ceilometer tests."""

        LOGGER.debug("Run sanity and smoke tests")
        self.fuel_web.run_ostf(cluster_id=cluster_id, test_sets=["smoke", "sanity"], timeout=60 * 15)

        LOGGER.debug("Run platform OSTF Ceilometer tests")

        test_class_main = "fuel_health.tests.tests_platform." "test_ceilometer." "CeilometerApiPlatformTests"
        tests_names = [
            "test_check_alarm_state",
            "test_create_sample",
            "test_check_volume_notifications",
            "test_check_glance_notifications",
            "test_check_keystone_notifications",
            "test_check_neutron_notifications",
            "test_check_sahara_notifications",
            "test_check_events_and_traits",
        ]

        test_classes = []

        for test_name in tests_names:
            test_classes.append("{0}.{1}".format(test_class_main, test_name))

        all_tests = [test["id"] for test in self.fuel_web.client.get_ostf_tests(cluster_id)]

        for test_id in test_classes:
            if test_id in all_tests:
                if skip_tests and test_id.split(".")[-1] in skip_tests:

                    all_status = self.fuel_web.run_single_ostf_test(
                        cluster_id=cluster_id,
                        test_sets=["tests_platform"],
                        test_name=test_id,
                        retries=True,
                        timeout=60 * 20,
                    )

                    test_name = next(
                        test["name"]
                        for test in self.fuel_web.client.get_ostf_tests(cluster_id)
                        if test["id"] == test_id
                    )

                    status = next(test.values()[0] for test in all_status if test.keys()[0] == test_name)

                    assert_equal(
                        status,
                        "skipped",
                        'Test: "{}" must be skipped status, ' "but his status {}".format(test_name, status),
                    )
                else:
                    self.fuel_web.run_single_ostf_test(
                        cluster_id=cluster_id, test_sets=["tests_platform"], test_name=test_id, timeout=60 * 20
                    )