就本文而言,「target」就是執行 Fuchsia 正在測試和「主機」就是執行一些穩定版 OS 的機器A 罩杯 主機目標互動測試會在主機上執行,並與目標互動。
在 GN 中聲明
如要在 GN 中宣告主機目標互動測試,請按照下列步驟操作:
例如:
# Doesn't have to be go_test. This is just an example.
go_test("an_hti_test") {
    ...
    # Declares that Fuchsia should be running in an emulator before this test
    # starts on the host.
    environments = [emu_env]
    ...
}
# This should be included in the transitive deps of some tests bundle.
group("tests") {
    testonly = true
    # Anything that depends on ":tests" will build the test as a host test.
    public_deps = [":an_hti_test($host_toolchain)"]
}
Host Test API
持續整合基礎架構 (即「基礎架構」) 和 fx test 會啟動
,然後在主機中叫用測試。
SL4F 是主機與目標互動的一種方式。SL4F 主機 而且程式庫會負責 與目標之間的連線
不使用 SL4F 的測試可以剖析這些環境變數 處理自己與主機的通訊:
- FUCHSIA_IPV4_ADDR:IPv4 位址。
- FUCHSIA_IPV6_ADDR:IPv6 位址。
- FUCHSIA_SSH_KEY:安全殼層金鑰檔案路徑。