| # Copyright 2018 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/assembly/bootfs_files_for_assembly.gni") |
| import("//build/components.gni") |
| import("//build/config.gni") |
| import("//src/sys/core/build/core_shard.gni") |
| |
| group("tests") { |
| testonly = true |
| deps = [ ":sshd-host-tests" ] |
| } |
| |
| source_set("service") { |
| sources = [ |
| "service.cc", |
| "service.h", |
| ] |
| deps = [ |
| "//sdk/lib/fdio", |
| "//sdk/lib/fit", |
| "//sdk/lib/syslog/cpp", |
| "//src/lib/fxl", |
| "//zircon/system/ulib/zx", |
| ] |
| public_deps = [ |
| "//sdk/fidl/fuchsia.component:fuchsia.component_cpp", |
| "//sdk/fidl/fuchsia.vsock:fuchsia.vsock_cpp", |
| "//sdk/lib/component/incoming/cpp", |
| "//zircon/system/ulib/async", |
| ] |
| } |
| |
| source_set("data_dir") { |
| sources = [ |
| "data_dir.cc", |
| "data_dir.h", |
| ] |
| deps = [ |
| "//sdk/lib/fdio", |
| "//sdk/lib/syslog/cpp", |
| "//src/lib/files", |
| "//third_party/openssh-portable:libssh", |
| "//third_party/openssh-portable:sk", |
| "//zircon/system/ulib/zx", |
| ] |
| public_deps = [ |
| "//src/storage/memfs:lib", |
| "//zircon/system/ulib/async-loop:async-loop-cpp", |
| ] |
| configs += [ "//third_party/openssh-portable:fuchsia" ] |
| } |
| |
| executable("bin") { |
| output_name = "vsock-sshd-host" |
| sources = [ "sshd-host.cc" ] |
| deps = [ |
| ":data_dir", |
| ":service", |
| "//sdk/lib/syslog/cpp", |
| "//zircon/system/ulib/async-loop:async-loop-cpp", |
| "//zircon/system/ulib/async-loop:async-loop-default", |
| ] |
| } |
| |
| fuchsia_component("vsock-sshd-component") { |
| component_name = "vsock-sshd" |
| manifest = "meta/vsock-sshd.cml" |
| |
| deps = [ |
| # Ensure this isn't included in production |
| "//build/validate:non_production_tag", |
| "//third_party/openssh-portable:sshd", |
| ] |
| } |
| |
| fuchsia_component("vsock-sshd-host-component") { |
| component_name = "vsock-sshd-host" |
| manifest = "meta/vsock-sshd-host.cml" |
| |
| deps = [ |
| ":bin", |
| |
| # Ensure this isn't included in production |
| "//build/validate:non_production_tag", |
| "//third_party/openssh-portable:hostkeygen", |
| ] |
| } |
| |
| fuchsia_package("vsock-sshd-host") { |
| deps = [ |
| ":vsock-sshd-component", |
| ":vsock-sshd-host-component", |
| ] |
| } |
| |
| resource("sshd_config") { |
| sources = [ "//third_party/openssh-portable/fuchsia/sshd_config" ] |
| outputs = [ "config/sshd_config" ] |
| visibility = [ ":*" ] |
| } |
| |
| bootfs_files_for_assembly("bootfs") { |
| deps = [ ":sshd_config" ] |
| } |
| |
| executable("test") { |
| testonly = true |
| output_name = "sshd-host-test" |
| sources = [ "test.cc" ] |
| deps = [ |
| ":service", |
| "//sdk/fidl/fuchsia.boot:fuchsia.boot_cpp", |
| "//sdk/lib/sys/cpp", |
| "//sdk/lib/sys/cpp/testing:unit", |
| "//src/lib/fxl/test:gtest_main", |
| "//src/lib/testing/loop_fixture", |
| "//zircon/system/ulib/async-loop:async-loop-cpp", |
| "//zircon/system/ulib/async-loop:async-loop-default", |
| "//zircon/system/ulib/zx", |
| ] |
| } |
| |
| fuchsia_unittest_package("sshd-host-tests") { |
| manifest = "meta/sshd-host-test.cml" |
| deps = [ ":test" ] |
| test_specs = { |
| log_settings = { |
| max_severity = "ERROR" |
| } |
| } |
| } |