summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--conf/10_custom.conf3
-rwxr-xr-xsystems/build_base_machine.sh31
-rwxr-xr-xsystems/debian/build_base_machine.sh39
-rwxr-xr-xsystems/debian/prepare_python_env.sh28
-rw-r--r--tools/docker/vsperf/Dockerfile37
-rw-r--r--tools/pkt_gen/trex/trex.py14
6 files changed, 144 insertions, 8 deletions
diff --git a/conf/10_custom.conf b/conf/10_custom.conf
index 0e274aab..99600966 100644
--- a/conf/10_custom.conf
+++ b/conf/10_custom.conf
@@ -147,6 +147,9 @@ TRAFFICGEN_TREX_VERIFICATION_MODE = False
TRAFFICGEN_TREX_VERIFICATION_DURATION = 60
TRAFFICGEN_TREX_MAXIMUM_VERIFICATION_TRIALS = 10
+TRAFFICGEN_TREX_RFC2544_MAX_REPEAT = 0
+TRAFFICGEN_TREX_RFC2544_BINARY_SEARCH_LOSS_VERIFICATION = False
+
# TREX Configuration and Connection Info-- END
####################################################
diff --git a/systems/build_base_machine.sh b/systems/build_base_machine.sh
index 59712b96..37b74ffe 100755
--- a/systems/build_base_machine.sh
+++ b/systems/build_base_machine.sh
@@ -68,15 +68,30 @@ else
die "$distro_dir is not yet supported"
fi
-if [ ! -d /lib/modules/`uname -r`/build ] ; then
- die "Kernel devel is not available for active kernel. It can be caused by recent kernel update. Please reboot and run $0 again."
+if [ $# -eq 0 ]; then
+ echo "No parameters provided - continuing with Lib checking"
+ if [ ! -d /lib/modules/`uname -r`/build ] ; then
+ die "Kernel devel is not available for active kernel. It can be caused by recent kernel update. Please reboot and run $0 again."
+ fi
fi
-# download and compile DPDK, OVS and QEMU
-if [ -f ../src/Makefile ] ; then
- cd ../src
- make || die "Make failed"
- cd -
+if [ $# -eq 0 ]; then
+ echo "No parameters provided - continuing with SRC Download and Compile"
+ # download and compile DPDK, OVS and QEMU
+ if [ -f ../src/Makefile ] ; then
+ cd ../src
+ make || die "Make failed"
+ cd -
+ else
+ die "Make failed; No Makefile"
+ fi
else
- die "Make failed; No Makefile"
+ echo "Downloading and compiling only T-Rex"
+ if [ -f ../src/trex/Makefile ]; then
+ cd ../src/trex/
+ make || die "Make failed"
+ cd -
+ else
+ die "Make failed; No Makefile"
+ fi
fi
diff --git a/systems/debian/build_base_machine.sh b/systems/debian/build_base_machine.sh
new file mode 100755
index 00000000..cc3f1eb8
--- /dev/null
+++ b/systems/debian/build_base_machine.sh
@@ -0,0 +1,39 @@
+#!/bin/bash
+#
+# Build a base machine for Debian style distro
+#
+# Copyright 2020 OPNFV
+#
+# 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.
+#
+# Contributors:
+# Sridhar K. N. Rao Spirent Communications
+
+# This is meant to be used only for Containerized VSPERF.
+
+# Synchronize package index files
+apt-get -y update
+apt-get -y install curl
+apt-get -y install git
+apt-get -y install wget
+apt-get -y install python3-venv
+
+# Make and Compilers
+apt-get -y install make
+apt-get -y install automake
+apt-get -y install gcc
+apt-get -y install g++
+apt-get -y install libssl1.1
+apt-get -y install libxml2
+apt-get -y install zlib1g-dev
+apt-get -y install scapy
diff --git a/systems/debian/prepare_python_env.sh b/systems/debian/prepare_python_env.sh
new file mode 100755
index 00000000..7c3b530b
--- /dev/null
+++ b/systems/debian/prepare_python_env.sh
@@ -0,0 +1,28 @@
+#!/bin/bash
+#
+# Prepare Python environment for vsperf execution on Debian systems
+#
+# Copyright 2020 OPNFV, Spirent Communications
+#
+# 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.
+
+if [ -d "$VSPERFENV_DIR" ] ; then
+ echo "Directory $VSPERFENV_DIR already exists. Skipping python virtualenv creation."
+ exit
+fi
+
+# enable virtual environment in a subshell
+
+(python3 -m venv "$VSPERFENV_DIR"
+source "$VSPERFENV_DIR"/bin/activate
+pip install -r ../requirements.txt)
diff --git a/tools/docker/vsperf/Dockerfile b/tools/docker/vsperf/Dockerfile
new file mode 100644
index 00000000..effce15b
--- /dev/null
+++ b/tools/docker/vsperf/Dockerfile
@@ -0,0 +1,37 @@
+# To Build
+# docker build --rm -t vsperf .
+
+# -------- Builder stage.
+FROM python:3.6.10-slim-buster
+MAINTAINER Sridhar Rao <sridhar.rao@spirent.com>
+
+# Create a directory
+RUN mkdir /home/opnfv
+#
+# Update and Install required packages
+#
+RUN apt-get -y update
+RUN apt-get -y install git iputils-ping openssh-client tk
+
+#
+# Get vswitchperf
+#
+RUN cd /home/opnfv && \
+ git clone https://gerrit.opnfv.org/gerrit/vswitchperf
+
+#
+# Remove unnecessary python packages.
+#
+RUN cd /home/opnfv/vswitchperf && \
+ sed -e '/numpy/ s/^#*/#\ /' -i requirements.txt && \
+ sed -e '/matplotlib/ s/^#*/#\ /' -i requirements.txt && \
+ sed -e '/pycrypto/ s/^#*/#\ /' -i requirements.txt && \
+ sed -e '/pypsi/ s/^#*/#\ /' -i requirements.txt && \
+ sed -e '/paramiko/ s/^#*/#\ /' -i requirements.txt && \
+ sed -e '/pyzmq/ s/^#*/#\ /' -i requirements.txt && \
+ sed -e "\$apyzmq" -i requirements.txt
+
+#
+# Build VSPERF
+#
+RUN cd /home/opnfv/vswitchperf/systems && ./build_base_machine.sh --trafficgen
diff --git a/tools/pkt_gen/trex/trex.py b/tools/pkt_gen/trex/trex.py
index d37a52c4..e2bc1e9a 100644
--- a/tools/pkt_gen/trex/trex.py
+++ b/tools/pkt_gen/trex/trex.py
@@ -594,9 +594,14 @@ class Trex(ITrafficGenerator):
:return: passing stats as dictionary
"""
threshold = settings.getValue('TRAFFICGEN_TREX_RFC2544_TPUT_THRESHOLD')
+ max_repeat = settings.getValue('TRAFFICGEN_TREX_RFC2544_MAX_REPEAT')
+ loss_verification = settings.getValue('TRAFFICGEN_TREX_RFC2544_BINARY_SEARCH_LOSS_VERIFICATION')
+ if loss_verification:
+ self._logger.info("Running Binary Search with Loss Verification")
stats_ok = _EMPTY_STATS
new_params = copy.deepcopy(traffic)
iteration = 1
+ repeat = 0
left = boundaries['left']
right = boundaries['right']
center = boundaries['center']
@@ -620,11 +625,20 @@ class Trex(ITrafficGenerator):
if test_lossrate == 0.0 and new_params['frame_rate'] == traffic['frame_rate']:
return copy.deepcopy(stats)
elif test_lossrate > lossrate:
+ if loss_verification:
+ if repeat < max_repeat:
+ repeat += 1
+ iteration += 1
+ continue
+ else:
+ repeat = 0
right = center
center = (left + right) / 2
new_params = copy.deepcopy(traffic)
new_params['frame_rate'] = center
else:
+ if loss_verification:
+ repeat = 0
stats_ok = copy.deepcopy(stats)
left = center
center = (left + right) / 2