Merge "wifi(vts): Precondition AP tests on existence of hostapd HAL" into android11-tests-dev am: 0cd6bffb74

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

Change-Id: Icda7f2ac0c099ea23b49183dcdeec1adbb44c105
This commit is contained in:
Treehugger Robot
2021-10-12 02:31:49 +00:00
committed by Les Lee
6 changed files with 46 additions and 4 deletions

View File

@@ -107,8 +107,10 @@ cc_test {
static_libs: [
"VtsHalWifiV1_0TargetTestUtil",
"android.hardware.wifi@1.0",
"android.hardware.wifi.hostapd@1.0",
"libwifi-system-iface",
],
disable_framework: true,
test_suites: [
"general-tests",
"vts",

View File

@@ -18,6 +18,7 @@
#include <android/hardware/wifi/1.0/IWifi.h>
#include <android/hardware/wifi/1.0/IWifiApIface.h>
#include <android/hardware/wifi/hostapd/1.0/IHostapd.h>
#include <gtest/gtest.h>
#include <hidl/GtestPrinter.h>
#include <hidl/ServiceManagement.h>
@@ -26,6 +27,7 @@
#include "wifi_hidl_test_utils.h"
using ::android::sp;
using ::android::hardware::wifi::hostapd::V1_0::IHostapd;
using ::android::hardware::wifi::V1_0::IfaceType;
using ::android::hardware::wifi::V1_0::IWifi;
using ::android::hardware::wifi::V1_0::IWifiApIface;
@@ -38,6 +40,10 @@ using ::android::hardware::wifi::V1_0::WifiStatusCode;
class WifiApIfaceHidlTest : public ::testing::TestWithParam<std::string> {
public:
virtual void SetUp() override {
if (android::hardware::getAllHalInstanceNames(IHostapd::descriptor)
.empty()) {
GTEST_SKIP() << "Device does not support AP";
}
// Make sure test starts with a clean state
stopWifi(GetInstanceName());

View File

@@ -18,6 +18,7 @@
#include <android/hardware/wifi/1.0/IWifi.h>
#include <android/hardware/wifi/1.0/IWifiChip.h>
#include <android/hardware/wifi/hostapd/1.0/IHostapd.h>
#include <gtest/gtest.h>
#include <hidl/GtestPrinter.h>
#include <hidl/ServiceManagement.h>
@@ -26,6 +27,7 @@
#include "wifi_hidl_test_utils.h"
using ::android::sp;
using ::android::hardware::wifi::hostapd::V1_0::IHostapd;
using ::android::hardware::wifi::V1_0::ChipModeId;
using ::android::hardware::wifi::V1_0::IfaceType;
using ::android::hardware::wifi::V1_0::IWifi;
@@ -41,6 +43,10 @@ using ::android::hardware::wifi::V1_0::WifiStatusCode;
class WifiChipHidlApTest : public ::testing::TestWithParam<std::string> {
public:
virtual void SetUp() override {
if (android::hardware::getAllHalInstanceNames(IHostapd::descriptor)
.empty()) {
GTEST_SKIP() << "Device does not support AP";
}
// Make sure test starts with a clean state
stopWifi(GetInstanceName());

View File

@@ -39,6 +39,7 @@ cc_test {
"android.hardware.wifi@1.5",
"libwifi-system-iface",
],
disable_framework: true,
test_suites: [
"general-tests",
"vts",

View File

@@ -13,8 +13,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//
// SoftAP-specific tests, similar to VtsHalWifiApV1_0TargetTest.
package {
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
@@ -25,10 +23,9 @@ package {
}
cc_test {
name: "VtsHalWifiApV1_4TargetTest",
name: "VtsHalWifiV1_4TargetTest",
defaults: ["VtsHalTargetTestDefaults"],
srcs: [
"wifi_ap_iface_hidl_test.cpp",
"wifi_chip_hidl_test.cpp",
],
static_libs: [
@@ -46,6 +43,30 @@ cc_test {
],
}
// SoftAP-specific tests, similar to VtsHalWifiApV1_0TargetTest.
cc_test {
name: "VtsHalWifiApV1_4TargetTest",
defaults: ["VtsHalTargetTestDefaults"],
srcs: [
"wifi_ap_iface_hidl_test.cpp",
],
static_libs: [
"VtsHalWifiV1_0TargetTestUtil",
"android.hardware.wifi@1.0",
"android.hardware.wifi@1.1",
"android.hardware.wifi@1.2",
"android.hardware.wifi@1.3",
"android.hardware.wifi@1.4",
"android.hardware.wifi.hostapd@1.0",
"libwifi-system-iface",
],
disable_framework: true,
test_suites: [
"general-tests",
"vts",
],
}
// These tests are split out so that they can be conditioned on presence of the
// "android.hardware.wifi.aware" feature.
cc_test {

View File

@@ -16,6 +16,7 @@
#include <android/hardware/wifi/1.4/IWifi.h>
#include <android/hardware/wifi/1.4/IWifiApIface.h>
#include <android/hardware/wifi/hostapd/1.0/IHostapd.h>
#include <gtest/gtest.h>
#include <hidl/GtestPrinter.h>
#include <hidl/ServiceManagement.h>
@@ -25,6 +26,7 @@
using ::android::sp;
using ::android::hardware::hidl_array;
using ::android::hardware::wifi::hostapd::V1_0::IHostapd;
using ::android::hardware::wifi::V1_0::WifiStatus;
using ::android::hardware::wifi::V1_0::WifiStatusCode;
using ::android::hardware::wifi::V1_4::IWifi;
@@ -36,6 +38,10 @@ using ::android::hardware::wifi::V1_4::IWifiApIface;
class WifiApIfaceHidlTest : public ::testing::TestWithParam<std::string> {
public:
virtual void SetUp() override {
if (android::hardware::getAllHalInstanceNames(IHostapd::descriptor)
.empty()) {
GTEST_SKIP() << "Device does not support AP";
}
// Make sure to start with a clean state
stopWifi(GetInstanceName());