--- /dev/null
+##
+## Copyright (c) 2010-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 = Rapid_ETSINFV_TST009
+number_of_tests = 1
+total_number_of_test_machines = 2
+lat_percentile = 99
+
+[TestM1]
+name = Generator
+config_file = gen.cfg
+dest_vm = 2
+gencores = [1]
+latcores = [3]
+#bucket_size_exp = 12
+
+[TestM2]
+name = Swap
+config_file = 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]]
+# 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=[64]
+drop_rate_threshold = 0
+lat_avg_threshold = inf
+lat_perc_threshold = inf
+lat_max_threshold = inf
+MAXr = 3
+MAXz = 5000
+MAXFramesPerSecondAllIngress = 12000000
+StepSize = 10000
return ((self.test['maxspeed'] - self.test['minspeed']) <= self.test['accuracy'])
def run(self):
- # global fieldnames
- # global writer
- # #fieldnames = ['Flows','PacketSize','Gbps','Mpps','AvgLatency','MaxLatency','PacketsDropped','PacketDropRate']
- # fieldnames = ['Flows','PacketSize','RequestedPPS','GeneratedPPS','SentPPS','ForwardedPPS','ReceivedPPS','AvgLatencyUSEC','MaxLatencyUSEC','Sent','Received','Lost','LostTotal']
- # writer = csv.DictWriter(data_csv_file, fieldnames=fieldnames)
- # writer.writeheader()
+ result_details = {'Details': 'Nothing'}
self.gen_machine.start_latency_cores()
TestPassed = True
for imix in self.test['imixs']:
RapidLog.info (endwarning)
RapidLog.info("+--------+------------------+-------------+-------------+-------------+------------------------+----------+----------+----------+-----------+-----------+-----------+-----------+-------+----+")
if self.test['test'] != 'fixed_rate':
- variables = {'test': self.test['testname'],
+ result_details = {'test': self.test['testname'],
'environment_file': self.test['environment_file'],
'start_date': self.start,
'stop_date': self.stop,
'PacketsLost': endabs_dropped,
'bucket_size': bucket_size,
'buckets': endbuckets}
- self.post_data('rapid_flowsizetest', variables)
+ self.post_data('rapid_flowsizetest', result_details)
else:
RapidLog.info('|{:>7}'.format(str(flow_number))+" | Speed 0 or close to 0")
self.gen_machine.stop_latency_cores()
- return (TestPassed)
-
+ return (TestPassed,result_details)
# Python 2.x fallback
import ConfigParser as configparser
import ast
+inf = float("inf")
class RapidConfigParser(object):
"""
latency_thresholds = ['lat_avg_threshold','lat_perc_threshold','lat_max_threshold']
for threshold in latency_thresholds:
if threshold not in test.keys():
- test[threshold] = 'inf'
+ test[threshold] = inf
test_params['tests'] = tests
if test_params['required_number_of_test_machines'] > test_params[
'total_number_of_machines']:
RapidLog.info(self.report_result(flow_number,size,speed,None,None,None,None,lat_avg,sample_percentile,percentile_max,lat_max, dp_tx, dp_rx , None, None))
tot_rx = tot_non_dp_rx = tot_tx = tot_non_dp_tx = tot_drop = 0
lat_avg = used_avg = 0
- buckets_total = [buckets[i] for i in range(len(buckets))]
+ buckets_total = buckets
tot_lat_samples = sum(buckets)
tot_lat_measurement_duration = float(0)
tot_core_measurement_duration = float(0)
--- /dev/null
+#!/usr/bin/python3
+
+##
+## 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.
+##
+
+# pylint: disable=missing-docstring
+
+import json
+import os
+import sys
+import time
+
+from xtesting.core import testcase
+from runrapid import RapidTestManager
+from rapid_cli import RapidCli
+from rapid_log import RapidLog
+
+class RapidXt(testcase.TestCase):
+
+ def run(self, **kwargs):
+ try:
+ test_params = RapidTestManager.get_defaults()
+ for key in kwargs:
+ test_params[key] = kwargs[key]
+ os.makedirs(self.res_dir, exist_ok=True)
+ log_file = '{}/RUN{}.{}.log'.format(self.res_dir,
+ test_params['environment_file'], test_params['test_file'])
+ RapidLog.log_init(log_file, test_params['loglevel'],
+ test_params['screenloglevel'] , test_params['version'] )
+ test_manager = RapidTestManager()
+ self.start_time = time.time()
+ self.result, self.details = test_manager.run_tests(test_params)
+ self.result = 100 * self.result
+ RapidLog.info('Test result is : {}'.format(self.result))
+ self.stop_time = time.time()
+ except Exception: # pylint: disable=broad-except
+ print("Unexpected error:", sys.exc_info()[0])
+ self.result = 0
+ self.stop_time = time.time()
else:
RapidLog.debug('Test name ({}) is not valid:'.format(
test_param['test']))
- single_test_result = test.run()
+ single_test_result, result_details = test.run()
if not single_test_result:
result = False
- return (result)
+ return (result, result_details)
def main():
"""Main function.
RapidLog.log_init(log_file, test_params['loglevel'],
test_params['screenloglevel'] , test_params['version'] )
test_manager = RapidTestManager()
- test_result = test_manager.run_tests(test_params)
+ test_result, _ = test_manager.run_tests(test_params)
RapidLog.info('Test result is : {}'.format(test_result))
if __name__ == "__main__":
--- /dev/null
+[metadata]
+name = rapidxt
+version = 1
+
+[files]
+packages = .
+
+[entry_points]
+xtesting.testcase =
+ rapidxt = rapidxt:RapidXt
--- /dev/null
+#!/usr/bin/env python
+
+# pylint: disable=missing-docstring
+
+import setuptools
+
+setuptools.setup(
+ setup_requires=['pbr>=2.0.0'],
+ pbr=True)
--- /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.
+##
+
+FROM opnfv/xtesting
+
+RUN apk upgrade --update
+
+ENV RAPID_TEST =rapid_tst009_throughput
+
+RUN git clone https://git.opnfv.org/samplevnf /samplevnf
+WORKDIR /samplevnf/VNFs/DPPD-PROX/helper-scripts/rapid
+COPY rapid.env /samplevnf/VNFs/DPPD-PROX/helper-scripts/rapid/.
+COPY rapid_key.pem /samplevnf/VNFs/DPPD-PROX/helper-scripts/rapid/.
+COPY TST009_Throughput_64B_64F.test /samplevnf/VNFs/DPPD-PROX/helper-scripts/rapid/.
+COPY testcases.yaml /usr/lib/python3.8/site-packages/xtesting/ci/testcases.yaml
+RUN apk add python3-dev openssh-client && cd /samplevnf/VNFs/DPPD-PROX/helper-scripts/rapid/ && git init && pip3 install .
+CMD ["run_tests", "-t", "all"]
--- /dev/null
+---
+- hosts:
+ - 127.0.0.1
+ roles:
+ - role: collivier.xtesting
+ project: rapidxt
+ repo: 127.0.0.1
+ dport: 5000
+ gerrit:
+ suites:
+ - container: rapidxt
+ tests:
+ - rapid_tst009
--- /dev/null
+---
+tiers:
+ -
+ name: rapid
+ order: 1
+ description: 'Rapid Testing'
+ testcases:
+ -
+ case_name: rapid_tst009
+ project_name: rapidxt
+ criteria: 100
+ blocking: true
+ clean_flag: false
+ description: 'TST009 test, 64 byte packets, 64 flows'
+ run:
+ name: rapidxt
+ args:
+ test_file: TST009_Throughput_64B_64F.test