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 | |
Jiyong Park | 09a2bda | 2022-06-13 16:44:45 +0900 | [diff] [blame] | 19 | kernel_version = "5.15" |
David Brazdil | 49f8a4d | 2021-03-04 09:57:33 +0000 | [diff] [blame] | 20 | |
| 21 | kernel_stem = "kernel_prebuilts-" + kernel_version |
David Brazdil | 49f8a4d | 2021-03-04 09:57:33 +0000 | [diff] [blame] | 22 | |
| 23 | cc_test { |
Jiyong Park | 29de517 | 2022-02-08 00:37:05 +0900 | [diff] [blame] | 24 | // ".64" suffix is to work around cts-unit-test which is demanding that all |
| 25 | // executables in CTS should have both 32 and 64 ABIs. |
| 26 | name: "VirtualizationTestCases.64", |
| 27 | test_suites: [ |
Jiyong Park | 29de517 | 2022-02-08 00:37:05 +0900 | [diff] [blame] | 28 | "general-tests", |
| 29 | ], |
David Brazdil | 49f8a4d | 2021-03-04 09:57:33 +0000 | [diff] [blame] | 30 | srcs: [ |
| 31 | "common.cc", |
| 32 | "vsock_test.cc", |
| 33 | ], |
| 34 | local_include_dirs: ["include"], |
Andrew Walbran | 3e73a09 | 2021-06-25 11:32:23 +0000 | [diff] [blame] | 35 | compile_multilib: "64", |
David Brazdil | 49f8a4d | 2021-03-04 09:57:33 +0000 | [diff] [blame] | 36 | data: [ |
| 37 | ":virt_test_kernel", |
| 38 | ":virt_test_initramfs", |
David Brazdil | 49f8a4d | 2021-03-04 09:57:33 +0000 | [diff] [blame] | 39 | ], |
| 40 | static_libs: [ |
| 41 | // The existence of the library in the system partition is not guaranteed. |
| 42 | // Let's have our own copy of it. |
Andrew Walbran | f6bf686 | 2021-05-21 12:41:13 +0000 | [diff] [blame] | 43 | "android.system.virtualizationservice-cpp", |
Trevor Radcliffe | 8393dfa | 2022-06-08 14:18:34 +0000 | [diff] [blame] | 44 | "libPlatformProperties", |
David Brazdil | 49f8a4d | 2021-03-04 09:57:33 +0000 | [diff] [blame] | 45 | ], |
| 46 | shared_libs: [ |
| 47 | "libbase", |
| 48 | "libbinder", |
| 49 | "liblog", |
| 50 | "libutils", |
| 51 | ], |
| 52 | } |
| 53 | |
| 54 | cc_defaults { |
| 55 | name: "virt_test_guest_binary", |
| 56 | static_libs: [ |
| 57 | "libbase", |
| 58 | "liblog", |
| 59 | ], |
| 60 | static_executable: true, |
| 61 | installable: false, |
| 62 | } |
| 63 | |
| 64 | cc_binary { |
| 65 | name: "virt_test_vsock_guest", |
| 66 | srcs: ["vsock_guest.cc"], |
| 67 | stem: "vsock_client", |
| 68 | defaults: ["virt_test_guest_binary"], |
| 69 | } |
| 70 | |
| 71 | prebuilt_etc { |
| 72 | name: "virt_test_kernel", |
| 73 | src: "nofile", |
| 74 | arch: { |
| 75 | arm64: { |
| 76 | src: ":" + kernel_stem + "-arm64", |
| 77 | }, |
| 78 | x86_64: { |
| 79 | src: ":" + kernel_stem + "-x86_64", |
| 80 | }, |
| 81 | }, |
| 82 | } |
| 83 | |
| 84 | android_filesystem { |
| 85 | name: "virt_test_initramfs", |
David Brazdil | 49f8a4d | 2021-03-04 09:57:33 +0000 | [diff] [blame] | 86 | deps: [ |
Jiyong Park | b54646f | 2022-02-07 11:13:56 +0900 | [diff] [blame] | 87 | "microdroid_kernel_modules", |
David Brazdil | 49f8a4d | 2021-03-04 09:57:33 +0000 | [diff] [blame] | 88 | "virt_test_guest_init", |
| 89 | "virt_test_vsock_guest", |
| 90 | ], |
| 91 | type: "cpio", |
| 92 | } |
Jooyung Han | 6afd667 | 2022-02-22 05:22:23 +0900 | [diff] [blame] | 93 | |
| 94 | genrule { |
| 95 | name: "test-payload-metadata", |
| 96 | tools: ["mk_payload"], |
| 97 | cmd: "$(location mk_payload) --metadata-only $(in) $(out)", |
| 98 | srcs: ["test-payload-metadata-config.json"], |
| 99 | out: ["test-payload-metadata.img"], |
| 100 | } |