[fuchsia] migrate test to CFv2

Fuchsia is undergoing a change to how programs are run and the Crashpad
tests must be migrated to the new system.

Bug: fuchsia:102371

TESTED=`fx test crashpad-test` (540 passing, 1 skipped)

Change-Id: I4daf7d160045b28b876a5f1aa93b0bd596461e0d
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/3817783
Commit-Queue: Alex Pankhurst <pankhurst@google.com>
Reviewed-by: Joshua Peraza <jperaza@chromium.org>
This commit is contained in:
Alex Pankhurst 2022-08-08 10:45:04 -07:00 committed by Crashpad LUCI CQ
parent 7b105f83ab
commit 6c6c2ae563
3 changed files with 86 additions and 30 deletions

View File

@ -67,7 +67,7 @@ if (crashpad_is_in_chromium || crashpad_is_in_fuchsia) {
if (crashpad_is_in_fuchsia) {
import("//build/components.gni")
fuchsia_test_component("crashpad-test-component") {
manifest = "test/fuchsia_crashpad_tests.cmx"
manifest = "test/fuchsia_crashpad_tests.cml"
deps = [
":crashpad-test-resources",
":crashpad_tests",
@ -84,8 +84,8 @@ if (crashpad_is_in_chromium || crashpad_is_in_fuchsia) {
test_components = [ ":crashpad-test-component" ]
deps = [
"//src/connectivity/network/dns:component-legacy",
"//src/connectivity/network/netstack:component-legacy",
"//src/connectivity/network/dns:component",
"//src/connectivity/network/netstack:component",
]
test_specs = {

View File

@ -0,0 +1,83 @@
// Copyright 2022 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.
{
include: [
"//src/sys/test_runners/elf/ambient_exec.shard.cml",
"syslog/client.shard.cml",
],
program: {
binary: "bin/crashpad_tests",
// For ProcessSnapshotFuchsiaTest.AddressSpaceMapping.
job_policy_ambient_mark_vmo_exec: "true",
},
children: [
{
name: "dns_resolver",
url: "#meta/dns_resolver.cm",
},
{
name: "netstack",
url: "#meta/netstack.cm",
},
{
name: "crashpad_test",
url: "#meta/crashpad_test.cm",
},
],
use: [
{
protocol: [ "fuchsia.net.name.Lookup" ],
from: "#dns_resolver",
},
{
protocol: [ "fuchsia.posix.socket.Provider" ],
from: "#netstack",
},
{
protocol: [ "fuchsia.process.Launcher" ],
},
{
storage: "tmp",
path: "/tmp",
},
],
offer: [
{
protocol: "fuchsia.logger.LogSink",
from: "parent",
to: [
"#crashpad_test",
"#dns_resolver",
"#netstack",
]
},
{
protocol: "fuchsia.net.name.Lookup",
from: "#dns_resolver",
to: "#crashpad_test",
},
{
protocol: "fuchsia.net.routes.State",
from: "#netstack",
to: "#dns_resolver",
},
{
protocol: "fuchsia.posix.socket.Provider",
from: "#netstack",
to: "#crashpad_test",
},
{
storage: "cache",
from: "parent",
to: [ "#netstack" ],
},
{
storage: "tmp",
from: "parent",
to: "#crashpad_test",
rights: [ "rw*" ],
},
],
}

View File

@ -1,27 +0,0 @@
{
"facets": {
"fuchsia.test": {
"injected-services": {
"fuchsia.net.name.Lookup": "fuchsia-pkg://fuchsia.com/crashpad-test#meta/dns-resolver.cmx",
"fuchsia.posix.socket.Provider": "fuchsia-pkg://fuchsia.com/crashpad-test#meta/netstack.cmx"
}
}
},
"include": [
"syslog/client.shard.cmx"
],
"program": {
"binary": "bin/crashpad_tests"
},
"sandbox": {
"features": [
"deprecated-ambient-replace-as-executable",
"isolated-temp"
],
"services": [
"fuchsia.net.name.Lookup",
"fuchsia.posix.socket.Provider",
"fuchsia.process.Launcher"
]
}
}