blob: 0062846168c542a7c4f05f5bbe9ea803d57f2291 [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
19kernel_version = "5.10"
20
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: [
28 "cts",
29 "general-tests",
30 ],
David Brazdil49f8a4d2021-03-04 09:57:33 +000031 srcs: [
32 "common.cc",
33 "vsock_test.cc",
34 ],
35 local_include_dirs: ["include"],
Andrew Walbran3e73a092021-06-25 11:32:23 +000036 compile_multilib: "64",
David Brazdil49f8a4d2021-03-04 09:57:33 +000037 data: [
38 ":virt_test_kernel",
39 ":virt_test_initramfs",
David Brazdil49f8a4d2021-03-04 09:57:33 +000040 ],
41 static_libs: [
42 // The existence of the library in the system partition is not guaranteed.
43 // Let's have our own copy of it.
Andrew Walbranf6bf6862021-05-21 12:41:13 +000044 "android.system.virtualizationservice-cpp",
Andrew Walbran9d39f302022-02-02 17:51:43 +000045 "PlatformProperties",
David Brazdil49f8a4d2021-03-04 09:57:33 +000046 ],
47 shared_libs: [
48 "libbase",
49 "libbinder",
50 "liblog",
51 "libutils",
52 ],
53}
54
55cc_defaults {
56 name: "virt_test_guest_binary",
57 static_libs: [
58 "libbase",
59 "liblog",
60 ],
61 static_executable: true,
62 installable: false,
63}
64
65cc_binary {
66 name: "virt_test_vsock_guest",
67 srcs: ["vsock_guest.cc"],
68 stem: "vsock_client",
69 defaults: ["virt_test_guest_binary"],
70}
71
72prebuilt_etc {
73 name: "virt_test_kernel",
74 src: "nofile",
75 arch: {
76 arm64: {
77 src: ":" + kernel_stem + "-arm64",
78 },
79 x86_64: {
80 src: ":" + kernel_stem + "-x86_64",
81 },
82 },
83}
84
85android_filesystem {
86 name: "virt_test_initramfs",
David Brazdil49f8a4d2021-03-04 09:57:33 +000087 deps: [
Jiyong Parkb54646f2022-02-07 11:13:56 +090088 "microdroid_kernel_modules",
David Brazdil49f8a4d2021-03-04 09:57:33 +000089 "virt_test_guest_init",
90 "virt_test_vsock_guest",
91 ],
92 type: "cpio",
93}
Jooyung Han6afd6672022-02-22 05:22:23 +090094
95genrule {
96 name: "test-payload-metadata",
97 tools: ["mk_payload"],
98 cmd: "$(location mk_payload) --metadata-only $(in) $(out)",
99 srcs: ["test-payload-metadata-config.json"],
100 out: ["test-payload-metadata.img"],
101}