From f800bd86f66128dcbff84283c242b8b2ba24a75f Mon Sep 17 00:00:00 2001 From: Dan Mihai Date: Tue, 2 Apr 2024 19:52:36 +0000 Subject: [PATCH] tests: k8s-sandbox-vcpus-allocation.bats policy Use the "allow all" policy for k8s-sandbox-vcpus-allocation.bats, instead of relying on the Kata Guest image to use the same policy as its default. Signed-off-by: Dan Mihai --- .../kubernetes/k8s-sandbox-vcpus-allocation.bats | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/integration/kubernetes/k8s-sandbox-vcpus-allocation.bats b/tests/integration/kubernetes/k8s-sandbox-vcpus-allocation.bats index 0b0d7678e7..8f18c0adee 100644 --- a/tests/integration/kubernetes/k8s-sandbox-vcpus-allocation.bats +++ b/tests/integration/kubernetes/k8s-sandbox-vcpus-allocation.bats @@ -15,11 +15,14 @@ setup() { get_pod_config_dir pods=( "vcpus-less-than-one-with-no-limits" "vcpus-less-than-one-with-limits" "vcpus-more-than-one-with-limits" ) expected_vcpus=( 1 1 2 ) + + yaml_file="${pod_config_dir}/pod-sandbox-vcpus-allocation.yaml" + add_allow_all_policy_to_yaml "${yaml_file}" } @test "Check the number vcpus are correctly allocated to the sandbox" { # Create the pods - kubectl create -f "${pod_config_dir}/pod-sandbox-vcpus-allocation.yaml" + kubectl create -f "${yaml_file}" # Wait for completion kubectl wait --for=jsonpath='{.status.phase}'=Succeeded --timeout=$timeout pod --all @@ -38,5 +41,5 @@ teardown() { kubectl logs ${pod} done - kubectl delete -f "${pod_config_dir}/pod-sandbox-vcpus-allocation.yaml" + kubectl delete -f "${yaml_file}" }