Skip to content

Commit

Permalink
BE-755 Update e2e test (#124)
Browse files Browse the repository at this point in the history
* BE-755 Upgrade e2e-test evn for fabric v2.1

Signed-off-by: Atsushi Neki <atsushin@fast.au.fujitsu.com>

* BE-755 Update GUI e2e-test for fabric v2.1

Signed-off-by: Atsushi Neki <atsushin@fast.au.fujitsu.com>

* BE-755 Rename job name of CI pipeline

Signed-off-by: Atsushi Neki <atsushin@fast.au.fujitsu.com>
  • Loading branch information
nekia authored Jun 26, 2020
1 parent 2404718 commit f4a38e9
Show file tree
Hide file tree
Showing 36 changed files with 2,095 additions and 207 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "first-network",
"name": "org1-network",
"version": "1.0.0",
"license": "Apache-2.0",
"client": {
Expand Down
79 changes: 73 additions & 6 deletions app/platform/fabric/e2e-test/runTestSuite.sh
Original file line number Diff line number Diff line change
@@ -1,30 +1,97 @@
#!/bin/bash

ROOTDIR="$(cd "$(dirname "$0")"/../../../.. && pwd)"
FABRIC_V1_VERSION=1.4.6
FABRIC_V2_VERSION=2.1.1

echo "#### Downloaded fabric-test repo"

if [ $# -eq 0 ]; then
echo "$0 [-1 | -2]"
exit 1;
fi

while getopts "12" opt; do
case "$opt" in
1)
SDKVER=1.4.8
export FABRIC_VERSION=1
export RELEASE_VERSION=1.4-stable
CHECKOUT_HASH=45799a2ee4eefa49ae705cc57ed415270c35d60a
# export FABRIC_CFG_PATH=$GOPATH/src/github.com/hyperledger/fabric-test/scripts/config
export PATH=$GOPATH/src/github.com/hyperledger/fabric-test/scripts/bin:$PATH
PULL_PEER_IMAGE_VERSION=${FABRIC_V1_VERSION}
PULL_CA_IMAGE_VERSION=${FABRIC_V1_VERSION}
;;
2)
SDKVER=2.0.0-beta.2
export FABRIC_VERSION=2
CHECKOUT_HASH=09680bea5aa0ec464982f7979fd99a777e8c1fed
export FABRIC_CFG_PATH=$GOPATH/src/github.com/hyperledger/fabric-test/config
export PATH=$GOPATH/src/github.com/hyperledger/fabric-test/bin:$PATH
PULL_PEER_IMAGE_VERSION=${FABRIC_V2_VERSION}
PULL_CA_IMAGE_VERSION=${FABRIC_V1_VERSION}
;;
*)
echo "$0 [-1 | -2]"
exit 1;
;;
esac
done

echo "HASH: ${CHECKOUT_HASH}"
echo "SDK : ${SDKVER}"
echo "ROOT: ${ROOTDIR}"

set -e

mkdir -p $GOPATH/src/github.com/hyperledger

pushd $GOPATH/src/github.com/hyperledger
sudo rm -rf fabric-test
if [ ! -d fabric-test ]; then
git clone https://github.com/hyperledger/fabric-test.git -b release-1.4
git clone https://github.com/hyperledger/fabric-test.git
fi
cd fabric-test
git checkout 45799a2ee4eefa49ae705cc57ed415270c35d60a
# git checkout 45799a2ee4eefa49ae705cc57ed415270c35d60a
git checkout ${CHECKOUT_HASH}
make pull-binaries-fabric
echo "#### Updated each sub-module under fabric-test repo"
popd

pushd $GOPATH/src/github.com/hyperledger/fabric-test/tools/PTE
npm install fabric-client@1.4.8
npm install fabric-ca-client@1.4.8
npm install fabric-client@${SDKVER}
npm install fabric-ca-client@${SDKVER}
echo "#### Installed required node packages"
popd

pushd $ROOTDIR/app/platform/fabric/e2e-test
rm -f PTE
ln -s $GOPATH/src/github.com/hyperledger/fabric-test/tools/PTE ./PTE
popd

pushd $ROOTDIR
rm -rf wallet logs
popd

curl -sSL https://raw.githubusercontent.com/hyperledger/fabric/master/scripts/bootstrap.sh | bash -s -- ${PULL_PEER_IMAGE_VERSION} ${PULL_CA_IMAGE_VERSION} 0.4.18 -s -b
docker pull hyperledger/fabric-ca:${FABRIC_V1_VERSION}
docker tag hyperledger/fabric-ca:${FABRIC_V1_VERSION} hyperledger/fabric-ca:${FABRIC_V2_VERSION}

pushd $ROOTDIR/app/platform/fabric/e2e-test/specs

rm -rf templates
sed -i -e '/github.com\/hyperledger\/fabric-test/d' go.mod
if [ ${FABRIC_VERSION} -eq 2 ]; then
cp -a templates-v2 templates
go get github.com/hyperledger/fabric-test@${CHECKOUT_HASH}
go get github.com/hyperledger/fabric-test/tools/operator@${CHECKOUT_HASH}
go get github.com/hyperledger/fabric-test/chaincodes/samplecc/go@${CHECKOUT_HASH}
else
cp -a templates-v1 templates
go get github.com/hyperledger/fabric-test@${CHECKOUT_HASH}
fi

pushd specs
echo "#### Starting Ginkgo based test suite"
ginkgo -v -stream
ginkgo -v -stream -failFast
popd
44 changes: 3 additions & 41 deletions app/platform/fabric/e2e-test/specs/apitest-input-multiprofile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,50 +48,30 @@ joinChannel:
installChaincode:
# installs chaincode with specified name on all peers in listed organziations
- name: samplecc
sdk: cli
version: v1
path: github.com/hyperledger/fabric-test/chaincodes/samplecc/go
organizations: org1,org2
language: golang
metadataPath: ""

- name: samplecc
version: v2
path: github.com/hyperledger/fabric-test/chaincodes/samplecc/go
organizations: org1,org2
language: golang
metadataPath: ""

instantiateChaincode:
- channelName: commonchannel
name: samplecc
sdk: cli
version: v1
args: ""
organizations: org1
endorsementPolicy: 2of(org1,org2)
collectionPath: ""
- channelName: org1channel
name: samplecc
sdk: cli
version: v1
args: ""
organizations: org1
endorsementPolicy: 1of(org1)
collectionPath: ""
- channelName: org2channel
name: samplecc
version: v1
args: ""
organizations: org2
endorsementPolicy: 1of(org2)
collectionPath: ""

upgradeChaincode:
- channelName: testorgschannel0
name: samplecc
version: v2
args: ""
organizations: org1
endorsementPolicy: 1of(org1,org2)
collectionPath: ""

invokes:
- channelName: commonchannel
Expand All @@ -117,21 +97,3 @@ invokes:
payLoadMin: 1024
payLoadMax: 2048
args: "put,a1,1"

queries:
- channelName: testorgschannel0
name: samplecc
targetPeers: OrgAnchor
nProcPerOrg: 1
nRequest: 1
runDur: 0
organizations: org1,org2
ccOpt:
ccType: ccchecker
keyStart: 0
txnOpt:
- mode: constant
options:
constFreq: 0
devFreq: 0
args: "get,a1"
26 changes: 2 additions & 24 deletions app/platform/fabric/e2e-test/specs/apitest-input-singleprofile.yml
Original file line number Diff line number Diff line change
@@ -1,78 +1,56 @@
organizations:
- name: org1
#! For smoke test suite, connection-profile are read from smoke directory
connProfilePath: ./connection-profile/connection_profile_org1.yaml
- name: org2
connProfilePath: ./connection-profile/connection_profile_org2.yaml

createChannel:
- channelName: commonchannel
#! For smoke test suite, channel-artifacts are read from smoke directory
channelTxPath: ./channel-artifacts/commonchannel/commonchannel.tx
organizations: org1
- channelName: org1channel
#! For smoke test suite, channel-artifacts are read from smoke directory
channelTxPath: ./channel-artifacts/org1channel/org1channel.tx
organizations: org1
- channelName: org2channel
#! For smoke test suite, channel-artifacts are read from smoke directory
channelTxPath: ./channel-artifacts/org2channel/org2channel.tx
organizations: org2

anchorPeerUpdate:
- channelName: commonchannel
organizations: org1
#! For smoke test suite, channel-artifacts are read from smoke directory
anchorPeerUpdateTxPath: ./channel-artifacts/commonchannel/commonchannelorg1anchor.tx
- channelName: commonchannel
organizations: org2
anchorPeerUpdateTxPath: ./channel-artifacts/commonchannel/commonchannelorg2anchor.tx
- channelName: org1channel
organizations: org1
#! For smoke test suite, channel-artifacts are read from smoke directory
anchorPeerUpdateTxPath: ./channel-artifacts/org1channel/org1channelorg1anchor.tx

joinChannel:
# joins all peers in listed organziations to all channels based on channelPrefix and numChannels
- channelName: commonchannel
organizations: org1,org2
- channelName: org1channel
organizations: org1

installChaincode:
# installs chaincode with specified name on all peers in listed organziations
- name: samplecc
sdk: cli
version: v1
path: github.com/hyperledger/fabric-test/chaincodes/samplecc/go
organizations: org1,org2
language: golang
metadataPath: ""

- name: samplecc
version: v2
path: github.com/hyperledger/fabric-test/chaincodes/samplecc/go
organizations: org1,org2
language: golang
metadataPath: ""

instantiateChaincode:
- channelName: commonchannel
sdk: cli
name: samplecc
version: v1
args: ""
organizations: org1
endorsementPolicy: 2of(org1,org2)
collectionPath: ""

upgradeChaincode:
- channelName: testorgschannel0
name: samplecc
version: v2
args: ""
organizations: org1
endorsementPolicy: 1of(org1,org2)
collectionPath: ""

invokes:
- channelName: commonchannel
name: samplecc
Expand Down
Original file line number Diff line number Diff line change
@@ -1,61 +1,43 @@
organizations:
- name: org1
#! For smoke test suite, connection-profile are read from smoke directory
connProfilePath: ./connection-profile/connection_profile_org1.yaml
- name: org2
connProfilePath: ./connection-profile/connection_profile_org2.yaml

createChannel:
- channelName: channel2422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422
#! For smoke test suite, channel-artifacts are read from smoke directory
channelTxPath: ./channel-artifacts/channel2422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422/channel2422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422.tx
organizations: org1

anchorPeerUpdate:
- channelName: channel2422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422
organizations: org1
#! For smoke test suite, channel-artifacts are read from smoke directory
anchorPeerUpdateTxPath: ./channel-artifacts/channel2422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422/channel2422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422org1anchor.tx

joinChannel:
# joins all peers in listed organziations to all channels based on channelPrefix and numChannels
- channelName: channel2422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422
organizations: org1

installChaincode:
# installs chaincode with specified name on all peers in listed organziations
- name: samplecc
sdk: cli
version: v1
path: github.com/hyperledger/fabric-test/chaincodes/samplecc/go
organizations: org1,org2
language: golang
metadataPath: ""

- name: samplecc
version: v2
path: github.com/hyperledger/fabric-test/chaincodes/samplecc/go
organizations: org1,org2
language: golang
metadataPath: ""

instantiateChaincode:
- channelName: channel2422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422
name: samplecc
sdk: cli
version: v1
args: ""
organizations: org1
endorsementPolicy: 1of(org1,org2)
collectionPath: ""

upgradeChaincode:
- channelName: testorgschannel0
name: samplecc
version: v2
args: ""
organizations: org1
endorsementPolicy: 1of(org1,org2)
collectionPath: ""

invokes:
- channelName: channel2422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422422
name: samplecc
Expand Down
Loading

0 comments on commit f4a38e9

Please sign in to comment.