@@ -9,6 +9,7 @@
#include <linux/stringify.h>
#include <stdint.h>
+#include "kselftest_harness.h"
#include "apic.h"
#include "test_util.h"
#include "kvm_util.h"
@@ -126,10 +127,19 @@ static void test_fix_hypercall(bool disable_quirk)
enter_guest(vcpu);
}
-int main(void)
+TEST(fix_hypercall)
{
- TEST_REQUIRE(kvm_check_cap(KVM_CAP_DISABLE_QUIRKS2) & KVM_X86_QUIRK_FIX_HYPERCALL_INSN);
-
test_fix_hypercall(false);
+}
+
+TEST(fix_hypercall_disable_quirk)
+{
test_fix_hypercall(true);
}
+
+int main(int argc, char *argv[])
+{
+ TEST_REQUIRE(kvm_check_cap(KVM_CAP_DISABLE_QUIRKS2) & KVM_X86_QUIRK_FIX_HYPERCALL_INSN);
+
+ return test_harness_run(argc, argv);
+}
Use the kselftest_harness.h interface in this test to get TAP output, so that it is easier for the user to see what the test is doing. Signed-off-by: Thomas Huth <thuth@redhat.com> --- .../selftests/kvm/x86_64/fix_hypercall_test.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-)