From a94e59a387d205b929a80529aa119f11bc498170 Mon Sep 17 00:00:00 2001 From: Hai Shalom Date: Fri, 20 Dec 2019 14:29:47 -0800 Subject: [PATCH] [DPP R2] Update VTS test for supplicant 1.2 Update VTS test for supplicant 1.2 to skip the DPP tests if the underyling HAL is 1.3. The reason is because 1.3 HAL uses different callbacks. Bug: 139381558 Test: atest VtsHalWifiSupplicantV1_2Host Change-Id: Ie9cd93e33bda3ca22ee2b5593d185f1918be847e --- wifi/supplicant/1.2/vts/functional/Android.bp | 1 + .../supplicant_sta_iface_hidl_test.cpp | 30 +++++++++++++++++++ 2 files changed, 31 insertions(+) diff --git a/wifi/supplicant/1.2/vts/functional/Android.bp b/wifi/supplicant/1.2/vts/functional/Android.bp index b7949d103d..7e9d4f6a47 100644 --- a/wifi/supplicant/1.2/vts/functional/Android.bp +++ b/wifi/supplicant/1.2/vts/functional/Android.bp @@ -51,6 +51,7 @@ cc_test { "android.hardware.wifi.supplicant@1.0", "android.hardware.wifi.supplicant@1.1", "android.hardware.wifi.supplicant@1.2", + "android.hardware.wifi.supplicant@1.3", "android.hardware.wifi@1.0", "android.hardware.wifi@1.1", "libgmock", diff --git a/wifi/supplicant/1.2/vts/functional/supplicant_sta_iface_hidl_test.cpp b/wifi/supplicant/1.2/vts/functional/supplicant_sta_iface_hidl_test.cpp index 2ff7751fa8..6272d30a1c 100644 --- a/wifi/supplicant/1.2/vts/functional/supplicant_sta_iface_hidl_test.cpp +++ b/wifi/supplicant/1.2/vts/functional/supplicant_sta_iface_hidl_test.cpp @@ -22,6 +22,8 @@ #include #include #include +#include +#include #include #include @@ -318,6 +320,19 @@ TEST_F(SupplicantStaIfaceHidlTest, StartDppEnrolleeInitiator) { return; } + /* Check if the underlying HAL version is 1.3 or higher and skip the test + * in this case. The 1.3 HAL uses different callbacks which are not + * supported by 1.2. This will cause this test to fail because the callbacks + * it is waiting for will never be called. Note that this test is also + * implemented in the 1.3 VTS test. + */ + sp<::android::hardware::wifi::supplicant::V1_3::ISupplicantStaIface> v1_3 = + ::android::hardware::wifi::supplicant::V1_3::ISupplicantStaIface:: + castFrom(sta_iface_); + if (v1_3 != nullptr) { + GTEST_SKIP() << "Test not supported with this HAL version"; + } + hidl_string uri = "DPP:C:81/1;M:48d6d5bd1de1;I:G1197843;K:MDkwEwYHKoZIzj0CAQYIKoZIzj" "0DAQcDIgAD0edY4X3N//HhMFYsZfMbQJTiNFtNIWF/cIwMB/gzqOM=;;"; @@ -369,6 +384,21 @@ TEST_F(SupplicantStaIfaceHidlTest, StartDppConfiguratorInitiator) { return; } + /* Check if the underlying HAL version is 1.3 or higher and skip the test + * in this case. The 1.3 HAL uses different callbacks which are not + * supported by 1.2. This will cause this test to fail because the callbacks + * it is waiting for will never be called. Note that this test is also + * implemented in the 1.3 VTS test. + */ + sp<::android::hardware::wifi::supplicant::V1_3::ISupplicantStaIface> v1_3 = + ::android::hardware::wifi::supplicant::V1_3::ISupplicantStaIface:: + castFrom(sta_iface_); + + if (v1_3 != nullptr) { + GTEST_SKIP() << "Test not supported with this HAL version"; + return; + } + hidl_string uri = "DPP:C:81/1;M:48d6d5bd1de1;I:G1197843;K:MDkwEwYHKoZIzj0CAQYIKoZIzj" "0DAQcDIgAD0edY4X3N//HhMFYsZfMbQJTiNFtNIWF/cIwMB/gzqOM=;;";