From 87c2f84c5a1f0b74ef79543d6353109bb3c004a7 Mon Sep 17 00:00:00 2001 From: lesl Date: Wed, 20 Jan 2021 11:23:45 +0800 Subject: [PATCH] wifi: Add sleep 3 seconds to allow terminate processing in VTS tear down In current android design, the general use case is the interface is removed after terminate() call. But the VTS kill the hostapd immediately it causes terminate doesn't work normally. Add sleep 3 seconds to allow terminate processing. Another test case is considered to check hostapd died because any reason. (for instance: NPE crash) But the interface handling in android design is control in framework and WiFiHal. Case 1. Native crash will be handled in framework and clean the interface for the recovery. Case 2. VTS use "stopHAL" to clean "primy interface". It will cause clean up fail if OEM use "non-primy interface" for the SoftAp. But it is not requirement in hostapd HAL. Verify terminate is good in VtsHalWifiHostapd. Bug: 163170239 Test: atest -c VtsHalWifiHostapdV1_1TargetTest Test: atest -c VtsHalWifiHostapdV1_0TargetTest Change-Id: I25618961eb43492a10a293484c9af431d5971e1b --- wifi/hostapd/1.0/vts/functional/hostapd_hidl_test.cpp | 2 ++ wifi/hostapd/1.1/vts/functional/hostapd_hidl_test.cpp | 2 ++ 2 files changed, 4 insertions(+) diff --git a/wifi/hostapd/1.0/vts/functional/hostapd_hidl_test.cpp b/wifi/hostapd/1.0/vts/functional/hostapd_hidl_test.cpp index a4a38dedad..e12b6b6189 100644 --- a/wifi/hostapd/1.0/vts/functional/hostapd_hidl_test.cpp +++ b/wifi/hostapd/1.0/vts/functional/hostapd_hidl_test.cpp @@ -49,6 +49,8 @@ class HostapdHidlTest : public ::testing::VtsHalHidlTargetTestBase { virtual void TearDown() override { HIDL_INVOKE_VOID_WITHOUT_ARGUMENTS(hostapd_, terminate); + // Wait 3 seconds to allow terminate processing before kill hostapd. + sleep(3); stopHostapd(); } diff --git a/wifi/hostapd/1.1/vts/functional/hostapd_hidl_test.cpp b/wifi/hostapd/1.1/vts/functional/hostapd_hidl_test.cpp index 3b3b8c1267..b2e388e338 100644 --- a/wifi/hostapd/1.1/vts/functional/hostapd_hidl_test.cpp +++ b/wifi/hostapd/1.1/vts/functional/hostapd_hidl_test.cpp @@ -53,6 +53,8 @@ class HostapdHidlTest : public ::testing::VtsHalHidlTargetTestBase { virtual void TearDown() override { HIDL_INVOKE_VOID_WITHOUT_ARGUMENTS(hostapd_, terminate); + // Wait 3 seconds to allow terminate processing before kill hostapd. + sleep(3); stopHostapd(); }