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:
@@ -73,5 +73,17 @@ class TestIperfAnalysis(unittest.TestCase):
|
||||
self.assertEqual(msg, "Iperf3 UDP: Log file not present")
|
||||
self.assertFalse(success)
|
||||
|
||||
def test_iperf_analyzeV2UDP(self):
|
||||
filename_ok = "tests/log/iperf_udp_v2_ok.log"
|
||||
msg_filename_ok = "tests/log/iperf_udp_v2_ok.txt"
|
||||
target_bitrate = "2.00"
|
||||
bitrate_thresh = 80
|
||||
packetloss_thresh = 25
|
||||
with open(msg_filename_ok, 'r') as file:
|
||||
expected_msg_ok = file.read().strip()
|
||||
success, msg = cls_oaicitest.Iperf_analyzeV2UDP(filename_ok, bitrate_thresh, packetloss_thresh, target_bitrate)
|
||||
self.assertEqual(msg, expected_msg_ok)
|
||||
self.assertTrue(success)
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
|
||||
Reference in New Issue
Block a user