summaryrefslogtreecommitdiffstats
path: root/VNFs/DPPD-PROX/helper-scripts
diff options
context:
space:
mode:
authorLuc Provoost <luc.provoost@intel.com>2020-11-16 13:43:14 +0100
committerLuc Provoost <luc.provoost@intel.com>2020-11-18 15:44:48 +0100
commite2ce11c54f2f64df472c64bcf03c9f858e79b835 (patch)
tree562b2e1d1d1527a9f68e089ce5bccb2f020cd189 /VNFs/DPPD-PROX/helper-scripts
parent5de20bff8792a736dabf5e48be8e14154ab4f7cc (diff)
Support for xtesting
Some files were added to for rapid testing in the xtesting framework Change-Id: Id912789c5007ca8390a67fb5b359296089aa9618 Signed-off-by: Luc Provoost <luc.provoost@intel.com>
Diffstat (limited to 'VNFs/DPPD-PROX/helper-scripts')
-rw-r--r--VNFs/DPPD-PROX/helper-scripts/rapid/TST009_Throughput_64B_64F.test54
-rw-r--r--VNFs/DPPD-PROX/helper-scripts/rapid/rapid_flowsizetest.py14
-rw-r--r--VNFs/DPPD-PROX/helper-scripts/rapid/rapid_parser.py3
-rw-r--r--VNFs/DPPD-PROX/helper-scripts/rapid/rapid_test.py2
-rw-r--r--VNFs/DPPD-PROX/helper-scripts/rapid/rapidxt.py52
-rwxr-xr-xVNFs/DPPD-PROX/helper-scripts/rapid/runrapid.py6
-rw-r--r--VNFs/DPPD-PROX/helper-scripts/rapid/setup.cfg10
-rw-r--r--VNFs/DPPD-PROX/helper-scripts/rapid/setup.py9
-rw-r--r--VNFs/DPPD-PROX/helper-scripts/rapid/xtesting/Dockerfile30
-rw-r--r--VNFs/DPPD-PROX/helper-scripts/rapid/xtesting/site.retry1
-rw-r--r--VNFs/DPPD-PROX/helper-scripts/rapid/xtesting/site.yaml13
-rw-r--r--VNFs/DPPD-PROX/helper-scripts/rapid/xtesting/testcases.yaml18
12 files changed, 197 insertions, 15 deletions
diff --git a/VNFs/DPPD-PROX/helper-scripts/rapid/TST009_Throughput_64B_64F.test b/VNFs/DPPD-PROX/helper-scripts/rapid/TST009_Throughput_64B_64F.test
new file mode 100644
index 00000000..866db5c3
--- /dev/null
+++ b/VNFs/DPPD-PROX/helper-scripts/rapid/TST009_Throughput_64B_64F.test
@@ -0,0 +1,54 @@
+##
+## 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
diff --git a/VNFs/DPPD-PROX/helper-scripts/rapid/rapid_flowsizetest.py b/VNFs/DPPD-PROX/helper-scripts/rapid/rapid_flowsizetest.py
index 288c78f8..0123a865 100644
--- a/VNFs/DPPD-PROX/helper-scripts/rapid/rapid_flowsizetest.py
+++ b/VNFs/DPPD-PROX/helper-scripts/rapid/rapid_flowsizetest.py
@@ -97,12 +97,7 @@ class FlowSizeTest(RapidTest):
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']:
@@ -253,7 +248,7 @@ class FlowSizeTest(RapidTest):
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,
@@ -272,9 +267,8 @@ class FlowSizeTest(RapidTest):
'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)
diff --git a/VNFs/DPPD-PROX/helper-scripts/rapid/rapid_parser.py b/VNFs/DPPD-PROX/helper-scripts/rapid/rapid_parser.py
index 992d2d0a..29d87556 100644
--- a/VNFs/DPPD-PROX/helper-scripts/rapid/rapid_parser.py
+++ b/VNFs/DPPD-PROX/helper-scripts/rapid/rapid_parser.py
@@ -24,6 +24,7 @@ except ImportError:
# Python 2.x fallback
import ConfigParser as configparser
import ast
+inf = float("inf")
class RapidConfigParser(object):
"""
@@ -84,7 +85,7 @@ 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']:
diff --git a/VNFs/DPPD-PROX/helper-scripts/rapid/rapid_test.py b/VNFs/DPPD-PROX/helper-scripts/rapid/rapid_test.py
index be7afb38..73b41a6f 100644
--- a/VNFs/DPPD-PROX/helper-scripts/rapid/rapid_test.py
+++ b/VNFs/DPPD-PROX/helper-scripts/rapid/rapid_test.py
@@ -256,7 +256,7 @@ class RapidTest(object):
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)
diff --git a/VNFs/DPPD-PROX/helper-scripts/rapid/rapidxt.py b/VNFs/DPPD-PROX/helper-scripts/rapid/rapidxt.py
new file mode 100644
index 00000000..b472f367
--- /dev/null
+++ b/VNFs/DPPD-PROX/helper-scripts/rapid/rapidxt.py
@@ -0,0 +1,52 @@
+#!/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()
diff --git a/VNFs/DPPD-PROX/helper-scripts/rapid/runrapid.py b/VNFs/DPPD-PROX/helper-scripts/rapid/runrapid.py
index f5b85a3e..44f33c06 100755
--- a/VNFs/DPPD-PROX/helper-scripts/rapid/runrapid.py
+++ b/VNFs/DPPD-PROX/helper-scripts/rapid/runrapid.py
@@ -127,10 +127,10 @@ class RapidTestManager(object):
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.
@@ -144,7 +144,7 @@ def main():
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__":
diff --git a/VNFs/DPPD-PROX/helper-scripts/rapid/setup.cfg b/VNFs/DPPD-PROX/helper-scripts/rapid/setup.cfg
new file mode 100644
index 00000000..f5ff5447
--- /dev/null
+++ b/VNFs/DPPD-PROX/helper-scripts/rapid/setup.cfg
@@ -0,0 +1,10 @@
+[metadata]
+name = rapidxt
+version = 1
+
+[files]
+packages = .
+
+[entry_points]
+xtesting.testcase =
+ rapidxt = rapidxt:RapidXt
diff --git a/VNFs/DPPD-PROX/helper-scripts/rapid/setup.py b/VNFs/DPPD-PROX/helper-scripts/rapid/setup.py
new file mode 100644
index 00000000..fa9d59ac
--- /dev/null
+++ b/VNFs/DPPD-PROX/helper-scripts/rapid/setup.py
@@ -0,0 +1,9 @@
+#!/usr/bin/env python
+
+# pylint: disable=missing-docstring
+
+import setuptools
+
+setuptools.setup(
+ setup_requires=['pbr>=2.0.0'],
+ pbr=True)
diff --git a/VNFs/DPPD-PROX/helper-scripts/rapid/xtesting/Dockerfile b/VNFs/DPPD-PROX/helper-scripts/rapid/xtesting/Dockerfile
new file mode 100644
index 00000000..b7bced8d
--- /dev/null
+++ b/VNFs/DPPD-PROX/helper-scripts/rapid/xtesting/Dockerfile
@@ -0,0 +1,30 @@
+##
+## 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"]
diff --git a/VNFs/DPPD-PROX/helper-scripts/rapid/xtesting/site.retry b/VNFs/DPPD-PROX/helper-scripts/rapid/xtesting/site.retry
new file mode 100644
index 00000000..7b9ad531
--- /dev/null
+++ b/VNFs/DPPD-PROX/helper-scripts/rapid/xtesting/site.retry
@@ -0,0 +1 @@
+127.0.0.1
diff --git a/VNFs/DPPD-PROX/helper-scripts/rapid/xtesting/site.yaml b/VNFs/DPPD-PROX/helper-scripts/rapid/xtesting/site.yaml
new file mode 100644
index 00000000..92fc7b4c
--- /dev/null
+++ b/VNFs/DPPD-PROX/helper-scripts/rapid/xtesting/site.yaml
@@ -0,0 +1,13 @@
+---
+- 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
diff --git a/VNFs/DPPD-PROX/helper-scripts/rapid/xtesting/testcases.yaml b/VNFs/DPPD-PROX/helper-scripts/rapid/xtesting/testcases.yaml
new file mode 100644
index 00000000..2db064f2
--- /dev/null
+++ b/VNFs/DPPD-PROX/helper-scripts/rapid/xtesting/testcases.yaml
@@ -0,0 +1,18 @@
+---
+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