From 2bc5b1bba25320111ae8afd159ca1d42b46479c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= Date: Thu, 9 May 2024 12:01:38 +0200 Subject: [PATCH] tests: pull-image: Only skip tests for TEEs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On 1423420, I've mistakenly disabled the tests entirely, for both non-TEEs and TEEs. This happened as I didn't realise that `confidential_setup` would take non-TEEs into consideration. :-/ Now, let me follow-up on that and make sure that the tests will be running on non-TEEs. Signed-off-by: Fabiano FidĂȘncio --- .../kubernetes/k8s-guest-pull-image.bats | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/tests/integration/kubernetes/k8s-guest-pull-image.bats b/tests/integration/kubernetes/k8s-guest-pull-image.bats index a0962a20dc..cd03dc3b1c 100644 --- a/tests/integration/kubernetes/k8s-guest-pull-image.bats +++ b/tests/integration/kubernetes/k8s-guest-pull-image.bats @@ -9,10 +9,14 @@ load "${BATS_TEST_DIRNAME}/lib.sh" load "${BATS_TEST_DIRNAME}/confidential_common.sh" setup() { - if is_confidential_runtime_class; then + if is_confidential_hardware; then skip "Due to issues related to pull-image integration skip tests for ${KATA_HYPERVISOR}." fi + if ! is_confidential_runtime_class; then + skip "Test not supported for ${KATA_HYPERVISOR}." + fi + [ "${SNAPSHOTTER:-}" = "nydus" ] || skip "None snapshotter was found but this test requires one" setup_common @@ -22,10 +26,14 @@ setup() { } @test "Test we can pull an unencrypted image outside the guest with runc and then inside the guest successfully" { - if is_confidential_runtime_class; then + if is_confidential_hardware; then skip "Due to issues related to pull-image integration skip tests for ${KATA_HYPERVISOR}." fi + if ! is_confidential_runtime_class; then + skip "Test not supported for ${KATA_HYPERVISOR}." + fi + # 1. Create one runc pod with the $unencrypted_image_1 image # We want to have one runc pod, so we pass a fake runtimeclass "runc" and then delete the runtimeClassName, # because the runtimeclass is not optional in new_pod_config function. @@ -220,10 +228,14 @@ setup() { } teardown() { - if is_confidential_runtime_class; then + if is_confidential_hardware; then skip "Due to issues related to pull-image integration skip tests for ${KATA_HYPERVISOR}." fi + if ! is_confidential_runtime_class; then + skip "Test not supported for ${KATA_HYPERVISOR}." + fi + [ "${SNAPSHOTTER:-}" = "nydus" ] || skip "None snapshotter was found but this test requires one" kubectl describe pod "$pod_name"