diff --git a/fabric-ca/scripts/run-fabric.sh b/fabric-ca/scripts/run-fabric.sh index a4ab0f8062..50fd542cab 100755 --- a/fabric-ca/scripts/run-fabric.sh +++ b/fabric-ca/scripts/run-fabric.sh @@ -157,6 +157,14 @@ function chaincodeQuery { logr "Query of channel '$CHANNEL_NAME' on peer '$PEER_HOST' was successful" set -e return 0 + else + # removed the string "Query Result" from peer chaincode query command result, as a result, have to support both options until the change is merged. + VALUE=$(cat log.txt | egrep '^[0-9]+$') + if [ $? -eq 0 -a "$VALUE" = "$1" ]; then + logr "Query of channel '$CHANNEL_NAME' on peer '$PEER_HOST' was successful" + set -e + return 0 + fi fi echo -n "." done diff --git a/first-network/scripts/utils.sh b/first-network/scripts/utils.sh index 7509147e3b..cc9008b66a 100755 --- a/first-network/scripts/utils.sh +++ b/first-network/scripts/utils.sh @@ -184,6 +184,9 @@ chaincodeQuery () { set +x test $res -eq 0 && VALUE=$(cat log.txt | awk '/Query Result/ {print $NF}') test "$VALUE" = "$EXPECTED_RESULT" && let rc=0 + # removed the string "Query Result" from peer chaincode query command result, as a result, have to support both options until the change is merged. + test $rc -ne 0 && VALUE=$(cat log.txt | egrep '^[0-9]+$') + test "$VALUE" = "$EXPECTED_RESULT" && let rc=0 done echo cat log.txt