diff options
-rw-r--r-- | VNFs/DPPD-PROX/helper-scripts/rapid/rapid_machine.py | 24 | ||||
-rw-r--r-- | VNFs/DPPD-PROX/helper-scripts/rapid/rapid_test.py | 5 | ||||
-rwxr-xr-x | VNFs/DPPD-PROX/helper-scripts/rapid/runrapid.py | 14 | ||||
-rw-r--r-- | VNFs/DPPD-PROX/helper-scripts/rapid/setup.cfg | 3 |
4 files changed, 31 insertions, 15 deletions
diff --git a/VNFs/DPPD-PROX/helper-scripts/rapid/rapid_machine.py b/VNFs/DPPD-PROX/helper-scripts/rapid/rapid_machine.py index c4b7247f..e46e46ef 100644 --- a/VNFs/DPPD-PROX/helper-scripts/rapid/rapid_machine.py +++ b/VNFs/DPPD-PROX/helper-scripts/rapid/rapid_machine.py @@ -197,18 +197,18 @@ class RapidMachine(object): self.remap_all_cpus() _, prox_config_file_name = os.path.split(self. machine_params['config_file']) - self.generate_lua() - self._client.scp_put(self.machine_params['config_file'], '{}/{}'. - format(self.rundir, prox_config_file_name)) - if ((not self.configonly) and - self.machine_params['prox_launch_exit']): - cmd = 'sudo {}/prox {} -t -o cli -f {}/{}'.format(self.rundir, - autostart, self.rundir, prox_config_file_name) - RapidLog.debug("Starting PROX on {}: {}".format(self.name, - cmd)) - result = self._client.run_cmd(cmd) - RapidLog.debug("Finished PROX on {}: {}".format(self.name, - cmd)) + if self.machine_params['prox_launch_exit']: + self.generate_lua() + self._client.scp_put(self.machine_params['config_file'], '{}/{}'. + format(self.rundir, prox_config_file_name)) + if not self.configonly: + cmd = 'sudo {}/prox {} -t -o cli -f {}/{}'.format(self.rundir, + autostart, self.rundir, prox_config_file_name) + RapidLog.debug("Starting PROX on {}: {}".format(self.name, + cmd)) + result = self._client.run_cmd(cmd) + RapidLog.debug("Finished PROX on {}: {}".format(self.name, + cmd)) def close_prox(self): if (not self.configonly) and self.machine_params[ diff --git a/VNFs/DPPD-PROX/helper-scripts/rapid/rapid_test.py b/VNFs/DPPD-PROX/helper-scripts/rapid/rapid_test.py index 16cf9190..7357a6e5 100644 --- a/VNFs/DPPD-PROX/helper-scripts/rapid/rapid_test.py +++ b/VNFs/DPPD-PROX/helper-scripts/rapid/rapid_test.py @@ -20,6 +20,7 @@ import yaml import requests import time +import os import copy from past.utils import old_div from rapid_log import RapidLog @@ -27,6 +28,8 @@ from rapid_log import bcolors inf = float("inf") from datetime import datetime as dt +_CURR_DIR = os.path.dirname(os.path.realpath(__file__)) + class RapidTest(object): """ Class to manage the testing @@ -40,7 +43,7 @@ class RapidTest(object): self.test['maxr'] = 1 if 'maxz' not in self.test.keys(): self.test['maxz'] = inf - with open('format.yaml') as f: + with open(os.path.join(_CURR_DIR,'format.yaml')) as f: self.data_format = yaml.load(f, Loader=yaml.FullLoader) @staticmethod diff --git a/VNFs/DPPD-PROX/helper-scripts/rapid/runrapid.py b/VNFs/DPPD-PROX/helper-scripts/rapid/runrapid.py index f3d489d6..e4055cc5 100755 --- a/VNFs/DPPD-PROX/helper-scripts/rapid/runrapid.py +++ b/VNFs/DPPD-PROX/helper-scripts/rapid/runrapid.py @@ -43,6 +43,12 @@ class RapidTestManager(object): """ RapidTestManager Class """ + def __init__(self): + """ + Init Function + """ + self.machines = [] + def __del__(self): for machine in self.machines: machine.close_prox() @@ -57,7 +63,6 @@ class RapidTestManager(object): monitor_gen = monitor_sut = False background_machines = [] sut_machine = gen_machine = None - self.machines = [] configonly = test_params['configonly'] for machine_params in test_params['machines']: if 'gencores' in machine_params.keys(): @@ -168,7 +173,12 @@ def main(): 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) + if 'resultsdir' in test_params: + res_dir = test_params['resultsdir'] + log_file = '{}/RUN{}.{}.log'.format(res_dir,environment_file_name, + test_file_name) + else: + 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() diff --git a/VNFs/DPPD-PROX/helper-scripts/rapid/setup.cfg b/VNFs/DPPD-PROX/helper-scripts/rapid/setup.cfg index 2f9542e1..bac49bd5 100644 --- a/VNFs/DPPD-PROX/helper-scripts/rapid/setup.cfg +++ b/VNFs/DPPD-PROX/helper-scripts/rapid/setup.cfg @@ -6,6 +6,9 @@ version = 1 packages = . package_dir = . +[options.data_files] +. = format.yaml + [entry_points] xtesting.testcase = rapidxt = rapidxt:RapidXt |