mirror of
https://github.com/torvalds/linux.git
synced 2026-04-25 18:12:26 -04:00
The kunit_test_suite() macro previously conflicted with module_init, making it unsuitable for use in the nitro_enclaves test. Now that it's fixed, we can use it instead of a custom call into internal KUnit functions to run the test. As a side-effect, this means that the test results are properly included with other suites when built-in. To celebrate, enable the test by default when KUNIT_ALL_TESTS is set (and NITRO_ENCLAVES enabled). The nitro_enclave tests can now be run via kunit_tool with: ./tools/testing/kunit/kunit.py run --arch=x86_64 \ --kconfig_add CONFIG_PCI=y --kconfig_add CONFIG_SMP=y \ --kconfig_add CONFIG_HOTPLUG_CPU=y \ --kconfig_add CONFIG_VIRT_DRIVERS=y \ --kconfig_add CONFIG_NITRO_ENCLAVES=y \ 'ne_misc_dev_test' (This is a pretty long command, so it may be worth adding a .kunitconfig file at some point, instead.) Reviewed-by: Andra Paraschiv <andraprs@amazon.com> Acked-by: Brendan Higgins <brendanhiggins@google.com> Signed-off-by: David Gow <davidgow@google.com> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
27 lines
945 B
Plaintext
27 lines
945 B
Plaintext
# SPDX-License-Identifier: GPL-2.0
|
|
#
|
|
# Copyright 2020-2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
|
|
# Amazon Nitro Enclaves (NE) support.
|
|
# Nitro is a hypervisor that has been developed by Amazon.
|
|
|
|
config NITRO_ENCLAVES
|
|
tristate "Nitro Enclaves Support"
|
|
depends on (ARM64 || X86) && HOTPLUG_CPU && PCI && SMP
|
|
help
|
|
This driver consists of support for enclave lifetime management
|
|
for Nitro Enclaves (NE).
|
|
|
|
To compile this driver as a module, choose M here.
|
|
The module will be called nitro_enclaves.
|
|
|
|
config NITRO_ENCLAVES_MISC_DEV_TEST
|
|
bool "Tests for the misc device functionality of the Nitro Enclaves" if !KUNIT_ALL_TESTS
|
|
depends on NITRO_ENCLAVES && KUNIT
|
|
default KUNIT_ALL_TESTS
|
|
help
|
|
Enable KUnit tests for the misc device functionality of the Nitro
|
|
Enclaves. Select this option only if you will boot the kernel for
|
|
the purpose of running unit tests (e.g. under UML or qemu). If
|
|
unsure, say N.
|