supplicant(vts): Stop framework after querying package manager am: 2595661c0d am: 5fdc6b6469 am: 5b07a6bef3 am: 1eb933123b am: add611e8e0

Original change: https://googleplex-android-review.googlesource.com/c/platform/hardware/interfaces/+/12351743

Change-Id: I5da209a4a2d44cde69ec74bf2fc7c62decaa9fca
This commit is contained in:
Roshan Pius 2020-08-18 10:02:04 +00:00 committed by Automerger Merge Worker
commit 2287fa3ab4
9 changed files with 53 additions and 13 deletions

View file

@ -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.

View file

@ -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;

View file

@ -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;

View file

@ -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() {

View file

@ -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:

View file

@ -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:

View file

@ -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_);

View file

@ -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;

View file

@ -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: