blob: a06977e64c7b7c0b5a2c2132f3448a757a8b51bb [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"],
32 data: [
33 ":virt_test_kernel",
34 ":virt_test_initramfs",
David Brazdil49f8a4d2021-03-04 09:57:33 +000035 ],
36 static_libs: [
37 // The existence of the library in the system partition is not guaranteed.
38 // Let's have our own copy of it.
39 "android.system.virtmanager-cpp",
40 ],
41 shared_libs: [
42 "libbase",
43 "libbinder",
44 "liblog",
45 "libutils",
46 ],
47}
48
49cc_defaults {
50 name: "virt_test_guest_binary",
51 static_libs: [
52 "libbase",
53 "liblog",
54 ],
55 static_executable: true,
56 installable: false,
57}
58
59cc_binary {
60 name: "virt_test_vsock_guest",
61 srcs: ["vsock_guest.cc"],
62 stem: "vsock_client",
63 defaults: ["virt_test_guest_binary"],
64}
65
66prebuilt_etc {
67 name: "virt_test_kernel",
68 src: "nofile",
69 arch: {
70 arm64: {
71 src: ":" + kernel_stem + "-arm64",
72 },
73 x86_64: {
74 src: ":" + kernel_stem + "-x86_64",
75 },
76 },
77}
78
79android_filesystem {
80 name: "virt_test_initramfs",
81 arch: {
82 arm64: {
83 deps: [kernel_modules_stem + "-arm64"],
84 },
85 x86_64: {
86 deps: [kernel_modules_stem + "-x86_64"],
87 },
88 },
89 deps: [
90 "virt_test_guest_init",
91 "virt_test_vsock_guest",
92 ],
93 type: "cpio",
94}