mirror of
https://github.com/Telecominfraproject/wlan-lanforge-scripts.git
synced 2025-10-31 18:58:01 +00:00
lfcli base changes
This commit is contained in:
@@ -178,19 +178,19 @@ Generic command example:
|
||||
if not ip_test.passes():
|
||||
print(ip_test.get_fail_message())
|
||||
ip_test.add_event(name="test_ipv4_connection.py", message=ip_test.get_fail_message())
|
||||
exit(1)
|
||||
ip_test.exit_fail()
|
||||
ip_test.start(station_list, False, False)
|
||||
ip_test.stop()
|
||||
if not ip_test.passes():
|
||||
print(ip_test.get_fail_message())
|
||||
ip_test.add_event(name="test_ipv4_connection.py", message=ip_test.get_fail_message())
|
||||
exit(1)
|
||||
ip_test.exit_fail()
|
||||
time.sleep(30)
|
||||
ip_test.cleanup(station_list)
|
||||
if ip_test.passes():
|
||||
print("Full test passed, all stations associated and got IP")
|
||||
ip_test.add_event(name="test_ipv4_connection.py", message="Full test passed, all stations associated and got IP")
|
||||
#exit(1)
|
||||
ip_test.exit_success()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
||||
@@ -165,18 +165,17 @@ def main():
|
||||
Generic command layout:
|
||||
python ./test_ipv4_l4.py --upstream_port <port> --radio <radio 0> <stations> <ssid> <ssid password> <security type: wpa2, open, wpa3> --debug
|
||||
|
||||
Note: multiple --radio switches may be entered up to the number of radios available:
|
||||
--radio <radio 0> <stations> <ssid> <ssid password> --radio <radio 01> <number of last station> <ssid> <ssid password>
|
||||
Command Line Example:
|
||||
python3 ./test_ipv4_l4.py --upstream_port eth1 \\
|
||||
--radio wiphy0 \\
|
||||
--num_stations 3 \\
|
||||
--security {open|wep|wpa|wpa2|wpa3} \\
|
||||
--ssid netgear \\
|
||||
--url "dl http://10.40.0.1 /dev/null" \\
|
||||
--password admin123 \\
|
||||
--test_duration 2m \\
|
||||
--debug
|
||||
python3 ./test_ipv4_l4.py
|
||||
--upstream_port eth1 (optional)
|
||||
--radio wiphy0 (required)
|
||||
--num_stations 3 (optional)
|
||||
--security {open|wep|wpa|wpa2|wpa3} (required)
|
||||
--ssid netgear (required)
|
||||
--url "dl http://10.40.0.1 /dev/null" (required)
|
||||
--password admin123 (required)
|
||||
--test_duration 2m (optional)
|
||||
--debug (optional)
|
||||
|
||||
''')
|
||||
|
||||
@@ -210,16 +209,17 @@ def main():
|
||||
ip_test.build()
|
||||
if not ip_test.passes():
|
||||
print(ip_test.get_fail_message())
|
||||
exit(1)
|
||||
ip_test.exit_fail()
|
||||
ip_test.start(False, False)
|
||||
ip_test.stop()
|
||||
if not ip_test.passes():
|
||||
print(ip_test.get_fail_message())
|
||||
exit(1)
|
||||
ip_test.exit_fail()
|
||||
time.sleep(30)
|
||||
ip_test.cleanup(station_list)
|
||||
if ip_test.passes():
|
||||
print("Full test passed, all endpoints had increased bytes-rd throughout test duration")
|
||||
ip_test.exit_success()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
@@ -62,7 +62,6 @@ class IPV4L4(LFCliBase):
|
||||
expected_passes += 1
|
||||
if new_list[item] > old_list[item]:
|
||||
passes += 1
|
||||
# print(item, old_list[item], new_list[item], passes, expected_passes)
|
||||
|
||||
if passes == expected_passes:
|
||||
return True
|
||||
@@ -74,7 +73,8 @@ class IPV4L4(LFCliBase):
|
||||
def __get_values(self):
|
||||
time.sleep(1)
|
||||
cx_list = self.json_get("layer4/list?fields=name,bytes-rd", debug_=self.debug)
|
||||
# print("==============\n", cx_list, "\n==============")
|
||||
if self.debug:
|
||||
print("==============\n", cx_list, "\n==============")
|
||||
cx_map = {}
|
||||
for cx_name in cx_list['endpoint']:
|
||||
if cx_name != 'uri' and cx_name != 'handler':
|
||||
@@ -100,7 +100,6 @@ class IPV4L4(LFCliBase):
|
||||
self._pass("All stations got IPs")
|
||||
else:
|
||||
self._fail("Stations failed to get IPs")
|
||||
exit(1)
|
||||
self.cx_profile.direction = self.direction
|
||||
self.cx_profile.dest = self.dest
|
||||
self.cx_profile.create(ports=self.station_profile.station_names, sleep_time=.5, debug_=self.debug,
|
||||
@@ -121,10 +120,11 @@ class IPV4L4(LFCliBase):
|
||||
time.sleep(1)
|
||||
|
||||
new_rx_values = self.__get_values()
|
||||
# print(old_rx_values, new_rx_values)
|
||||
# print("\n-----------------------------------")
|
||||
# print(cur_time, end_time, cur_time + datetime.timedelta(minutes=1))
|
||||
# print("-----------------------------------\n")
|
||||
if self.debug:
|
||||
print(old_rx_values, new_rx_values)
|
||||
print("\n-----------------------------------")
|
||||
print(cur_time, end_time, cur_time + datetime.timedelta(minutes=1))
|
||||
print("-----------------------------------\n")
|
||||
expected_passes += 1
|
||||
if self.__compare_vals(old_rx_values, new_rx_values):
|
||||
passes += 1
|
||||
@@ -203,16 +203,17 @@ python3 ./test_ipv4_l4_wifi.py --upstream_port eth1 \\
|
||||
ip_test.build()
|
||||
if not ip_test.passes():
|
||||
print(ip_test.get_fail_message())
|
||||
exit(1)
|
||||
ip_test.exit_fail()
|
||||
ip_test.start(False, False)
|
||||
ip_test.stop()
|
||||
if not ip_test.passes():
|
||||
print(ip_test.get_fail_message())
|
||||
exit(1)
|
||||
ip_test.exit_fail()
|
||||
time.sleep(30)
|
||||
ip_test.cleanup(station_list)
|
||||
if ip_test.passes():
|
||||
print("Full test passed, all endpoints had increased bytes-rd throughout test duration")
|
||||
("Full test passed, all endpoints had increased bytes-rd throughout test duration")
|
||||
ip_test.exit_success()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
Reference in New Issue
Block a user