From 2d6386c42188bb22fc8b9f66e43131b5e4f63f61 Mon Sep 17 00:00:00 2001 From: nirro Date: Tue, 17 Apr 2018 15:45:26 +0300 Subject: [PATCH] [FAB-8245] change first network according to the fix fixed [FAB-8245], and fabric samples have to be changed accordingly. currently, added support for both output formats. Change-Id: I0cac063af44556d6a37f17b25abf20134032540f Signed-off-by: nirro --- fabric-ca/scripts/run-fabric.sh | 8 ++++++++ first-network/scripts/utils.sh | 3 +++ 2 files changed, 11 insertions(+) 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