From 1e7e1308ab3785eb9717dac117d2cc7426e09df9 Mon Sep 17 00:00:00 2001 From: Sanne Raymaekers Date: Mon, 11 Sep 2023 09:51:33 +0200 Subject: [PATCH] test/cases/api: don't print command traces Causes some secrets to be dumped into the logs. --- test/cases/api.sh | 12 +----------- test/cases/api/azure.sh | 2 -- 2 files changed, 1 insertion(+), 13 deletions(-) diff --git a/test/cases/api.sh b/test/cases/api.sh index 4d68676ee..fa2f4c09e 100755 --- a/test/cases/api.sh +++ b/test/cases/api.sh @@ -5,12 +5,6 @@ # uploading it to the appropriate cloud provider. The test currently supports # AWS and GCP. # -# This script sets `-x` and is meant to always be run like that. This is -# simpler than adding extensive error reporting, which would make this script -# considerably more complex. Also, the full trace this produces is very useful -# for the primary audience: developers of osbuild-composer looking at the log -# from a run on a remote continuous integration system. -# # # Cloud provider / target names @@ -49,7 +43,7 @@ if (( $# == 0 )); then exit 1 fi -set -euxo pipefail +set -euo pipefail IMAGE_TYPE="$1" @@ -198,13 +192,9 @@ checkEnv [[ "$ID" == "rhel" ]] && printenv API_TEST_SUBSCRIPTION_ORG_ID API_TEST_SUBSCRIPTION_ACTIVATION_KEY_V2 > /dev/null function dump_db() { - # Disable -x for these commands to avoid printing the whole result and manifest into the log - set +x - # Save the result, including the manifest, for the job, straight from the db sudo "${CONTAINER_RUNTIME}" exec "${DB_CONTAINER_NAME}" psql -U postgres -d osbuildcomposer -c "SELECT result FROM jobs WHERE type='manifest-id-only'" \ | sudo tee "${ARTIFACTS}/build-result.txt" - set -x } WORKDIR=$(mktemp -d) diff --git a/test/cases/api/azure.sh b/test/cases/api/azure.sh index 347295ede..c3d476df5 100644 --- a/test/cases/api/azure.sh +++ b/test/cases/api/azure.sh @@ -110,9 +110,7 @@ function checkUploadStatusOptions() { # Log into Azure function cloud_login() { - set +x $AZURE_CMD login --service-principal --username "${V2_AZURE_CLIENT_ID}" --password "${V2_AZURE_CLIENT_SECRET}" --tenant "${AZURE_TENANT_ID}" - set -x } # Verify image in Azure