From d57d263a6c9e6a4fe51e245b2308f58685ed006f Mon Sep 17 00:00:00 2001 From: stevenhorsman Date: Mon, 21 Jul 2025 11:28:20 +0100 Subject: [PATCH] tests/k8s: call teardown_common in k8s-job.bats The teardown_common will print the description of the running pods, kill them all and print the system's syslogs afterwards. Signed-off-by: stevenhorsman --- tests/integration/kubernetes/k8s-job.bats | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tests/integration/kubernetes/k8s-job.bats b/tests/integration/kubernetes/k8s-job.bats index 9b64d4dec3..4584d0224c 100644 --- a/tests/integration/kubernetes/k8s-job.bats +++ b/tests/integration/kubernetes/k8s-job.bats @@ -6,12 +6,15 @@ # load "${BATS_TEST_DIRNAME}/../../common.bash" +load "${BATS_TEST_DIRNAME}/lib.sh" load "${BATS_TEST_DIRNAME}/tests_common.sh" setup() { + setup_common get_pod_config_dir job_name="job-pi-test" yaml_file="${pod_config_dir}/job.yaml" + set_node "${yaml_file}" "${node}" policy_settings_dir="$(create_tmp_policy_settings_dir "${pod_config_dir}")" add_requests_to_policy_settings "${policy_settings_dir}" "ReadStreamRequest" @@ -52,8 +55,10 @@ teardown() { kubectl delete jobs/"$job_name" # Verify that the job is not running run kubectl get jobs - echo "$output" - [[ "$output" =~ "No resources found" ]] + echo "${output}" + [[ "${output}" =~ "No resources found" ]] delete_tmp_policy_settings_dir "${policy_settings_dir}" + + teardown_common "${node}" "${node_start_time:-}" }