summaryrefslogtreecommitdiffstats
path: root/VNFs/DPPD-PROX/helper-scripts/rapid/rapid_machine.py
diff options
context:
space:
mode:
authorLuc Provoost <luc.provoost@intel.com>2021-05-05 18:09:07 +0200
committerLuc Provoost <luc.provoost@intel.com>2021-05-05 18:09:07 +0200
commit0e9709a99633737364e8f3f5b475f30f0cfbddcb (patch)
treefcbc1e9860503575109989e019cb4d52fb01b7b9 /VNFs/DPPD-PROX/helper-scripts/rapid/rapid_machine.py
parent4d80ebbc19018121572ecaa043bf7d4900a8144f (diff)
New test case: gen versus swap via gateway
A new test was added: tests/basicrapid_gw.test. Traffic generated will now go to the reflector (swap instance) via the Gateway. The swap instance will also send the traffic back via the gateway. This use case is created to support GCP testing where the interfaces are defined with a /32 netmask, and hence all traffic is routed via the gateway. Change-Id: I60142d650072ab345cd47a0f32cb6a8275da0542 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.py15
1 files changed, 11 insertions, 4 deletions
diff --git a/VNFs/DPPD-PROX/helper-scripts/rapid/rapid_machine.py b/VNFs/DPPD-PROX/helper-scripts/rapid/rapid_machine.py
index e97b255a..d0ce8c14 100644
--- a/VNFs/DPPD-PROX/helper-scripts/rapid/rapid_machine.py
+++ b/VNFs/DPPD-PROX/helper-scripts/rapid/rapid_machine.py
@@ -50,10 +50,11 @@ class RapidMachine(object):
self.machine_params = machine_params
self.vim = vim
self.cpu_mapping = None
- PROXConfigfile = open (self.machine_params['config_file'], 'r')
- PROXConfig = PROXConfigfile.read()
- PROXConfigfile.close()
- self.all_tasks_for_this_cfg = set(re.findall("task\s*=\s*(\d+)",PROXConfig))
+ if 'config_file' in self.machine_params.keys():
+ PROXConfigfile = open (self.machine_params['config_file'], 'r')
+ PROXConfig = PROXConfigfile.read()
+ PROXConfigfile.close()
+ self.all_tasks_for_this_cfg = set(re.findall("task\s*=\s*(\d+)",PROXConfig))
def __del__(self):
if ((not self.configonly) and self.machine_params['prox_socket']):
@@ -154,6 +155,12 @@ class RapidMachine(object):
LuaFile.write('dest_ip{}="{}"\n'.format(index, dest_port['ip']))
LuaFile.write('dest_hex_ip{}=convertIPToHex(dest_ip{})\n'.format(index, index))
LuaFile.write('dest_hex_mac{}="{}"\n'.format(index , dest_port['mac'].replace(':',' ')))
+ if 'gw_vm' in self.machine_params.keys():
+ for index, gw_ip in enumerate(self.machine_params['gw_ips'],
+ start = 1):
+ LuaFile.write('gw_ip{}="{}"\n'.format(index, gw_ip))
+ LuaFile.write('gw_hex_ip{}=convertIPToHex(gw_ip{})\n'.
+ format(index, index))
LuaFile.write(appendix)
self._client.scp_put(self.LuaFileName, self.rundir + '/parameters.lua')
self._client.scp_put('helper.lua', self.rundir + '/helper.lua')