Add configurable infra for Iperf2_Unidir, test, fixes

Add a possibility to use an "infrastructure YAML file" to configure both
ends of the iperf2 call through a file.

Fix bugs in Iperf2: at least on my machine, iperf2 start time is logged
at 0.00 not 0.0, so update the regex to match both. Do not overwrite
results if the matched regex (otherwise, the result might be None at the
end) and suppress server output.

Add a unit test to test that this function actually works (on my
machine, with iperf v2.2.1), as well as a unit test for analysis.
This commit is contained in:
Robert Schmidt
2025-03-28 14:31:28 +01:00
parent ac6b296616
commit e5d8c25084
5 changed files with 74 additions and 7 deletions
+12
View File
@@ -53,5 +53,17 @@ class TestPingIperf(unittest.TestCase):
success = self.ci.Iperf(self.html, self.epc, self.cont, infra_file=infra_file)
self.assertTrue(success)
def test_iperf2_unidir(self):
self.ci.iperf_args = "-u -t 5 -b 1M"
self.ci.svr_id = "test"
self.ci.svr_node = "localhost"
self.ci.iperf_packetloss_threshold = "0"
self.ci.iperf_bitrate_threshold = "0"
self.ci.iperf_profile = "balanced"
infra_file = "tests/config/infra_ping_iperf.yaml"
# TODO Should need nothing but options and UE(s) to use
success = self.ci.Iperf2_Unidir(self.html, self.epc, self.cont, infra_file=infra_file)
self.assertTrue(success)
if __name__ == '__main__':
unittest.main()