lfcli base changes

This commit is contained in:
Dipti
2020-12-11 00:45:52 -08:00
parent fcc4b20c1f
commit 08bc4a47c0
3 changed files with 28 additions and 27 deletions

View File

@@ -178,19 +178,19 @@ Generic command example:
if not ip_test.passes(): if not ip_test.passes():
print(ip_test.get_fail_message()) print(ip_test.get_fail_message())
ip_test.add_event(name="test_ipv4_connection.py", message=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.start(station_list, False, False)
ip_test.stop() ip_test.stop()
if not ip_test.passes(): if not ip_test.passes():
print(ip_test.get_fail_message()) print(ip_test.get_fail_message())
ip_test.add_event(name="test_ipv4_connection.py", message=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) time.sleep(30)
ip_test.cleanup(station_list) ip_test.cleanup(station_list)
if ip_test.passes(): 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") 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__": if __name__ == "__main__":
main() main()

View File

@@ -165,18 +165,17 @@ def main():
Generic command layout: Generic command layout:
python ./test_ipv4_l4.py --upstream_port <port> --radio <radio 0> <stations> <ssid> <ssid password> <security type: wpa2, open, wpa3> --debug 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: Command Line Example:
python3 ./test_ipv4_l4.py --upstream_port eth1 \\ python3 ./test_ipv4_l4.py
--radio wiphy0 \\ --upstream_port eth1 (optional)
--num_stations 3 \\ --radio wiphy0 (required)
--security {open|wep|wpa|wpa2|wpa3} \\ --num_stations 3 (optional)
--ssid netgear \\ --security {open|wep|wpa|wpa2|wpa3} (required)
--url "dl http://10.40.0.1 /dev/null" \\ --ssid netgear (required)
--password admin123 \\ --url "dl http://10.40.0.1 /dev/null" (required)
--test_duration 2m \\ --password admin123 (required)
--debug --test_duration 2m (optional)
--debug (optional)
''') ''')
@@ -210,16 +209,17 @@ def main():
ip_test.build() ip_test.build()
if not ip_test.passes(): if not ip_test.passes():
print(ip_test.get_fail_message()) print(ip_test.get_fail_message())
exit(1) ip_test.exit_fail()
ip_test.start(False, False) ip_test.start(False, False)
ip_test.stop() ip_test.stop()
if not ip_test.passes(): if not ip_test.passes():
print(ip_test.get_fail_message()) print(ip_test.get_fail_message())
exit(1) ip_test.exit_fail()
time.sleep(30) time.sleep(30)
ip_test.cleanup(station_list) ip_test.cleanup(station_list)
if ip_test.passes(): if ip_test.passes():
print("Full test passed, all endpoints had increased bytes-rd throughout test duration") print("Full test passed, all endpoints had increased bytes-rd throughout test duration")
ip_test.exit_success()
if __name__ == "__main__": if __name__ == "__main__":

View File

@@ -62,7 +62,6 @@ class IPV4L4(LFCliBase):
expected_passes += 1 expected_passes += 1
if new_list[item] > old_list[item]: if new_list[item] > old_list[item]:
passes += 1 passes += 1
# print(item, old_list[item], new_list[item], passes, expected_passes)
if passes == expected_passes: if passes == expected_passes:
return True return True
@@ -74,7 +73,8 @@ class IPV4L4(LFCliBase):
def __get_values(self): def __get_values(self):
time.sleep(1) time.sleep(1)
cx_list = self.json_get("layer4/list?fields=name,bytes-rd", debug_=self.debug) 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 = {} cx_map = {}
for cx_name in cx_list['endpoint']: for cx_name in cx_list['endpoint']:
if cx_name != 'uri' and cx_name != 'handler': if cx_name != 'uri' and cx_name != 'handler':
@@ -100,7 +100,6 @@ class IPV4L4(LFCliBase):
self._pass("All stations got IPs") self._pass("All stations got IPs")
else: else:
self._fail("Stations failed to get IPs") self._fail("Stations failed to get IPs")
exit(1)
self.cx_profile.direction = self.direction self.cx_profile.direction = self.direction
self.cx_profile.dest = self.dest self.cx_profile.dest = self.dest
self.cx_profile.create(ports=self.station_profile.station_names, sleep_time=.5, debug_=self.debug, 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) time.sleep(1)
new_rx_values = self.__get_values() new_rx_values = self.__get_values()
# print(old_rx_values, new_rx_values) if self.debug:
# print("\n-----------------------------------") print(old_rx_values, new_rx_values)
# print(cur_time, end_time, cur_time + datetime.timedelta(minutes=1)) print("\n-----------------------------------")
# print("-----------------------------------\n") print(cur_time, end_time, cur_time + datetime.timedelta(minutes=1))
print("-----------------------------------\n")
expected_passes += 1 expected_passes += 1
if self.__compare_vals(old_rx_values, new_rx_values): if self.__compare_vals(old_rx_values, new_rx_values):
passes += 1 passes += 1
@@ -203,16 +203,17 @@ python3 ./test_ipv4_l4_wifi.py --upstream_port eth1 \\
ip_test.build() ip_test.build()
if not ip_test.passes(): if not ip_test.passes():
print(ip_test.get_fail_message()) print(ip_test.get_fail_message())
exit(1) ip_test.exit_fail()
ip_test.start(False, False) ip_test.start(False, False)
ip_test.stop() ip_test.stop()
if not ip_test.passes(): if not ip_test.passes():
print(ip_test.get_fail_message()) print(ip_test.get_fail_message())
exit(1) ip_test.exit_fail()
time.sleep(30) time.sleep(30)
ip_test.cleanup(station_list) ip_test.cleanup(station_list)
if ip_test.passes(): 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__": if __name__ == "__main__":