supplicant(vts): Stop framework after querying package manager
Bug: 161951052 Test: atest VtsHalWifiSupplicantV1_0TargetTest VtsHalWifiSupplicantV1_1TargetTest VtsHalWifiSupplicantV1_2TargetTest VtsHalWifiSupplicantV1_3TargetTest Change-Id: Ic5f57ce77cae7c8f3e233065923877943460edee
This commit is contained in:
parent
37b752ed99
commit
2595661c0d
9 changed files with 53 additions and 13 deletions
|
@ -40,16 +40,22 @@ class SupplicantHidlTest
|
|||
virtual void SetUp() override {
|
||||
wifi_instance_name_ = std::get<0>(GetParam());
|
||||
supplicant_instance_name_ = std::get<1>(GetParam());
|
||||
isP2pOn_ =
|
||||
testing::deviceSupportsFeature("android.hardware.wifi.direct");
|
||||
// Stop Framework
|
||||
std::system("/system/bin/stop");
|
||||
stopSupplicant(wifi_instance_name_);
|
||||
startSupplicantAndWaitForHidlService(wifi_instance_name_,
|
||||
supplicant_instance_name_);
|
||||
isP2pOn_ =
|
||||
testing::deviceSupportsFeature("android.hardware.wifi.direct");
|
||||
supplicant_ = getSupplicant(supplicant_instance_name_, isP2pOn_);
|
||||
ASSERT_NE(supplicant_.get(), nullptr);
|
||||
}
|
||||
|
||||
virtual void TearDown() override { stopSupplicant(wifi_instance_name_); }
|
||||
virtual void TearDown() override {
|
||||
stopSupplicant(wifi_instance_name_);
|
||||
// Start Framework
|
||||
std::system("/system/bin/start");
|
||||
}
|
||||
|
||||
protected:
|
||||
// ISupplicant object used for all tests in this fixture.
|
||||
|
|
|
@ -77,11 +77,13 @@ class SupplicantP2pIfaceHidlTest
|
|||
virtual void SetUp() override {
|
||||
wifi_instance_name_ = std::get<0>(GetParam());
|
||||
supplicant_instance_name_ = std::get<1>(GetParam());
|
||||
isP2pOn_ =
|
||||
testing::deviceSupportsFeature("android.hardware.wifi.direct");
|
||||
// Stop Framework
|
||||
std::system("/system/bin/stop");
|
||||
stopSupplicant(wifi_instance_name_);
|
||||
startSupplicantAndWaitForHidlService(wifi_instance_name_,
|
||||
supplicant_instance_name_);
|
||||
isP2pOn_ =
|
||||
testing::deviceSupportsFeature("android.hardware.wifi.direct");
|
||||
supplicant_ = getSupplicant(supplicant_instance_name_, isP2pOn_);
|
||||
EXPECT_TRUE(turnOnExcessiveLogging(supplicant_));
|
||||
p2p_iface_ = getSupplicantP2pIface(supplicant_);
|
||||
|
@ -91,7 +93,11 @@ class SupplicantP2pIfaceHidlTest
|
|||
memcpy(peer_mac_addr_.data(), kTestPeerMacAddr, peer_mac_addr_.size());
|
||||
}
|
||||
|
||||
virtual void TearDown() override { stopSupplicant(wifi_instance_name_); }
|
||||
virtual void TearDown() override {
|
||||
stopSupplicant(wifi_instance_name_);
|
||||
// Start Framework
|
||||
std::system("/system/bin/start");
|
||||
}
|
||||
|
||||
protected:
|
||||
bool isP2pOn_ = false;
|
||||
|
|
|
@ -72,11 +72,13 @@ class SupplicantStaIfaceHidlTest
|
|||
virtual void SetUp() override {
|
||||
wifi_instance_name_ = std::get<0>(GetParam());
|
||||
supplicant_instance_name_ = std::get<1>(GetParam());
|
||||
isP2pOn_ =
|
||||
testing::deviceSupportsFeature("android.hardware.wifi.direct");
|
||||
// Stop Framework
|
||||
std::system("/system/bin/stop");
|
||||
stopSupplicant(wifi_instance_name_);
|
||||
startSupplicantAndWaitForHidlService(wifi_instance_name_,
|
||||
supplicant_instance_name_);
|
||||
isP2pOn_ =
|
||||
testing::deviceSupportsFeature("android.hardware.wifi.direct");
|
||||
supplicant_ = getSupplicant(supplicant_instance_name_, isP2pOn_);
|
||||
EXPECT_TRUE(turnOnExcessiveLogging(supplicant_));
|
||||
sta_iface_ = getSupplicantStaIface(supplicant_);
|
||||
|
@ -85,7 +87,11 @@ class SupplicantStaIfaceHidlTest
|
|||
memcpy(mac_addr_.data(), kTestMacAddr, mac_addr_.size());
|
||||
}
|
||||
|
||||
virtual void TearDown() override { stopSupplicant(wifi_instance_name_); }
|
||||
virtual void TearDown() override {
|
||||
stopSupplicant(wifi_instance_name_);
|
||||
// Start Framework
|
||||
std::system("/system/bin/start");
|
||||
}
|
||||
|
||||
protected:
|
||||
bool isP2pOn_ = false;
|
||||
|
|
|
@ -85,11 +85,13 @@ class SupplicantStaNetworkHidlTest
|
|||
virtual void SetUp() override {
|
||||
wifi_instance_name_ = std::get<0>(GetParam());
|
||||
supplicant_instance_name_ = std::get<1>(GetParam());
|
||||
isP2pOn_ =
|
||||
testing::deviceSupportsFeature("android.hardware.wifi.direct");
|
||||
// Stop Framework
|
||||
std::system("/system/bin/stop");
|
||||
stopSupplicant(wifi_instance_name_);
|
||||
startSupplicantAndWaitForHidlService(wifi_instance_name_,
|
||||
supplicant_instance_name_);
|
||||
isP2pOn_ =
|
||||
testing::deviceSupportsFeature("android.hardware.wifi.direct");
|
||||
supplicant_ = getSupplicant(supplicant_instance_name_, isP2pOn_);
|
||||
EXPECT_TRUE(turnOnExcessiveLogging(supplicant_));
|
||||
sta_network_ = createSupplicantStaNetwork(supplicant_);
|
||||
|
@ -103,7 +105,11 @@ class SupplicantStaNetworkHidlTest
|
|||
ssid_.assign(kTestSsidStr, kTestSsidStr + strlen(kTestSsidStr));
|
||||
}
|
||||
|
||||
virtual void TearDown() override { stopSupplicant(wifi_instance_name_); }
|
||||
virtual void TearDown() override {
|
||||
stopSupplicant(wifi_instance_name_);
|
||||
// Start Framework
|
||||
std::system("/system/bin/start");
|
||||
}
|
||||
|
||||
protected:
|
||||
void removeNetwork() {
|
||||
|
|
|
@ -44,6 +44,8 @@ class SupplicantHidlTestBase
|
|||
supplicant_v1_1_instance_name_ = std::get<1>(GetParam());
|
||||
isP2pOn_ =
|
||||
testing::deviceSupportsFeature("android.hardware.wifi.direct");
|
||||
// Stop Framework
|
||||
std::system("/system/bin/stop");
|
||||
stopSupplicant(wifi_v1_0_instance_name_);
|
||||
startSupplicantAndWaitForHidlService(wifi_v1_0_instance_name_,
|
||||
supplicant_v1_1_instance_name_);
|
||||
|
@ -54,6 +56,8 @@ class SupplicantHidlTestBase
|
|||
|
||||
virtual void TearDown() override {
|
||||
stopSupplicant(wifi_v1_0_instance_name_);
|
||||
// Start Framework
|
||||
std::system("/system/bin/start");
|
||||
}
|
||||
|
||||
protected:
|
||||
|
|
|
@ -50,6 +50,8 @@ class SupplicantHidlTestBase
|
|||
supplicant_v1_2_instance_name_ = std::get<1>(GetParam());
|
||||
isP2pOn_ =
|
||||
testing::deviceSupportsFeature("android.hardware.wifi.direct");
|
||||
// Stop Framework
|
||||
std::system("/system/bin/stop");
|
||||
stopSupplicant(wifi_v1_0_instance_name_);
|
||||
startSupplicantAndWaitForHidlService(wifi_v1_0_instance_name_,
|
||||
supplicant_v1_2_instance_name_);
|
||||
|
@ -61,6 +63,8 @@ class SupplicantHidlTestBase
|
|||
|
||||
virtual void TearDown() override {
|
||||
stopSupplicant(wifi_v1_0_instance_name_);
|
||||
// Start Framework
|
||||
std::system("/system/bin/start");
|
||||
}
|
||||
|
||||
protected:
|
||||
|
|
|
@ -43,7 +43,7 @@ class SupplicantP2pIfaceHidlTest : public SupplicantHidlTestBase {
|
|||
virtual void SetUp() override {
|
||||
SupplicantHidlTestBase::SetUp();
|
||||
EXPECT_TRUE(turnOnExcessiveLogging(supplicant_));
|
||||
if (!::testing::deviceSupportsFeature("android.hardware.wifi.direct")) {
|
||||
if (!isP2pOn_) {
|
||||
GTEST_SKIP() << "Wi-Fi Direct is not supported, skip this test.";
|
||||
}
|
||||
p2p_iface_ = getSupplicantP2pIface_1_2(supplicant_);
|
||||
|
|
|
@ -63,6 +63,8 @@ class SupplicantStaIfaceHidlTest
|
|||
supplicant_v1_3_instance_name_ = std::get<1>(GetParam());
|
||||
isP2pOn_ =
|
||||
testing::deviceSupportsFeature("android.hardware.wifi.direct");
|
||||
// Stop Framework
|
||||
std::system("/system/bin/stop");
|
||||
|
||||
stopSupplicant(wifi_v1_0_instance_name_);
|
||||
startSupplicantAndWaitForHidlService(wifi_v1_0_instance_name_,
|
||||
|
@ -76,6 +78,8 @@ class SupplicantStaIfaceHidlTest
|
|||
|
||||
virtual void TearDown() override {
|
||||
stopSupplicant(wifi_v1_0_instance_name_);
|
||||
// Start Framework
|
||||
std::system("/system/bin/start");
|
||||
}
|
||||
|
||||
int64_t pmkCacheExpirationTimeInSec;
|
||||
|
|
|
@ -51,6 +51,8 @@ class SupplicantStaNetworkHidlTest
|
|||
supplicant_v1_3_instance_name_ = std::get<1>(GetParam());
|
||||
isP2pOn_ =
|
||||
testing::deviceSupportsFeature("android.hardware.wifi.direct");
|
||||
// Stop Framework
|
||||
std::system("/system/bin/stop");
|
||||
|
||||
stopSupplicant(wifi_v1_0_instance_name_);
|
||||
startSupplicantAndWaitForHidlService(wifi_v1_0_instance_name_,
|
||||
|
@ -66,6 +68,8 @@ class SupplicantStaNetworkHidlTest
|
|||
|
||||
virtual void TearDown() override {
|
||||
stopSupplicant(wifi_v1_0_instance_name_);
|
||||
// Start Framework
|
||||
std::system("/system/bin/start");
|
||||
}
|
||||
|
||||
protected:
|
||||
|
|
Loading…
Reference in a new issue