| # 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. |
| |
| import("//build/components.gni") |
| import("//build/rust/rustc_test.gni") |
| |
| rustc_test("http_client_integration_test") { |
| edition = "2024" |
| |
| deps = [ |
| "//sdk/fidl/fuchsia.net.http:fuchsia.net.http_rust", |
| "//sdk/fidl/fuchsia.pkg.http:fuchsia.pkg.http_rust", |
| "//sdk/rust/zx", |
| "//src/lib/fidl/rust/fidl", |
| "//src/lib/fuchsia-async", |
| "//src/lib/fuchsia-component-test", |
| "//src/lib/fuchsia-hyper", |
| "//src/storage/fxfs/fidl/fuchsia.fxfs:fuchsia.fxfs_rust", |
| "//src/sys/lib/component-events", |
| "//third_party/rust_crates:futures", |
| "//third_party/rust_crates:hyper", |
| "//third_party/rust_crates:test-case", |
| ] |
| |
| sources = [ |
| "src/lib.rs", |
| "src/pkg.rs", |
| ] |
| |
| configs += [ "//build/config/rust/lints:deny_unused_results" ] |
| } |
| |
| fuchsia_test_component("component") { |
| component_name = "http-client-integration-test" |
| manifest = "meta/http_client_integration_test.cml" |
| deps = [ ":http_client_integration_test" ] |
| } |
| |
| # fuchsia_hyper::new_https_client fails if there isn't a file at |
| # /config/ssl/cert.pem, but the unit tests don't actually make https connections |
| # and so don't need any certs so we can just give them an empty file instead of |
| # making them a system test and giving them the system certs. |
| resource("fake-ssl-certs") { |
| sources = [ "fake_cert_for_test.pem" ] |
| outputs = [ "fake-ssl-certs/cert.pem" ] |
| visibility = [ ":*" ] |
| } |
| |
| fuchsia_test_package("http-client-integration-tests") { |
| test_components = [ ":component" ] |
| deps = [ |
| ":config_idle_1ms", |
| ":config_never_idle", |
| ":fake-ssl-certs", |
| |
| # The component under test. |
| "../:component", |
| "//src/connectivity/network/netstack:component-debug", |
| ] |
| } |
| |
| # A component providing configuration that the http client should never stop |
| # itself on idle. |
| fuchsia_component_manifest("config_never_idle") { |
| component_name = "http-client-config-never-idle" |
| manifest = "meta/config_never_idle.cml" |
| } |
| |
| # A component providing configuration that the http client should stop itself if |
| # it did not receive requests for 1 milliseconds. |
| fuchsia_component_manifest("config_idle_1ms") { |
| component_name = "http-client-config-idle-1ms" |
| manifest = "meta/config_idle_1ms.cml" |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ ":http-client-integration-tests" ] |
| } |