From 2c0bc8855b7693cc63d8b8366c90cea7c3e1a3a9 Mon Sep 17 00:00:00 2001 From: ChengyuZhu6 Date: Mon, 4 Mar 2024 17:42:36 +0800 Subject: [PATCH] tests: Make sure to install yq before using it Make sure to install yq before using it to modify YAML files. Signed-off-by: ChengyuZhu6 --- tests/integration/kubernetes/confidential_common.sh | 2 ++ tests/integration/kubernetes/lib.sh | 1 + 2 files changed, 3 insertions(+) diff --git a/tests/integration/kubernetes/confidential_common.sh b/tests/integration/kubernetes/confidential_common.sh index b46207ca66..a97b863101 100644 --- a/tests/integration/kubernetes/confidential_common.sh +++ b/tests/integration/kubernetes/confidential_common.sh @@ -6,6 +6,7 @@ # source "${BATS_TEST_DIRNAME}/tests_common.sh" +source "${BATS_TEST_DIRNAME}/../../common.bash" SUPPORTED_TEE_HYPERVISORS=("qemu-sev" "qemu-snp" "qemu-tdx" "qemu-se") SUPPORTED_NON_TEE_HYPERVISORS=("qemu") @@ -53,6 +54,7 @@ function check_hypervisor_for_confidential_tests() { # Common setup for confidential tests. function confidential_setup() { + ensure_yq if ! check_hypervisor_for_confidential_tests "${KATA_HYPERVISOR}"; then return 1 elif [[ " ${SUPPORTED_NON_TEE_HYPERVISORS[*]} " =~ " ${KATA_HYPERVISOR} " ]]; then diff --git a/tests/integration/kubernetes/lib.sh b/tests/integration/kubernetes/lib.sh index 6aee780c79..5e498ab00e 100644 --- a/tests/integration/kubernetes/lib.sh +++ b/tests/integration/kubernetes/lib.sh @@ -203,6 +203,7 @@ set_container_command() { local yaml="${1}" local container_idx="${2}" shift 2 + for command_value in "$@"; do yq write -i "${yaml}" "spec.containers[${container_idx}].command[+]" --tag '!!str' "${command_value}" done