rapid_stack_params = {}
RapidStackManager.parse_config(rapid_stack_params)
log_file = 'CREATE{}.log'.format(rapid_stack_params['stack_name'])
- RapidLog.log_init(log_file, 'DEBUG', 'INFO', '2020.09.23')
+ RapidLog.log_init(log_file, 'DEBUG', 'INFO', '2021.01.27')
#cloud_name = 'openstackL6'
#stack_name = 'rapid'
#heat_template = 'openstack-rapid.yaml'
print(" --env ENVIRONMENT_NAME Parameters will be read from ENVIRONMENT_NAME. Default is %s."%test_params['environment_file'])
print(" --test TEST_NAME Test cases will be read from TEST_NAME. Default is %s."%test_params['test_file'])
print(" --map MACHINE_MAP_FILE Machine mapping will be read from MACHINE_MAP_FILE. Default is %s."%test_params['machine_map_file'])
+ print(" --map INDEX_LIST This parameter can also be a list of indices, e.g. [2,3]")
print(" --runtime Specify time in seconds for 1 test run")
print(" --configonly If this option is specified, only upload all config files to the VMs, do not run the tests")
print(" --log Specify logging level for log file output, default is DEBUG")
Class to define the test defaults
"""
test_params = {
- 'version' : '2020.12.21', # Please do NOT change, used for debugging
+ 'version' : '2021.01.27', # Please do NOT change, used for debugging
'environment_file' : 'rapid.env', #Default string for environment
'test_file' : 'basicrapid.test', #Default string for test
'machine_map_file' : 'machine.map', #Default string for machine map file
backgroundinfo = '{}{}'.format(bcolors.FLASH,bcolors.ENDC)
self.set_background_size(self.background_machines, imix)
RapidLog.info("+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+")
- RapidLog.info('| UDP, {:>5} bytes, different number of flows by randomizing SRC & DST UDP port. {:116.116}|'.format(size, backgroundinfo))
+ RapidLog.info('| UDP, {:>5} bytes, different number of flows by randomizing SRC & DST UDP port. {:116.116}|'.format(round(size), backgroundinfo))
RapidLog.info("+--------+------------------+-------------+-------------+-------------+------------------------+----------+----------+----------+-----------+-----------+-----------+-----------+-------+----+")
RapidLog.info('| Flows | Speed requested | Gen by core | Sent by NIC | Fwrd by SUT | Rec. by core | Avg. Lat.|{:.0f} Pcentil| Max. Lat.| Sent | Received | Lost | Total Lost|L.Ratio|Time|'.format(self.test['lat_percentile']*100))
RapidLog.info("+--------+------------------+-------------+-------------+-------------+------------------------+----------+----------+----------+-----------+-----------+-----------+-----------+-------+----+")
return (self.machine_params['gencores'] +
self.machine_params['latcores'])
- def generate_lua(self, vim):
+ def generate_lua(self, vim, prox_config_file):
appendix = 'gencores="%s"\n'% ','.join(map(str,
self.machine_params['gencores']))
appendix = appendix + 'latcores="%s"\n'% ','.join(map(str,
'heartbeat="%s"\n'% self.machine_params['heartbeat'])
else:
appendix = appendix + 'heartbeat="60"\n'
- super().generate_lua(vim, appendix)
+ super().generate_lua(vim, prox_config_file, appendix)
def start_prox(self):
# Start the generator with the -e option so that the cores don't
flow_number = self.gen_machine.set_flows(flow_number)
self.gen_machine.start_latency_cores()
RapidLog.info("+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+")
- RapidLog.info("| Generator is sending UDP ({:>5} flow) packets ({:>5} bytes) to SUT via GW dropping and delaying packets. SUT sends packets back. Use ctrl-c to stop the test |".format(flow_number,size))
+ RapidLog.info("| Generator is sending UDP ({:>5} flow) packets ({:>5} bytes) to SUT via GW dropping and delaying packets. SUT sends packets back. Use ctrl-c to stop the test |".format(flow_number,round(size)))
RapidLog.info("+--------+------------------+-------------+-------------+-------------+------------------------+----------+----------+----------+-----------+-----------+-----------+-----------+-------+----+")
RapidLog.info('| Test | Speed requested | Gen by core | Sent by NIC | Fwrd by SUT | Rec. by core | Avg. Lat.|{:.0f} Pcentil| Max. Lat.| Sent | Received | Lost | Total Lost|L.Ratio|Time|'.format(self.test['lat_percentile']*100))
RapidLog.info("+--------+------------------+-------------+-------------+-------------+------------------------+----------+----------+----------+-----------+-----------+-----------+-----------+-------+----+")
from rapid_log import RapidLog
from prox_ctrl import prox_ctrl
+import os
import re
class RapidMachine(object):
result = self._client.run_cmd(DevBindFileName)
RapidLog.debug('devbind.sh running for port {} on {} {}'.format(index, self.name, result))
- def generate_lua(self, vim, appendix = ''):
- PROXConfigfile = open (self.machine_params['config_file'], 'r')
+ def generate_lua(self, vim, prox_config_file, appendix = ''):
+ PROXConfigfile = open (prox_config_file, 'r')
PROXConfig = PROXConfigfile.read()
PROXConfigfile.close()
self.all_tasks_for_this_cfg = set(re.findall("task\s*=\s*(\d+)",PROXConfig))
self._client.connect()
if self.vim in ['OpenStack']:
self.devbind()
- self.generate_lua(self.vim)
- self._client.scp_put(self.machine_params['config_file'], '{}/{}'.format(self.rundir, self.machine_params['config_file']))
+ _, prox_config_file_name = os.path.split(self.machine_params['config_file'])
+ self.generate_lua(self.vim, self.machine_params['config_file'])
+ self._client.scp_put(self.machine_params['config_file'], '{}/{}'.format(self.rundir, prox_config_file_name))
if ((not self.configonly) and self.machine_params['prox_launch_exit']):
- cmd = 'sudo {}/prox {} -t -o cli -f {}/{}'.format(self.rundir, autostart, self.rundir, self.machine_params['config_file'])
+ cmd = 'sudo {}/prox {} -t -o cli -f {}/{}'.format(self.rundir, autostart, self.rundir, prox_config_file_name)
RapidLog.debug("Starting PROX on {}: {}".format(self.name, cmd))
result = self._client.run_cmd(cmd, 'PROX Testing on {}'.format(self.name))
- #RapidLog.debug("Finished PROX on {}: {}, {}".format(self.name, cmd, result))
RapidLog.debug("Finished PROX on {}: {}".format(self.name, cmd))
def close_prox(self):
'total_number_of_machines']:
RapidLog.exception("Not enough VMs for this test: %d needed and only %d available" % (required_number_of_test_machines,total_number_of_machines))
raise Exception("Not enough VMs for this test: %d needed and only %d available" % (required_number_of_test_machines,total_number_of_machines))
+ map_info = test_params['machine_map_file'].strip('[]').split(',')
+ map_info_length = len(map_info)
+ if map_info_length > 1:
+ if map_info_length < test_params[
+ 'required_number_of_test_machines']:
+ RapidLog.exception('Not enough machine indices in --map \
+ parameter: {}. Needing {} entries'.format(map_info,
+ test_params['required_number_of_test_machines']))
+ machine_index = list(map(int,map_info))
+ else:
+ machine_map = configparser.RawConfigParser()
+ machine_map.read(test_params['machine_map_file'])
+ machine_index = []
+ for test_machine in range(1,
+ test_params['required_number_of_test_machines']+1):
+ machine_index.append(int(machine_map.get(
+ 'TestM%d'%test_machine, 'machine_index')))
machine_map = configparser.RawConfigParser()
machine_map.read(test_params['machine_map_file'])
machines = []
machine = {}
- for test_machine in range(1, test_params['required_number_of_test_machines']+1):
+ for test_machine in range(1, test_params[
+ 'required_number_of_test_machines']+1):
machine.clear()
section = 'TestM%d'%test_machine
options = testconfig.options(section)
elif option in ['bucket_size_exp']:
machine[option] = int(testconfig.get(section, option))
if machine[option] < 11:
- RapidLog.exception("Minimum Value for bucket_size_exp is 11")
+ RapidLog.exception(
+ "Minimum Value for bucket_size_exp is 11")
else:
machine[option] = testconfig.get(section, option)
for key in ['prox_socket','prox_launch_exit']:
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
+ section = 'M%d'%machine_index[test_machine-1]
options = config.options(section)
for option in options:
machine[option] = config.get(section, option)
test_params[key] = kwargs[key]
os.makedirs(self.res_dir, exist_ok=True)
test_params['resultsdir'] = self.res_dir
+ _, test_file_name = os.path.split(test_params['test_file'])
+ _, environment_file_name = os.path.split(
+ test_params['environment_file'])
log_file = '{}/RUN{}.{}.log'.format(self.res_dir,
- test_params['environment_file'], test_params['test_file'])
+ environment_file_name, test_file)
RapidLog.log_init(log_file, test_params['loglevel'],
test_params['screenloglevel'] , test_params['version'] )
test_manager = RapidTestManager()
from future import standard_library
standard_library.install_aliases()
from builtins import object
+import os
import sys
import concurrent.futures
from concurrent.futures import ALL_COMPLETED
# When no cli is used, the process_cli can be replaced by code modifying
# test_params
test_params = RapidCli.process_cli(test_params)
- log_file = 'RUN{}.{}.log'.format(test_params['environment_file'],
- test_params['test_file'])
+ _, test_file_name = os.path.split(test_params['test_file'])
+ _, environment_file_name = os.path.split(test_params['environment_file'])
+ log_file = 'RUN{}.{}.log'.format(environment_file_name, test_file_name)
RapidLog.log_init(log_file, test_params['loglevel'],
test_params['screenloglevel'] , test_params['version'] )
test_manager = RapidTestManager()
[TestM1]
name = Generator
-config_file = gen.cfg
+config_file = configs/gen.cfg
dest_vm = 2
gencores = [1]
latcores = [3]
[TestM2]
name = Swap
-config_file = swap.cfg
+config_file = configs/swap.cfg
cores = [1]
[test1]
[TestM1]
name = Generator
-config_file = gen.cfg
+config_file = configs/gen.cfg
dest_vm = 2
gencores = [1]
latcores = [3]
[TestM2]
name = Swap
-config_file = swap.cfg
+config_file = configs/swap.cfg
cores = [1]
[test1]
[TestM1]
name = Generator
-config_file = gen.cfg
+config_file = configs/gen.cfg
dest_vm = 2
gencores = [1]
latcores = [3]
[TestM2]
name = Swap
-config_file = swap.cfg
+config_file = configs/swap.cfg
cores = [1]
[test1]
test=TST009test
-# Following parameter defines the success criterium for the test.
-# When this test uses multiple combinations of packet size and flows,
-# all combinations must be meeting the same threshold
-# The threshold is expressed in Mpps
-pass_threshold=0.001
imixs=[[64,256,64,1024,64,128]]
# the number of flows in the list need to be powers of 2, max 2^20
# Select from following numbers: 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768, 65536, 131072, 262144, 524288, 1048576
--- /dev/null
+##
+## Copyright (c) 2020 Intel Corporation
+##
+## Licensed under the Apache License, Version 2.0 (the "License");
+## you may not use this file except in compliance with the License.
+## You may obtain a copy of the License at
+##
+## http://www.apache.org/licenses/LICENSE-2.0
+##
+## Unless required by applicable law or agreed to in writing, software
+## distributed under the License is distributed on an "AS IS" BASIS,
+## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+## See the License for the specific language governing permissions and
+## limitations under the License.
+##
+
+[TestParameters]
+name = BasicSwapTesting
+number_of_tests = 2
+total_number_of_test_machines = 2
+lat_percentile = 99
+
+[TestM1]
+name = Generator
+config_file = configs/genv6.cfg
+dest_vm = 2
+gencores = [1]
+latcores = [3]
+#bucket_size_exp = 12
+
+[TestM2]
+name = Swap
+config_file = configs/swapv6.cfg
+cores = [1]
+#prox_socket = true
+#prox_launch_exit = true
+
+[test1]
+test=warmuptest
+flowsize=512
+imix=[64]
+warmupspeed=1
+warmuptime=2
+
+[test2]
+test=TST009test
+# DO NOT USE IMIX FOR IPV6 TESTING. THE LIST OF IMIXS CAN ONLY CONTAIN LISTS
+# WITH ONE ELEMENT!!!
+# PACKET SIZE NEEDS TO BE AT LEAST 84 (66 + 18) FOR IPV6
+# 18 bytes needed for UDP LATENCY AND COUNTER CONTENT
+imixs=[[84],[128]]
+# the number of flows in the list need to be powers of 2, max 2^20
+# Select from following numbers: 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768, 65536, 131072, 262144, 524288, 1048576
+flows=[8,1024]
+drop_rate_threshold = 0
+MAXr = 3
+MAXz = 5000
+MAXFramesPerSecondAllIngress = 12000000
+StepSize = 10000
[TestM1]
name = Generator
-config_file = l2gen_bare.cfg
+config_file = configs/l2gen_bare.cfg
dest_vm = 2
gencores = [1]
latcores = [3]
[TestM2]
name = Swap
-config_file = l2swap.cfg
+config_file = configs/l2swap.cfg
cores = [1]
[test1]
[TestM1]
name = Generator
-config_file = gen.cfg
+config_file = configs/gen.cfg
dest_vm = 2
gencores = [1]
latcores = [3]
[TestM2]
name = Swap
-config_file = swap.cfg
+config_file = configs/swap.cfg
cores = [1]
#prox_socket = true
#prox_launch_exit = true
[TestM1]
name = Swap
-config_file = swap.cfg
+config_file = configs/swap.cfg
cores = [1]
[test1]
[TestM1]
name = Generator
-config_file = gen_gw.cfg
+config_file = configs/gen_gw.cfg
gw_vm = 2
dest_vm = 3
gencores = [1]
[TestM2]
name = ImpairGW
-config_file = impair.cfg
+config_file = configs/impair.cfg
cores = [1]
monitor = False
[TestM3]
name = Swap
-config_file = swap.cfg
+config_file = configs/swap.cfg
cores = [1]
[test1]
[TestM1]
name = Generator
-config_file = gen.cfg
+config_file = configs/gen.cfg
dest_vm = 2
gencores = [1]
latcores = [3]
[TestM2]
name = Swap
-config_file = swap.cfg
+config_file = configs/swap.cfg
cores = [1]
#prox_socket = true
#prox_launch_exit = true
[TestM1]
name = Generator
-config_file = genv6.cfg
+config_file = configs/genv6.cfg
dest_vm = 2
gencores = [1]
latcores = [3]
[TestM2]
name = Swap
-config_file = swapv6.cfg
+config_file = configs/swapv6.cfg
cores = [1]
#prox_socket = true
#prox_launch_exit = true
[TestM1]
name = InterruptTestMachine1
-config_file = irq.cfg
+config_file = configs/irq.cfg
cores = [1,2,3]
monitor = False
[TestM2]
name = InterruptTestMachine2
-config_file = irq.cfg
+config_file = configs/irq.cfg
cores = [1,2,3]
monitor = False
[TestM1]
name = Generator
-config_file = l2gen.cfg
+config_file = configs/l2gen.cfg
dest_vm = 2
gencores = [1]
latcores = [3]
[TestM2]
name = Swap
-config_file = l2swap.cfg
+config_file = configs/l2swap.cfg
cores = [1]
[test1]
[TestM1]
name = Generator
-config_file = l2gen.cfg
+config_file = configs/l2gen.cfg
dest_vm = 2
gencores = [1]
latcores = [3]
[TestM2]
name = Swap
-config_file = l2swap.cfg
+config_file = configs/l2swap.cfg
cores = [1]
[test1]
[TestM1]
name = Generator
-config_file = gen.cfg
+config_file = configs/gen.cfg
dest_vm = 2
gencores = [1]
latcores = [3]
[TestM2]
name = Swap
-config_file = swap.cfg
+config_file = configs/swap.cfg
cores = [1]
[test1]
[TestM1]
name = Swap
-config_file = swap.cfg
+config_file = configs/swap.cfg
cores = [1]
ports = [0]
[TestM1]
name = Generator
-config_file = gen_gw.cfg
+config_file = configs/gen_gw.cfg
dest_vm = 3
gw_vm = 2
gencores = [1]
[TestM2]
name = GW1
-config_file = secgw1.cfg
+config_file = configs/secgw1.cfg
dest_vm = 3
cores = [1]
[TestM3]
name = GW2
-config_file = secgw2.cfg
+config_file = configs/secgw2.cfg
cores = [1]
[test1]
run:
name: rapidxt
args:
- test_file: irq.test
+ test_file: tests/irq.test
runtime: 5
-
name: TST009_rapid_benchmarking
run:
name: rapidxt
args:
- test_file: TST009_Throughput_64B_64F.test
+ test_file: tests/TST009_Throughput_64B_64F.test
runtime: 5
-
case_name: rapid_tst009_acaeab_16384f
run:
name: rapidxt
args:
- test_file: TST009_Throughput_acaeab_16384F.test
+ test_file: tests/TST009_Throughput_acaeab_16384F.test
runtime: 5