| # Copyright 2018 Google LLC |
| # |
| # Licensed under the Apache License, Version 2.0 (the "License"); |
| # you may not use this file except in compliance with the License. |
| # You may obtain a copy of the License at |
| # |
| # https://www.apache.org/licenses/LICENSE-2.0 |
| # |
| # Unless required by applicable law or agreed to in writing, software |
| # distributed under the License is distributed on an "AS IS" BASIS, |
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| # See the License for the specific language governing permissions and |
| # limitations under the License. |
| |
| import("//build/image/image.gni") |
| import("//build/toolchain/platform.gni") |
| |
| config("config") { |
| include_dirs = [ "inc" ] |
| } |
| |
| group("vmapi") { |
| testonly = true |
| |
| deps = [ |
| ":primary_only_test", |
| ":primary_with_secondaries_test", |
| ":primary_with_state_secondary_test", |
| ] |
| } |
| |
| # Tests with no secondary VMs. |
| vm_kernel("primary_only_test_vm") { |
| testonly = true |
| public_configs = [ "//test/vmapi:config" ] |
| |
| sources = [ |
| "primary_only.c", |
| ] |
| |
| deps = [ |
| "//test/hftest:hftest_primary_vm", |
| ] |
| } |
| |
| initrd("primary_only_test") { |
| testonly = true |
| |
| primary_vm = ":primary_only_test_vm" |
| } |
| |
| # Tests specific to GICv3. |
| vm_kernel("gicv3_test_vm") { |
| testonly = true |
| public_configs = [ "//test/vmapi:config" ] |
| |
| sources = [ |
| "gicv3.c", |
| ] |
| |
| deps = [ |
| "//src/arch/${plat_arch}/hftest:interrupts_gicv3", |
| "//test/hftest:hftest_primary_vm", |
| ] |
| } |
| |
| initrd("gicv3_test") { |
| testonly = true |
| |
| primary_vm = ":gicv3_test_vm" |
| } |
| |
| # Tests with secondary VMs. |
| vm_kernel("primary_with_secondaries_test_vm") { |
| testonly = true |
| public_configs = [ "//test/vmapi:config" ] |
| |
| sources = [ |
| "primary_with_secondaries.c", |
| ] |
| |
| deps = [ |
| "//test/hftest:hftest_primary_vm", |
| ] |
| } |
| |
| initrd("primary_with_secondaries_test") { |
| testonly = true |
| |
| primary_vm = ":primary_with_secondaries_test_vm" |
| secondary_vms = [ |
| [ |
| "1048576", |
| "1", |
| "relay_a", |
| "//test/vmapi/secondaries:relay_a", |
| ], |
| [ |
| "1048576", |
| "1", |
| "relay_b", |
| "//test/vmapi/secondaries:relay_b", |
| ], |
| [ |
| "1048576", |
| "1", |
| "echo", |
| "//test/vmapi/secondaries:echo", |
| ], |
| [ |
| "1048576", |
| "1", |
| "interruptible", |
| "//test/vmapi/secondaries:interruptible", |
| ], |
| ] |
| } |
| |
| # Tests with state test secondary VM. |
| vm_kernel("primary_with_state_secondary_test_vm") { |
| testonly = true |
| |
| sources = [ |
| "primary_for_state_test.c", |
| ] |
| |
| deps = [ |
| "//test/hftest:hftest_primary_vm", |
| ] |
| } |
| |
| initrd("primary_with_state_secondary_test") { |
| testonly = true |
| |
| primary_vm = ":primary_with_state_secondary_test_vm" |
| secondary_vms = [ [ |
| "1048576", |
| "1", |
| "check_state", |
| "//test/vmapi/secondaries:check_state", |
| ] ] |
| } |