test: Add journal logging for debug

- Due to the error we hit with pulling the agnhost
image used in the liveness-probe tests, we want to leave
the console printing to help with debug when we next try
to bump the image-rs version

Signed-off-by: stevenhorsman <steven@uk.ibm.com>
This commit is contained in:
stevenhorsman
2024-06-28 16:30:43 +01:00
parent d511820974
commit 1d6c1d1621

View File

@@ -5,6 +5,7 @@
# SPDX-License-Identifier: Apache-2.0
#
load "${BATS_TEST_DIRNAME}/lib.sh"
load "${BATS_TEST_DIRNAME}/../../common.bash"
load "${BATS_TEST_DIRNAME}/tests_common.sh"
@@ -13,6 +14,7 @@ setup() {
agnhost_name="${container_images_agnhost_name}"
agnhost_version="${container_images_agnhost_version}"
setup_common
get_pod_config_dir
}
@@ -21,6 +23,7 @@ setup() {
yaml_file="${pod_config_dir}/probe-pod-liveness.yaml"
cp "${pod_config_dir}/pod-liveness.yaml" "${yaml_file}"
set_node "${yaml_file}" "$node"
add_allow_all_policy_to_yaml "${yaml_file}"
# Create pod
@@ -45,7 +48,7 @@ setup() {
sed -e "s#\${agnhost_image}#${agnhost_name}:${agnhost_version}#" \
"${pod_config_dir}/pod-http-liveness.yaml" > "${yaml_file}"
set_node "${yaml_file}" "$node"
add_allow_all_policy_to_yaml "${yaml_file}"
# Create pod
@@ -71,7 +74,7 @@ setup() {
sed -e "s#\${agnhost_image}#${agnhost_name}:${agnhost_version}#" \
"${pod_config_dir}/pod-tcp-liveness.yaml" > "${yaml_file}"
set_node "${yaml_file}" "$node"
add_allow_all_policy_to_yaml "${yaml_file}"
# Create pod
@@ -95,4 +98,9 @@ teardown() {
kubectl delete pod "$pod_name"
rm -f "${yaml_file}"
if [[ -n "${node_start_time}:-}" && -z "$BATS_TEST_COMPLETED" ]]; then
echo "DEBUG: system logs of node '$node' since test start time ($node_start_time)"
print_node_journal "$node" "kata" --since "$node_start_time" || true
fi
}