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 { |
Jiyong Park | a735165 | 2022-02-04 13:45:56 +0900 | [diff] [blame] | 25 | // ".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 Brazdil | 49f8a4d | 2021-03-04 09:57:33 +0000 | [diff] [blame] | 32 | srcs: [ |
| 33 | "common.cc", |
| 34 | "vsock_test.cc", |
| 35 | ], |
| 36 | local_include_dirs: ["include"], |
Andrew Walbran | 3e73a09 | 2021-06-25 11:32:23 +0000 | [diff] [blame] | 37 | compile_multilib: "64", |
David Brazdil | 49f8a4d | 2021-03-04 09:57:33 +0000 | [diff] [blame] | 38 | data: [ |
| 39 | ":virt_test_kernel", |
| 40 | ":virt_test_initramfs", |
David Brazdil | 49f8a4d | 2021-03-04 09:57:33 +0000 | [diff] [blame] | 41 | ], |
| 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 Walbran | f6bf686 | 2021-05-21 12:41:13 +0000 | [diff] [blame] | 45 | "android.system.virtualizationservice-cpp", |
Andrew Walbran | 9d39f30 | 2022-02-02 17:51:43 +0000 | [diff] [blame] | 46 | "PlatformProperties", |
David Brazdil | 49f8a4d | 2021-03-04 09:57:33 +0000 | [diff] [blame] | 47 | ], |
| 48 | shared_libs: [ |
| 49 | "libbase", |
| 50 | "libbinder", |
| 51 | "liblog", |
| 52 | "libutils", |
| 53 | ], |
| 54 | } |
| 55 | |
| 56 | cc_defaults { |
| 57 | name: "virt_test_guest_binary", |
| 58 | static_libs: [ |
| 59 | "libbase", |
| 60 | "liblog", |
| 61 | ], |
| 62 | static_executable: true, |
| 63 | installable: false, |
| 64 | } |
| 65 | |
| 66 | cc_binary { |
| 67 | name: "virt_test_vsock_guest", |
| 68 | srcs: ["vsock_guest.cc"], |
| 69 | stem: "vsock_client", |
| 70 | defaults: ["virt_test_guest_binary"], |
| 71 | } |
| 72 | |
| 73 | prebuilt_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 | |
| 86 | android_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 | } |