From 1ae4cbbb82d778a8945c78a569331c1616842bef Mon Sep 17 00:00:00 2001 From: Roshan Pius Date: Tue, 6 Dec 2016 18:59:15 -0800 Subject: [PATCH] wifi(vts): Add framework for gtests These tests don't do much currently other than assert that we can configure the chip in the required modes and create all the iface objects. The |wifi_hidl_test_utils| contains all helper functions that will be shared across the different test fixtures. Bug: 33459306 Test: adb root && adb remount && adb push out/target/product/angler/data/nativetest/wifi_hidl_test/wifi_hidl_test /data/ && adb shell /data/wifi_hidl_test Change-Id: Iaea8e264ab1ef9113f375d7f56acab851aff21aa --- wifi/1.0/vts/functional/Android.bp | 50 ++++ wifi/1.0/vts/functional/Android.mk | 19 ++ wifi/1.0/vts/functional/main.cpp | 37 +++ .../functional/wifi_ap_iface_hidl_test.cpp | 48 +++ .../vts/functional/wifi_chip_hidl_test.cpp | 48 +++ wifi/1.0/vts/functional/wifi_hidl_test.cpp | 48 +++ .../vts/functional/wifi_hidl_test_utils.cpp | 278 ++++++++++++++++++ .../1.0/vts/functional/wifi_hidl_test_utils.h | 45 +++ .../functional/wifi_nan_iface_hidl_test.cpp | 48 +++ .../functional/wifi_p2p_iface_hidl_test.cpp | 48 +++ .../wifi_rtt_controller_hidl_test.cpp | 48 +++ .../functional/wifi_sta_iface_hidl_test.cpp | 48 +++ wifi/Android.bp | 1 + 13 files changed, 766 insertions(+) create mode 100644 wifi/1.0/vts/functional/Android.bp create mode 100644 wifi/1.0/vts/functional/Android.mk create mode 100644 wifi/1.0/vts/functional/main.cpp create mode 100644 wifi/1.0/vts/functional/wifi_ap_iface_hidl_test.cpp create mode 100644 wifi/1.0/vts/functional/wifi_chip_hidl_test.cpp create mode 100644 wifi/1.0/vts/functional/wifi_hidl_test.cpp create mode 100644 wifi/1.0/vts/functional/wifi_hidl_test_utils.cpp create mode 100644 wifi/1.0/vts/functional/wifi_hidl_test_utils.h create mode 100644 wifi/1.0/vts/functional/wifi_nan_iface_hidl_test.cpp create mode 100644 wifi/1.0/vts/functional/wifi_p2p_iface_hidl_test.cpp create mode 100644 wifi/1.0/vts/functional/wifi_rtt_controller_hidl_test.cpp create mode 100644 wifi/1.0/vts/functional/wifi_sta_iface_hidl_test.cpp diff --git a/wifi/1.0/vts/functional/Android.bp b/wifi/1.0/vts/functional/Android.bp new file mode 100644 index 0000000000..422eec5200 --- /dev/null +++ b/wifi/1.0/vts/functional/Android.bp @@ -0,0 +1,50 @@ +// +// Copyright (C) 2016 The Android Open Source Project +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +cc_test { + name: "wifi_hidl_test", + gtest: true, + srcs: [ + "main.cpp", + "wifi_ap_iface_hidl_test.cpp", + "wifi_chip_hidl_test.cpp", + "wifi_hidl_test.cpp", + "wifi_hidl_test_utils.cpp", + "wifi_nan_iface_hidl_test.cpp", + "wifi_p2p_iface_hidl_test.cpp", + "wifi_rtt_controller_hidl_test.cpp", + "wifi_sta_iface_hidl_test.cpp"], + shared_libs: [ + "libbase", + "liblog", + "libcutils", + "libhidlbase", + "libhidltransport", + "libhwbinder", + "libnativehelper", + "libutils", + "android.hardware.wifi@1.0", + ], + static_libs: ["libgtest"], + cflags: [ + "--coverage", + "-O0", + "-g", + ], + ldflags: [ + "--coverage" + ] +} diff --git a/wifi/1.0/vts/functional/Android.mk b/wifi/1.0/vts/functional/Android.mk new file mode 100644 index 0000000000..f9e32763ff --- /dev/null +++ b/wifi/1.0/vts/functional/Android.mk @@ -0,0 +1,19 @@ +# +# Copyright (C) 2016 The Android Open Source Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +LOCAL_PATH := $(call my-dir) + +include $(call all-subdir-makefiles) diff --git a/wifi/1.0/vts/functional/main.cpp b/wifi/1.0/vts/functional/main.cpp new file mode 100644 index 0000000000..b33b5ebfd7 --- /dev/null +++ b/wifi/1.0/vts/functional/main.cpp @@ -0,0 +1,37 @@ +/* + * Copyright (C) 2016 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include + +#include + +#include "wifi_hidl_test_utils.h" + +class WifiHidlEnvironment : public ::testing::Environment { + public: + virtual void SetUp() override { stopFramework(); } + virtual void TearDown() override { startFramework(); } + + private: +}; + +int main(int argc, char** argv) { + ::testing::AddGlobalTestEnvironment(new WifiHidlEnvironment); + ::testing::InitGoogleTest(&argc, argv); + int status = RUN_ALL_TESTS(); + LOG(INFO) << "Test result = " << status; + return status; +} diff --git a/wifi/1.0/vts/functional/wifi_ap_iface_hidl_test.cpp b/wifi/1.0/vts/functional/wifi_ap_iface_hidl_test.cpp new file mode 100644 index 0000000000..dc7b0b9e47 --- /dev/null +++ b/wifi/1.0/vts/functional/wifi_ap_iface_hidl_test.cpp @@ -0,0 +1,48 @@ +/* + * Copyright (C) 2016 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include + +#include + +#include + +#include "wifi_hidl_test_utils.h" + +using ::android::hardware::wifi::V1_0::IWifiApIface; +using ::android::sp; + +/** + * Fixture to use for all AP Iface HIDL interface tests. + */ +class WifiApIfaceHidlTest : public ::testing::Test { + public: + virtual void SetUp() override {} + + virtual void TearDown() override { stopWifi(); } + + protected: +}; + +/* + * Create: + * Ensures that an instance of the IWifiApIface proxy object is + * successfully created. + */ +TEST(WifiApIfaceHidlTestNoFixture, Create) { + EXPECT_NE(nullptr, getWifiApIface().get()); + stopWifi(); +} diff --git a/wifi/1.0/vts/functional/wifi_chip_hidl_test.cpp b/wifi/1.0/vts/functional/wifi_chip_hidl_test.cpp new file mode 100644 index 0000000000..b6ecd8bcbd --- /dev/null +++ b/wifi/1.0/vts/functional/wifi_chip_hidl_test.cpp @@ -0,0 +1,48 @@ +/* + * Copyright (C) 2016 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include + +#include + +#include + +#include "wifi_hidl_test_utils.h" + +using ::android::hardware::wifi::V1_0::IWifiChip; +using ::android::sp; + +/** + * Fixture to use for all Wifi chip HIDL interface tests. + */ +class WifiChipHidlTest : public ::testing::Test { + public: + virtual void SetUp() override {} + + virtual void TearDown() override { stopWifi(); } + + protected: +}; + +/* + * Create: + * Ensures that an instance of the IWifiChip proxy object is + * successfully created. + */ +TEST(WifiChipHidlTestNoFixture, Create) { + EXPECT_NE(nullptr, getWifiChip().get()); + stopWifi(); +} diff --git a/wifi/1.0/vts/functional/wifi_hidl_test.cpp b/wifi/1.0/vts/functional/wifi_hidl_test.cpp new file mode 100644 index 0000000000..3e350e5e6a --- /dev/null +++ b/wifi/1.0/vts/functional/wifi_hidl_test.cpp @@ -0,0 +1,48 @@ +/* + * Copyright (C) 2016 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include + +#include + +#include + +#include "wifi_hidl_test_utils.h" + +using ::android::hardware::wifi::V1_0::IWifi; +using ::android::sp; + +/** + * Fixture to use for all root Wifi HIDL interface tests. + */ +class WifiHidlTest : public ::testing::Test { + public: + virtual void SetUp() override {} + + virtual void TearDown() override { stopWifi(); } + + protected: +}; + +/* + * Create: + * Ensures that an instance of the IWifi proxy object is + * successfully created. + */ +TEST(WifiHidlTestNoFixture, Create) { + EXPECT_NE(nullptr, getWifi().get()); + stopWifi(); +} diff --git a/wifi/1.0/vts/functional/wifi_hidl_test_utils.cpp b/wifi/1.0/vts/functional/wifi_hidl_test_utils.cpp new file mode 100644 index 0000000000..f88b866819 --- /dev/null +++ b/wifi/1.0/vts/functional/wifi_hidl_test_utils.cpp @@ -0,0 +1,278 @@ +/* + * Copyright (C) 2016 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include + +#include "wifi_hidl_test_utils.h" + +using ::android::hardware::wifi::V1_0::IWifi; +using ::android::hardware::wifi::V1_0::IWifiApIface; +using ::android::hardware::wifi::V1_0::IWifiChip; +using ::android::hardware::wifi::V1_0::IWifiNanIface; +using ::android::hardware::wifi::V1_0::IWifiP2pIface; +using ::android::hardware::wifi::V1_0::IWifiRttController; +using ::android::hardware::wifi::V1_0::IWifiStaIface; +using ::android::hardware::wifi::V1_0::ChipModeId; +using ::android::hardware::wifi::V1_0::ChipId; +using ::android::hardware::wifi::V1_0::IfaceType; +using ::android::hardware::wifi::V1_0::WifiStatus; +using ::android::hardware::wifi::V1_0::WifiStatusCode; +using ::android::sp; +using ::android::hardware::hidl_string; +using ::android::hardware::hidl_vec; + +const char kWifiServiceName[] = "wifi"; + +void stopFramework() { + ASSERT_EQ(std::system("svc wifi disable"), 0); + sleep(5); +} + +void startFramework() { ASSERT_EQ(std::system("svc wifi enable"), 0); } + +sp getWifi() { + sp wifi = IWifi::getService(kWifiServiceName); + return wifi; +} + +sp getWifiChip() { + sp wifi = getWifi(); + if (!wifi.get()) { + return nullptr; + } + + bool operation_failed = false; + wifi->start([&](WifiStatus status) { + if (status.code != WifiStatusCode::SUCCESS) { + operation_failed = true; + } + }); + if (operation_failed) { + return nullptr; + } + + std::vector wifi_chip_ids; + wifi->getChipIds( + [&](const WifiStatus& status, const hidl_vec& chip_ids) { + if (status.code != WifiStatusCode::SUCCESS) { + operation_failed = true; + } + wifi_chip_ids = chip_ids; + }); + // We don't expect more than 1 chip currently. + if (operation_failed || wifi_chip_ids.size() != 1) { + return nullptr; + } + + sp wifi_chip; + wifi->getChip(wifi_chip_ids[0], + [&](const WifiStatus& status, const sp& chip) { + if (status.code != WifiStatusCode::SUCCESS) { + operation_failed = true; + } + wifi_chip = chip; + }); + if (operation_failed) { + return nullptr; + } + return wifi_chip; +} + +// Since we currently only support one iface of each type. Just iterate thru the +// modes of operation and find the mode ID to use for that iface type. +bool findModeToSupportIfaceType(IfaceType type, + const std::vector& modes, + ChipModeId* mode_id) { + for (const auto& mode : modes) { + std::vector combinations = + mode.availableCombinations; + for (const auto& combination : combinations) { + std::vector iface_limits = + combination.limits; + for (const auto& iface_limit : iface_limits) { + std::vector iface_types = iface_limit.types; + for (const auto& iface_type : iface_types) { + if (iface_type == type) { + *mode_id = mode.id; + return true; + } + } + } + } + } + return false; +} + +bool configureChipToSupportIfaceType(const sp& wifi_chip, + IfaceType type) { + bool operation_failed = false; + std::vector chip_modes; + wifi_chip->getAvailableModes( + [&](WifiStatus status, const hidl_vec& modes) { + if (status.code != WifiStatusCode::SUCCESS) { + operation_failed = true; + } + chip_modes = modes; + }); + if (operation_failed) { + return false; + } + + ChipModeId mode_id; + if (!findModeToSupportIfaceType(type, chip_modes, &mode_id)) { + return false; + } + + wifi_chip->configureChip(mode_id, [&](WifiStatus status) { + if (status.code != WifiStatusCode::SUCCESS) { + operation_failed = true; + } + }); + if (operation_failed) { + return false; + } + return true; +} + +sp getWifiApIface() { + sp wifi_chip = getWifiChip(); + if (!wifi_chip.get()) { + return nullptr; + } + if (!configureChipToSupportIfaceType(wifi_chip, IfaceType::AP)) { + return nullptr; + } + + bool operation_failed = false; + sp wifi_ap_iface; + wifi_chip->createApIface( + [&](const WifiStatus& status, const sp& iface) { + if (status.code != WifiStatusCode::SUCCESS) { + operation_failed = true; + } + wifi_ap_iface = iface; + }); + if (operation_failed) { + return nullptr; + } + return wifi_ap_iface; +} + +sp getWifiNanIface() { + sp wifi_chip = getWifiChip(); + if (!wifi_chip.get()) { + return nullptr; + } + if (!configureChipToSupportIfaceType(wifi_chip, IfaceType::NAN)) { + return nullptr; + } + + bool operation_failed = false; + sp wifi_nan_iface; + wifi_chip->createNanIface( + [&](const WifiStatus& status, const sp& iface) { + if (status.code != WifiStatusCode::SUCCESS) { + operation_failed = true; + } + wifi_nan_iface = iface; + }); + if (operation_failed) { + return nullptr; + } + return wifi_nan_iface; +} + +sp getWifiP2pIface() { + sp wifi_chip = getWifiChip(); + if (!wifi_chip.get()) { + return nullptr; + } + if (!configureChipToSupportIfaceType(wifi_chip, IfaceType::P2P)) { + return nullptr; + } + + bool operation_failed = false; + sp wifi_p2p_iface; + wifi_chip->createP2pIface( + [&](const WifiStatus& status, const sp& iface) { + if (status.code != WifiStatusCode::SUCCESS) { + operation_failed = true; + } + wifi_p2p_iface = iface; + }); + if (operation_failed) { + return nullptr; + } + return wifi_p2p_iface; +} + +sp getWifiStaIface() { + sp wifi_chip = getWifiChip(); + if (!wifi_chip.get()) { + return nullptr; + } + if (!configureChipToSupportIfaceType(wifi_chip, IfaceType::STA)) { + return nullptr; + } + + bool operation_failed = false; + sp wifi_sta_iface; + wifi_chip->createStaIface( + [&](const WifiStatus& status, const sp& iface) { + if (status.code != WifiStatusCode::SUCCESS) { + operation_failed = true; + } + wifi_sta_iface = iface; + }); + if (operation_failed) { + return nullptr; + } + return wifi_sta_iface; +} + +sp getWifiRttController() { + sp wifi_chip = getWifiChip(); + if (!wifi_chip.get()) { + return nullptr; + } + sp wifi_sta_iface = getWifiStaIface(); + if (!wifi_sta_iface.get()) { + return nullptr; + } + + bool operation_failed = false; + sp wifi_rtt_controller; + wifi_chip->createRttController( + wifi_sta_iface, [&](const WifiStatus& status, + const sp& controller) { + if (status.code != WifiStatusCode::SUCCESS) { + operation_failed = true; + } + wifi_rtt_controller = controller; + }); + if (operation_failed) { + return nullptr; + } + return wifi_rtt_controller; +} + +void stopWifi() { + sp wifi = getWifi(); + ASSERT_NE(wifi, nullptr); + wifi->stop([](const WifiStatus& status) { + ASSERT_EQ(status.code, WifiStatusCode::SUCCESS); + }); +} diff --git a/wifi/1.0/vts/functional/wifi_hidl_test_utils.h b/wifi/1.0/vts/functional/wifi_hidl_test_utils.h new file mode 100644 index 0000000000..08933d902e --- /dev/null +++ b/wifi/1.0/vts/functional/wifi_hidl_test_utils.h @@ -0,0 +1,45 @@ +/* + * Copyright (C) 2016 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include +#include +#include +#include +#include +#include +#include + +// Used to stop the android framework (wifi service) before every +// test. +void stopFramework(); +void startFramework(); + +// Helper functions to obtain references to the various HIDL interface objects. +// Note: We only have a single instance of each of these objects currently. +// These helper functions should be modified to return vectors if we support +// multiple instances. +android::sp getWifi(); +android::sp getWifiChip(); +android::sp getWifiApIface(); +android::sp getWifiNanIface(); +android::sp getWifiP2pIface(); +android::sp getWifiStaIface(); +android::sp +getWifiRttController(); +// Used to trigger IWifi.stop() at the end of every test. +void stopWifi(); diff --git a/wifi/1.0/vts/functional/wifi_nan_iface_hidl_test.cpp b/wifi/1.0/vts/functional/wifi_nan_iface_hidl_test.cpp new file mode 100644 index 0000000000..a8be48c1d8 --- /dev/null +++ b/wifi/1.0/vts/functional/wifi_nan_iface_hidl_test.cpp @@ -0,0 +1,48 @@ +/* + * Copyright (C) 2016 The Android Open Source Project + * + * Licensed under the Nanache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include + +#include + +#include + +#include "wifi_hidl_test_utils.h" + +using ::android::hardware::wifi::V1_0::IWifiNanIface; +using ::android::sp; + +/** + * Fixture to use for all NAN Iface HIDL interface tests. + */ +class WifiNanIfaceHidlTest : public ::testing::Test { + public: + virtual void SetUp() override {} + + virtual void TearDown() override { stopWifi(); } + + protected: +}; + +/* + * Create: + * Ensures that an instance of the IWifiNanIface proxy object is + * successfully created. + */ +TEST(WifiNanIfaceHidlTestNoFixture, Create) { + EXPECT_NE(nullptr, getWifiNanIface().get()); + stopWifi(); +} diff --git a/wifi/1.0/vts/functional/wifi_p2p_iface_hidl_test.cpp b/wifi/1.0/vts/functional/wifi_p2p_iface_hidl_test.cpp new file mode 100644 index 0000000000..e29226d640 --- /dev/null +++ b/wifi/1.0/vts/functional/wifi_p2p_iface_hidl_test.cpp @@ -0,0 +1,48 @@ +/* + * Copyright (C) 2016 The Android Open Source Project + * + * Licensed under the P2pache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include + +#include + +#include + +#include "wifi_hidl_test_utils.h" + +using ::android::hardware::wifi::V1_0::IWifiP2pIface; +using ::android::sp; + +/** + * Fixture to use for all P2P Iface HIDL interface tests. + */ +class WifiP2pIfaceHidlTest : public ::testing::Test { + public: + virtual void SetUp() override {} + + virtual void TearDown() override { stopWifi(); } + + protected: +}; + +/* + * Create: + * Ensures that an instance of the IWifiP2pIface proxy object is + * successfully created. + */ +TEST(WifiP2pIfaceHidlTestNoFixture, Create) { + EXPECT_NE(nullptr, getWifiP2pIface().get()); + stopWifi(); +} diff --git a/wifi/1.0/vts/functional/wifi_rtt_controller_hidl_test.cpp b/wifi/1.0/vts/functional/wifi_rtt_controller_hidl_test.cpp new file mode 100644 index 0000000000..7aee761190 --- /dev/null +++ b/wifi/1.0/vts/functional/wifi_rtt_controller_hidl_test.cpp @@ -0,0 +1,48 @@ +/* + * Copyright (C) 2016 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include + +#include + +#include + +#include "wifi_hidl_test_utils.h" + +using ::android::hardware::wifi::V1_0::IWifiRttController; +using ::android::sp; + +/** + * Fixture to use for all RTT controller HIDL interface tests. + */ +class WifiRttControllerHidlTest : public ::testing::Test { + public: + virtual void SetUp() override {} + + virtual void TearDown() override { stopWifi(); } + + protected: +}; + +/* + * Create: + * Ensures that an instance of the IWifiRttController proxy object is + * successfully created. + */ +TEST(WifiRttControllerHidlTestNoFixture, Create) { + EXPECT_NE(nullptr, getWifiRttController().get()); + stopWifi(); +} diff --git a/wifi/1.0/vts/functional/wifi_sta_iface_hidl_test.cpp b/wifi/1.0/vts/functional/wifi_sta_iface_hidl_test.cpp new file mode 100644 index 0000000000..770763c5c2 --- /dev/null +++ b/wifi/1.0/vts/functional/wifi_sta_iface_hidl_test.cpp @@ -0,0 +1,48 @@ +/* + * Copyright (C) 2016 The Android Open Source Project + * + * Licensed under the Staache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include + +#include + +#include + +#include "wifi_hidl_test_utils.h" + +using ::android::hardware::wifi::V1_0::IWifiStaIface; +using ::android::sp; + +/** + * Fixture to use for all STA Iface HIDL interface tests. + */ +class WifiStaIfaceHidlTest : public ::testing::Test { + public: + virtual void SetUp() override {} + + virtual void TearDown() override { stopWifi(); } + + protected: +}; + +/* + * Create: + * Ensures that an instance of the IWifiStaIface proxy object is + * successfully created. + */ +TEST(WifiStaIfaceHidlTestNoFixture, Create) { + EXPECT_NE(nullptr, getWifiStaIface().get()); + stopWifi(); +} diff --git a/wifi/Android.bp b/wifi/Android.bp index ea43db4e14..d4e0fda2c1 100644 --- a/wifi/Android.bp +++ b/wifi/Android.bp @@ -1,5 +1,6 @@ // This is an autogenerated file, do not edit. subdirs = [ "1.0", + "1.0/vts/functional", "supplicant/1.0", ]