-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FAB-12875] Add automated tests for fabcar sample
Introduce automated tests for the fabcar sample, that deploy the new sample contracts and submit the initLedger transaction using the "peer" CLI. Additional changes will follow to drive the new sample apps to ensure that they work as well (but the apps aren't there yet!). Change-Id: Ie42d139eb1dc1cf0f7c16f41f54bb5f40309921c Signed-off-by: Simon Stone <sstone1@uk.ibm.com>
- Loading branch information
Simon Stone
committed
Nov 30, 2018
1 parent
5c087f1
commit 928b72b
Showing
5 changed files
with
93 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#!/bin/bash | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
|
||
# docker container list - Check these from basic-network/docker-compose.yaml | ||
CONTAINER_LIST=(peer0.org1 orderer ca) | ||
|
||
logs() { | ||
|
||
for CONTAINER in ${CONTAINER_LIST[*]}; do | ||
docker logs $CONTAINER.example.com >& $WORKSPACE/$CONTAINER-$1.log | ||
echo | ||
done | ||
# Write couchdb container logs into couchdb.log file | ||
docker logs couchdb >& couchdb.log | ||
|
||
} | ||
|
||
copy_logs() { | ||
|
||
# Call logs function | ||
logs $2 $3 | ||
|
||
if [ $1 != 0 ]; then | ||
echo -e "\033[31m $2 test case is FAILED" "\033[0m" | ||
exit 1 | ||
fi | ||
} | ||
|
||
cd $BASE_FOLDER/fabric-samples/fabcar || exit | ||
export PATH=gopath/src/github.com/hyperledger/fabric-samples/bin:$PATH | ||
|
||
LANGUAGES="go javascript typescript" | ||
for LANGUAGE in ${LANGUAGES}; do | ||
echo -e "\033[32m starting fabcar test (${LANGUAGE})" "\033[0m" | ||
./startFabric.sh ${LANGUAGE} | ||
copy_logs $? fabcar-${LANGUAGE} | ||
docker ps -aq | xargs docker rm -f | ||
docker rmi -f $(docker images -aq dev-*) | ||
echo -e "\033[32m finished fabcar test (${LANGUAGE})" "\033[0m" | ||
done |