summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBindu Mahadev <bmahadev@google.com>2017-06-20 23:33:05 +0000
committerBindu Mahadev <bmahadev@google.com>2017-06-21 23:49:24 +0000
commit0d1eec98bbbf3df7198bfb1dd32595bd9bbb2a0c (patch)
tree0814146926a993ff670feb30b617345f9b4f1a6f
parentc60b05ddc8d6e58fbcb66c00cfb195aca95e4c38 (diff)
downloadplatform_tools_test_connectivity-0d1eec98bbbf3df7198bfb1dd32595bd9bbb2a0c.tar.gz
platform_tools_test_connectivity-0d1eec98bbbf3df7198bfb1dd32595bd9bbb2a0c.tar.bz2
platform_tools_test_connectivity-0d1eec98bbbf3df7198bfb1dd32595bd9bbb2a0c.zip
Merge "[Tests]Migrate remaining tests scripts to use dynamic AP" am: 7d27743474 am: 161b8e54ce am: 7f20b56255
am: d6174e53c1 Change-Id: I8624b6a8481e7466ef81a36d443a6a233091eb35 (cherry picked from commit bbd79fa94d1c99e8e5838b7bddaf7494457e240f)
-rw-r--r--acts/tests/google/wifi/WifiNetworkSelectorTest.py16
-rw-r--r--acts/tests/google/wifi/WifiNewSetupAutoJoinTest.py16
-rw-r--r--acts/tests/google/wifi/WifiPnoTest.py26
-rwxr-xr-xacts/tests/google/wifi/WifiScannerMultiScanTest.py14
-rwxr-xr-xacts/tests/google/wifi/WifiScannerScanTest.py16
5 files changed, 62 insertions, 26 deletions
diff --git a/acts/tests/google/wifi/WifiNetworkSelectorTest.py b/acts/tests/google/wifi/WifiNetworkSelectorTest.py
index f8f10ffc00..17b4b28456 100644
--- a/acts/tests/google/wifi/WifiNetworkSelectorTest.py
+++ b/acts/tests/google/wifi/WifiNetworkSelectorTest.py
@@ -23,6 +23,7 @@ from acts.controllers import android_device
from acts.controllers import attenuator
from acts.test_decorators import test_tracker_info
from acts.test_utils.wifi import wifi_test_utils as wutils
+from acts.test_utils.wifi.WifiBaseTest import WifiBaseTest
WifiEnums = wutils.WifiEnums
@@ -37,17 +38,24 @@ ATTENUATOR_INITIAL_SETTING = 60
NETWORK_SELECTION_TIME_GAP = 12
-class WifiNetworkSelectorTest(base_test.BaseTestClass):
+class WifiNetworkSelectorTest(WifiBaseTest):
"""These tests verify the behavior of the Android Wi-Fi Network Selector
feature.
"""
+ def __init__(self, controllers):
+ WifiBaseTest.__init__(self, controllers)
+
def setup_class(self):
self.dut = self.android_devices[0]
wutils.wifi_test_device_init(self.dut)
- req_params = ("reference_networks", "open_network")
- self.unpack_userparams(req_params)
- # self.dut.droid.wifiEnableVerboseLogging(1)
+ req_params = []
+ opt_param = ["open_network", "reference_networks"]
+ self.unpack_userparams(
+ req_param_names=req_params, opt_param_names=opt_param)
+
+ if "AccessPoint" in self.user_params:
+ self.legacy_configure_ap_and_start()
def setup_test(self):
#reset and clear all saved networks on the DUT
diff --git a/acts/tests/google/wifi/WifiNewSetupAutoJoinTest.py b/acts/tests/google/wifi/WifiNewSetupAutoJoinTest.py
index 7fa2efd766..7c8891ebb2 100644
--- a/acts/tests/google/wifi/WifiNewSetupAutoJoinTest.py
+++ b/acts/tests/google/wifi/WifiNewSetupAutoJoinTest.py
@@ -21,15 +21,16 @@ from acts import base_test
from acts.test_decorators import test_tracker_info
from acts.test_utils.wifi import wifi_constants
from acts.test_utils.wifi import wifi_test_utils as wutils
+from acts.test_utils.wifi.WifiBaseTest import WifiBaseTest
WifiEnums = wutils.WifiEnums
NETWORK_ID_ERROR = "Network don't have ID"
NETWORK_ERROR = "Device is not connected to reference network"
-class WifiNewSetupAutoJoinTest(base_test.BaseTestClass):
+class WifiNewSetupAutoJoinTest(WifiBaseTest):
def __init__(self, controllers):
- base_test.BaseTestClass.__init__(self, controllers)
+ WifiBaseTest.__init__(self, controllers)
self.tests = ("test_autojoin_out_of_range",
"test_autojoin_Ap1_2g",
"test_autojoin_Ap1_2gto5g",
@@ -56,9 +57,14 @@ class WifiNewSetupAutoJoinTest(base_test.BaseTestClass):
"""
self.dut = self.android_devices[0]
wutils.wifi_test_device_init(self.dut)
- req_params = ("reference_networks", "atten_val", "ping_addr",
- "max_bugreports")
- self.unpack_userparams(req_params)
+ req_params = ("atten_val", "ping_addr", "max_bugreports")
+ opt_param = ["reference_networks"]
+ self.unpack_userparams(
+ req_param_names=req_params, opt_param_names=opt_param)
+
+ if "AccessPoint" in self.user_params:
+ self.legacy_configure_ap_and_start(ap_count=2)
+
configured_networks = self.dut.droid.wifiGetConfiguredNetworks()
self.log.debug("Configured networks :: {}".format(configured_networks))
count_confnet = 0
diff --git a/acts/tests/google/wifi/WifiPnoTest.py b/acts/tests/google/wifi/WifiPnoTest.py
index c3f815fbb5..ffdbab82b3 100644
--- a/acts/tests/google/wifi/WifiPnoTest.py
+++ b/acts/tests/google/wifi/WifiPnoTest.py
@@ -19,23 +19,29 @@ from acts import asserts
from acts import base_test
from acts.test_decorators import test_tracker_info
import acts.test_utils.wifi.wifi_test_utils as wutils
+from acts.test_utils.wifi.WifiBaseTest import WifiBaseTest
WifiEnums = wutils.WifiEnums
-class WifiPnoTest(base_test.BaseTestClass):
+class WifiPnoTest(WifiBaseTest):
+
+ def __init__(self, controllers):
+ WifiBaseTest.__init__(self, controllers)
+
def setup_class(self):
self.dut = self.android_devices[0]
wutils.wifi_test_device_init(self.dut)
- req_params = ("attn_vals", "reference_networks", "pno_interval")
- self.unpack_userparams(req_params)
- WifiNetworks = wutils.WifiReferenceNetworks(self.reference_networks)
- self.secure_networks_2g = WifiNetworks.return_2g_secure_networks()
- asserts.assert_true(
- len(self.secure_networks_2g) >= 2,
- "Need at least two secure 2g networks.")
- self.pno_network_a = self.secure_networks_2g[0]
- self.pno_network_b = self.secure_networks_2g[1]
+ req_params = ["attn_vals", "pno_interval"]
+ opt_param = ["reference_networks"]
+ self.unpack_userparams(
+ req_param_names=req_params, opt_param_names=opt_param)
+
+ if "AccessPoint" in self.user_params:
+ self.legacy_configure_ap_and_start()
+
+ self.pno_network_a = self.reference_networks[0]['2g']
+ self.pno_network_b = self.reference_networks[0]['5g']
self.attenuators = wutils.group_attenuators(self.attenuators)
self.attn_a = self.attenuators[0]
self.attn_b = self.attenuators[1]
diff --git a/acts/tests/google/wifi/WifiScannerMultiScanTest.py b/acts/tests/google/wifi/WifiScannerMultiScanTest.py
index 481ffb018c..14cd318e36 100755
--- a/acts/tests/google/wifi/WifiScannerMultiScanTest.py
+++ b/acts/tests/google/wifi/WifiScannerMultiScanTest.py
@@ -22,6 +22,7 @@ from acts import base_test
from acts import signals
from acts.test_decorators import test_tracker_info
from acts.test_utils.wifi import wifi_test_utils as wutils
+from acts.test_utils.wifi.WifiBaseTest import WifiBaseTest
WifiChannelUS = wutils.WifiChannelUS
WifiEnums = wutils.WifiEnums
@@ -217,7 +218,7 @@ class WifiScanResultEvents():
batches[0]["ScanResults"][0])
-class WifiScannerMultiScanTest(base_test.BaseTestClass):
+class WifiScannerMultiScanTest(WifiBaseTest):
"""This class is the WiFi Scanner Multi-Scan Test suite.
It collects a number of test cases, sets up and executes
the tests, and validates the scan results.
@@ -231,6 +232,9 @@ class WifiScannerMultiScanTest(base_test.BaseTestClass):
max_bugreports: Max number of bug reports allowed.
"""
+ def __init__(self, controllers):
+ WifiBaseTest.__init__(self, controllers)
+
def setup_class(self):
# If running in a setup with attenuators, set attenuation on all
# channels to zero.
@@ -248,8 +252,14 @@ class WifiScannerMultiScanTest(base_test.BaseTestClass):
config file.
"""
req_params = ("bssid_2g", "bssid_5g", "bssid_dfs", "max_bugreports")
+ opt_param = ["reference_networks"]
+ self.unpack_userparams(
+ req_param_names=req_params, opt_param_names=opt_param)
+
+ if "AccessPoint" in self.user_params:
+ self.legacy_configure_ap_and_start()
+
self.wifi_chs = WifiChannelUS(self.dut.model)
- self.unpack_userparams(req_params)
def on_fail(self, test_name, begin_time):
if self.max_bugreports > 0:
diff --git a/acts/tests/google/wifi/WifiScannerScanTest.py b/acts/tests/google/wifi/WifiScannerScanTest.py
index 3057b45655..d19a620112 100755
--- a/acts/tests/google/wifi/WifiScannerScanTest.py
+++ b/acts/tests/google/wifi/WifiScannerScanTest.py
@@ -25,6 +25,7 @@ from acts import utils
from acts.test_decorators import test_tracker_info
from acts.test_utils.wifi import wifi_constants
from acts.test_utils.wifi import wifi_test_utils as wutils
+from acts.test_utils.wifi.WifiBaseTest import WifiBaseTest
SCANTIME = 10000 #framework support only 10s as minimum scan interval
NUMBSSIDPERSCAN = 8
@@ -43,9 +44,9 @@ class WifiScannerScanError(Exception):
pass
-class WifiScannerScanTest(base_test.BaseTestClass):
+class WifiScannerScanTest(WifiBaseTest):
def __init__(self, controllers):
- base_test.BaseTestClass.__init__(self, controllers)
+ WifiBaseTest.__init__(self, controllers)
# TODO(angli): Remove this list.
# There are order dependencies among these tests so we'll have to leave
# it here for now. :(
@@ -74,9 +75,14 @@ class WifiScannerScanTest(base_test.BaseTestClass):
def setup_class(self):
self.dut = self.android_devices[0]
wutils.wifi_test_device_init(self.dut)
- req_params = ("reference_networks", "run_extended_test", "ping_addr",
- "max_bugreports")
- self.unpack_userparams(req_params)
+ req_params = ("run_extended_test", "ping_addr", "max_bugreports")
+ opt_param = ["reference_networks"]
+ self.unpack_userparams(
+ req_param_names=req_params, opt_param_names=opt_param)
+
+ if "AccessPoint" in self.user_params:
+ self.legacy_configure_ap_and_start()
+
self.leeway = 10
self.stime_channel = SCAN_TIME_PASSIVE
self.default_scan_setting = {