summaryrefslogtreecommitdiffstats
path: root/VNFs/DPPD-PROX/helper-scripts/rapid/rapid_machine.py
diff options
context:
space:
mode:
authorLuc Provoost <luc.provoost@intel.com>2021-01-27 17:18:31 +0100
committerLuc Provoost <luc.provoost@intel.com>2021-01-27 17:26:50 +0100
commit75198fcb02fcb5aa5fbfee92e9df6e4f8b25792b (patch)
tree336a8ba2930035776a26eba5b0e3286dd1eb6026 /VNFs/DPPD-PROX/helper-scripts/rapid/rapid_machine.py
parentcee5ad40ee80a34b30242657e1670a02263f4f87 (diff)
creation of tests and configs subdirectories
All test files are now in the tests directory. All PROX config files moved to the configs directory. When specifying a test on the runrapid.py command line, you should now also mention the directory: e.g. --test tests/basicrapid.test In these test files, you need now to also include the configs subdirectory when specifying the prox configuration that needs to be used. The --map parameter has also changed. It can still take the file name of the map file, that specifies which PROX instance to use during a test. On top of that, you can now also specify a list of indices of the machines to be used during a test: e.g. --map [1,3]. Change-Id: I887cba59834dd8c903a22bc80959b10da2775398 Signed-off-by: Luc Provoost <luc.provoost@intel.com>
Diffstat (limited to 'VNFs/DPPD-PROX/helper-scripts/rapid/rapid_machine.py')
-rw-r--r--VNFs/DPPD-PROX/helper-scripts/rapid/rapid_machine.py13
1 files changed, 7 insertions, 6 deletions
diff --git a/VNFs/DPPD-PROX/helper-scripts/rapid/rapid_machine.py b/VNFs/DPPD-PROX/helper-scripts/rapid/rapid_machine.py
index e47c1799..d9e18b09 100644
--- a/VNFs/DPPD-PROX/helper-scripts/rapid/rapid_machine.py
+++ b/VNFs/DPPD-PROX/helper-scripts/rapid/rapid_machine.py
@@ -18,6 +18,7 @@
from rapid_log import RapidLog
from prox_ctrl import prox_ctrl
+import os
import re
class RapidMachine(object):
@@ -69,8 +70,8 @@ class RapidMachine(object):
result = self._client.run_cmd(DevBindFileName)
RapidLog.debug('devbind.sh running for port {} on {} {}'.format(index, self.name, result))
- def generate_lua(self, vim, appendix = ''):
- PROXConfigfile = open (self.machine_params['config_file'], 'r')
+ def generate_lua(self, vim, prox_config_file, appendix = ''):
+ PROXConfigfile = open (prox_config_file, 'r')
PROXConfig = PROXConfigfile.read()
PROXConfigfile.close()
self.all_tasks_for_this_cfg = set(re.findall("task\s*=\s*(\d+)",PROXConfig))
@@ -104,13 +105,13 @@ class RapidMachine(object):
self._client.connect()
if self.vim in ['OpenStack']:
self.devbind()
- self.generate_lua(self.vim)
- self._client.scp_put(self.machine_params['config_file'], '{}/{}'.format(self.rundir, self.machine_params['config_file']))
+ _, prox_config_file_name = os.path.split(self.machine_params['config_file'])
+ self.generate_lua(self.vim, self.machine_params['config_file'])
+ 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, self.machine_params['config_file'])
+ 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, 'PROX Testing on {}'.format(self.name))
- #RapidLog.debug("Finished PROX on {}: {}, {}".format(self.name, cmd, result))
RapidLog.debug("Finished PROX on {}: {}".format(self.name, cmd))
def close_prox(self):