Пример #1
0
    def run(self, **kwargs):
        try:
            test_params = RapidTestManager.get_defaults()
            for key in kwargs:
                test_params[key] = kwargs[key]
            os.makedirs(self.res_dir, exist_ok=True)
            test_params['resultsdir'] = self.res_dir
            _, test_file_name = os.path.split(test_params['test_file'])
            _, environment_file_name = os.path.split(
                test_params['environment_file'])
            log_file = '{}/RUN{}.{}.log'.format(self.res_dir,
                                                environment_file_name,
                                                test_file_name)
            RapidLog.log_init(log_file, test_params['loglevel'],
                              test_params['screenloglevel'],
                              test_params['version'])
            test_manager = RapidTestManager()
            self.start_time = time.time()
            self.result, self.details = test_manager.run_tests(test_params)
            self.stop_time = time.time()
            RapidLog.log_close()

        except Exception:  # pylint: disable=broad-except
            print("Unexpected error:", sys.exc_info()[0])
            self.result = 0
            self.stop_time = time.time()
Пример #2
0
def main():
    rapid_stack_params = {}
    RapidStackManager.parse_config(rapid_stack_params)
    log_file = 'CREATE{}.log'.format(rapid_stack_params['stack_name'])
    RapidLog.log_init(log_file, 'DEBUG', 'INFO', '2021.03.15')
    #cloud_name = 'openstackL6'
    #stack_name = 'rapid'
    #heat_template = 'openstack-rapid.yaml'
    #heat_param = 'params_rapid.yaml'
    #user = '******'
    RapidStackManager.deploy_stack(rapid_stack_params)
Пример #3
0
def main():
    """Main function.
    """
    test_params = RapidTestManager.get_defaults()
    # When no cli is used, the process_cli can be replaced by code modifying
    # test_params
    test_params = RapidCli.process_cli(test_params)
    log_file = 'RUN{}.{}.log'.format(test_params['environment_file'],
            test_params['test_file'])
    RapidLog.log_init(log_file, test_params['loglevel'],
            test_params['screenloglevel'] , test_params['version']  )
    test_result = RapidTestManager.run_tests(test_params)
    RapidLog.info('Test result is : {}'.format(test_result))
Пример #4
0
def main():
    """Main function.
    """
    test_params = RapidTestManager.get_defaults()
    # When no cli is used, the process_cli can be replaced by code modifying
    # test_params
    test_params = RapidCli.process_cli(test_params)
    _, test_file_name = os.path.split(test_params['test_file'])
    _, environment_file_name = os.path.split(test_params['environment_file'])
    log_file = 'RUN{}.{}.log'.format(environment_file_name, test_file_name)
    RapidLog.log_init(log_file, test_params['loglevel'],
                      test_params['screenloglevel'], test_params['version'])
    test_manager = RapidTestManager()
    test_result, _ = test_manager.run_tests(test_params)
    RapidLog.log_close()