Commit e9f9718f authored by Jaroslava Fiedlerova's avatar Jaroslava Fiedlerova Committed by Robert Schmidt

CI: add more unit tests for UDP iperf3 analysis function

parent 5fd5ed43
......@@ -15,29 +15,61 @@ class TestIperfAnalysis(unittest.TestCase):
def setUp(self):
self.iperf_bitrate_threshold = "99"
self.iperf_packetloss_threshold = "0"
self.target_bitrate = "1"
def test_iperf_analyzeV3UDP_ok(self):
filename_ok = "tests/log/iperf_udp_test_ok.log"
msg_filename_ok = "tests/log/iperf_udp_msg_ok.txt"
target_bitrate = "1"
with open(msg_filename_ok, 'r') as file:
expected_msg_ok = file.read().strip()
success, msg = cls_oaicitest.Iperf_analyzeV3UDP(filename_ok, self.iperf_bitrate_threshold, self.iperf_packetloss_threshold, self.target_bitrate)
success, msg = cls_oaicitest.Iperf_analyzeV3UDP(filename_ok, self.iperf_bitrate_threshold, self.iperf_packetloss_threshold, target_bitrate)
self.assertEqual(msg, expected_msg_ok)
self.assertTrue(success)
def test_iperf_analyzeV3UDP_ok2(self):
filename_ok = "tests/log/iperf_udp_test_ok2.log"
msg_filename_ok = "tests/log/iperf_udp_msg_ok2.txt"
target_bitrate = "4.67"
with open(msg_filename_ok, 'r') as file:
expected_msg_ok = file.read().strip()
success, msg = cls_oaicitest.Iperf_analyzeV3UDP(filename_ok, self.iperf_bitrate_threshold, self.iperf_packetloss_threshold, target_bitrate)
self.assertEqual(msg, expected_msg_ok)
self.assertTrue(success)
def test_iperf_analyzeV3UDP_nok(self):
filename_nok = "tests/log/iperf_udp_test_nok.log"
msg_filename_nok = "tests/log/iperf_udp_msg_nok.txt"
target_bitrate = "1"
with open(msg_filename_nok, 'r') as file:
expected_msg_nok = file.read().strip()
success, msg = cls_oaicitest.Iperf_analyzeV3UDP(filename_nok, self.iperf_bitrate_threshold, self.iperf_packetloss_threshold, target_bitrate)
self.assertEqual(msg, expected_msg_nok)
self.assertFalse(success)
def test_iperf_analyzeV3UDP_nok2(self):
filename_nok = "tests/log/iperf_udp_test_nok2.log"
msg_filename_nok = "tests/log/iperf_udp_msg_nok2.txt"
target_bitrate = "80"
with open(msg_filename_nok, 'r') as file:
expected_msg_nok = file.read().strip()
success, msg = cls_oaicitest.Iperf_analyzeV3UDP(filename_nok, self.iperf_bitrate_threshold, self.iperf_packetloss_threshold, target_bitrate)
self.assertEqual(msg, expected_msg_nok)
self.assertFalse(success)
def test_iperf_analyzeV3UDP_nok3(self):
filename_nok = "tests/log/iperf_udp_test_nok3.log"
msg_filename_nok = "tests/log/iperf_udp_msg_nok3.txt"
target_bitrate = "4.67"
with open(msg_filename_nok, 'r') as file:
expected_msg_nok = file.read().strip()
success, msg = cls_oaicitest.Iperf_analyzeV3UDP(filename_nok, self.iperf_bitrate_threshold, self.iperf_packetloss_threshold, self.target_bitrate)
success, msg = cls_oaicitest.Iperf_analyzeV3UDP(filename_nok, self.iperf_bitrate_threshold, self.iperf_packetloss_threshold, target_bitrate)
self.assertEqual(msg, expected_msg_nok)
self.assertFalse(success)
def test_iperf_analyzeV3UDP_notfound(self):
filename_notfound = "tests/log/iperf_udp_test_notfound.log"
success, msg = cls_oaicitest.Iperf_analyzeV3UDP(filename_notfound, self.iperf_bitrate_threshold, self.iperf_packetloss_threshold, self.target_bitrate)
target_bitrate = "1"
success, msg = cls_oaicitest.Iperf_analyzeV3UDP(filename_notfound, self.iperf_bitrate_threshold, self.iperf_packetloss_threshold, target_bitrate)
self.assertEqual(msg, "Iperf3 UDP: Log file not present")
self.assertFalse(success)
......
Sender Bitrate : 0.00 Mbps
Receiver Bitrate: 3.98 Mbps (too low! < 99%)
Jitter : 3.847 ms
Packet Loss : 0.038 % (too high! > 0%)
Sender Bitrate : 1.03 Mbps
Receiver Bitrate: 0.00 Mbps (too low! < 99%)
Jitter : 0.000 ms
Packet Loss : 0 %
Sender Bitrate : 4.67 Mbps
Receiver Bitrate: 4.67 Mbps (100.00 %)
Jitter : 3.413 ms
Packet Loss : 0 %
Connecting to host 192.172.0.1, port 5002
Reverse mode, remote host 192.172.0.1 is sending
[ 5] local 192.172.0.2 port 44733 connected to 192.172.0.1 port 5002
[ ID] Interval Transfer Bitrate Jitter Lost/Total Datagrams
[ 5] 0.00-1.00 sec 8.55 MBytes 71.7 Mbits/sec 0.407 ms 66/6256 (1.1%) (omitted)
[ 5] 1.00-2.00 sec 10.4 MBytes 87.3 Mbits/sec 0.355 ms 0/7540 (0%) (omitted)
[ 5] 2.00-3.00 sec 9.55 MBytes 80.1 Mbits/sec 0.333 ms 0/6913 (0%) (omitted)
[ 5] 3.00-4.00 sec 9.54 MBytes 80.0 Mbits/sec 0.344 ms 0/6906 (0%) (omitted)
[ 5] 4.00-5.00 sec 9.54 MBytes 80.0 Mbits/sec 0.338 ms 0/6906 (0%) (omitted)
[ 5] 0.00-1.00 sec 9.53 MBytes 80.0 Mbits/sec 0.398 ms 0/6903 (0%)
[ 5] 1.00-2.00 sec 9.54 MBytes 80.0 Mbits/sec 0.393 ms 0/6907 (0%)
[ 5] 2.00-3.00 sec 9.53 MBytes 80.0 Mbits/sec 0.338 ms 0/6902 (0%)
[ 5] 3.00-4.00 sec 4.50 MBytes 37.7 Mbits/sec 3.847 ms 9/3269 (0.28%)
[ 5] 4.00-5.00 sec 0.00 Bytes 0.00 bits/sec 3.847 ms 0/0 (0%)
[ 5] 5.00-6.00 sec 0.00 Bytes 0.00 bits/sec 3.847 ms 0/0 (0%)
[ 5] 6.00-7.00 sec 0.00 Bytes 0.00 bits/sec 3.847 ms 0/0 (0%)
[ 5] 7.00-8.00 sec 0.00 Bytes 0.00 bits/sec 3.847 ms 0/0 (0%)
[ 5] 8.00-9.00 sec 0.00 Bytes 0.00 bits/sec 3.847 ms 0/0 (0%)
[ 5] 9.00-10.00 sec 0.00 Bytes 0.00 bits/sec 3.847 ms 0/0 (0%)
[ 5] 10.00-11.00 sec 0.00 Bytes 0.00 bits/sec 3.847 ms 0/0 (0%)
[ 5] 11.00-12.00 sec 0.00 Bytes 0.00 bits/sec 3.847 ms 0/0 (0%)
[ 5] 12.00-13.00 sec 0.00 Bytes 0.00 bits/sec 3.847 ms 0/0 (0%)
[ 5] 13.00-14.00 sec 0.00 Bytes 0.00 bits/sec 3.847 ms 0/0 (0%)
[ 5] 14.00-15.00 sec 0.00 Bytes 0.00 bits/sec 3.847 ms 0/0 (0%)
[ 5] 15.00-16.00 sec 0.00 Bytes 0.00 bits/sec 3.847 ms 0/0 (0%)
[ 5] 16.00-17.00 sec 0.00 Bytes 0.00 bits/sec 3.847 ms 0/0 (0%)
[ 5] 17.00-18.00 sec 0.00 Bytes 0.00 bits/sec 3.847 ms 0/0 (0%)
[ 5] 18.00-19.00 sec 0.00 Bytes 0.00 bits/sec 3.847 ms 0/0 (0%)
[ 5] 19.00-20.00 sec 0.00 Bytes 0.00 bits/sec 3.847 ms 0/0 (0%)
[ 5] 20.00-21.00 sec 0.00 Bytes 0.00 bits/sec 3.847 ms 0/0 (0%)
[ 5] 21.00-22.00 sec 0.00 Bytes 0.00 bits/sec 3.847 ms 0/0 (0%)
[ 5] 22.00-23.00 sec 0.00 Bytes 0.00 bits/sec 3.847 ms 0/0 (0%)
[ 5] 23.00-24.00 sec 0.00 Bytes 0.00 bits/sec 3.847 ms 0/0 (0%)
[ 5] 24.00-25.00 sec 0.00 Bytes 0.00 bits/sec 3.847 ms 0/0 (0%)
[ 5] 25.00-26.00 sec 0.00 Bytes 0.00 bits/sec 3.847 ms 0/0 (0%)
[ 5] 26.00-27.00 sec 0.00 Bytes 0.00 bits/sec 3.847 ms 0/0 (0%)
[ 5] 27.00-28.00 sec 0.00 Bytes 0.00 bits/sec 3.847 ms 0/0 (0%)
[ 5] 28.00-29.00 sec 0.00 Bytes 0.00 bits/sec 3.847 ms 0/0 (0%)
[ 5] 30.00-69.84 sec 0.00 Bytes 0.00 bits/sec 3.847 ms 0/0 (0%)
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval Transfer Bitrate Jitter Lost/Total Datagrams
[ 5] 0.00-69.84 sec 0.00 Bytes 0.00 bits/sec 0.000 ms 0/-34521 (0%) sender
[ 5] 0.00-69.84 sec 33.1 MBytes 3.98 Mbits/sec 3.847 ms 9/23981 (0.038%) receiver
Connecting to host 172.21.6.102, port 5007
[ 5] local 12.1.1.105 port 46131 connected to 172.21.6.102 port 5007
[ ID] Interval Transfer Bitrate Total Datagrams
[ 5] 0.00-1.00 sec 293 KBytes 2.40 Mbits/sec 207 (omitted)
[ 5] 1.00-2.00 sec 294 KBytes 2.41 Mbits/sec 208 (omitted)
[ 5] 2.00-3.00 sec 293 KBytes 2.40 Mbits/sec 207 (omitted)
[ 5] 3.00-4.00 sec 293 KBytes 2.40 Mbits/sec 207 (omitted)
[ 5] 1.00-1.00 sec 293 KBytes 1.20 Mbits/sec 414
[ 5] 1.00-2.00 sec 294 KBytes 2.41 Mbits/sec 208
[ 5] 2.00-3.00 sec 293 KBytes 2.40 Mbits/sec 207
[ 5] 3.00-4.00 sec 293 KBytes 2.40 Mbits/sec 207
[ 5] 4.00-5.00 sec 293 KBytes 2.40 Mbits/sec 207
[ 5] 5.00-6.00 sec 293 KBytes 2.40 Mbits/sec 207
[ 5] 6.00-7.00 sec 293 KBytes 2.40 Mbits/sec 207
[ 5] 7.00-8.00 sec 294 KBytes 2.41 Mbits/sec 208
[ 5] 8.00-9.00 sec 293 KBytes 2.40 Mbits/sec 207
[ 5] 9.00-10.00 sec 293 KBytes 2.40 Mbits/sec 207
[ 5] 10.00-11.00 sec 293 KBytes 2.40 Mbits/sec 207
[ 5] 11.00-12.00 sec 294 KBytes 2.41 Mbits/sec 208
[ 5] 12.00-13.00 sec 293 KBytes 2.40 Mbits/sec 207
[ 5] 13.00-14.00 sec 293 KBytes 2.40 Mbits/sec 207
[ 5] 14.00-15.00 sec 293 KBytes 2.40 Mbits/sec 207
[ 5] 15.00-16.00 sec 293 KBytes 2.40 Mbits/sec 207
[ 5] 16.00-17.00 sec 293 KBytes 2.40 Mbits/sec 207
[ 5] 17.00-18.00 sec 293 KBytes 2.40 Mbits/sec 207
[ 5] 18.00-19.00 sec 294 KBytes 2.41 Mbits/sec 208
[ 5] 19.00-20.00 sec 293 KBytes 2.40 Mbits/sec 207
[ 5] 20.00-21.00 sec 293 KBytes 2.40 Mbits/sec 207
[ 5] 21.00-22.00 sec 293 KBytes 2.40 Mbits/sec 207
[ 5] 22.00-23.00 sec 293 KBytes 2.40 Mbits/sec 207
[ 5] 23.00-24.00 sec 294 KBytes 2.41 Mbits/sec 208
[ 5] 24.00-25.00 sec 293 KBytes 2.40 Mbits/sec 207
[ 5] 25.00-26.00 sec 293 KBytes 2.40 Mbits/sec 207
[ 5] 26.00-27.00 sec 293 KBytes 2.40 Mbits/sec 207
[ 5] 27.00-28.00 sec 293 KBytes 2.40 Mbits/sec 207
[ 5] 28.00-29.00 sec 294 KBytes 2.41 Mbits/sec 208
[ 5] 30.00-69.81 sec 0.00 Bytes 0.00 bits/sec 0
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval Transfer Bitrate Jitter Lost/Total Datagrams
[ 5] 0.00-69.81 sec 8.58 MBytes 1.03 Mbits/sec 0.000 ms 0/6216 (0%) sender
[ 5] 0.00-69.81 sec 0.00 Bytes 0.00 bits/sec 0.000 ms 0/-1036 (0%) receiver
Connecting to host 172.21.6.102, port 5007
Reverse mode, remote host 172.21.6.102 is sending
[ 5] local 12.1.1.105 port 52299 connected to 172.21.6.102 port 5007
[ ID] Interval Transfer Bitrate Jitter Lost/Total Datagrams
[ 5] 0.00-1.00 sec 389 KBytes 3.19 Mbits/sec 8024.341 ms 131771/132046 (1e+02%) (omitted)
[ 5] 1.00-2.00 sec 602 KBytes 4.93 Mbits/sec 4.031 ms -426/0 (0%) (omitted)
[ 5] 2.00-3.00 sec 638 KBytes 5.22 Mbits/sec 3.643 ms -451/0 (0%) (omitted)
[ 5] 3.00-4.00 sec 632 KBytes 5.18 Mbits/sec 3.607 ms -447/0 (0%) (omitted)
[ 5] 1.00-1.00 sec 567 KBytes 2.32 Mbits/sec 2.950 ms -818/0 (0%)
[ 5] 1.00-2.00 sec 570 KBytes 4.67 Mbits/sec 3.083 ms -403/0 (0%)
[ 5] 2.00-3.00 sec 573 KBytes 4.69 Mbits/sec 3.222 ms -405/0 (0%)
[ 5] 3.00-4.00 sec 566 KBytes 4.63 Mbits/sec 3.114 ms -400/0 (0%)
[ 5] 4.00-5.00 sec 576 KBytes 4.71 Mbits/sec 3.594 ms -407/0 (0%)
[ 5] 5.00-6.00 sec 567 KBytes 4.65 Mbits/sec 3.634 ms -401/0 (0%)
[ 5] 6.00-7.00 sec 571 KBytes 4.68 Mbits/sec 3.196 ms -404/0 (0%)
[ 5] 7.00-8.00 sec 567 KBytes 4.65 Mbits/sec 3.514 ms -401/0 (0%)
[ 5] 8.00-9.00 sec 573 KBytes 4.69 Mbits/sec 3.230 ms -405/0 (0%)
[ 5] 9.00-10.00 sec 570 KBytes 4.67 Mbits/sec 3.334 ms -403/0 (0%)
[ 5] 10.00-11.00 sec 566 KBytes 4.63 Mbits/sec 3.602 ms -400/0 (0%)
[ 5] 11.00-12.00 sec 574 KBytes 4.70 Mbits/sec 3.484 ms -406/0 (0%)
[ 5] 12.00-13.00 sec 571 KBytes 4.68 Mbits/sec 3.339 ms -404/0 (0%)
[ 5] 13.00-14.00 sec 568 KBytes 4.66 Mbits/sec 3.404 ms -402/0 (0%)
[ 5] 14.00-15.00 sec 570 KBytes 4.67 Mbits/sec 3.503 ms -403/0 (0%)
[ 5] 15.00-16.00 sec 573 KBytes 4.69 Mbits/sec 3.369 ms -405/0 (0%)
[ 5] 16.00-17.00 sec 567 KBytes 4.65 Mbits/sec 3.533 ms -401/0 (0%)
[ 5] 17.00-18.00 sec 570 KBytes 4.67 Mbits/sec 3.650 ms -403/0 (0%)
[ 5] 18.00-19.00 sec 573 KBytes 4.69 Mbits/sec 3.532 ms -405/0 (0%)
[ 5] 19.00-20.00 sec 568 KBytes 4.66 Mbits/sec 3.461 ms -402/0 (0%)
[ 5] 20.00-21.00 sec 573 KBytes 4.69 Mbits/sec 3.369 ms -405/0 (0%)
[ 5] 21.00-22.00 sec 566 KBytes 4.63 Mbits/sec 3.654 ms -400/0 (0%)
[ 5] 22.00-23.00 sec 573 KBytes 4.69 Mbits/sec 3.309 ms -405/0 (0%)
[ 5] 23.00-24.00 sec 568 KBytes 4.66 Mbits/sec 3.681 ms -402/0 (0%)
[ 5] 24.00-25.00 sec 570 KBytes 4.67 Mbits/sec 3.443 ms -403/0 (0%)
[ 5] 25.00-26.00 sec 571 KBytes 4.68 Mbits/sec 3.467 ms -404/0 (0%)
[ 5] 26.00-27.00 sec 573 KBytes 4.69 Mbits/sec 3.324 ms -405/0 (0%)
[ 5] 27.00-28.00 sec 566 KBytes 4.63 Mbits/sec 3.425 ms -400/0 (0%)
[ 5] 28.00-29.00 sec 574 KBytes 4.70 Mbits/sec 3.274 ms -406/0 (0%)
[ 5] 29.00-30.00 sec 570 KBytes 4.67 Mbits/sec 3.413 ms -403/0 (0%)
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval Transfer Bitrate Jitter Lost/Total Datagrams
[ 5] 0.00-30.01 sec 16.7 MBytes 4.67 Mbits/sec 0.000 ms 0/-117930 (0%) sender
[SUM] 0.0-30.0 sec 12094 datagrams received out-of-order
[ 5] 0.00-30.00 sec 16.7 MBytes 4.67 Mbits/sec 3.413 ms -12094/0 (0%) receiver
Server output:
Accepted connection from 172.21.6.101, port 47601
[ 5] local 172.21.6.102 port 5007 connected to 172.21.6.101 port 52299
[ ID] Interval Transfer Bitrate Total Datagrams
[ 5] 0.00-1.00 sec 570 KBytes 4.67 Mbits/sec 403 (omitted)
[ 5] 1.00-2.00 sec 570 KBytes 4.67 Mbits/sec 403 (omitted)
[ 5] 2.00-3.00 sec 571 KBytes 4.68 Mbits/sec 404 (omitted)
[ 5] 3.00-4.00 sec 570 KBytes 4.67 Mbits/sec 403 (omitted)
[ 5] 4.00-5.00 sec 570 KBytes 4.67 Mbits/sec 403 (omitted)
[ 5] 0.00-1.00 sec 570 KBytes 4.67 Mbits/sec 403
[ 5] 1.00-2.00 sec 570 KBytes 4.67 Mbits/sec 403
[ 5] 2.00-3.00 sec 570 KBytes 4.67 Mbits/sec 403
[ 5] 3.00-4.00 sec 570 KBytes 4.67 Mbits/sec 403
[ 5] 4.00-5.00 sec 571 KBytes 4.68 Mbits/sec 404
[ 5] 5.00-6.00 sec 570 KBytes 4.67 Mbits/sec 403
[ 5] 6.00-7.00 sec 570 KBytes 4.67 Mbits/sec 403
[ 5] 7.00-8.00 sec 570 KBytes 4.67 Mbits/sec 403
[ 5] 8.00-9.00 sec 571 KBytes 4.68 Mbits/sec 404
[ 5] 9.00-10.00 sec 570 KBytes 4.67 Mbits/sec 403
[ 5] 10.00-11.00 sec 570 KBytes 4.67 Mbits/sec 403
[ 5] 11.00-12.00 sec 570 KBytes 4.67 Mbits/sec 403
[ 5] 12.00-13.00 sec 570 KBytes 4.67 Mbits/sec 403
[ 5] 13.00-14.00 sec 570 KBytes 4.67 Mbits/sec 403
[ 5] 14.00-15.00 sec 570 KBytes 4.67 Mbits/sec 403
[ 5] 15.00-16.00 sec 570 KBytes 4.67 Mbits/sec 403
[ 5] 16.00-17.00 sec 570 KBytes 4.67 Mbits/sec 403
[ 5] 17.00-18.00 sec 570 KBytes 4.67 Mbits/sec 403
[ 5] 18.00-19.00 sec 571 KBytes 4.68 Mbits/sec 404
[ 5] 19.00-20.00 sec 570 KBytes 4.67 Mbits/sec 403
[ 5] 20.00-21.00 sec 570 KBytes 4.67 Mbits/sec 403
[ 5] 21.00-22.00 sec 570 KBytes 4.67 Mbits/sec 403
[ 5] 22.00-23.00 sec 570 KBytes 4.67 Mbits/sec 403
[ 5] 23.00-24.00 sec 570 KBytes 4.67 Mbits/sec 403
[ 5] 24.00-25.00 sec 571 KBytes 4.68 Mbits/sec 404
[ 5] 25.00-26.00 sec 570 KBytes 4.67 Mbits/sec 403
[ 5] 26.00-27.00 sec 570 KBytes 4.67 Mbits/sec 403
[ 5] 27.00-28.00 sec 570 KBytes 4.67 Mbits/sec 403
[ 5] 28.00-29.00 sec 570 KBytes 4.67 Mbits/sec 403
[ 5] 29.00-30.00 sec 570 KBytes 4.67 Mbits/sec 403
[ 5] 30.00-30.01 sec 8.48 KBytes 4.94 Mbits/sec 6
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval Transfer Bitrate Jitter Lost/Total Datagrams
[ 5] 0.00-30.01 sec 16.7 MBytes 4.67 Mbits/sec 0.000 ms 0/12100 (0%) sender
iperf Done.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment