From 77d9eea1dab39c1dc375caa95e88fbbf76946ce6 Mon Sep 17 00:00:00 2001 From: Roshan Pius Date: Fri, 14 Jul 2017 11:32:25 -0700 Subject: [PATCH] supplicant(vts): Remove dependency on libwifi_hal libwifi_hal is a vendor component, so these are not allowed to be used in the VTS tests. Use the vendor HAL for the required initializations instead since that is the flow used by framework anyway (setup the wifi chip using vendor hal and then use wpa_supplicant for connections). Bug: 63704014 Bug: 33241851 Test: make vts -j30 BUILD_GOOGLE_VTS=true TARGET_PRODUCT=aosp_arm64 && vts-tradefed run commandAndExit vts --skip-all-system-status-check --primary-abi-only --skip-preconditions --module VtsHalWifiSupplicantV1_0Target -l INFO Change-Id: I396d8311253e2b2493f9bb901731937019d30164 --- wifi/supplicant/1.0/vts/functional/Android.mk | 5 +++-- .../vts/functional/supplicant_hidl_test_utils.cpp | 24 +++++++++++++--------- 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/wifi/supplicant/1.0/vts/functional/Android.mk b/wifi/supplicant/1.0/vts/functional/Android.mk index d87d7efa..c6e39503 100644 --- a/wifi/supplicant/1.0/vts/functional/Android.mk +++ b/wifi/supplicant/1.0/vts/functional/Android.mk @@ -27,17 +27,18 @@ LOCAL_SRC_FILES := \ supplicant_sta_network_hidl_test.cpp LOCAL_SHARED_LIBRARIES := \ android.hardware.wifi.supplicant@1.0 \ + android.hardware.wifi@1.0 \ libbase \ libcutils \ libhidlbase \ libhidltransport \ liblog \ libutils \ - libwifi-hal \ libwifi-system \ libwifi-system-iface LOCAL_STATIC_LIBRARIES := \ libgmock \ - VtsHalHidlTargetTestBase + VtsHalHidlTargetTestBase \ + VtsHalWifiV1_0TargetTestUtil include $(BUILD_NATIVE_TEST) diff --git a/wifi/supplicant/1.0/vts/functional/supplicant_hidl_test_utils.cpp b/wifi/supplicant/1.0/vts/functional/supplicant_hidl_test_utils.cpp index df4bfa95..0afab2f0 100644 --- a/wifi/supplicant/1.0/vts/functional/supplicant_hidl_test_utils.cpp +++ b/wifi/supplicant/1.0/vts/functional/supplicant_hidl_test_utils.cpp @@ -21,11 +21,11 @@ #include #include -#include #include #include #include "supplicant_hidl_test_utils.h" +#include "wifi_hidl_test_utils.h" using ::android::sp; using ::android::hardware::configureRpcThreadpool; @@ -34,6 +34,8 @@ using ::android::hardware::hidl_string; using ::android::hardware::hidl_vec; using ::android::hardware::Return; using ::android::hardware::Void; +using ::android::hardware::wifi::V1_0::ChipModeId; +using ::android::hardware::wifi::V1_0::IWifiChip; using ::android::hardware::wifi::supplicant::V1_0::ISupplicant; using ::android::hardware::wifi::supplicant::V1_0::ISupplicantIface; using ::android::hardware::wifi::supplicant::V1_0::ISupplicantNetwork; @@ -44,22 +46,25 @@ using ::android::hardware::wifi::supplicant::V1_0::IfaceType; using ::android::hardware::wifi::supplicant::V1_0::SupplicantStatus; using ::android::hardware::wifi::supplicant::V1_0::SupplicantStatusCode; using ::android::hidl::manager::V1_0::IServiceNotification; -using ::android::wifi_hal::DriverTool; using ::android::wifi_system::InterfaceTool; using ::android::wifi_system::SupplicantManager; namespace { const char kSupplicantServiceName[] = "default"; -// Helper function to initialize the driver and firmware to STA mode. +// Helper function to initialize the driver and firmware to STA mode +// using the vendor HAL HIDL interface. void initilializeDriverAndFirmware() { - DriverTool driver_tool; - InterfaceTool iface_tool; - EXPECT_TRUE(driver_tool.LoadDriver()); - EXPECT_TRUE(driver_tool.ChangeFirmwareMode(DriverTool::kFirmwareModeSta)); - EXPECT_TRUE(iface_tool.SetWifiUpState(true)); + sp wifi_chip = getWifiChip(); + ChipModeId mode_id; + EXPECT_TRUE(configureChipToSupportIfaceType( + wifi_chip, ::android::hardware::wifi::V1_0::IfaceType::STA, &mode_id)); } +// Helper function to deinitialize the driver and firmware +// using the vendor HAL HIDL interface. +void deInitilializeDriverAndFirmware() { stopWifi(); } + // Helper function to find any iface of the desired type exposed. bool findIfaceOfType(sp supplicant, IfaceType desired_type, ISupplicant::IfaceInfo* out_info) { @@ -149,11 +154,10 @@ void startWifiFramework() { } void stopSupplicant() { - DriverTool driver_tool; SupplicantManager supplicant_manager; ASSERT_TRUE(supplicant_manager.StopSupplicant()); - ASSERT_TRUE(driver_tool.UnloadDriver()); + deInitilializeDriverAndFirmware(); ASSERT_FALSE(supplicant_manager.IsSupplicantRunning()); } -- 2.11.0