當前位置: 首頁>>代碼示例>>Python>>正文


Python NailgunClient.get_releases_details方法代碼示例

本文整理匯總了Python中fuelweb_test.models.nailgun_client.NailgunClient.get_releases_details方法的典型用法代碼示例。如果您正苦於以下問題:Python NailgunClient.get_releases_details方法的具體用法?Python NailgunClient.get_releases_details怎麽用?Python NailgunClient.get_releases_details使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在fuelweb_test.models.nailgun_client.NailgunClient的用法示例。


在下文中一共展示了NailgunClient.get_releases_details方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: FuelWebClient

# 需要導入模塊: from fuelweb_test.models.nailgun_client import NailgunClient [as 別名]
# 或者: from fuelweb_test.models.nailgun_client.NailgunClient import get_releases_details [as 別名]

#.........這裏部分代碼省略.........
            [test_result.update({test['name']:test['status']})
             for test in set_result['tests']]

            [failed_tests_res.append({test['name']:test['message']})
             for test in set_result['tests'] if test['status'] != 'success']

        logger.info('OSTF test statuses are : {0}'.format(test_result))

        if failed_test_name:
            for test_name in failed_test_name:
                assert_true(test_name in actual_failed_names,
                            'WARNINg unexpected fail,'
                            'expected {0} actual {1}'.format(
                                failed_test_name, actual_failed_names))

        assert_true(
            failed <= should_fail, 'Failed tests,  fails: {} should fail:'
                                   ' {} failed tests name: {}'
                                   ''.format(failed, should_fail,
                                             failed_tests_res))

    def assert_release_state(self, release_name, state='available'):
        logger.info('Assert release %s has state %s', release_name, state)
        for release in self.client.get_releases():
            if release["name"].find(release_name) != -1:
                assert_equal(release['state'], state,
                             'Release state {0}'.format(release['state']))
                return release["id"]

    def assert_release_role_present(self, release_name, role_name):
        logger.info('Assert role %s is available in release %s',
                    role_name, release_name)
        id = self.assert_release_state(release_name)
        release_data = self.client.get_releases_details(release_id=id)
        assert_equal(
            True, role_name in release_data['roles'],
            message='There is no {0} role in release id {1}'.format(
                role_name, release_name))

    @logwrap
    def assert_task_success(
            self, task, timeout=130 * 60, interval=5, progress=None):
        logger.info('Assert task %s is success', task)
        if not progress:
            task = self.task_wait(task, timeout, interval)
            assert_equal(
                task['status'], 'ready',
                "Task '{name}' has incorrect status. {} != {}".format(
                    task['status'], 'ready', name=task["name"]
                )
            )
        else:
            logger.info('Start to polling task progress')
            task = self.task_wait_progress(
                task, timeout=timeout, interval=interval, progress=progress)
            assert_true(
                task['progress'] >= progress,
                'Task has other progress{0}'.format(task['progress']))

    @logwrap
    def assert_task_failed(self, task, timeout=70 * 60, interval=5):
        logger.info('Assert task %s is failed', task)
        task = self.task_wait(task, timeout, interval)
        assert_equal(
            'error', task['status'],
            "Task '{name}' has incorrect status. {} != {}".format(
開發者ID:shaikapsar,項目名稱:fuel-main,代碼行數:70,代碼來源:fuel_web_client.py

示例2: FuelWebClient

# 需要導入模塊: from fuelweb_test.models.nailgun_client import NailgunClient [as 別名]
# 或者: from fuelweb_test.models.nailgun_client.NailgunClient import get_releases_details [as 別名]

#.........這裏部分代碼省略.........

            [test_result.update({test["name"]: test["status"]}) for test in set_result["tests"]]

            [
                failed_tests_res.append({test["name"]: test["message"]})
                for test in set_result["tests"]
                if test["status"] != "success"
            ]

        logger.info("OSTF test statuses are : {0}".format(test_result))

        if failed_test_name:
            for test_name in failed_test_name:
                assert_true(
                    test_name in actual_failed_names,
                    "WARNINg unexpected fail," "expected {0} actual {1}".format(failed_test_name, actual_failed_names),
                )

        assert_true(
            failed <= should_fail,
            "Failed tests,  fails: {} should fail:"
            " {} failed tests name: {}"
            "".format(failed, should_fail, failed_tests_res),
        )

    def assert_release_state(self, release_name, state="available"):
        for release in self.client.get_releases():
            if release["name"].find(release_name) != -1:
                assert_equal(release["state"], state)
                return release["id"]

    def assert_release_role_present(self, release_name, role_name):
        id = self.assert_release_state(release_name)
        release_data = self.client.get_releases_details(release_id=id)
        assert_equal(
            True,
            role_name in release_data["roles"],
            message="There is no {0} role in release id {1}".format(role_name, release_name),
        )

    @logwrap
    def assert_task_success(self, task, timeout=130 * 60, interval=5):
        task = self.task_wait(task, timeout, interval)
        assert_equal(
            task["status"],
            "ready",
            "Task '{name}' has incorrect status. {} != {}".format(task["status"], "ready", name=task["name"]),
        )

    @logwrap
    def assert_task_failed(self, task, timeout=70 * 60, interval=5):
        task = self.task_wait(task, timeout, interval)
        assert_equal(
            "error",
            task["status"],
            "Task '{name}' has incorrect status. {} != {}".format(task["status"], "error", name=task["name"]),
        )

    @logwrap
    def fqdn(self, devops_node):
        nailgun_node = self.get_nailgun_node_by_devops_node(devops_node)
        if OPENSTACK_RELEASE_UBUNTU in OPENSTACK_RELEASE:
            return nailgun_node["meta"]["system"]["fqdn"]
        return nailgun_node["fqdn"]

    @logwrap
開發者ID:piousbox,項目名稱:fuel-main,代碼行數:70,代碼來源:fuel_web_client.py

示例3: FuelWebClient

# 需要導入模塊: from fuelweb_test.models.nailgun_client import NailgunClient [as 別名]
# 或者: from fuelweb_test.models.nailgun_client.NailgunClient import get_releases_details [as 別名]

#.........這裏部分代碼省略.........
             for test in set_result['tests']]

            [failed_tests_res.append({test['name']:test['message']})
             for test in set_result['tests']
             if test['status'] != 'success' and test['status'] != 'disabled']

        logger.info('OSTF test statuses are : {0}'.format(test_result))

        if failed_test_name:
            for test_name in failed_test_name:
                assert_true(test_name in actual_failed_names,
                            'WARNINg unexpected fail,'
                            'expected {0} actual {1}'.format(
                                failed_test_name, actual_failed_names))

        assert_true(
            failed <= should_fail, 'Failed tests,  fails: {} should fail:'
                                   ' {} failed tests name: {}'
                                   ''.format(failed, should_fail,
                                             failed_tests_res))

    def assert_release_state(self, release_name, state='available'):
        logger.info('Assert release %s has state %s', release_name, state)
        for release in self.client.get_releases():
            if release["name"].find(release_name) != -1:
                assert_equal(release['state'], state,
                             'Release state {0}'.format(release['state']))
                return release["id"]

    def assert_release_role_present(self, release_name, role_name):
        logger.info('Assert role %s is available in release %s',
                    role_name, release_name)
        id = self.assert_release_state(release_name)
        release_data = self.client.get_releases_details(release_id=id)
        assert_equal(
            True, role_name in release_data['roles'],
            message='There is no {0} role in release id {1}'.format(
                role_name, release_name))

    @logwrap
    def assert_fuel_version(self, fuel_version):
        logger.info('Assert fuel version is {0}'.format(fuel_version))
        version = self.client.get_api_version()
        logger.debug('version get from api is {0}'.format(version['release']))
        assert_equal(version['release'], fuel_version,
                     'Release state is not {0}'.format(fuel_version))

    @logwrap
    def assert_nailgun_upgrade_migration(self,
                                         key='can_update_from_versions'):
        for release in self.client.get_releases():
            assert_true(key in release)

    @logwrap
    def assert_task_success(
            self, task, timeout=130 * 60, interval=5, progress=None):
        logger.info('Assert task %s is success', task)
        if not progress:
            task = self.task_wait(task, timeout, interval)
            assert_equal(
                task['status'], 'ready',
                "Task '{name}' has incorrect status. {} != {}".format(
                    task['status'], 'ready', name=task["name"]
                )
            )
        else:
開發者ID:igajsin,項目名稱:fuel-main,代碼行數:70,代碼來源:fuel_web_client.py


注:本文中的fuelweb_test.models.nailgun_client.NailgunClient.get_releases_details方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。