Added sleep_time optional configuration in rapid 62/73162/2
authorXavier Simonart <simonartxavier@gmail.com>
Sun, 9 Jan 2022 19:35:22 +0000 (19:35 +0000)
committerXavier Simonart <simonartxavier@gmail.com>
Sun, 6 Feb 2022 21:43:02 +0000 (21:43 +0000)
This can for instance be useful to ensure that inter-iteration
time is higher than SUT switch max_idle time.

Signed-off-by: Xavier Simonart <simonartxavier@gmail.com>
Change-Id: I3a94b022f4d38e0c97d5cbd343b36a9a3ed5fd9e

VNFs/DPPD-PROX/helper-scripts/rapid/rapid_defaults.py
VNFs/DPPD-PROX/helper-scripts/rapid/rapid_flowsizetest.py
VNFs/DPPD-PROX/helper-scripts/rapid/rapid_parser.py
VNFs/DPPD-PROX/helper-scripts/rapid/rapid_test.py
VNFs/DPPD-PROX/helper-scripts/rapid/runrapid.py

index f45b4dc..b56fbe1 100644 (file)
@@ -31,5 +31,6 @@ class RapidDefaults(object):
         'configonly' : False, # If True, the system will upload all the necessary config fiels to the VMs, but not start PROX and the actual testing
         'rundir' : '/opt/rapid', # Directory where to find the tools in the machines running PROX
         'resultsdir' : '.', # Directory where to store log files
+        'sleep_time' : 2, # Sleep time between two loop iteration. Minimum is 2 seconds. Might be useful to let SUT clean caches
         'lat_percentile' : 0.99
         }
index 2f121a5..0a1f374 100644 (file)
@@ -32,12 +32,13 @@ class FlowSizeTest(RapidTest):
     Class to manage the flowsizetesting
     """
     def __init__(self, test_param, lat_percentile, runtime, testname,
-            environment_file, gen_machine, sut_machine, background_machines):
+            environment_file, gen_machine, sut_machine, background_machines, sleep_time):
         super().__init__(test_param, runtime, testname, environment_file)
         self.gen_machine = gen_machine
         self.sut_machine = sut_machine
         self.background_machines = background_machines
         self.test['lat_percentile'] = lat_percentile
+        self.test['sleep_time'] = sleep_time
         if self.test['test'] == 'TST009test':
             # This test implements some of the testing as defined in
             # https://docbox.etsi.org/ISG/NFV/open/Publications_pdf/Specs-Reports/NFV-TST%20009v3.2.1%20-%20GS%20-%20NFVI_Benchmarks.pdf
index 81a1c45..445aed4 100644 (file)
@@ -46,6 +46,12 @@ class RapidConfigParser(object):
             test_params['lat_percentile'] = 0.99
         RapidLog.info('Latency percentile at {:.0f}%'.format(
             test_params['lat_percentile']*100))
+        if testconfig.has_option('TestParameters', 'sleep_time'):
+            test_params['sleep_time'] = int(testconfig.get('TestParameters', 'sleep_time'))
+            if test_params['sleep_time'] < 2:
+                test_params['sleep_time'] = 2
+        else:
+            test_params['sleep_time'] = 2
 
         if testconfig.has_option('TestParameters', 'ipv6'):
             test_params['ipv6'] = testconfig.getboolean('TestParameters','ipv6')
index 76b3bf0..6badfb4 100644 (file)
@@ -185,11 +185,12 @@ class RapidTest(object):
 
     def run_iteration(self, requested_duration, flow_number, size, speed):
         BUCKET_SIZE_EXP = self.gen_machine.bucket_size_exp
+        sleep_time = self.test['sleep_time']
         LAT_PERCENTILE = self.test['lat_percentile']
         iteration_data= {}
         time_loop_data= {}
         iteration_data['r'] = 0;
-        sleep_time = 2
+
         while (iteration_data['r'] < self.test['maxr']):
             self.gen_machine.start_latency_cores()
             time.sleep(sleep_time)
index e4055cc..7a1c8eb 100755 (executable)
@@ -114,7 +114,8 @@ class RapidTestManager(object):
                             test_params['TestName'],
                             test_params['environment_file'],
                             gen_machine,
-                            sut_machine, background_machines)
+                            sut_machine, background_machines,
+                            test_params['sleep_time'])
                 elif test_param['test'] in ['corestatstest']:
                     test = CoreStatsTest(test_param,
                             test_params['runtime'],