diff --git a/docs/how-to/ccv0.sh b/docs/how-to/ccv0.sh index 45176f2f19..11110875ad 100755 --- a/docs/how-to/ccv0.sh +++ b/docs/how-to/ccv0.sh @@ -51,29 +51,20 @@ export CONTAINER_ID="${CONTAINER_ID:-0123456789}" source /etc/os-release || source /usr/lib/os-release grep -Eq "\" /etc/os-release 2> /dev/null && export USE_PODMAN=true -export BATS_TEST_DIRNAME="${tests_repo_dir}/integration/containerd/confidential" + # If we've already checked out the test repo then source the confidential scripts -[ -d "${BATS_TEST_DIRNAME}" ] && source "${BATS_TEST_DIRNAME}/lib.sh" +if [ "${KUBERNETES}" == "yes" ]; then + export BATS_TEST_DIRNAME="${tests_repo_dir}/integration/kubernetes/confidential" + [ -d "${BATS_TEST_DIRNAME}" ] && source "${BATS_TEST_DIRNAME}/lib.sh" +else + export BATS_TEST_DIRNAME="${tests_repo_dir}/integration/containerd/confidential" + [ -d "${BATS_TEST_DIRNAME}" ] && source "${BATS_TEST_DIRNAME}/lib.sh" +fi + +[ -d "${BATS_TEST_DIRNAME}" ] && source "${BATS_TEST_DIRNAME}/../../confidential/lib.sh" export RUNTIME_CONFIG_PATH=/etc/kata-containers/configuration.toml -debug_output() { - if [ -n "${DEBUG}" ] - then - echo "$(date): $@" - fi -} - -debug_function() { - debug_output "> $@" - start=$(date +%s%N | cut -b1-13) - $@; - status=$? - end=$(date +%s%N | cut -b1-13) - time=`expr ${end} - ${start}` - debug_output "< $@. Time taken: $(echo "scale=2; ${time} / 1000" | bc -l)s. RC: ${status}" -} - usage() { exit_code="$1" cat <