blob: 0b3a821c03be5a612d32f7a3e23dacb313c24e28 [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 {
25 name: "VirtualizationTestCases",
26 test_suites: ["device-tests"],
27 srcs: [
28 "common.cc",
29 "vsock_test.cc",
30 ],
31 local_include_dirs: ["include"],
Andrew Walbran3e73a092021-06-25 11:32:23 +000032 compile_multilib: "64",
David Brazdil49f8a4d2021-03-04 09:57:33 +000033 data: [
34 ":virt_test_kernel",
35 ":virt_test_initramfs",
David Brazdil49f8a4d2021-03-04 09:57:33 +000036 ],
37 static_libs: [
38 // The existence of the library in the system partition is not guaranteed.
39 // Let's have our own copy of it.
Andrew Walbranf6bf6862021-05-21 12:41:13 +000040 "android.system.virtualizationservice-cpp",
Andrew Walbran9d39f302022-02-02 17:51:43 +000041 "PlatformProperties",
David Brazdil49f8a4d2021-03-04 09:57:33 +000042 ],
43 shared_libs: [
44 "libbase",
45 "libbinder",
46 "liblog",
47 "libutils",
48 ],
49}
50
51cc_defaults {
52 name: "virt_test_guest_binary",
53 static_libs: [
54 "libbase",
55 "liblog",
56 ],
57 static_executable: true,
58 installable: false,
59}
60
61cc_binary {
62 name: "virt_test_vsock_guest",
63 srcs: ["vsock_guest.cc"],
64 stem: "vsock_client",
65 defaults: ["virt_test_guest_binary"],
66}
67
68prebuilt_etc {
69 name: "virt_test_kernel",
70 src: "nofile",
71 arch: {
72 arm64: {
73 src: ":" + kernel_stem + "-arm64",
74 },
75 x86_64: {
76 src: ":" + kernel_stem + "-x86_64",
77 },
78 },
79}
80
81android_filesystem {
82 name: "virt_test_initramfs",
83 arch: {
84 arm64: {
85 deps: [kernel_modules_stem + "-arm64"],
86 },
87 x86_64: {
88 deps: [kernel_modules_stem + "-x86_64"],
89 },
90 },
91 deps: [
92 "virt_test_guest_init",
93 "virt_test_vsock_guest",
94 ],
95 type: "cpio",
96}