Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit dcfab61c authored by Ahmed ElArabawy's avatar Ahmed ElArabawy
Browse files

Wifi: Make sure that VTS tests start with a clean state

In current code base, The SetUp() method in wifi VTS tests does not
reset Wifi state. Hence the first Wifi test runs with unspecified state.
Following test cases are not impacted due to that TearDown() takes care
of resetting the Wifi state.

This commit adds the stopWifi() method to the SetUp() so all test cases
start from the same Wifi state.

Bug: 145312303
Test: Run all wifi VTS tests
Test: atest <VTS test module name>
Change-Id: I63d7c0d27f4ceb713dda3804786a199dc2274be5
parent ca673f26
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -38,6 +38,9 @@ using ::android::hardware::wifi::V1_0::WifiStatusCode;
class WifiApIfaceHidlTest : public ::testing::TestWithParam<std::string> {
   public:
    virtual void SetUp() override {
        // Make sure test starts with a clean state
        stopWifi(GetInstanceName());

        wifi_ap_iface_ = getWifiApIface(GetInstanceName());
        ASSERT_NE(nullptr, wifi_ap_iface_.get());
    }
+4 −1
Original line number Diff line number Diff line
@@ -41,6 +41,9 @@ using ::android::hardware::wifi::V1_0::WifiStatusCode;
class WifiChipHidlApTest : public ::testing::TestWithParam<std::string> {
   public:
    virtual void SetUp() override {
        // Make sure test starts with a clean state
        stopWifi(GetInstanceName());

        wifi_chip_ = getWifiChip(GetInstanceName());
        ASSERT_NE(nullptr, wifi_chip_.get());
    }
+4 −1
Original line number Diff line number Diff line
@@ -41,6 +41,9 @@ using ::android::hardware::wifi::V1_0::WifiStatusCode;
class WifiChipHidlNanTest : public ::testing::TestWithParam<std::string> {
   public:
    virtual void SetUp() override {
        // Make sure test starts with a clean state
        stopWifi(GetInstanceName());

        wifi_chip_ = getWifiChip(GetInstanceName());
        ASSERT_NE(nullptr, wifi_chip_.get());
    }
+3 −0
Original line number Diff line number Diff line
@@ -73,6 +73,9 @@ bool hasAnyRingBufferCapabilities(uint32_t caps) {
class WifiChipHidlTest : public ::testing::TestWithParam<std::string> {
   public:
    virtual void SetUp() override {
        // Make sure test starts with a clean state
        stopWifi(GetInstanceName());

        wifi_chip_ = getWifiChip(GetInstanceName());
        ASSERT_NE(nullptr, wifi_chip_.get());
    }
+5 −2
Original line number Diff line number Diff line
@@ -32,7 +32,10 @@ using ::android::sp;
 */
class WifiHidlTest : public ::testing::TestWithParam<std::string> {
   public:
    virtual void SetUp() override {}
    virtual void SetUp() override {
        // Make sure test starts with a clean state
        stopWifi(GetInstanceName());
    }

    virtual void TearDown() override { stopWifi(GetInstanceName()); }

Loading