diff --git a/test/cases/aws.sh b/test/cases/aws.sh index 56384d071..5da755cb2 100755 --- a/test/cases/aws.sh +++ b/test/cases/aws.sh @@ -161,7 +161,7 @@ trap - EXIT # Did the compose finish with success? if [[ $COMPOSE_STATUS != FINISHED ]]; then - echo "Something went wrong with the compose. 😢" + redprint "Something went wrong with the compose. 😢" exit 1 fi @@ -187,19 +187,19 @@ if nvrGreaterOrEqual "osbuild-composer" "83"; then aarch64) # aarch64 image supports only uefi boot mode if [[ "$AMI_BOOT_MODE" != "uefi" ]]; then - echo "AMI boot mode is not \"uefi\", but \"$AMI_BOOT_MODE\"" + redprint "AMI boot mode is not \"uefi\", but \"$AMI_BOOT_MODE\"" exit 1 fi ;; x86_64) # x86_64 image supports hybrid boot mode with preference for uefi if [[ "$AMI_BOOT_MODE" != "uefi-preferred" ]]; then - echo "AMI boot mode is not \"uefi-preferred\", but \"$AMI_BOOT_MODE\"" + redprint "AMI boot mode is not \"uefi-preferred\", but \"$AMI_BOOT_MODE\"" exit 1 fi ;; *) - echo "Unsupported architecture: $ARCH" + redprint "Unsupported architecture: $ARCH" exit 1 ;; esac @@ -249,7 +249,7 @@ if [ "$ARCH" == "aarch64" ]; then fi if [ -z "$CIV_CONFIG_FILE" ]; then - echo "ERROR: please provide the variable CIV_CONFIG_FILE" + redprint "ERROR: please provide the variable CIV_CONFIG_FILE" exit 1 fi @@ -289,7 +289,7 @@ if [[ $RESULTS == 1 ]]; then greenprint "💚 Success" exit 0 elif [[ $RESULTS != 1 ]]; then - greenprint "❌ Failed" + redprint "❌ Failed" exit 1 fi diff --git a/test/cases/azure.sh b/test/cases/azure.sh index 09c23f659..91b5cbc06 100755 --- a/test/cases/azure.sh +++ b/test/cases/azure.sh @@ -188,7 +188,7 @@ trap - EXIT # Did the compose finish with success? if [[ $COMPOSE_STATUS != FINISHED ]]; then - echo "Something went wrong with the compose. 😢" + redprint "Something went wrong with the compose. 😢" exit 1 fi @@ -226,7 +226,7 @@ tee "${TEMPDIR}/resource-file.json" < /dev/null clean_up -echo "🎉 All tests passed." +greenprint "🎉 All tests passed." exit 0 diff --git a/test/cases/image_tests.sh b/test/cases/image_tests.sh index 75aa5781b..367e29412 100755 --- a/test/cases/image_tests.sh +++ b/test/cases/image_tests.sh @@ -79,7 +79,7 @@ run_test_case () { echo test_divider - echo "🏃🏻 Running test: ${TEST_NAME}" + greenprint "🏃🏻 Running test: ${TEST_NAME}" test_divider TEST_CMD="env BRANCH_NAME=${BRANCH_NAME-main} BUILD_ID=$BUILD_ID DISTRO_CODE=$DISTRO_CODE $TEST_RUNNER -test.v ${IMAGE_TEST_CASES_PATH}/${TEST_CASE_FILENAME}" @@ -114,15 +114,15 @@ done # Print a report of the test results. test_divider -echo "😃 Passed tests: " "${PASSED_TESTS[@]}" -echo "☹ Failed tests: " "${FAILED_TESTS[@]}" +greenprint "😃 Passed tests: " "${PASSED_TESTS[@]}" +redprint "☹ Failed tests: " "${FAILED_TESTS[@]}" test_divider # Exit with a failure if tests were executed and any of them failed. if [ ${#PASSED_TESTS[@]} -gt 0 ] && [ ${#FAILED_TESTS[@]} -eq 0 ]; then - echo "🎉 All tests passed." + greenprint "🎉 All tests passed." exit 0 else - echo "🔥 One or more tests failed." + redprint "🔥 One or more tests failed." exit 1 fi diff --git a/test/cases/installers.sh b/test/cases/installers.sh index 31086d1ab..b4451297b 100755 --- a/test/cases/installers.sh +++ b/test/cases/installers.sh @@ -137,7 +137,7 @@ case "${ID}-${VERSION_ID}" in OS_VARIANT="centos-stream9" ;; *) - echo "unsupported distro: ${ID}-${VERSION_ID}" + redprint "unsupported distro: ${ID}-${VERSION_ID}" exit 1;; esac TEST_UUID=$(uuidgen) @@ -226,7 +226,7 @@ build_image() { # Did the compose finish with success? if [[ $COMPOSE_STATUS != FINISHED ]]; then - echo "Something went wrong with the compose. 😢" + redprint "Something went wrong with the compose. 😢" exit 1 fi @@ -265,7 +265,7 @@ check_result () { if [[ $RESULTS == 1 ]]; then greenprint "💚 Success" else - greenprint "❌ Failed" + redprint "❌ Failed" clean_up exit 1 fi diff --git a/test/cases/minimal-raw.sh b/test/cases/minimal-raw.sh index 714d3a181..eb013fc49 100755 --- a/test/cases/minimal-raw.sh +++ b/test/cases/minimal-raw.sh @@ -109,7 +109,7 @@ case "${ID}-${VERSION_ID}" in OS_VARIANT="fedora-rawhide" ;; *) - echo "unsupported distro: ${ID}-${VERSION_ID}" + redprint "unsupported distro: ${ID}-${VERSION_ID}" exit 1;; esac @@ -184,7 +184,7 @@ build_image() { # Did the compose finish with success? if [[ $COMPOSE_STATUS != FINISHED ]]; then - echo "Something went wrong with the compose. 😢" + redprint "Something went wrong with the compose. 😢" exit 1 fi } @@ -221,7 +221,7 @@ check_result () { if [[ $RESULTS == 1 ]]; then greenprint "💚 Success" else - greenprint "❌ Failed" + redprint "❌ Failed" clean_up exit 1 fi diff --git a/test/cases/oscap.sh b/test/cases/oscap.sh index d242d09a3..f25ed4595 100755 --- a/test/cases/oscap.sh +++ b/test/cases/oscap.sh @@ -96,7 +96,7 @@ case "${ID}-${VERSION_ID}" in DATASTREAM="/usr/share/xml/scap/ssg/content/ssg-rhel9-ds.xml" ;; *) - echo "$0 should be skipped on ${ID}-${VERSION_ID} check gitlab-ci.yml" + redprint "$0 should be skipped on ${ID}-${VERSION_ID} check gitlab-ci.yml" exit 1 ;; esac @@ -198,7 +198,7 @@ build_image() { # Did the compose finish with success? if [[ ${COMPOSE_STATUS} != FINISHED ]]; then - echo "Something went wrong with the compose. 😢" + redprint "Something went wrong with the compose. 😢" exit 1 fi } @@ -224,7 +224,7 @@ wait_for_ssh_up () { done if [[ ${RESULTS} == 0 ]]; then clean_up "${1}" - echo "SSH failed to become ready 😢" + redprint "SSH failed to become ready 😢" exit 1 fi } @@ -473,7 +473,7 @@ echo "Hardened score: ${HARDENED_SCORE}%" # compare floating point numbers if python3 -c "exit(${HARDENED_SCORE} > ${BASELINE_SCORE})"; then - greenprint "❌ Failed" + redprint "❌ Failed" echo "Hardened image did not improve baseline score" exit 1 fi @@ -481,7 +481,7 @@ fi # one grub rule fails (expected) # check if any other rules have failed if [[ ${SEVERITY} -gt 1 ]]; then - greenprint "❌ Failed" + redprint "❌ Failed" echo "More than one oscap rule with high severity failed" exit 1 fi diff --git a/test/cases/ostree-ami-image.sh b/test/cases/ostree-ami-image.sh index 47f1d1247..b6b27101b 100755 --- a/test/cases/ostree-ami-image.sh +++ b/test/cases/ostree-ami-image.sh @@ -90,7 +90,7 @@ case "${ID}-${VERSION_ID}" in SYSROOT_RO="true" ;; *) - echo "unsupported distro: ${ID}-${VERSION_ID}" + redprint "unsupported distro: ${ID}-${VERSION_ID}" exit 1;; esac @@ -169,7 +169,7 @@ build_image() { # Did the compose finish with success? if [[ $COMPOSE_STATUS != FINISHED ]]; then - echo "Something went wrong with the compose. 😢" + redprint "Something went wrong with the compose. 😢" exit 1 fi } @@ -246,7 +246,7 @@ check_result () { if [[ $RESULTS == 1 ]]; then greenprint "💚 Success" else - greenprint "❌ Failed" + redprint "❌ Failed" clean_up exit 1 fi @@ -573,7 +573,7 @@ while true; do done if [[ $IMPORT_STATUS != completed ]]; then - echo "Something went wrong with the snapshot. 😢" + redprint "Something went wrong with the snapshot. 😢" exit 1 else greenprint "Snapshot imported successfully." diff --git a/test/cases/ostree-ignition.sh b/test/cases/ostree-ignition.sh index e3114e1a5..02aa8b795 100755 --- a/test/cases/ostree-ignition.sh +++ b/test/cases/ostree-ignition.sh @@ -126,7 +126,7 @@ case "${ID}-${VERSION_ID}" in BOOT_ARGS="uefi,firmware.feature0.name=secure-boot,firmware.feature0.enabled=no" ;; *) - echo "unsupported distro: ${ID}-${VERSION_ID}" + redprint "unsupported distro: ${ID}-${VERSION_ID}" exit 1;; esac @@ -206,7 +206,7 @@ build_image() { # Did the compose finish with success? if [[ $COMPOSE_STATUS != FINISHED ]]; then - echo "Something went wrong with the compose. 😢" + redprint "Something went wrong with the compose. 😢" exit 1 fi } @@ -248,7 +248,7 @@ check_result () { if [[ $RESULTS == 1 ]]; then greenprint "💚 Success" else - greenprint "❌ Failed" + redprint "❌ Failed" clean_up exit 1 fi diff --git a/test/cases/ostree-ng.sh b/test/cases/ostree-ng.sh index 870ecf8a9..7b5576e60 100755 --- a/test/cases/ostree-ng.sh +++ b/test/cases/ostree-ng.sh @@ -151,7 +151,7 @@ case "${ID}-${VERSION_ID}" in SYSROOT_RO="true" ;; *) - echo "unsupported distro: ${ID}-${VERSION_ID}" + redprint "unsupported distro: ${ID}-${VERSION_ID}" exit 1;; esac @@ -293,7 +293,7 @@ build_image() { # Did the compose finish with success? if [[ $COMPOSE_STATUS != FINISHED ]]; then - echo "Something went wrong with the compose. 😢" + redprint "Something went wrong with the compose. 😢" exit 1 fi } @@ -344,7 +344,7 @@ check_result () { if [[ $RESULTS == 1 ]]; then greenprint "💚 Success" else - greenprint "❌ Failed" + redprint "❌ Failed" clean_up exit 1 fi diff --git a/test/cases/ostree-raw-image.sh b/test/cases/ostree-raw-image.sh index 4f71dcfa8..f776bc0bb 100755 --- a/test/cases/ostree-raw-image.sh +++ b/test/cases/ostree-raw-image.sh @@ -139,7 +139,7 @@ case "${ID}-${VERSION_ID}" in CUSTOM_DIRS_FILES="true" ;; *) - echo "unsupported distro: ${ID}-${VERSION_ID}" + redprint "unsupported distro: ${ID}-${VERSION_ID}" exit 1;; esac @@ -222,7 +222,7 @@ build_image() { # Did the compose finish with success? if [[ $COMPOSE_STATUS != FINISHED ]]; then - echo "Something went wrong with the compose. 😢" + redprint "Something went wrong with the compose. 😢" exit 1 fi } @@ -270,7 +270,7 @@ check_result () { if [[ $RESULTS == 1 ]]; then greenprint "💚 Success" else - greenprint "❌ Failed" + redprint "❌ Failed" clean_up exit 1 fi diff --git a/test/cases/ostree-simplified-installer.sh b/test/cases/ostree-simplified-installer.sh index dd1a82416..031c43b67 100755 --- a/test/cases/ostree-simplified-installer.sh +++ b/test/cases/ostree-simplified-installer.sh @@ -154,7 +154,7 @@ case "${ID}-${VERSION_ID}" in FDO_USER_ONBOARDING="true" ;; *) - echo "unsupported distro: ${ID}-${VERSION_ID}" + redprint "unsupported distro: ${ID}-${VERSION_ID}" exit 1;; esac @@ -251,7 +251,7 @@ build_image() { # Did the compose finish with success? if [[ $COMPOSE_STATUS != FINISHED ]]; then - echo "Something went wrong with the compose. 😢" + redprint "Something went wrong with the compose. 😢" exit 1 fi } @@ -301,7 +301,7 @@ check_result () { if [[ $RESULTS == 1 ]]; then greenprint "💚 Success" else - greenprint "❌ Failed" + redprint "❌ Failed" clean_up exit 1 fi diff --git a/test/cases/ostree.sh b/test/cases/ostree.sh index 1a4733ec6..fb1778591 100755 --- a/test/cases/ostree.sh +++ b/test/cases/ostree.sh @@ -146,7 +146,7 @@ case "${ID}-${VERSION_ID}" in SYSROOT_RO="true" ;; *) - echo "unsupported distro: ${ID}-${VERSION_ID}" + redprint "unsupported distro: ${ID}-${VERSION_ID}" exit 1;; esac @@ -308,7 +308,7 @@ build_image() { # Did the compose finish with success? if [[ $COMPOSE_STATUS != FINISHED ]]; then - echo "Something went wrong with the compose. 😢" + redprint "Something went wrong with the compose. 😢" exit 1 fi } @@ -350,7 +350,7 @@ check_result () { if [[ $RESULTS == 1 ]]; then greenprint "💚 Success" else - greenprint "❌ Failed" + redprint "❌ Failed" clean_up exit 1 fi diff --git a/test/cases/upgrade8to9.sh b/test/cases/upgrade8to9.sh index 6dd3f28f2..9c01b5b5b 100755 --- a/test/cases/upgrade8to9.sh +++ b/test/cases/upgrade8to9.sh @@ -148,7 +148,7 @@ sudo scp "${SSH_OPTIONS[@]}" -q -i "${SSH_KEY}" root@"$INSTANCE_ADDRESS":logs/* if [[ "$RESULT" == 0 ]]; then greenprint "💚 Success" else - greenprint "❌ Failed" + redprint "❌ Failed" exit 1 fi