Skip to content

Commit

Permalink
BE-681 Add e2e test for raft ordering model
Browse files Browse the repository at this point in the history
Based on v1.4.2 tag of fabric-samples

Signed-off-by: Atsushi Neki <atsushin@fast.au.fujitsu.com>
Change-Id: I191fc1b76ed7257aa722177e276d55b8af6105a6
  • Loading branch information
nekia committed Aug 29, 2019
1 parent f6ad147 commit 154fdac
Show file tree
Hide file tree
Showing 138 changed files with 1,142 additions and 19,578 deletions.
4 changes: 3 additions & 1 deletion app/platform/fabric/e2e-test/.env
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,6 @@ KAFKA_MESSAGE_MAX_BYTES=1000012 B
KAFKA_REPLICA_FETCH_MAX_BYTES=1048576 B
KAFKA_REPLICA_FETCH_RESPONSE_MAX_BYTES=10485760 B
IMAGE_TAG=latest
FABRIC_CA_SERVER_EXAMPLE_TLS_KEYFILE=/var/hyperledger/fabric-ca-server-config/sk
FABRIC_CA_SERVER_EXAMPLE_TLS_KEYFILE=/var/hyperledger/fabric-ca-server-config/sk
SYS_CHANNEL=byfn-sys-channel

9 changes: 5 additions & 4 deletions app/platform/fabric/e2e-test/explorer.feature
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Feature: Bootstrapping Hyperledger Explorer
# @doNotDecompose
Scenario Outline: [<network-type>] Bring up explorer with fabric-samples/<network-type> and send requests to the basic REST API functions successfully
# Start a fabric network by using fabric-samples/<network-type>
Given I start <network-type>
Given I start <network-type> orderer network of type <consensus_type>
# Need to specify which profiles should be in use before starting Explorer
Given the NETWORK_PROFILE environment variable is <network-type>
When I start explorer
Expand Down Expand Up @@ -105,9 +105,10 @@ Scenario Outline: [<network-type>] Bring up explorer with fabric-samples/<networ
Then JSON at path ".row[0].channelname" should equal "mychannel"

Examples:
|network-type |
|first-network |
|balance-transfer |
|network-type |consensus_type|
|first-network |solo |
|first-network |etcdraft |
|balance-transfer |unused |

@basic
# @doNotDecompose
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
#
# SPDX-License-Identifier: Apache-2.0
#
/node_modules/*
/package-lock.json
/fabric-client-kv-org*
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@

<!-- (SPDX-License-Identifier: CC-BY-4.0) --> <!-- Ensure there is a newline before, and after, this line -->

## Balance transfer

A sample Node.js app to demonstrate **__fabric-client__** & **__fabric-ca-client__** Node.js SDK APIs
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
/*
*SPDX-License-Identifier: Apache-2.0
*/

/**
* Copyright 2017 IBM All Rights Reserved.
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
/*
*SPDX-License-Identifier: Apache-2.0
*/

/**
* Copyright 2017 IBM All Rights Reserved.
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
/*
*SPDX-License-Identifier: Apache-2.0
*/

/**
* Copyright 2017 IBM All Rights Reserved.
*
Expand Down Expand Up @@ -94,10 +90,7 @@ var getRegisteredUser = async function(username, userOrg, isJson) {
adminUserObj
);
logger.debug('Successfully got the secret for user %s', username);
user = await client.setUserContext({
username: username,
password: secret
});
user = await client.setUserContext({ username: username, password: secret });
logger.debug(
'Successfully enrolled username %s and setUserContext on the client object',
username
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
/*
*SPDX-License-Identifier: Apache-2.0
*/

/**
* Copyright 2017 IBM All Rights Reserved.
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
/*
*SPDX-License-Identifier: Apache-2.0
*/

/**
* Copyright 2017 IBM All Rights Reserved.
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
/*
*SPDX-License-Identifier: Apache-2.0
*/

/**
* Copyright 2017 IBM All Rights Reserved.
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
/*
*SPDX-License-Identifier: Apache-2.0
*/

/**
* Copyright 2017 IBM All Rights Reserved.
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
/*
*SPDX-License-Identifier: Apache-2.0
*/

/**
* Copyright 2017 IBM All Rights Reserved.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ services:
# the following setting starts chaincode containers on the same
# bridge network as the peers
# https://docs.docker.com/compose/networking/
- CORE_VM_DOCKER_HOSTCONFIG_NETWORKMODE=${CORE_PEER_NETWORKID}_behave
- CORE_VM_DOCKER_HOSTCONFIG_NETWORKMODE=artifacts_default
- FABRIC_LOGGING_SPEC=DEBUG
- CORE_PEER_GOSSIP_USELEADERELECTION=true
- CORE_PEER_GOSSIP_ORGLEADER=false
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
#
# Copyright IBM Corp. All Rights Reserved.
#
# SPDX-License-Identifier: Apache-2.0
#
version: '2'

networks:
behave:

services:

ca.org1.example.com:
extends:
file: docker-compose.yaml
service: ca.org1.example.com
container_name: ca_peerorg1
networks:
behave:
aliases:
- ${CORE_PEER_NETWORKID}

ca.org2.example.com:
extends:
file: docker-compose.yaml
service: ca.org2.example.com
container_name: ca_peerorg2
networks:
behave:
aliases:
- ${CORE_PEER_NETWORKID}

orderer.example.com:
extends:
file: docker-compose.yaml
service: orderer.example.com
networks:
behave:
aliases:
- ${CORE_PEER_NETWORKID}

peer0.org1.example.com:
container_name: peer0.org1.example.com
extends:
file: base.yaml
service: peer-base
environment:
- CORE_PEER_ID=peer0.org1.example.com
- CORE_PEER_LOCALMSPID=Org1MSP
- CORE_PEER_ADDRESS=peer0.org1.example.com:7051
- CORE_PEER_GOSSIP_BOOTSTRAP=peer1.org1.example.com:7051
- CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer0.org1.example.com:7051
- CORE_VM_DOCKER_HOSTCONFIG_NETWORKMODE=${CORE_PEER_NETWORKID}_behave
ports:
- 7051:7051
- 7053:7053
volumes:
- ./channel/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/:/etc/hyperledger/crypto/peer
depends_on:
- orderer.example.com
networks:
behave:
aliases:
- ${CORE_PEER_NETWORKID}

peer1.org1.example.com:
container_name: peer1.org1.example.com
extends:
file: base.yaml
service: peer-base
environment:
- CORE_PEER_ID=peer1.org1.example.com
- CORE_PEER_LOCALMSPID=Org1MSP
- CORE_PEER_ADDRESS=peer1.org1.example.com:7051
- CORE_PEER_GOSSIP_BOOTSTRAP=peer0.org1.example.com:7051
- CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer1.org1.example.com:7051
- CORE_VM_DOCKER_HOSTCONFIG_NETWORKMODE=${CORE_PEER_NETWORKID}_behave
ports:
- 7056:7051
- 7058:7053
volumes:
- ./channel/crypto-config/peerOrganizations/org1.example.com/peers/peer1.org1.example.com/:/etc/hyperledger/crypto/peer
depends_on:
- orderer.example.com
networks:
behave:
aliases:
- ${CORE_PEER_NETWORKID}

peer0.org2.example.com:
container_name: peer0.org2.example.com
extends:
file: base.yaml
service: peer-base
environment:
- CORE_PEER_ID=peer0.org2.example.com
- CORE_PEER_LOCALMSPID=Org2MSP
- CORE_PEER_ADDRESS=peer0.org2.example.com:7051
- CORE_PEER_GOSSIP_BOOTSTRAP=peer1.org2.example.com:7051
- CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer0.org2.example.com:7051
- CORE_VM_DOCKER_HOSTCONFIG_NETWORKMODE=${CORE_PEER_NETWORKID}_behave
ports:
- 8051:7051
- 8053:7053
volumes:
- ./channel/crypto-config/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/:/etc/hyperledger/crypto/peer
depends_on:
- orderer.example.com
networks:
behave:
aliases:
- ${CORE_PEER_NETWORKID}

peer1.org2.example.com:
container_name: peer1.org2.example.com
extends:
file: base.yaml
service: peer-base
environment:
- CORE_PEER_ID=peer1.org2.example.com
- CORE_PEER_LOCALMSPID=Org2MSP
- CORE_PEER_ADDRESS=peer1.org2.example.com:7051
- CORE_PEER_GOSSIP_BOOTSTRAP=peer0.org2.example.com:7051
- CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer1.org2.example.com:7051
- CORE_VM_DOCKER_HOSTCONFIG_NETWORKMODE=${CORE_PEER_NETWORKID}_behave
ports:
- 8056:7051
- 8058:7053
volumes:
- ./channel/crypto-config/peerOrganizations/org2.example.com/peers/peer1.org2.example.com/:/etc/hyperledger/crypto/peer
depends_on:
- orderer.example.com
networks:
behave:
aliases:
- ${CORE_PEER_NETWORKID}
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@
#
version: '2'

networks:
behave:

services:

ca.org1.example.com:
Expand All @@ -25,11 +22,7 @@ services:
command: sh -c 'fabric-ca-server start -b admin:adminpw -d'
volumes:
- ./channel/crypto-config/peerOrganizations/org1.example.com/ca/:/etc/hyperledger/fabric-ca-server-config
container_name: ca_peerorg1
networks:
behave:
aliases:
- ${CORE_PEER_NETWORKID}
container_name: ca_peerOrg1

ca.org2.example.com:
image: hyperledger/fabric-ca
Expand All @@ -46,11 +39,7 @@ services:
command: sh -c 'fabric-ca-server start -b admin:adminpw -d'
volumes:
- ./channel/crypto-config/peerOrganizations/org2.example.com/ca/:/etc/hyperledger/fabric-ca-server-config
container_name: ca_peerorg2
networks:
behave:
aliases:
- ${CORE_PEER_NETWORKID}
container_name: ca_peerOrg2

orderer.example.com:
container_name: orderer.example.com
Expand All @@ -75,10 +64,6 @@ services:
- ./channel/crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/:/etc/hyperledger/crypto/orderer
- ./channel/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/:/etc/hyperledger/crypto/peerOrg1
- ./channel/crypto-config/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/:/etc/hyperledger/crypto/peerOrg2
networks:
behave:
aliases:
- ${CORE_PEER_NETWORKID}

peer0.org1.example.com:
container_name: peer0.org1.example.com
Expand All @@ -89,7 +74,7 @@ services:
- CORE_PEER_ID=peer0.org1.example.com
- CORE_PEER_LOCALMSPID=Org1MSP
- CORE_PEER_ADDRESS=peer0.org1.example.com:7051
- CORE_PEER_GOSSIP_BOOTSTRAP=peer1.org1.example.com:7051
- CORE_PEER_GOSSIP_BOOTSTRAP=peer1.org1.example.com:7051
- CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer0.org1.example.com:7051
ports:
- 7051:7051
Expand All @@ -98,10 +83,6 @@ services:
- ./channel/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/:/etc/hyperledger/crypto/peer
depends_on:
- orderer.example.com
networks:
behave:
aliases:
- ${CORE_PEER_NETWORKID}

peer1.org1.example.com:
container_name: peer1.org1.example.com
Expand All @@ -112,7 +93,7 @@ services:
- CORE_PEER_ID=peer1.org1.example.com
- CORE_PEER_LOCALMSPID=Org1MSP
- CORE_PEER_ADDRESS=peer1.org1.example.com:7051
- CORE_PEER_GOSSIP_BOOTSTRAP=peer0.org1.example.com:7051
- CORE_PEER_GOSSIP_BOOTSTRAP=peer0.org1.example.com:7051
- CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer1.org1.example.com:7051
ports:
- 7056:7051
Expand All @@ -121,10 +102,6 @@ services:
- ./channel/crypto-config/peerOrganizations/org1.example.com/peers/peer1.org1.example.com/:/etc/hyperledger/crypto/peer
depends_on:
- orderer.example.com
networks:
behave:
aliases:
- ${CORE_PEER_NETWORKID}

peer0.org2.example.com:
container_name: peer0.org2.example.com
Expand All @@ -135,7 +112,7 @@ services:
- CORE_PEER_ID=peer0.org2.example.com
- CORE_PEER_LOCALMSPID=Org2MSP
- CORE_PEER_ADDRESS=peer0.org2.example.com:7051
- CORE_PEER_GOSSIP_BOOTSTRAP=peer1.org2.example.com:7051
- CORE_PEER_GOSSIP_BOOTSTRAP=peer1.org2.example.com:7051
- CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer0.org2.example.com:7051
ports:
- 8051:7051
Expand All @@ -144,10 +121,6 @@ services:
- ./channel/crypto-config/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/:/etc/hyperledger/crypto/peer
depends_on:
- orderer.example.com
networks:
behave:
aliases:
- ${CORE_PEER_NETWORKID}

peer1.org2.example.com:
container_name: peer1.org2.example.com
Expand All @@ -158,7 +131,7 @@ services:
- CORE_PEER_ID=peer1.org2.example.com
- CORE_PEER_LOCALMSPID=Org2MSP
- CORE_PEER_ADDRESS=peer1.org2.example.com:7051
- CORE_PEER_GOSSIP_BOOTSTRAP=peer0.org2.example.com:7051
- CORE_PEER_GOSSIP_BOOTSTRAP=peer0.org2.example.com:7051
- CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer1.org2.example.com:7051
ports:
- 8056:7051
Expand All @@ -167,7 +140,3 @@ services:
- ./channel/crypto-config/peerOrganizations/org2.example.com/peers/peer1.org2.example.com/:/etc/hyperledger/crypto/peer
depends_on:
- orderer.example.com
networks:
behave:
aliases:
- ${CORE_PEER_NETWORKID}
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---
# SPDX-License-Identifier: Apache-2.0
#
# The network connection profile provides client applications the information about the target
# blockchain network that are necessary for the applications to interact with it. These are all
Expand Down
Loading

0 comments on commit 154fdac

Please sign in to comment.