From 942d5e737729a030bd8f436c1c41a71911e6dd45 Mon Sep 17 00:00:00 2001 From: Luc Provoost Date: Mon, 30 Jan 2023 11:48:00 +0100 Subject: Create a unique machine name Using containers, we need a unique --file-prefix parameter in the EAL DPDK configuration. The file-prefix name is the name of the PROX machine. This is defined by the name parameter in the rapid.env file. When the name parameter is not specified in the rapid.env file, the name will be defined in the test file. The machine name will still be defined in the same way, but when a name is not unique, an number will be appended to the name to make it unique. Signed-off-by: Luc Provoost Change-Id: I0b4e3be60f8ddef6c7eb30bca25c041ea270e238 --- VNFs/DPPD-PROX/helper-scripts/rapid/runrapid.py | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'VNFs/DPPD-PROX/helper-scripts') diff --git a/VNFs/DPPD-PROX/helper-scripts/rapid/runrapid.py b/VNFs/DPPD-PROX/helper-scripts/rapid/runrapid.py index 7a1c8eb5..f5b722c8 100755 --- a/VNFs/DPPD-PROX/helper-scripts/rapid/runrapid.py +++ b/VNFs/DPPD-PROX/helper-scripts/rapid/runrapid.py @@ -64,7 +64,16 @@ class RapidTestManager(object): background_machines = [] sut_machine = gen_machine = None configonly = test_params['configonly'] + machine_names = [] + machine_counter = {} for machine_params in test_params['machines']: + if machine_params['name'] not in machine_names: + machine_names.append(machine_params['name']) + machine_counter[machine_params['name']] = 1 + else: + machine_counter[machine_params['name']] += 1 + machine_params['name'] = '{}_{}'.format(machine_params['name'], + machine_counter[machine_params['name']]) if 'gencores' in machine_params.keys(): machine = RapidGeneratorMachine(test_params['key'], test_params['user'], test_params['password'], -- cgit 1.2.3-korg