From eb5b7d3bf8ab273b98fa8016ab3d3fcf5c47c212 Mon Sep 17 00:00:00 2001 From: Gabriela Cervantes Date: Mon, 11 Dec 2023 15:52:29 +0000 Subject: [PATCH] tests: k8s: Enable tests for cloud hypervisor runtime-rs This PR enable the k8s tests for cloud hypervisor runtime-rs. Fixes #8627 Signed-off-by: Gabriela Cervantes --- tests/integration/kubernetes/gha-run.sh | 6 ++---- tests/integration/kubernetes/k8s-cpu-ns.bats | 3 +++ .../kubernetes/k8s-sandbox-vcpus-allocation.bats | 4 ++-- tests/integration/kubernetes/k8s-scale-nginx.bats | 1 - 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/integration/kubernetes/gha-run.sh b/tests/integration/kubernetes/gha-run.sh index 86c7da7f9e..f1308b87d8 100755 --- a/tests/integration/kubernetes/gha-run.sh +++ b/tests/integration/kubernetes/gha-run.sh @@ -173,10 +173,8 @@ function run_tests() { pushd "${kubernetes_dir}" bash setup.sh - if [[ "${KATA_HYPERVISOR}" = "dragonball" ]] && [[ "${SNAPSHOTTER}" = "devmapper" ]]; then - echo "Skipping tests for dragonball using devmapper" - elif [[ "${KATA_HYPERVISOR}" = "cloud-hypervisor" ]]; then - echo "Skipping tests for ${KATA_HYPERVISOR}" + if [[ "${KATA_HYPERVISOR}" = "dragonball" ]] && [[ "${SNAPSHOTTER}" = "devmapper" ]] || [[ "${KATA_HYPERVISOR}" = "cloud-hypervisor" ]] && [[ "${SNAPSHOTTER}" = "devmapper" ]]; then + echo "Skipping tests for $KATA_HYPERVISOR using devmapper" else bash run_kubernetes_tests.sh fi diff --git a/tests/integration/kubernetes/k8s-cpu-ns.bats b/tests/integration/kubernetes/k8s-cpu-ns.bats index c3183698cb..07b3dd1643 100644 --- a/tests/integration/kubernetes/k8s-cpu-ns.bats +++ b/tests/integration/kubernetes/k8s-cpu-ns.bats @@ -10,6 +10,7 @@ load "${BATS_TEST_DIRNAME}/tests_common.sh" setup() { [ "${KATA_HYPERVISOR}" == "firecracker" ] && skip "test not working see: ${fc_limitations}" + [ "${KATA_HYPERVISOR}" == "cloud-hypervisor" ] && skip "test not working https://github.com/kata-containers/kata-containers/issues/8965" [ "${KATA_HYPERVISOR}" == "fc" ] && skip "test not working see: ${fc_limitations}" [ "${KATA_HYPERVISOR}" == "dragonball" ] && skip "test not working see: ${dragonball_limitations}" ( [ "${KATA_HYPERVISOR}" == "qemu-tdx" ] || [ "${KATA_HYPERVISOR}" == "qemu-snp" ] || \ @@ -30,6 +31,7 @@ setup() { } @test "Check CPU constraints" { + [ "${KATA_HYPERVISOR}" == "cloud-hypervisor" ] && skip "test not working https://github.com/kata-containers/kata-containers/issues/8965" # Create the pod kubectl create -f "${pod_config_dir}/pod-cpu.yaml" @@ -72,6 +74,7 @@ setup() { teardown() { [ "${KATA_HYPERVISOR}" == "firecracker" ] && skip "test not working see: ${fc_limitations}" + [ "${KATA_HYPERVISOR}" == "cloud-hypervisor" ] && skip "test not working https://github.com/kata-containers/kata-containers/issues/8965" [ "${KATA_HYPERVISOR}" == "fc" ] && skip "test not working see: ${fc_limitations}" [ "${KATA_HYPERVISOR}" == "dragonball" ] && skip "test not working see: ${dragonball_limitations}" ( [ "${KATA_HYPERVISOR}" == "qemu-tdx" ] || [ "${KATA_HYPERVISOR}" == "qemu-snp" ] || \ diff --git a/tests/integration/kubernetes/k8s-sandbox-vcpus-allocation.bats b/tests/integration/kubernetes/k8s-sandbox-vcpus-allocation.bats index 2f0a872c00..e39ba044b6 100644 --- a/tests/integration/kubernetes/k8s-sandbox-vcpus-allocation.bats +++ b/tests/integration/kubernetes/k8s-sandbox-vcpus-allocation.bats @@ -9,7 +9,7 @@ load "${BATS_TEST_DIRNAME}/../../common.bash" load "${BATS_TEST_DIRNAME}/tests_common.sh" setup() { - [ "${KATA_HYPERVISOR}" == "dragonball" ] && \ + [ "${KATA_HYPERVISOR}" == "dragonball" ] || [ "${KATA_HYPERVISOR}" == "cloud-hypervisor" ]&& \ skip "runtime-rs is still using the old vcpus allocation algorithm, skipping the test" get_pod_config_dir @@ -29,7 +29,7 @@ setup() { } teardown() { - [ "${KATA_HYPERVISOR}" == "dragonball" ] && \ + [ "${KATA_HYPERVISOR}" == "dragonball" ] || [ "${KATA_HYPERVISOR}" == "cloud-hypervisor" ] && \ skip "runtime-rs is still using the old vcpus allocation algorithm, skipping the test" for pod in "${pods[@]}"; do diff --git a/tests/integration/kubernetes/k8s-scale-nginx.bats b/tests/integration/kubernetes/k8s-scale-nginx.bats index 3f11236f38..81b172b851 100644 --- a/tests/integration/kubernetes/k8s-scale-nginx.bats +++ b/tests/integration/kubernetes/k8s-scale-nginx.bats @@ -17,7 +17,6 @@ setup() { } @test "Scale nginx deployment" { - sed -e "s/\${nginx_version}/${nginx_image}/" \ "${pod_config_dir}/${deployment}.yaml" > "${pod_config_dir}/test-${deployment}.yaml"