blob: 58cc06f67ce0b171b876326f361f4102fafd4d85 [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
22kernel_modules_stem = "virt_device_prebuilts_kernel_modules-" + kernel_version
23
24cc_test {
Jiyong Parka7351652022-02-04 13:45:56 +090025 // ".64" suffix is to work around cts-unit-test which is demanding that all
26 // executables in CTS should have both 32 and 64 ABIs.
27 name: "VirtualizationTestCases.64",
28 test_suites: [
29 "cts",
30 "general-tests",
31 ],
David Brazdil49f8a4d2021-03-04 09:57:33 +000032 srcs: [
33 "common.cc",
34 "vsock_test.cc",
35 ],
36 local_include_dirs: ["include"],
Andrew Walbran3e73a092021-06-25 11:32:23 +000037 compile_multilib: "64",
David Brazdil49f8a4d2021-03-04 09:57:33 +000038 data: [
39 ":virt_test_kernel",
40 ":virt_test_initramfs",
David Brazdil49f8a4d2021-03-04 09:57:33 +000041 ],
42 static_libs: [
43 // The existence of the library in the system partition is not guaranteed.
44 // Let's have our own copy of it.
Andrew Walbranf6bf6862021-05-21 12:41:13 +000045 "android.system.virtualizationservice-cpp",
Andrew Walbran9d39f302022-02-02 17:51:43 +000046 "PlatformProperties",
David Brazdil49f8a4d2021-03-04 09:57:33 +000047 ],
48 shared_libs: [
49 "libbase",
50 "libbinder",
51 "liblog",
52 "libutils",
53 ],
54}
55
56cc_defaults {
57 name: "virt_test_guest_binary",
58 static_libs: [
59 "libbase",
60 "liblog",
61 ],
62 static_executable: true,
63 installable: false,
64}
65
66cc_binary {
67 name: "virt_test_vsock_guest",
68 srcs: ["vsock_guest.cc"],
69 stem: "vsock_client",
70 defaults: ["virt_test_guest_binary"],
71}
72
73prebuilt_etc {
74 name: "virt_test_kernel",
75 src: "nofile",
76 arch: {
77 arm64: {
78 src: ":" + kernel_stem + "-arm64",
79 },
80 x86_64: {
81 src: ":" + kernel_stem + "-x86_64",
82 },
83 },
84}
85
86android_filesystem {
87 name: "virt_test_initramfs",
88 arch: {
89 arm64: {
90 deps: [kernel_modules_stem + "-arm64"],
91 },
92 x86_64: {
93 deps: [kernel_modules_stem + "-x86_64"],
94 },
95 },
96 deps: [
97 "virt_test_guest_init",
98 "virt_test_vsock_guest",
99 ],
100 type: "cpio",
101}