Removes dependency on golden files in ping and rvr tests.
This CL removes the dependency on golden files in ping tests and makes
the files optional in RvR tests.
Test: Done
Bug: None
Signed-off-by: Omar El Ayach <oelayach@google.com>
Change-Id: I745e104f440dbcf04c8d6402d11eede43c11831b
diff --git a/acts/tests/google/wifi/WifiPingTest.py b/acts/tests/google/wifi/WifiPingTest.py
index cab0240..86b4434 100644
--- a/acts/tests/google/wifi/WifiPingTest.py
+++ b/acts/tests/google/wifi/WifiPingTest.py
@@ -70,7 +70,7 @@
'ping_test_params', 'testbed_params', 'main_network',
'RetailAccessPoints', 'RemoteServer'
]
- opt_params = ['golden_files_list', 'OTASniffer']
+ opt_params = ['OTASniffer']
self.unpack_userparams(req_params, opt_params)
self.testclass_params = self.ping_test_params
self.num_atten = self.attenuators[0].instrument.num_atten
@@ -84,12 +84,6 @@
self.access_point.ap_settings))
self.log_path = os.path.join(logging.log_path, 'results')
os.makedirs(self.log_path, exist_ok=True)
- if not hasattr(self, 'golden_files_list'):
- self.golden_files_list = [
- os.path.join(self.testbed_params['golden_results_path'], file)
- for file in os.listdir(
- self.testbed_params['golden_results_path'])
- ]
if hasattr(self, 'bdf'):
self.log.info('Pushing WiFi BDF to DUT.')
wputils.push_bdf(self.dut, self.bdf)
diff --git a/acts/tests/google/wifi/WifiRvrTest.py b/acts/tests/google/wifi/WifiRvrTest.py
index c9b3672..9e61b6b 100644
--- a/acts/tests/google/wifi/WifiRvrTest.py
+++ b/acts/tests/google/wifi/WifiRvrTest.py
@@ -84,11 +84,15 @@
self.log_path = os.path.join(logging.log_path, 'results')
os.makedirs(self.log_path, exist_ok=True)
if not hasattr(self, 'golden_files_list'):
- self.golden_files_list = [
- os.path.join(self.testbed_params['golden_results_path'], file)
- for file in os.listdir(
- self.testbed_params['golden_results_path'])
- ]
+ if 'golden_results_path' in self.testbed_params:
+ self.golden_files_list = [
+ os.path.join(self.testbed_params['golden_results_path'],
+ file) for file in
+ os.listdir(self.testbed_params['golden_results_path'])
+ ]
+ else:
+ self.log.warning('No golden files found.')
+ self.golden_files_list = []
if hasattr(self, 'bdf'):
self.log.info('Pushing WiFi BDF to DUT.')
wputils.push_bdf(self.dut, self.bdf)
diff --git a/acts/tests/google/wifi/WifiSensitivityTest.py b/acts/tests/google/wifi/WifiSensitivityTest.py
index 9f1ea53..3ad6749 100644
--- a/acts/tests/google/wifi/WifiSensitivityTest.py
+++ b/acts/tests/google/wifi/WifiSensitivityTest.py
@@ -142,7 +142,7 @@
'RetailAccessPoints', 'sensitivity_test_params', 'testbed_params',
'RemoteServer'
]
- opt_params = ['main_network', 'golden_files_list']
+ opt_params = ['main_network']
self.unpack_userparams(req_params, opt_params)
self.testclass_params = self.sensitivity_test_params
self.num_atten = self.attenuators[0].instrument.num_atten
@@ -155,12 +155,6 @@
self.access_point.ap_settings))
self.log_path = os.path.join(logging.log_path, 'results')
os.makedirs(self.log_path, exist_ok=True)
- if not hasattr(self, 'golden_files_list'):
- self.golden_files_list = [
- os.path.join(self.testbed_params['golden_results_path'], file)
- for file in os.listdir(
- self.testbed_params['golden_results_path'])
- ]
if hasattr(self, 'bdf'):
self.log.info('Pushing WiFi BDF to DUT.')
wputils.push_bdf(self.dut, self.bdf)
@@ -211,7 +205,7 @@
wutils.toggle_wifi_off_and_on(dev)
def pass_fail_check(self, result):
- """Checks sensitivity against golden results and decides on pass/fail.
+ """Checks sensitivity results and decides on pass/fail.
Args:
result: dict containing attenuation, throughput and other meta
diff --git a/acts/tests/google/wifi/WifiThroughputStabilityTest.py b/acts/tests/google/wifi/WifiThroughputStabilityTest.py
index 98e165f..2df0343 100644
--- a/acts/tests/google/wifi/WifiThroughputStabilityTest.py
+++ b/acts/tests/google/wifi/WifiThroughputStabilityTest.py
@@ -18,7 +18,6 @@
import itertools
import json
import logging
-import math
import numpy
import os
from acts import asserts
@@ -281,7 +280,7 @@
wutils.wifi_toggle_state(self.dut, True)
wutils.reset_wifi(self.dut)
wutils.set_wifi_country_code(self.dut,
- self.testclass_params['country_code'])
+ self.testclass_params['country_code'])
self.main_network[band]['channel'] = testcase_params['channel']
wutils.wifi_connect(self.dut,
testcase_params['test_network'],