summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJimmy Chen <jimmycmchen@google.com>2020-07-06 13:04:29 +0800
committerJimmy Chen <jimmycmchen@google.com>2020-07-06 17:24:39 +0800
commita1920dc42585d3d74c77edb1bf2a9f14a95e1ba7 (patch)
tree24ebe8b938a155e0ae02c0b866e423088c64744f
parent11c40d008b3aa5eb8017a75c543f76ca8630a913 (diff)
downloadplatform_tools_test_connectivity-a1920dc42585d3d74c77edb1bf2a9f14a95e1ba7.tar.gz
platform_tools_test_connectivity-a1920dc42585d3d74c77edb1bf2a9f14a95e1ba7.tar.bz2
platform_tools_test_connectivity-a1920dc42585d3d74c77edb1bf2a9f14a95e1ba7.zip
p2p: extend waiting timee for the group client lost event
The lost of a group client might not be awared by the group owner immediately due to packet lost or interference. The group owner needs to wait the maximum client kickout time to know the lost of a group client. Bug: 160432599 Test: act.py -c \ ./tools/test/connectivity/acts/tests/google/wifi/p2p/config/wifi_p2p.json \ -tb WifiP2pAllAttached -tc WifiP2pManagerTest Change-Id: I77b206fe451f529bff527ab63873304f375a6198
-rw-r--r--acts/framework/acts/test_utils/wifi/p2p/wifi_p2p_const.py1
-rwxr-xr-xacts/framework/acts/test_utils/wifi/p2p/wifi_p2p_test_utils.py4
-rw-r--r--acts/tests/google/wifi/p2p/functional/WifiP2pManagerTest.py9
3 files changed, 9 insertions, 5 deletions
diff --git a/acts/framework/acts/test_utils/wifi/p2p/wifi_p2p_const.py b/acts/framework/acts/test_utils/wifi/p2p/wifi_p2p_const.py
index 6e0c95779d..87f405967e 100644
--- a/acts/framework/acts/test_utils/wifi/p2p/wifi_p2p_const.py
+++ b/acts/framework/acts/test_utils/wifi/p2p/wifi_p2p_const.py
@@ -28,6 +28,7 @@ DEFAULT_TIMEOUT = 30
DEFAULT_SLEEPTIME = 5
DEFAULT_FUNCTION_SWITCH_TIME = 10
DEFAULT_SERVICE_WAITING_TIME = 20
+DEFAULT_GROUP_CLIENT_LOST_TIME = 60
P2P_CONNECT_NEGOTIATION = 0
P2P_CONNECT_JOIN = 1
diff --git a/acts/framework/acts/test_utils/wifi/p2p/wifi_p2p_test_utils.py b/acts/framework/acts/test_utils/wifi/p2p/wifi_p2p_test_utils.py
index 2e94f48f4c..abd186f0d3 100755
--- a/acts/framework/acts/test_utils/wifi/p2p/wifi_p2p_test_utils.py
+++ b/acts/framework/acts/test_utils/wifi/p2p/wifi_p2p_test_utils.py
@@ -43,7 +43,7 @@ def is_discovered(event, ad):
return False
-def check_disconnect(ad):
+def check_disconnect(ad, timeout=p2pconsts.DEFAULT_TIMEOUT):
"""Check an Android device disconnect or not
Args:
@@ -51,7 +51,7 @@ def check_disconnect(ad):
"""
ad.droid.wifiP2pRequestConnectionInfo()
# wait disconnect event
- ad.ed.pop_event(p2pconsts.DISCONNECTED_EVENT, p2pconsts.DEFAULT_TIMEOUT)
+ ad.ed.pop_event(p2pconsts.DISCONNECTED_EVENT, timeout)
def p2p_disconnect(ad):
diff --git a/acts/tests/google/wifi/p2p/functional/WifiP2pManagerTest.py b/acts/tests/google/wifi/p2p/functional/WifiP2pManagerTest.py
index 1b941e2852..6bda400dd6 100644
--- a/acts/tests/google/wifi/p2p/functional/WifiP2pManagerTest.py
+++ b/acts/tests/google/wifi/p2p/functional/WifiP2pManagerTest.py
@@ -100,7 +100,8 @@ class WifiP2pManagerTest(WifiP2pBaseTest):
gc_dut.ed.clear_all_events()
wp2putils.p2p_connect(gc_dut, go_dut, True, WPS_PBC)
wp2putils.p2p_disconnect(gc_dut)
- wp2putils.check_disconnect(go_dut)
+ wp2putils.check_disconnect(
+ go_dut, timeout=p2pconsts.DEFAULT_GROUP_CLIENT_LOST_TIME)
time.sleep(p2pconsts.DEFAULT_FUNCTION_SWITCH_TIME)
@test_tracker_info(uuid="12bbe73a-5a6c-4307-9797-c77c7efdc4b5")
@@ -150,7 +151,8 @@ class WifiP2pManagerTest(WifiP2pBaseTest):
gc_dut.ed.clear_all_events()
wp2putils.p2p_connect(gc_dut, go_dut, True, WPS_DISPLAY)
wp2putils.p2p_disconnect(gc_dut)
- wp2putils.check_disconnect(go_dut)
+ wp2putils.check_disconnect(
+ go_dut, timeout=p2pconsts.DEFAULT_GROUP_CLIENT_LOST_TIME)
time.sleep(p2pconsts.DEFAULT_FUNCTION_SWITCH_TIME)
@test_tracker_info(uuid="efe88f57-5a08-4195-9592-2f6945a9d18a")
@@ -200,5 +202,6 @@ class WifiP2pManagerTest(WifiP2pBaseTest):
gc_dut.ed.clear_all_events()
wp2putils.p2p_connect(gc_dut, go_dut, True, WPS_KEYPAD)
wp2putils.p2p_disconnect(gc_dut)
- wp2putils.check_disconnect(go_dut)
+ wp2putils.check_disconnect(
+ go_dut, timeout=p2pconsts.DEFAULT_GROUP_CLIENT_LOST_TIME)
time.sleep(p2pconsts.DEFAULT_FUNCTION_SWITCH_TIME)