From e286e842c1a0025d95b526978b56f7ee2a608a93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= Date: Mon, 28 Aug 2023 21:37:20 +0200 Subject: [PATCH] tests: Expand confidential test to support TDX MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Let's expand the confidential test to also support TDX. The main difference on the test, though, is that we're not grepping for a string in the `dmesg` output, but rather relying on `cpuid` to detect a TDX guest. Fixes: #7184 Signed-off-by: Fabiano FidĂȘncio --- tests/integration/kubernetes/confidential_common.sh | 1 + tests/integration/kubernetes/k8s-confidential.bats | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/integration/kubernetes/confidential_common.sh b/tests/integration/kubernetes/confidential_common.sh index 3260fac52c..0e049cadd9 100644 --- a/tests/integration/kubernetes/confidential_common.sh +++ b/tests/integration/kubernetes/confidential_common.sh @@ -28,6 +28,7 @@ function get_remote_command_per_hypervisor() { declare -A REMOTE_COMMAND_PER_HYPERVISOR REMOTE_COMMAND_PER_HYPERVISOR[qemu-sev]="dmesg | grep \"Memory Encryption Features active:.*\(SEV$\|SEV \)\"" REMOTE_COMMAND_PER_HYPERVISOR[qemu-snp]="dmesg | grep \"Memory Encryption Features active:.*SEV-SNP\"" + REMOTE_COMMAND_PER_HYPERVISOR[qemu-tdx]="cpuid | grep TDX_GUEST" echo "${REMOTE_COMMAND_PER_HYPERVISOR[${KATA_HYPERVISOR}]}" } diff --git a/tests/integration/kubernetes/k8s-confidential.bats b/tests/integration/kubernetes/k8s-confidential.bats index 915cc65315..c78c7d5184 100644 --- a/tests/integration/kubernetes/k8s-confidential.bats +++ b/tests/integration/kubernetes/k8s-confidential.bats @@ -10,7 +10,7 @@ load "${BATS_TEST_DIRNAME}/confidential_common.sh" load "${BATS_TEST_DIRNAME}/tests_common.sh" setup() { - SUPPORTED_HYPERVISORS=("qemu-sev" "qemu-snp") + SUPPORTED_HYPERVISORS=("qemu-sev" "qemu-snp" "qemu-tdx") # This check must be done with "${KATA_HYPERVISOR}" to avoid # having substrings, like qemu, being matched with qemu-$something.