diff --git a/garnet/bin/auth/OWNERS b/garnet/bin/auth/OWNERS deleted file mode 100644 index 268f3df52b628baa45be6e7ec41d021166b0b784..0000000000000000000000000000000000000000 --- a/garnet/bin/auth/OWNERS +++ /dev/null @@ -1,3 +0,0 @@ -jsankey@google.com -ukode@google.com -* diff --git a/garnet/bin/auth/README.md b/garnet/bin/auth/README.md deleted file mode 100644 index fed2a4ce488f72c2a9db3b2adf7a3dfba129c8a0..0000000000000000000000000000000000000000 --- a/garnet/bin/auth/README.md +++ /dev/null @@ -1,4 +0,0 @@ -`/bin/auth` contains component binaries related to user identity and -authentication. Please refer to the more detailed README.md file in each -package for more information. - diff --git a/garnet/bin/auth/tests/BUILD.gn b/garnet/bin/auth/tests/BUILD.gn deleted file mode 100644 index e192da30528787ff659a206ef307382d3530316e..0000000000000000000000000000000000000000 --- a/garnet/bin/auth/tests/BUILD.gn +++ /dev/null @@ -1,11 +0,0 @@ -# Copyright 2019 The Fuchsia Authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -group("tests") { - testonly = true - public_deps = [ - "account_manager_integration", - "token_manager_integration", - ] -} diff --git a/garnet/packages/tests/BUILD.gn b/garnet/packages/tests/BUILD.gn index c2d34d506cc65702fc5adc5748cde801f4e77fbe..bc83c3a2c1d2d6f54569333ab6f312c70a161763 100644 --- a/garnet/packages/tests/BUILD.gn +++ b/garnet/packages/tests/BUILD.gn @@ -201,17 +201,6 @@ group("feedback_agent") { ] } -group("auth") { - testonly = true - public_deps = [ - "//garnet/bin/auth/tests/account_manager_integration:account_manager_integration_test_pkg", - "//garnet/bin/auth/tests/token_manager_integration:token_manager_integration_tests", - "//garnet/packages/prod:auth", - "//src/identity/bin/dev_auth_provider", - "//src/identity/bin/dev_auth_provider_iotid", - ] -} - group("elflib") { testonly = true public_deps = [ @@ -315,7 +304,6 @@ group("all") { "//garnet/packages/tests:asio", "//garnet/packages/tests:async_promise", "//garnet/packages/tests:ath10k", - "//garnet/packages/tests:auth", "//garnet/packages/tests:banjo", "//garnet/packages/tests:bluetooth", "//garnet/packages/tests:boringssl", diff --git a/src/identity/BUILD.gn b/src/identity/BUILD.gn index 74b1828b71dbc14c0dccb17471a9584c6dd8965c..c345de587133d2da8465a88af2e3c5c82784b29f 100644 --- a/src/identity/BUILD.gn +++ b/src/identity/BUILD.gn @@ -17,5 +17,7 @@ group("tests") { data_deps = [ "bin:tests", "lib:tests", + "tests/account_manager_integration", + "tests/token_manager_integration", ] } diff --git a/src/identity/bin/BUILD.gn b/src/identity/bin/BUILD.gn index cf9cc6c5a5773d0a318b4c7953b096169fcc8330..b8e89ced2ef4fcdabcde3d892c9a3666748abdc8 100644 --- a/src/identity/bin/BUILD.gn +++ b/src/identity/bin/BUILD.gn @@ -29,7 +29,7 @@ test_package("identity_bin_unittests") { ] tests = [ - { + { name = "account_handler_bin_test" environments = basic_envs }, diff --git a/garnet/bin/auth/tests/account_manager_integration/BUILD.gn b/src/identity/tests/account_manager_integration/BUILD.gn similarity index 79% rename from garnet/bin/auth/tests/account_manager_integration/BUILD.gn rename to src/identity/tests/account_manager_integration/BUILD.gn index 84dfbdda4408eda26507463405f890bcc815185e..557b8e428732115f162eba6cdd2540455ab11b52 100644 --- a/garnet/bin/auth/tests/account_manager_integration/BUILD.gn +++ b/src/identity/tests/account_manager_integration/BUILD.gn @@ -7,7 +7,17 @@ import("//build/rust/rustc_library.gni") import("//build/test/test_package.gni") import("//build/testing/environments.gni") -rustc_library("account_manager_integration") { +group("account_manager_integration") { + testonly = true + deps = [ + ":account_manager_integration_test_pkg", + "//src/identity/bin/dev_auth_provider", + "//src/identity/bin/dev_auth_provider_iotid", + ] +} + +rustc_library("lib") { + name = "account_manager_integration" edition = "2018" testonly = true with_unit_tests = true @@ -32,7 +42,7 @@ rustc_library("account_manager_integration") { test_package("account_manager_integration_test_pkg") { deps = [ - ":account_manager_integration", + ":lib", ] tests = [ diff --git a/garnet/bin/auth/tests/account_manager_integration/meta/account_manager_integration_lib_test.cmx b/src/identity/tests/account_manager_integration/meta/account_manager_integration_lib_test.cmx similarity index 100% rename from garnet/bin/auth/tests/account_manager_integration/meta/account_manager_integration_lib_test.cmx rename to src/identity/tests/account_manager_integration/meta/account_manager_integration_lib_test.cmx index 8b7f9e0344a1da691c4858ba71315dc19c987325..7064183d0ce8e282ca3b9e94eb36b07f15fb94f3 100644 --- a/garnet/bin/auth/tests/account_manager_integration/meta/account_manager_integration_lib_test.cmx +++ b/src/identity/tests/account_manager_integration/meta/account_manager_integration_lib_test.cmx @@ -1,13 +1,4 @@ { - "program": { - "binary": "test/account_manager_integration_lib_test" - }, - "sandbox": { - "services": [ - "fuchsia.logger.LogSink", - "fuchsia.auth.account.AccountManager" - ] - }, "facets": { "fuchsia.test": { "injected-services": { @@ -17,5 +8,14 @@ ] } } + }, + "program": { + "binary": "test/account_manager_integration_lib_test" + }, + "sandbox": { + "services": [ + "fuchsia.logger.LogSink", + "fuchsia.auth.account.AccountManager" + ] } } diff --git a/garnet/bin/auth/tests/account_manager_integration/tests/account.rs b/src/identity/tests/account_manager_integration/tests/account.rs similarity index 100% rename from garnet/bin/auth/tests/account_manager_integration/tests/account.rs rename to src/identity/tests/account_manager_integration/tests/account.rs index ea3019328817838319d459a999819429c917c22d..73e657c7516b0f51cbd23cfa836605e8700d1a06 100644 --- a/garnet/bin/auth/tests/account_manager_integration/tests/account.rs +++ b/src/identity/tests/account_manager_integration/tests/account.rs @@ -10,8 +10,8 @@ use fidl_fuchsia_auth::{ use fidl_fuchsia_auth_account::{ AccountManagerMarker, AccountManagerProxy, LocalAccountId, Status, }; -use futures::prelude::*; use futures::future::join; +use futures::prelude::*; /// Calls provision_new_account on the supplied account_manager, returning an error on any /// non-OK responses, or the account ID on success. diff --git a/garnet/bin/auth/tests/account_manager_integration/tests/lib.rs b/src/identity/tests/account_manager_integration/tests/lib.rs similarity index 100% rename from garnet/bin/auth/tests/account_manager_integration/tests/lib.rs rename to src/identity/tests/account_manager_integration/tests/lib.rs diff --git a/garnet/bin/auth/tests/token_manager_integration/BUILD.gn b/src/identity/tests/token_manager_integration/BUILD.gn similarity index 63% rename from garnet/bin/auth/tests/token_manager_integration/BUILD.gn rename to src/identity/tests/token_manager_integration/BUILD.gn index 245ab7386770ac5c7e827e4bb38d30a34bbda84e..76c808aca4df76b0dbbf893f8821c979320c4949 100644 --- a/garnet/bin/auth/tests/token_manager_integration/BUILD.gn +++ b/src/identity/tests/token_manager_integration/BUILD.gn @@ -3,37 +3,20 @@ # found in the LICENSE file. # -visibility = [ "//garnet/bin/auth/*" ] - -import("//build/package.gni") +import("//build/test/test_package.gni") import("//build/testing/environments.gni") group("token_manager_integration") { testonly = true deps = [ - ":e2e_dev", - ":token_manager_integration_tests", + ":token_manager_integration_test_pkg", + "//src/identity/bin/dev_auth_provider", + "//src/identity/bin/dev_auth_provider_iotid", ] } -package("token_manager_integration_tests") { - testonly = true - - deps = [ - ":e2e_dev", - ] - - tests = [ - { - name = "dev_token_mgr_e2e_test" - environments = basic_envs - }, - ] -} - -executable("e2e_dev") { - output_name = "dev_token_mgr_e2e_test" - +executable("bin") { + output_name = "token_manager_integration_test" testonly = true sources = [ @@ -51,6 +34,20 @@ executable("e2e_dev") { "//garnet/public/lib/test_runner/cpp/reporting", "//sdk/fidl/fuchsia.auth", "//src/lib/fxl", - "//third_party/googletest:gtest", + "//src/lib/fxl/test:gtest_main", + ] +} + +test_package("token_manager_integration_test_pkg") { + deps = [ + ":bin", + ] + + tests = [ + { + name = "token_manager_integration_test" + environments = basic_envs + }, ] } + diff --git a/garnet/bin/auth/tests/token_manager_integration/dev_token_mgr_test.cc b/src/identity/tests/token_manager_integration/dev_token_mgr_test.cc similarity index 96% rename from garnet/bin/auth/tests/token_manager_integration/dev_token_mgr_test.cc rename to src/identity/tests/token_manager_integration/dev_token_mgr_test.cc index 9081b548222d8d711d77b7dd09b6c648d5f098ee..33a37330e68b23255fb72779383509f59d975354 100644 --- a/garnet/bin/auth/tests/token_manager_integration/dev_token_mgr_test.cc +++ b/src/identity/tests/token_manager_integration/dev_token_mgr_test.cc @@ -419,19 +419,3 @@ INSTANTIATE_TEST_SUITE_P(Cpp, DevTokenManagerAppTest, ::testing::ValuesIn(kTestComponentParams)); } // namespace } // namespace e2e_dev - -int main(int argc, char** argv) { - test_runner::GTestListener listener(argv[0]); - testing::InitGoogleTest(&argc, argv); - testing::UnitTest::GetInstance()->listeners().Append(&listener); - int status = RUN_ALL_TESTS(); - testing::UnitTest::GetInstance()->listeners().Release(&listener); - - { - async::Loop loop(&kAsyncLoopConfigAttachToThread); - auto context = sys::ComponentContext::Create(); - test_runner::ReportResult(argv[0], context.get(), listener.GetResults()); - } - - return status; -} diff --git a/src/identity/tests/token_manager_integration/meta/token_manager_integration_test.cmx b/src/identity/tests/token_manager_integration/meta/token_manager_integration_test.cmx new file mode 100644 index 0000000000000000000000000000000000000000..74db2d0b88670e1d2fd516e3c84da9b9f292b1f0 --- /dev/null +++ b/src/identity/tests/token_manager_integration/meta/token_manager_integration_test.cmx @@ -0,0 +1,12 @@ +{ + "program": { + "binary": "test/token_manager_integration_test" + }, + "sandbox": { + "services": [ + "fuchsia.auth.TokenManagerFactory", + "fuchsia.logger.LogSink", + "fuchsia.sys.Launcher" + ] + } +}