mirror of
https://github.com/Telecominfraproject/wlan-lanforge-scripts.git
synced 2025-11-02 03:37:55 +00:00
sta_connect: updated to have a results array
This commit is contained in:
@@ -58,13 +58,19 @@ class StaConnect(LFCliBase):
|
|||||||
return self.upstream_url
|
return self.upstream_url
|
||||||
|
|
||||||
# Compare pre-test values to post-test values
|
# Compare pre-test values to post-test values
|
||||||
|
# TODO: make this method add a results to an array
|
||||||
|
# the calling client should collect results from that array
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def compareVals(name, postVal):
|
def compareVals(name, postVal, results=None):
|
||||||
# print(f"Comparing {name}")
|
# print(f"Comparing {name}")
|
||||||
if postVal > 0:
|
if postVal > 0:
|
||||||
print("PASSED: %s %s" % (name, postVal))
|
print("PASSED: %s %s" % (name, postVal))
|
||||||
|
if results is not None:
|
||||||
|
results.append("PASSED: %s %s" % (name, postVal))
|
||||||
else:
|
else:
|
||||||
print("FAILED: %s did not report traffic: %s" % (name, postVal))
|
print("FAILED: %s did not report traffic: %s" % (name, postVal))
|
||||||
|
if results is not None:
|
||||||
|
results.append("FAILED: %s did not report traffic: %s" % (name, postVal))
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
self.check_connect()
|
self.check_connect()
|
||||||
@@ -323,17 +329,18 @@ class StaConnect(LFCliBase):
|
|||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
print("\n")
|
print("\n")
|
||||||
self.compareVals("testTCP-A TX", ptestTCPATX)
|
self.test_results = []
|
||||||
self.compareVals("testTCP-A RX", ptestTCPARX)
|
self.compareVals("testTCP-A TX", ptestTCPATX, self.test_results)
|
||||||
|
self.compareVals("testTCP-A RX", ptestTCPARX, self.test_results)
|
||||||
|
|
||||||
self.compareVals("testTCP-B TX", ptestTCPBTX)
|
self.compareVals("testTCP-B TX", ptestTCPBTX, self.test_results)
|
||||||
self.compareVals("testTCP-B RX", ptestTCPBRX)
|
self.compareVals("testTCP-B RX", ptestTCPBRX, self.test_results)
|
||||||
|
|
||||||
self.compareVals("testUDP-A TX", ptestUDPATX)
|
self.compareVals("testUDP-A TX", ptestUDPATX, self.test_results)
|
||||||
self.compareVals("testUDP-A RX", ptestUDPARX)
|
self.compareVals("testUDP-A RX", ptestUDPARX, self.test_results)
|
||||||
|
|
||||||
self.compareVals("testUDP-B TX", ptestUDPBTX)
|
self.compareVals("testUDP-B TX", ptestUDPBTX, self.test_results)
|
||||||
self.compareVals("testUDP-B RX", ptestUDPBRX)
|
self.compareVals("testUDP-B RX", ptestUDPBRX, self.test_results)
|
||||||
print("\n")
|
print("\n")
|
||||||
|
|
||||||
# remove all endpoints and cxs
|
# remove all endpoints and cxs
|
||||||
@@ -342,6 +349,9 @@ class StaConnect(LFCliBase):
|
|||||||
removeCX(self.mgr_url, cxNames)
|
removeCX(self.mgr_url, cxNames)
|
||||||
removeEndps(self.mgr_url, endpNames)
|
removeEndps(self.mgr_url, endpNames)
|
||||||
|
|
||||||
|
def get_result_list(self):
|
||||||
|
return self.test_results
|
||||||
|
|
||||||
# ~class
|
# ~class
|
||||||
|
|
||||||
|
|
||||||
@@ -400,7 +410,7 @@ Example:
|
|||||||
staConnect.dut_ssid = args.dut_ssid
|
staConnect.dut_ssid = args.dut_ssid
|
||||||
|
|
||||||
staConnect.run()
|
staConnect.run()
|
||||||
|
run_results = staConnect.get_result_list()
|
||||||
|
|
||||||
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
|
||||||
|
|||||||
@@ -24,7 +24,9 @@ def main():
|
|||||||
staConnect.dut_ssid = "jedway-wpa2-x2048-5-1"
|
staConnect.dut_ssid = "jedway-wpa2-x2048-5-1"
|
||||||
staConnect.dut_passwd = "jedway-wpa2-x2048-5-1"
|
staConnect.dut_passwd = "jedway-wpa2-x2048-5-1"
|
||||||
staConnect.run()
|
staConnect.run()
|
||||||
|
run_results = staConnect.get_result_list()
|
||||||
|
for result in run_results:
|
||||||
|
print("test result: "+result)
|
||||||
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user