iperf3_{dl,ul}: adapt pass/fail threshold

change pass threshold to 80% of the max rate for
half of the testduration (rolling average).

the overall average might be lowered because of a slower
TCP start or a late UE attach.

Change-Id: I8a545b8175784e9d6b49d6bf80f637ef7aa731f7
diff --git a/sysmocom/suites/4g/iperf3_dl.py b/sysmocom/suites/4g/iperf3_dl.py
index 6f79076..bf5b1f0 100755
--- a/sysmocom/suites/4g/iperf3_dl.py
+++ b/sysmocom/suites/4g/iperf3_dl.py
@@ -36,6 +36,8 @@
 iperf3cli.print_results()
 iperf3srv.print_results(iperf3cli.proto() == iperf3cli.PROTO_UDP)
 
-res_str = ue.verify_metric(max_rate * 0.8, operation='avg', metric='dl_brate', criterion='gt')
+# 80% of the maximum rate for half of the test duration
+half_duration = int(round(iperf3cli.time_sec() / 2))
+res_str = ue.verify_metric(max_rate * 0.8, operation='max_rolling_avg', metric='dl_brate', criterion='gt', window=half_duration)
 print(res_str)
 test.set_report_stdout(res_str)
diff --git a/sysmocom/suites/4g/iperf3_ul.py b/sysmocom/suites/4g/iperf3_ul.py
index 4ae0118..6c0d25d 100755
--- a/sysmocom/suites/4g/iperf3_ul.py
+++ b/sysmocom/suites/4g/iperf3_ul.py
@@ -36,6 +36,8 @@
 iperf3cli.print_results()
 iperf3srv.print_results(iperf3cli.proto() == iperf3cli.PROTO_UDP)
 
-res_str = ue.verify_metric(max_rate * 0.8, operation='avg', metric='ul_brate', criterion='gt')
+# 80% of the maximum rate for half of the test duration
+half_duration = int(round(iperf3cli.time_sec() / 2))
+res_str = ue.verify_metric(max_rate * 0.8, operation='max_rolling_avg', metric='ul_brate', criterion='gt', window=half_duration)
 print(res_str)
 test.set_report_stdout(res_str)