blob: b849d37b1f8e6c93c7d9b2770840d14cf754db62 [file] [log] [blame]
David Brazdil49f8a4d2021-03-04 09:57:33 +00001// Copyright (C) 2020 The Android Open Source Project
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15package {
16 default_applicable_licenses: ["Android-Apache-2.0"],
17}
18
Jiyong Park09a2bda2022-06-13 16:44:45 +090019kernel_version = "5.15"
David Brazdil49f8a4d2021-03-04 09:57:33 +000020
21kernel_stem = "kernel_prebuilts-" + kernel_version
David Brazdil49f8a4d2021-03-04 09:57:33 +000022
23cc_test {
Jiyong Park29de5172022-02-08 00:37:05 +090024 // ".64" suffix is to work around cts-unit-test which is demanding that all
25 // executables in CTS should have both 32 and 64 ABIs.
26 name: "VirtualizationTestCases.64",
27 test_suites: [
Jiyong Park29de5172022-02-08 00:37:05 +090028 "general-tests",
29 ],
David Brazdil49f8a4d2021-03-04 09:57:33 +000030 srcs: [
31 "common.cc",
32 "vsock_test.cc",
33 ],
34 local_include_dirs: ["include"],
Andrew Walbran3e73a092021-06-25 11:32:23 +000035 compile_multilib: "64",
David Brazdil49f8a4d2021-03-04 09:57:33 +000036 data: [
37 ":virt_test_kernel",
38 ":virt_test_initramfs",
David Brazdil49f8a4d2021-03-04 09:57:33 +000039 ],
40 static_libs: [
41 // The existence of the library in the system partition is not guaranteed.
42 // Let's have our own copy of it.
Andrew Walbranf6bf6862021-05-21 12:41:13 +000043 "android.system.virtualizationservice-cpp",
Trevor Radcliffe8393dfa2022-06-08 14:18:34 +000044 "libPlatformProperties",
David Brazdil49f8a4d2021-03-04 09:57:33 +000045 ],
46 shared_libs: [
47 "libbase",
48 "libbinder",
49 "liblog",
50 "libutils",
51 ],
52}
53
54cc_defaults {
55 name: "virt_test_guest_binary",
56 static_libs: [
57 "libbase",
58 "liblog",
59 ],
60 static_executable: true,
61 installable: false,
62}
63
64cc_binary {
65 name: "virt_test_vsock_guest",
66 srcs: ["vsock_guest.cc"],
67 stem: "vsock_client",
68 defaults: ["virt_test_guest_binary"],
69}
70
71prebuilt_etc {
72 name: "virt_test_kernel",
73 src: "nofile",
74 arch: {
75 arm64: {
76 src: ":" + kernel_stem + "-arm64",
77 },
78 x86_64: {
79 src: ":" + kernel_stem + "-x86_64",
80 },
81 },
82}
83
84android_filesystem {
85 name: "virt_test_initramfs",
David Brazdil49f8a4d2021-03-04 09:57:33 +000086 deps: [
Jiyong Parkb54646f2022-02-07 11:13:56 +090087 "microdroid_kernel_modules",
David Brazdil49f8a4d2021-03-04 09:57:33 +000088 "virt_test_guest_init",
89 "virt_test_vsock_guest",
90 ],
91 type: "cpio",
92}
Jooyung Han6afd6672022-02-22 05:22:23 +090093
94genrule {
95 name: "test-payload-metadata",
96 tools: ["mk_payload"],
97 cmd: "$(location mk_payload) --metadata-only $(in) $(out)",
98 srcs: ["test-payload-metadata-config.json"],
99 out: ["test-payload-metadata.img"],
100}