From 4d932aced6931d756e07dbce6ab7cf04799ba5f4 Mon Sep 17 00:00:00 2001 From: Luc Provoost Date: Mon, 27 Apr 2020 12:32:43 -0400 Subject: Code rewrite and Python3 support The code has been rewritten in multiple classes and files for better readability and maintainability. You should now also use Python3 to run the scripts. Some of the variables in the config files have moved to other sections. The pushgateway parameter moved to the [varia] section of the rapid environment file. Change-Id: Ic61a1bc3baa39447d42b21dfcc0f16c28fcdfa6e Signed-off-by: Luc Provoost --- .../helper-scripts/rapid/rapid_warmuptest.py | 51 ++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 VNFs/DPPD-PROX/helper-scripts/rapid/rapid_warmuptest.py (limited to 'VNFs/DPPD-PROX/helper-scripts/rapid/rapid_warmuptest.py') diff --git a/VNFs/DPPD-PROX/helper-scripts/rapid/rapid_warmuptest.py b/VNFs/DPPD-PROX/helper-scripts/rapid/rapid_warmuptest.py new file mode 100644 index 00000000..6a9daa73 --- /dev/null +++ b/VNFs/DPPD-PROX/helper-scripts/rapid/rapid_warmuptest.py @@ -0,0 +1,51 @@ +#!/usr/bin/python + +## +## 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. +## + +import sys +import time +from rapid_log import RapidLog +from rapid_test import RapidTest + +class WarmupTest(RapidTest): + """ + Class to manage the warmup testing + """ + def __init__(self, test_param, gen_machine): + self.test = test_param + self.gen_machine = gen_machine + + def run(self): + # Running at low speed to make sure the ARP messages can get through. + # If not doing this, the ARP message could be dropped by a switch in overload and then the test will not give proper results + # Note hoever that if we would run the test steps during a very long time, the ARP would expire in the switch. + # PROX will send a new ARP request every seconds so chances are very low that they will all fail to get through + size = int(self.test['packetsize']) + FLOWSIZE = int(self.test['flowsize']) + WARMUPSPEED = int(self.test['warmupspeed']) + WARMUPTIME = int(self.test['warmuptime']) + self.gen_machine.set_generator_speed(WARMUPSPEED) + self.gen_machine.set_udp_packet_size(size) + # gen_machine['socket'].set_value(gencores,0,56,1,1) + self.gen_machine.set_flows(FLOWSIZE) + self.gen_machine.start() + time.sleep(WARMUPTIME) + self.gen_machine.stop() + # gen_machine['socket'].set_value(gencores,0,56,50,1) + time.sleep(WARMUPTIME) + return (True) -- cgit 1.2.3-korg