Fix the search algorithm 04/73204/3
authorLuc Provoost <luc.provoost@gmail.com>
Fri, 4 Feb 2022 13:34:02 +0000 (14:34 +0100)
committerLuc Provoost <luc.provoost@gmail.com>
Mon, 7 Feb 2022 19:31:15 +0000 (20:31 +0100)
In case, we are sending less packets through than the requested
amount of packets, we will now stop the binary search.

Signed-off-by: Luc Provoost <luc.provoost@gmail.com>
Change-Id: I7ddb8860d47104beffdd5ff05c0359f91f4908e9

VNFs/DPPD-PROX/helper-scripts/rapid/rapid_flowsizetest.py

index 0a1f374..500be5b 100644 (file)
@@ -227,24 +227,29 @@ class FlowSizeTest(RapidTest):
                     # packet has been lost during the test.
                     # This can be specified by putting 0 in the .test file
                     elif ((iteration_data['drop_rate'] < self.test['drop_rate_threshold']) or (iteration_data['abs_dropped']==self.test['drop_rate_threshold']==0)) and (iteration_data['lat_avg']< self.test['lat_avg_threshold']) and (iteration_data['lat_perc']< self.test['lat_perc_threshold']) and (iteration_data['lat_max'] < self.test['lat_max_threshold'] and iteration_data['mis_ordered'] <= self.test['mis_ordered_threshold']):
+                        end_data = copy.deepcopy(iteration_data)
+                        end_prefix = copy.deepcopy(iteration_prefix)
+                        success = True
+                        success_message=' SUCCESS'
                         if (old_div((self.get_pps(speed,size) - iteration_data['pps_tx']),self.get_pps(speed,size)))>0.01:
                             iteration_prefix['speed'] = bcolors.WARNING
                             if iteration_data['abs_tx_fail'] > 0:
                                 gen_warning = bcolors.WARNING + ' Network limit?: requesting {:<.3f} Mpps and getting {:<.3f} Mpps - {} failed to be transmitted'.format(self.get_pps(speed,size), iteration_data['pps_tx'], iteration_data['abs_tx_fail']) + bcolors.ENDC
                             else:
                                 gen_warning = bcolors.WARNING + ' Generator limit?: requesting {:<.3f} Mpps and getting {:<.3f} Mpps'.format(self.get_pps(speed,size), iteration_data['pps_tx']) + bcolors.ENDC
+                            endwarning = '|        | {:186.186} |'.format(retry_warning + lat_warning + gen_warning)
+                            RapidLog.debug(self.report_result(-attempts, size,
+                                iteration_data, iteration_prefix) + success_message +
+                                retry_warning + lat_warning + gen_warning)
+                            break
                         else:
                             iteration_prefix['speed'] = bcolors.ENDC
                             gen_warning = ''
-                        end_data = copy.deepcopy(iteration_data)
-                        end_prefix = copy.deepcopy(iteration_prefix)
-                        if lat_warning or gen_warning or retry_warning:
-                            endwarning = '|        | {:186.186} |'.format(retry_warning + lat_warning + gen_warning)
-                        success = True
-                        success_message=' SUCCESS'
-                        RapidLog.debug(self.report_result(-attempts, size,
-                            iteration_data, iteration_prefix) + success_message +
-                            retry_warning + lat_warning + gen_warning)
+                            if lat_warning or retry_warning:
+                                endwarning = '|        | {:186.186} |'.format(retry_warning + lat_warning)
+                            RapidLog.debug(self.report_result(-attempts, size,
+                                iteration_data, iteration_prefix) + success_message +
+                                retry_warning + lat_warning + gen_warning)
                     else:
                         success_message=' FAILED'
                         if ((iteration_data['abs_dropped']>0) and (self.test['drop_rate_threshold'] ==0)):