summaryrefslogtreecommitdiffstats
path: root/VNFs/DPPD-PROX/helper-scripts/rapid/rapid_parser.py
diff options
context:
space:
mode:
authorLuc Provoost <luc.provoost@intel.com>2020-05-11 05:06:17 -0400
committerLuc Provoost <luc.provoost@intel.com>2020-05-15 11:55:09 +0200
commit9d4e94ed8cbd2110cab0388181bad3223a1155ce (patch)
treef5c92fdccccdc54701ea21a2a4e7b6aa47bfe8cd /VNFs/DPPD-PROX/helper-scripts/rapid/rapid_parser.py
parent4d932aced6931d756e07dbce6ab7cf04799ba5f4 (diff)
createrapid.py is now using heat templates yaml
yaml files have been added to the repo as an example. Please check the README explaining the output section reqs for this yaml file. There is also a new file (config_file): it also specifies which yaml files to use. multiple dataplane interfaces per VM can now be specified and will appear in the <STACK>.env file. An error in setting the packet size has been fixed (see set_udp_packet_size for packet size setting details) Change-Id: Ie89a4940521dac7dd3652acca477739abb9f5497 Signed-off-by: Luc Provoost <luc.provoost@intel.com>
Diffstat (limited to 'VNFs/DPPD-PROX/helper-scripts/rapid/rapid_parser.py')
-rw-r--r--VNFs/DPPD-PROX/helper-scripts/rapid/rapid_parser.py48
1 files changed, 24 insertions, 24 deletions
diff --git a/VNFs/DPPD-PROX/helper-scripts/rapid/rapid_parser.py b/VNFs/DPPD-PROX/helper-scripts/rapid/rapid_parser.py
index 864f84b8..bebc748e 100644
--- a/VNFs/DPPD-PROX/helper-scripts/rapid/rapid_parser.py
+++ b/VNFs/DPPD-PROX/helper-scripts/rapid/rapid_parser.py
@@ -87,7 +87,7 @@ class RapidConfigParser(object):
section = 'TestM%d'%test_machine
options = testconfig.options(section)
for option in options:
- if option in ['prox_socket','prox_launch_exit']:
+ if option in ['prox_socket','prox_launch_exit','monitor']:
machine[option] = testconfig.getboolean(section, option)
elif option in ['cores', 'gencores','latcores']:
machine[option] = ast.literal_eval(testconfig.get(section, option))
@@ -96,41 +96,41 @@ class RapidConfigParser(object):
for key in ['prox_socket','prox_launch_exit']:
if key not in machine.keys():
machine[key] = True
+ if 'monitor' not in machine.keys():
+ machine['monitor'] = True
index = int(machine_map.get('TestM%d'%test_machine, 'machine_index'))
section = 'M%d'%index
options = config.options(section)
for option in options:
machine[option] = config.get(section, option)
- if 'monitor' not in machine.keys():
- machine['monitor'] = True
- else:
- machine['monitor'] = config.getboolean(section, option)
machines.append(dict(machine))
for machine in machines:
dp_ports = []
if 'dest_vm' in machine.keys():
index = 1
- dp_ip_key = 'dp_ip{}'.format(index)
- dp_mac_key = 'dp_mac{}'.format(index)
- if dp_ip_key in machines[int(machine['dest_vm'])-1].keys() and \
- dp_mac_key in machines[int(machine['dest_vm'])-1].keys():
- dp_port = {'ip': machines[int(machine['dest_vm'])-1][dp_ip_key],
- 'mac' : machines[int(machine['dest_vm'])-1][dp_mac_key]}
- dp_ports.append(dict(dp_port))
- index += 1
- else:
- break
- machine['dest_ports'] = list(dp_ports)
+ while True:
+ dp_ip_key = 'dp_ip{}'.format(index)
+ dp_mac_key = 'dp_mac{}'.format(index)
+ if dp_ip_key in machines[int(machine['dest_vm'])-1].keys() and \
+ dp_mac_key in machines[int(machine['dest_vm'])-1].keys():
+ dp_port = {'ip': machines[int(machine['dest_vm'])-1][dp_ip_key],
+ 'mac' : machines[int(machine['dest_vm'])-1][dp_mac_key]}
+ dp_ports.append(dict(dp_port))
+ index += 1
+ else:
+ break
+ machine['dest_ports'] = list(dp_ports)
gw_ips = []
if 'gw_vm' in machine.keys():
index = 1
- gw_ip_key = 'dp_ip{}'.format(index)
- if gw_ip_key in machines[int(machine['gw_vm'])-1].keys():
- gw_ip = machines[int(machine['dest_vm'])-1][gw_ip_key]
- gw_ips.append(gw_ip)
- index += 1
- else:
- break
- machine['gw_ips'] = list(gw_ips)
+ while True:
+ gw_ip_key = 'dp_ip{}'.format(index)
+ if gw_ip_key in machines[int(machine['gw_vm'])-1].keys():
+ gw_ip = machines[int(machine['dest_vm'])-1][gw_ip_key]
+ gw_ips.append(gw_ip)
+ index += 1
+ else:
+ break
+ machine['gw_ips'] = list(gw_ips)
test_params['machines'] = machines
return (test_params)