Reporting test details for all tests
[samplevnf.git] / VNFs / DPPD-PROX / helper-scripts / rapid / rapid_warmuptest.py
1 #!/usr/bin/python
2
3 ##
4 ## Copyright (c) 2020 Intel Corporation
5 ##
6 ## Licensed under the Apache License, Version 2.0 (the "License");
7 ## you may not use this file except in compliance with the License.
8 ## You may obtain a copy of the License at
9 ##
10 ##
11 ##     http://www.apache.org/licenses/LICENSE-2.0
12 ##
13 ## Unless required by applicable law or agreed to in writing, software
14 ## distributed under the License is distributed on an "AS IS" BASIS,
15 ## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 ## See the License for the specific language governing permissions and
17 ## limitations under the License.
18 ##
19
20 import sys
21 import time
22 from rapid_log import RapidLog
23 from rapid_test import RapidTest
24
25 class WarmupTest(RapidTest):
26     """
27     Class to manage the warmup testing
28     """
29     def __init__(self, test_param, gen_machine):
30         self.test = test_param
31         self.gen_machine = gen_machine
32
33     def run(self):
34     # Running at low speed to make sure the ARP messages can get through.
35     # If not doing this, the ARP message could be dropped by a switch in overload and then the test will not give proper results
36     # Note hoever that if we would run the test steps during a very long time, the ARP would expire in the switch.
37     # PROX will send a new ARP request every seconds so chances are very low that they will all fail to get through
38         imix = self.test['imix']
39         FLOWSIZE = int(self.test['flowsize'])
40         WARMUPSPEED = int(self.test['warmupspeed'])
41         WARMUPTIME = int(self.test['warmuptime'])
42         self.gen_machine.set_generator_speed(WARMUPSPEED)
43         self.gen_machine.set_udp_packet_size(imix)
44     #    gen_machine['socket'].set_value(gencores,0,56,1,1)
45         _ = self.gen_machine.set_flows(FLOWSIZE)
46         self.gen_machine.start()
47         time.sleep(WARMUPTIME)
48         self.gen_machine.stop()
49     #    gen_machine['socket'].set_value(gencores,0,56,50,1)
50         time.sleep(WARMUPTIME)
51         return (True, None)