docker-compose-files/hyperledger_fabric/v1.0.0/scripts/test_cc_all.sh

46 lines
1.1 KiB
Bash
Raw Normal View History

2017-05-16 18:33:23 +08:00
#!/bin/bash
2017-08-23 12:45:55 +08:00
# Importing useful functions for cc testing
if [ -f ./func.sh ]; then
source ./func.sh
elif [ -f scripts/func.sh ]; then
source scripts/func.sh
2017-07-10 17:24:19 +08:00
fi
2017-06-14 13:30:12 +08:00
echo_b "Channel name : "$CHANNEL_NAME
2017-05-16 18:33:23 +08:00
#Query on chaincode on Peer0/Org1
2017-08-22 16:34:37 +08:00
echo_b "Querying chaincode on all 4 peers..."
chaincodeQuery 0 100
chaincodeQuery 1 100
2017-06-09 19:42:58 +08:00
chaincodeQuery 2 100
2017-08-22 16:34:37 +08:00
chaincodeQuery 3 100
2017-05-16 18:33:23 +08:00
#Invoke on chaincode on Peer0/Org1
2017-08-22 16:34:37 +08:00
echo_b "Sending invoke transaction (transfer 10) on org1/peer0..."
chaincodeInvoke 0
2017-05-16 18:33:23 +08:00
#Query on chaincode on Peer1/Org2, check if the result is 90
2017-08-22 16:34:37 +08:00
echo_b "Querying chaincode on all 4 peers..."
chaincodeQuery 0 90
chaincodeQuery 1 90
chaincodeQuery 2 90
2017-05-16 18:33:23 +08:00
chaincodeQuery 3 90
2017-06-14 13:30:12 +08:00
#Invoke on chaincode on Peer1/Org2
2017-08-22 16:34:37 +08:00
echo_b "Sending invoke transaction on org2/peer3..."
2017-06-09 19:42:58 +08:00
chaincodeInvoke 3
2017-06-14 13:30:12 +08:00
#Query on chaincode on Peer1/Org2, check if the result is 80
2017-08-22 16:34:37 +08:00
echo_b "Querying chaincode on all 4peers..."
chaincodeQuery 0 80
chaincodeQuery 1 80
chaincodeQuery 2 80
2017-06-09 19:42:58 +08:00
chaincodeQuery 3 80
2017-05-16 18:33:23 +08:00
echo
2017-06-14 13:30:12 +08:00
echo_g "===================== All GOOD, End-2-End execution completed ===================== "
2017-05-16 18:33:23 +08:00
echo
exit 0