-
Notifications
You must be signed in to change notification settings - Fork 507
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FAB-10649] Fix local integration tests for v1.2
The Fabric Selection service now retrieves the URL of the peer from endpoint config before applying filters. Also, various integration tests needed to be changed in order to work with local config/entity matchers. Change-Id: I62ca6ad9e526d94e46ad09963ae29430d59f7569 Signed-off-by: Bob Stasyszyn <[email protected]>
- Loading branch information
1 parent
a906355
commit 88455b4
Showing
9 changed files
with
323 additions
and
63 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
37 changes: 37 additions & 0 deletions
37
test/fixtures/config/overrides/local_entity_matchers_bootstrap.yaml
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,37 @@ | ||
# | ||
# Copyright SecureKey Technologies Inc. All Rights Reserved. | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
|
||
entityMatchers: | ||
peer: | ||
- pattern: (\w+).org1.example.com:(\d+) | ||
urlSubstitutionExp: localhost:$2 | ||
sslTargetOverrideUrlSubstitutionExp: $1.org1.example.com | ||
mappedHost: local.peer0.org1.example.com | ||
|
||
- pattern: peer0.org2.example.com:8051 | ||
urlSubstitutionExp: localhost:8051 | ||
sslTargetOverrideUrlSubstitutionExp: peer0.org2.example.com | ||
mappedHost: local.peer0.org2.example.com | ||
|
||
orderer: | ||
- pattern: (\w+).example.(\w+) | ||
urlSubstitutionExp: localhost:7050 | ||
sslTargetOverrideUrlSubstitutionExp: orderer.example.com | ||
mappedHost: local.orderer.example.com | ||
|
||
- pattern: (\w+).example.(\w+):(\d+) | ||
urlSubstitutionExp: localhost:7050 | ||
sslTargetOverrideUrlSubstitutionExp: orderer.example.com | ||
mappedHost: local.orderer.example.com | ||
|
||
certificateAuthority: | ||
- pattern: (\w+).org1.example.(\w+) | ||
urlSubstitutionExp: https://localhost:7054 | ||
mappedHost: local.ca.org1.example.com | ||
|
||
- pattern: (\w+).org2.example.(\w+) | ||
urlSubstitutionExp: https://localhost:8054 | ||
mappedHost: local.ca.org2.example.com |
183 changes: 183 additions & 0 deletions
183
test/fixtures/config/overrides/local_orderers_peers_ca_bootstrap.yaml
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,183 @@ | ||
# | ||
# Copyright SecureKey Technologies Inc. All Rights Reserved. | ||
# | ||
# 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 | ||
# knowledge that must be acquired from out-of-band sources. This file provides such a source. | ||
# | ||
|
||
# | ||
# list of participating organizations in this network | ||
# | ||
organizations: | ||
org1: | ||
mspid: Org1MSP | ||
|
||
# This org's MSP store (absolute path or relative to client.cryptoconfig) | ||
cryptoPath: peerOrganizations/org1.example.com/users/{username}@org1.example.com/msp | ||
|
||
peers: | ||
- local.peer0.org1.example.com | ||
|
||
org2: | ||
mspid: Org2MSP | ||
|
||
# This org's MSP store (absolute path or relative to client.cryptoconfig) | ||
cryptoPath: peerOrganizations/org2.example.com/users/{username}@org2.example.com/msp | ||
|
||
peers: | ||
- local.peer0.org2.example.com | ||
|
||
# Orderer Org name | ||
ordererorg: | ||
# Membership Service Provider ID for this organization | ||
mspID: "OrdererOrg" | ||
|
||
# Needed to load users crypto keys and certs for this org (absolute path or relative to global crypto path, DEV mode) | ||
cryptoPath: ordererOrganizations/example.com/users/{username}@example.com/msp | ||
|
||
|
||
channels: | ||
# multi-org test channel | ||
orgchannel: | ||
|
||
# anchor peers only for the bootstrap config is required, other org's peers will be discovered | ||
peers: | ||
local.peer0.org1.example.com: | ||
endorsingPeer: true | ||
chaincodeQuery: true | ||
ledgerQuery: true | ||
eventSource: true | ||
|
||
local.peer0.org2.example.com: | ||
endorsingPeer: true | ||
chaincodeQuery: true | ||
ledgerQuery: true | ||
eventSource: true | ||
|
||
policies: | ||
queryChannelConfig: | ||
minResponses: 1 | ||
maxTargets: 1 | ||
retryOpts: | ||
attempts: 5 | ||
initialBackoff: 500ms | ||
maxBackoff: 5s | ||
backoffFactor: 2.0 | ||
|
||
# | ||
# List of orderers to send transaction and channel create/update requests to. For the time | ||
# being only one orderer is needed. If more than one is defined, which one get used by the | ||
# SDK is implementation specific. Consult each SDK's documentation for its handling of orderers. | ||
# | ||
orderers: | ||
local.orderer.example.com: | ||
url: orderer.example.com:7050 | ||
|
||
# these are standard properties defined by the gRPC library | ||
# they will be passed in as-is to gRPC client constructor | ||
grpcOptions: | ||
ssl-target-name-override: orderer.example.com | ||
# These parameters should be set in coordination with the keepalive policy on the server, | ||
# as incompatible settings can result in closing of connection. | ||
# When duration of the 'keep-alive-time' is set to 0 or less the keep alive client parameters are disabled | ||
keep-alive-time: 0s | ||
keep-alive-timeout: 20s | ||
keep-alive-permit: false | ||
fail-fast: false | ||
# allow-insecure will be taken into consideration if address has no protocol defined, if true then grpc or else grpcs | ||
allow-insecure: false | ||
|
||
tlsCACerts: | ||
# Certificate location absolute path | ||
path: ${GOPATH}/src/github.com/hyperledger/fabric-sdk-go/${CRYPTOCONFIG_FIXTURES_PATH}/ordererOrganizations/example.com/tlsca/tlsca.example.com-cert.pem | ||
|
||
# | ||
# List of peers to send various requests to, including endorsement, query | ||
# and event listener registration. | ||
# | ||
peers: | ||
local.peer0.org1.example.com: | ||
# this URL is used to send endorsement and query requests | ||
url: localhost:7051 | ||
|
||
grpcOptions: | ||
ssl-target-name-override: peer0.org1.example.com | ||
# These parameters should be set in coordination with the keepalive policy on the server, | ||
# as incompatible settings can result in closing of connection. | ||
# When duration of the 'keep-alive-time' is set to 0 or less the keep alive client parameters are disabled | ||
keep-alive-time: 0s | ||
keep-alive-timeout: 20s | ||
keep-alive-permit: false | ||
fail-fast: false | ||
# allow-insecure will be taken into consideration if address has no protocol defined, if true then grpc or else grpcs | ||
allow-insecure: false | ||
|
||
tlsCACerts: | ||
# Certificate location absolute path | ||
path: ${GOPATH}/src/github.com/hyperledger/fabric-sdk-go/${CRYPTOCONFIG_FIXTURES_PATH}/peerOrganizations/org1.example.com/tlsca/tlsca.org1.example.com-cert.pem | ||
|
||
local.peer0.org2.example.com: | ||
url: localhost:8051 | ||
grpcOptions: | ||
ssl-target-name-override: peer0.org2.example.com | ||
# These parameters should be set in coordination with the keepalive policy on the server, | ||
# as incompatible settings can result in closing of connection. | ||
# When duration of the 'keep-alive-time' is set to 0 or less the keep alive client parameters are disabled | ||
keep-alive-time: 0s | ||
keep-alive-timeout: 20s | ||
keep-alive-permit: false | ||
fail-fast: false | ||
# allow-insecure will be taken into consideration if address has no protocol defined, if true then grpc or else grpcs | ||
allow-insecure: false | ||
|
||
tlsCACerts: | ||
path: ${GOPATH}/src/github.com/hyperledger/fabric-sdk-go/${CRYPTOCONFIG_FIXTURES_PATH}/peerOrganizations/org2.example.com/tlsca/tlsca.org2.example.com-cert.pem | ||
|
||
# | ||
# Fabric-CA is a special kind of Certificate Authority provided by Hyperledger Fabric which allows | ||
# certificate management to be done via REST APIs. Application may choose to use a standard | ||
# Certificate Authority instead of Fabric-CA, in which case this section would not be specified. | ||
# | ||
certificateAuthorities: | ||
local.ca.org1.example.com: | ||
url: https://ca.org1.example.com:7054 | ||
tlsCACerts: | ||
# Comma-Separated list of paths | ||
path: ${GOPATH}/src/github.com/hyperledger/fabric-sdk-go/test/fixtures/fabricca/tls/certs/ca_root.pem | ||
# Client key and cert for SSL handshake with Fabric CA | ||
client: | ||
key: | ||
path: ${GOPATH}/src/github.com/hyperledger/fabric-sdk-go/test/fixtures/fabricca/tls/certs/client/client_fabric_client-key.pem | ||
cert: | ||
path: ${GOPATH}/src/github.com/hyperledger/fabric-sdk-go/test/fixtures/fabricca/tls/certs/client/client_fabric_client.pem | ||
|
||
# Fabric-CA supports dynamic user enrollment via REST APIs. A "root" user, a.k.a registrar, is | ||
# needed to enroll and invoke new users. | ||
registrar: | ||
enrollId: admin | ||
enrollSecret: adminpw | ||
# [Optional] The optional name of the CA. | ||
caName: ca.org1.example.com | ||
local.ca.org2.example.com: | ||
url: https://ca.org2.example.com:8054 | ||
tlsCACerts: | ||
# Comma-Separated list of paths | ||
path: ${GOPATH}/src/github.com/hyperledger/fabric-sdk-go/test/fixtures/fabricca/tls/certs/ca_root.pem | ||
# Client key and cert for SSL handshake with Fabric CA | ||
client: | ||
key: | ||
path: ${GOPATH}/src/github.com/hyperledger/fabric-sdk-go/test/fixtures/fabricca/tls/certs/client/client_fabric_client-key.pem | ||
cert: | ||
path: ${GOPATH}/src/github.com/hyperledger/fabric-sdk-go/test/fixtures/fabricca/tls/certs/client/client_fabric_client.pem | ||
|
||
# Fabric-CA supports dynamic user enrollment via REST APIs. A "root" user, a.k.a registrar, is | ||
# needed to enroll and invoke new users. | ||
registrar: | ||
enrollId: admin | ||
enrollSecret: adminpw | ||
# [Optional] The optional name of the CA. | ||
caName: ca.org2.example.com |
Oops, something went wrong.