Create a unique machine name 39/73839/1
authorLuc Provoost <luc.provoost@gmail.com>
Mon, 30 Jan 2023 10:48:00 +0000 (11:48 +0100)
committerLuc Provoost <luc.provoost@gmail.com>
Mon, 30 Jan 2023 10:48:00 +0000 (11:48 +0100)
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 <luc.provoost@gmail.com>
Change-Id: I0b4e3be60f8ddef6c7eb30bca25c041ea270e238

VNFs/DPPD-PROX/helper-scripts/rapid/runrapid.py

index 7a1c8eb..f5b722c 100755 (executable)
@@ -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'],