David Brazdil | 49f8a4d | 2021-03-04 09:57:33 +0000 | [diff] [blame] | 1 | // 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 | |
| 15 | package { |
| 16 | default_applicable_licenses: ["Android-Apache-2.0"], |
| 17 | } |
| 18 | |
| 19 | kernel_version = "5.10" |
| 20 | |
| 21 | kernel_stem = "kernel_prebuilts-" + kernel_version |
| 22 | kernel_modules_stem = "virt_device_prebuilts_kernel_modules-" + kernel_version |
| 23 | |
| 24 | cc_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 Walbran | 3e73a09 | 2021-06-25 11:32:23 +0000 | [diff] [blame] | 32 | compile_multilib: "64", |
David Brazdil | 49f8a4d | 2021-03-04 09:57:33 +0000 | [diff] [blame] | 33 | data: [ |
| 34 | ":virt_test_kernel", |
| 35 | ":virt_test_initramfs", |
David Brazdil | 49f8a4d | 2021-03-04 09:57:33 +0000 | [diff] [blame] | 36 | ], |
| 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 Walbran | f6bf686 | 2021-05-21 12:41:13 +0000 | [diff] [blame] | 40 | "android.system.virtualizationservice-cpp", |
David Brazdil | 49f8a4d | 2021-03-04 09:57:33 +0000 | [diff] [blame] | 41 | ], |
| 42 | shared_libs: [ |
| 43 | "libbase", |
| 44 | "libbinder", |
| 45 | "liblog", |
| 46 | "libutils", |
| 47 | ], |
| 48 | } |
| 49 | |
| 50 | cc_defaults { |
| 51 | name: "virt_test_guest_binary", |
| 52 | static_libs: [ |
| 53 | "libbase", |
| 54 | "liblog", |
| 55 | ], |
| 56 | static_executable: true, |
| 57 | installable: false, |
| 58 | } |
| 59 | |
| 60 | cc_binary { |
| 61 | name: "virt_test_vsock_guest", |
| 62 | srcs: ["vsock_guest.cc"], |
| 63 | stem: "vsock_client", |
| 64 | defaults: ["virt_test_guest_binary"], |
| 65 | } |
| 66 | |
| 67 | prebuilt_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 | |
| 80 | android_filesystem { |
| 81 | name: "virt_test_initramfs", |
| 82 | arch: { |
| 83 | arm64: { |
| 84 | deps: [kernel_modules_stem + "-arm64"], |
| 85 | }, |
| 86 | x86_64: { |
| 87 | deps: [kernel_modules_stem + "-x86_64"], |
| 88 | }, |
| 89 | }, |
| 90 | deps: [ |
| 91 | "virt_test_guest_init", |
| 92 | "virt_test_vsock_guest", |
| 93 | ], |
| 94 | type: "cpio", |
| 95 | } |