blob: 35ff6a071be9ce0e6d8807bb6b5243fa0d3d6f9a [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 {
24 name: "VirtualizationTestCases",
Jiyong Park5c71cac2022-02-04 11:49:31 +090025 test_suites: ["general-tests"],
David Brazdil49f8a4d2021-03-04 09:57:33 +000026 srcs: [
27 "common.cc",
28 "vsock_test.cc",
29 ],
30 local_include_dirs: ["include"],
Andrew Walbran3e73a092021-06-25 11:32:23 +000031 compile_multilib: "64",
David Brazdil49f8a4d2021-03-04 09:57:33 +000032 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.
Andrew Walbranf6bf6862021-05-21 12:41:13 +000039 "android.system.virtualizationservice-cpp",
Andrew Walbran9d39f302022-02-02 17:51:43 +000040 "PlatformProperties",
David Brazdil49f8a4d2021-03-04 09:57:33 +000041 ],
42 shared_libs: [
43 "libbase",
44 "libbinder",
45 "liblog",
46 "libutils",
47 ],
48}
49
50cc_defaults {
51 name: "virt_test_guest_binary",
52 static_libs: [
53 "libbase",
54 "liblog",
55 ],
56 static_executable: true,
57 installable: false,
58}
59
60cc_binary {
61 name: "virt_test_vsock_guest",
62 srcs: ["vsock_guest.cc"],
63 stem: "vsock_client",
64 defaults: ["virt_test_guest_binary"],
65}
66
67prebuilt_etc {
68 name: "virt_test_kernel",
69 src: "nofile",
70 arch: {
71 arm64: {
72 src: ":" + kernel_stem + "-arm64",
73 },
74 x86_64: {
75 src: ":" + kernel_stem + "-x86_64",
76 },
77 },
78}
79
80android_filesystem {
81 name: "virt_test_initramfs",
David Brazdil49f8a4d2021-03-04 09:57:33 +000082 deps: [
Jiyong Parkb54646f2022-02-07 11:13:56 +090083 "microdroid_kernel_modules",
David Brazdil49f8a4d2021-03-04 09:57:33 +000084 "virt_test_guest_init",
85 "virt_test_vsock_guest",
86 ],
87 type: "cpio",
88}