test_ipv4_ttls: cleanup stations upon creation and at end of program

Signed-off-by: Matthew Stidham <stidmatt@gmail.com>
This commit is contained in:
Matthew Stidham
2021-12-15 09:48:44 -08:00
parent 7e0563ac21
commit 2852c5e593

View File

@@ -277,6 +277,13 @@ class TTLSTest(Realm):
LFUtils.wait_until_ports_disappear(base_url=self.lfclient_url, port_list=sta_list, LFUtils.wait_until_ports_disappear(base_url=self.lfclient_url, port_list=sta_list,
debug=self.debug) debug=self.debug)
def pre_cleanup(self):
self.cx_profile.cleanup_prefix()
# do not clean up station if existed prior to test
if not self.use_existing_sta:
for sta in self.sta_list:
self.rm_port(sta, check_exists=True, debug_=False)
def collect_endp_stats(self, endp_map, traffic_type="TCP"): def collect_endp_stats(self, endp_map, traffic_type="TCP"):
print("Collecting Data") print("Collecting Data")
fields = "?fields=name,tx+bytes,rx+bytes" fields = "?fields=name,tx+bytes,rx+bytes"
@@ -382,6 +389,7 @@ test_ipv4_ttls.py:
enable_pkc=args.enable_pkc, enable_pkc=args.enable_pkc,
) )
ttls_test.cleanup(station_list) ttls_test.cleanup(station_list)
ttls_test.pre_cleanup()
ttls_test.build() ttls_test.build()
if not ttls_test.passes(): if not ttls_test.passes():
print(ttls_test.get_fail_message()) print(ttls_test.get_fail_message())
@@ -393,6 +401,7 @@ test_ipv4_ttls.py:
exit(1) exit(1)
time.sleep(30) time.sleep(30)
ttls_test.cleanup(station_list) ttls_test.cleanup(station_list)
ttls_test.pre_cleanup()
if ttls_test.passes(): if ttls_test.passes():
print("Full test passed, all stations associated and got IP") print("Full test passed, all stations associated and got IP")