Merge pull request #10202 from BbolroC/fix-k8s-tests-s390x

tests: Fix k8s test issues on s390x
This commit is contained in:
Hyounggyu Choi 2024-08-23 09:51:11 +02:00 committed by GitHub
commit 4cd83d2b98
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 3 deletions

View File

@ -7,6 +7,7 @@
load "${BATS_TEST_DIRNAME}/lib.sh" load "${BATS_TEST_DIRNAME}/lib.sh"
load "${BATS_TEST_DIRNAME}/confidential_common.sh" load "${BATS_TEST_DIRNAME}/confidential_common.sh"
load "${BATS_TEST_DIRNAME}/confidential_kbs.sh"
setup() { setup() {
if ! is_confidential_runtime_class; then if ! is_confidential_runtime_class; then

View File

@ -37,9 +37,11 @@ k8s_wait_pod_be_ready() {
# #
# Parameters: # Parameters:
# $1 - the pod configuration file. # $1 - the pod configuration file.
# $2 - wait time in seconds. Defaults to 120. (optional)
# #
k8s_create_pod() { k8s_create_pod() {
local config_file="$1" local config_file="$1"
local wait_time="${2:-120}"
local pod_name="" local pod_name=""
if [ ! -f "${config_file}" ]; then if [ ! -f "${config_file}" ]; then
@ -53,11 +55,11 @@ k8s_create_pod() {
return 1 return 1
fi fi
if ! k8s_wait_pod_be_ready "$pod_name"; then if ! k8s_wait_pod_be_ready "${pod_name}" "${wait_time}"; then
# TODO: run this command for debugging. Maybe it should be # TODO: run this command for debugging. Maybe it should be
# guarded by DEBUG=true? # guarded by DEBUG=true?
kubectl get pods "$pod_name" kubectl get pods "${pod_name}"
kubectl describe pod "$pod_name" kubectl describe pod "${pod_name}"
return 1 return 1
fi fi
} }