Snap for 5511141 from 421cc2e5f70e617e342b4f911233697dfac40eba to qt-aml-release

Change-Id: I34b973dd8898b28dd6688a988d2bb120e3f18939
diff --git a/tests/mock_netlink_utils.h b/tests/mock_netlink_utils.h
index cc76fae..708a385 100644
--- a/tests/mock_netlink_utils.h
+++ b/tests/mock_netlink_utils.h
@@ -30,6 +30,8 @@
   ~MockNetlinkUtils() override = default;
 
   MOCK_METHOD1(GetWiphyIndex, bool(uint32_t* out_wiphy_index));
+  MOCK_METHOD2(GetWiphyIndex,
+               bool(uint32_t* out_wiphy_index, const std::string& iface_name));
   MOCK_METHOD1(UnsubscribeMlmeEvent, void(uint32_t interface_index));
   MOCK_METHOD1(UnsubscribeRegDomainChange, void(uint32_t wiphy_index));
   MOCK_METHOD1(UnsubscribeStationEvent, void(uint32_t interface_index));
diff --git a/tests/scanner_unittest.cpp b/tests/scanner_unittest.cpp
index 8cb49b3..39a591e 100644
--- a/tests/scanner_unittest.cpp
+++ b/tests/scanner_unittest.cpp
@@ -96,7 +96,7 @@
     const SchedScanIntervalSetting&  /* interval_setting */,
     int32_t /* rssi_threshold_2g */,
     int32_t /* rssi_threshold_5g */,
-    const SchedScanReqFlags&  req_flags,
+    const SchedScanReqFlags& req_flags,
     const  std::vector<std::vector<uint8_t>>& /* scan_ssids */,
     const std::vector<std::vector<uint8_t>>& /* match_ssids */,
     const  std::vector<uint32_t>& /* freqs */,
@@ -351,19 +351,15 @@
                            wiphy_features_, &client_interface_impl_,
                            &scan_utils_, offload_service_utils_);
   SchedScanReqFlags req_flags = {};
-  ON_CALL(
-      scan_utils_,
-      StartScheduledScan(_, _, _, _, _, _, _, _, _)).
-          WillByDefault(Return(true));
   EXPECT_CALL(
       scan_utils_,
       StartScheduledScan(_, _, _, _, _, _, _, _, _)).
           WillOnce(Invoke(bind(
               CaptureSchedScanReqFlags,
               _1, _2, _3, _4, _5, _6, _7, _8, _9, &req_flags)));
-  EXPECT_TRUE(req_flags.request_low_power);
   EXPECT_TRUE(scanner_impl.startPnoScan(PnoSettings(), &success).isOk());
   EXPECT_TRUE(success);
+  EXPECT_TRUE(req_flags.request_low_power);
 }
 
 TEST_F(ScannerTest, TestStopPnoScanViaNetlink) {
diff --git a/tests/server_unittest.cpp b/tests/server_unittest.cpp
index c2886c2..2175cf9 100644
--- a/tests/server_unittest.cpp
+++ b/tests/server_unittest.cpp
@@ -80,6 +80,7 @@
   void SetUp() override {
     ON_CALL(*if_tool_, SetUpState(_, _)).WillByDefault(Return(true));
     ON_CALL(*netlink_utils_, GetWiphyIndex(_)).WillByDefault(Return(true));
+    ON_CALL(*netlink_utils_, GetWiphyIndex(_, _)).WillByDefault(Return(true));
     ON_CALL(*netlink_utils_, GetInterfaces(_, _))
       .WillByDefault(Invoke(bind(
           MockGetInterfacesResponse, mock_interfaces, true, _1, _2)));
@@ -155,9 +156,6 @@
 TEST_F(ServerTest, CanTeardownApInterface) {
   sp<IApInterface> ap_if;
 
-  // When we tear down the interface, we expect the iface to be unloaded.
-  EXPECT_CALL(*if_tool_, SetUpState(StrEq(kFakeInterfaceName), Eq(false)));
-
   EXPECT_TRUE(server_.createApInterface(kFakeInterfaceName, &ap_if).isOk());
   EXPECT_NE(nullptr, ap_if.get());
 
@@ -174,9 +172,6 @@
 TEST_F(ServerTest, CanTeardownClientInterface) {
   sp<IClientInterface> client_if;
 
-  // When we tear down the interface, we expect the iface to be unloaded.
-  EXPECT_CALL(*if_tool_, SetUpState(StrEq(kFakeInterfaceName), Eq(false)));
-
   EXPECT_TRUE(server_.createClientInterface(
       kFakeInterfaceName, &client_if).isOk());
   EXPECT_NE(nullptr, client_if.get());
@@ -202,10 +197,6 @@
   EXPECT_TRUE(server_.createApInterface(kFakeInterfaceName1, &ap_if).isOk());
   EXPECT_NE(nullptr, ap_if.get());
 
-  // When we tear down the interfaces, we expect the iface to be unloaded.
-  EXPECT_CALL(*if_tool_, SetUpState(StrEq(kFakeInterfaceName), Eq(false)));
-  EXPECT_CALL(*if_tool_, SetUpState(StrEq(kFakeInterfaceName1), Eq(false)));
-
   bool success = true;
   // Try to remove an invalid iface name, this should fail.
   EXPECT_TRUE(server_.tearDownClientInterface(