@@ -287,29 +287,12 @@ def _check_rx_rate_limit_patch(test_microvm):
287
287
288
288
289
289
def _check_tx_bandwidth (test_microvm , ip , expected_kbps ):
290
- """Check that the rate-limited TX bandwidth is close to what we expect.
291
-
292
- At this point, a daemonized iperf3 server is expected to be running on
293
- the host.
294
- """
295
- print ("Check guest TX rate-limit; expected kbps {}" .format (expected_kbps ))
290
+ """Check that the rate-limited TX bandwidth is close to what we expect."""
296
291
observed_kbps = _get_tx_bandwidth_with_duration (
297
292
test_microvm , ip , IPERF_TRANSMIT_TIME
298
293
)
299
-
300
294
diff_pc = _get_percentage_difference (observed_kbps , expected_kbps )
301
- print ("TX calculated diff percentage: {}\n " .format (diff_pc ))
302
-
303
- if diff_pc >= MAX_BYTES_DIFF_PERCENTAGE :
304
- print ("Short duration test failed. Try another run with 10x duration." )
305
-
306
- observed_kbps = _get_tx_bandwidth_with_duration (
307
- test_microvm , ip , 10 * IPERF_TRANSMIT_TIME
308
- )
309
- diff_pc = _get_percentage_difference (observed_kbps , expected_kbps )
310
- print ("TX calculated diff percentage: {}\n " .format (diff_pc ))
311
-
312
- assert diff_pc < MAX_BYTES_DIFF_PERCENTAGE
295
+ assert diff_pc < MAX_BYTES_DIFF_PERCENTAGE
313
296
314
297
315
298
def _get_tx_bandwidth_with_duration (test_microvm , host_ip , duration ):
@@ -327,29 +310,12 @@ def _get_tx_bandwidth_with_duration(test_microvm, host_ip, duration):
327
310
328
311
329
312
def _check_rx_bandwidth (test_microvm , ip , expected_kbps ):
330
- """Check that the rate-limited RX bandwidth is close to what we expect.
331
-
332
- At this point, a daemonized iperf3 server is expected to be running on
333
- the guest.
334
- """
335
- print ("Check guest RX rate-limit; expected kbps {}" .format (expected_kbps ))
313
+ """Check that the rate-limited RX bandwidth is close to what we expect."""
336
314
observed_kbps = _get_rx_bandwidth_with_duration (
337
315
test_microvm , ip , IPERF_TRANSMIT_TIME
338
316
)
339
-
340
317
diff_pc = _get_percentage_difference (observed_kbps , expected_kbps )
341
- print ("RX calculated diff percentage: {}\n " .format (diff_pc ))
342
-
343
- if diff_pc >= MAX_BYTES_DIFF_PERCENTAGE :
344
- print ("Short duration test failed. Try another run with 10x duration." )
345
-
346
- observed_kbps = _get_rx_bandwidth_with_duration (
347
- test_microvm , ip , 10 * IPERF_TRANSMIT_TIME
348
- )
349
- diff_pc = _get_percentage_difference (observed_kbps , expected_kbps )
350
- print ("TX calculated diff percentage: {}\n " .format (diff_pc ))
351
-
352
- assert diff_pc < MAX_BYTES_DIFF_PERCENTAGE
318
+ assert diff_pc < MAX_BYTES_DIFF_PERCENTAGE
353
319
354
320
355
321
def _get_rx_bandwidth_with_duration (test_microvm , guest_ip , duration ):
0 commit comments