Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Commit

Permalink
Set explicit fail on bad command.
Browse files Browse the repository at this point in the history
  • Loading branch information
williamblevins committed Mar 15, 2021
1 parent f4131a9 commit 7bdfaef
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
1 change: 1 addition & 0 deletions tests/full-version-label.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/bash
set -eo pipefail
# The purpose of this test is to ensure that the output of the "nodeos --full-version" command matches the version string defined by our CMake files
echo '##### Nodeos Full Version Label Test #####'
# orient ourselves
Expand Down
12 changes: 5 additions & 7 deletions tests/print-build-info.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/bash
set -eo pipefail
# The purpose of this test is to ensure that the output of the "nodeos --print-build-info" command.
# This includes verifying valid output in JSON shape and checking parameters (only boost for now).
echo '##### Nodeos Print Build Info Test #####'
Expand All @@ -8,13 +9,10 @@ echo '##### Nodeos Print Build Info Test #####'
[[ "$EOSIO_ROOT" == '' ]] && EOSIO_ROOT=$(echo $(pwd)/ | grep -ioe '.*/build/' | sed 's,/build/,,')
echo "Using EOSIO_ROOT=\"$EOSIO_ROOT\"."

OUTPUT=$($EOSIO_ROOT/build/bin/nodeos --print-build-info 2>&1)
EXIT_CODE=$?
echo "$OUTPUT"
if [[ $EXIT_CODE -eq 0 ]]; then
echo 'Expected non-zero nodeos exit code.'
exit 1
fi
exec 9>&1 # enable tee to write to STDOUT as a file
PRINT_BUILD_INFO="$EOSIO_ROOT/build/bin/nodeos --print-build-info 2>&1 | tee >(cat - >&9) || :"
echo "$ $PRINT_BUILD_INFO"
OUTPUT="$(eval $PRINT_BUILD_INFO)"

OUTPUT=$(echo "$OUTPUT" | tr -d '\r\n')
OUTPUT=$(echo "$OUTPUT" | sed -E 's/^.+JSON://')
Expand Down
1 change: 1 addition & 0 deletions tests/version-label.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/bash
set -eo pipefail
# The purpose of this test is to ensure that the output of the "nodeos --version" command matches the version string defined by our CMake files
echo '##### Nodeos Version Label Test #####'
# orient ourselves
Expand Down

0 comments on commit 7bdfaef

Please sign in to comment.