diff options
Diffstat (limited to 'tools')
-rw-r--r-- | tools/docker/vsperf/Dockerfile | 37 | ||||
-rw-r--r-- | tools/pkt_gen/trex/trex.py | 14 |
2 files changed, 51 insertions, 0 deletions
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 |