test/cases/api: don't print command traces

Causes some secrets to be dumped into the logs.
This commit is contained in:
Sanne Raymaekers 2023-09-11 09:51:33 +02:00
parent 522a54188a
commit 1e7e1308ab
2 changed files with 1 additions and 13 deletions

View file

@ -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)

View file

@ -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