Skip to content

Commit

Permalink
Experimental integration test runner using microfab
Browse files Browse the repository at this point in the history
Signed-off-by: CaptainIRS <[email protected]>
  • Loading branch information
CaptainIRS committed Oct 26, 2022
1 parent 4a64acf commit abac822
Show file tree
Hide file tree
Showing 17 changed files with 181 additions and 139 deletions.
4 changes: 4 additions & 0 deletions packages/caliper-tests-integration/fabric_tests/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
**/*.log
*.tar.gz
_cfg
bin
config
report.html
fabric-samples
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,3 @@ services:
- "9001:9001"
volumes:
- ./mosquitto/mosquitto.conf:/mosquitto/config/mosquitto.conf

networks:
default:
name: fabric_test
external: true
2 changes: 1 addition & 1 deletion packages/caliper-tests-integration/fabric_tests/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class MarblesInitWorkload extends WorkloadModuleBase {
contractId: this.txIndex % 2 === 0 ? 'mymarbles' : 'yourmarbles',
contractFunction: 'initMarble',
contractArguments: [marbleName, marbleColor, marbleSize, marbleOwner],
invokerIdentity: 'client0.org1.example.com',
invokerIdentity: 'client0.org1.127-0-0-1.nip.io:8080',
timeout: 5,
readOnly: false
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,10 @@ class MarblesInitByChannelWorkload extends WorkloadModuleBase {
contractId: this.txIndex % 2 === 0 ? 'mymarbles' : 'yourmarbles',
contractVersion: 'v0',
contractFunction: 'initMarble',
invokerIdentity: 'client0.org1.example.com',
invokerIdentity: 'client0.org1.127-0-0-1.nip.io:8080',
channel: this.txIndex % 2 === 0 ? 'mychannel' : 'yourchannel',
contractArguments: [marbleName, marbleColor, marbleSize, marbleOwner],
timeout: 5,
timeout: 10,
readOnly: false
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,47 +25,41 @@ organizations:
Org1:
mspid: Org1MSP
peers:
- peer0.org1.example.com
- org1peer-api.127-0-0-1.nip.io:8080

orderers:
orderer.example.com:
url: grpcs://localhost:7050
orderer-api.127-0-0-1.nip.io:8080:
url: grpc://orderer-api.127-0-0-1.nip.io:8080
grpcOptions:
ssl-target-name-override: orderer.example.com
tlsCACerts:
path: ./fabric-samples/test-network/organizations/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem
ssl-target-name-override: orderer-api.127-0-0-1.nip.io:8080

peers:
peer0.org1.example.com:
url: grpcs://localhost:7051
org1peer-api.127-0-0-1.nip.io:8080:
url: grpc://org1peer-api.127-0-0-1.nip.io:8080
grpcOptions:
ssl-target-name-override: peer0.org1.example.com
ssl-target-name-override: org1peer-api.127-0-0-1.nip.io
grpc.keepalive_time_ms: 600000
tlsCACerts:
path: ./fabric-samples/test-network/organizations/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/msp/tlscacerts/tlsca.org1.example.com-cert.pem

peer0.org2.example.com:
url: grpcs://localhost:9051
org2peer-api.127-0-0-1.nip.io:8080:
url: grpc://org2peer-api.127-0-0-1.nip.io:8080
grpcOptions:
ssl-target-name-override: peer0.org2.example.com
ssl-target-name-override: org2peer-api.127-0-0-1.nip.io
grpc.keepalive_time_ms: 600000
tlsCACerts:
path: ./fabric-samples/test-network/organizations/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/msp/tlscacerts/tlsca.org2.example.com-cert.pem

channels:
mychannel:
orderers:
- orderer.example.com
- orderer-api.127-0-0-1.nip.io:8080
peers:
peer0.org1.example.com:
org1peer-api.127-0-0-1.nip.io:8080:
eventSource: true
peer0.org2.example.com:
org2peer-api.127-0-0-1.nip.io:8080:
eventSource: true
yourchannel:
orderers:
- orderer.example.com
- orderer-api.127-0-0-1.nip.io:8080
peers:
peer0.org1.example.com:
org1peer-api.127-0-0-1.nip.io:8080:
eventSource: true
peer0.org2.example.com:
org2peer-api.127-0-0-1.nip.io:8080:
eventSource: true
Original file line number Diff line number Diff line change
Expand Up @@ -25,47 +25,41 @@ organizations:
Org2:
mspid: Org2MSP
peers:
- peer0.org2.example.com
- org2peer-api.127-0-0-1.nip.io:8080

orderers:
orderer.example.com:
url: grpcs://localhost:7050
orderer-api.127-0-0-1.nip.io:8080:
url: grpc://orderer-api.127-0-0-1.nip.io:8080
grpcOptions:
ssl-target-name-override: orderer.example.com
tlsCACerts:
path: ./fabric-samples/test-network/organizations/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem
ssl-target-name-override: orderer-api.127-0-0-1.nip.io:8080

peers:
peer0.org1.example.com:
url: grpcs://localhost:7051
org1peer-api.127-0-0-1.nip.io:8080:
url: grpc://org1peer-api.127-0-0-1.nip.io:8080
grpcOptions:
ssl-target-name-override: peer0.org1.example.com
ssl-target-name-override: org1peer-api.127-0-0-1.nip.io
grpc.keepalive_time_ms: 600000
tlsCACerts:
path: ./fabric-samples/test-network/organizations/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/msp/tlscacerts/tlsca.org1.example.com-cert.pem

peer0.org2.example.com:
url: grpcs://localhost:9051
org2peer-api.127-0-0-1.nip.io:8080:
url: grpc://org2peer-api.127-0-0-1.nip.io:8080
grpcOptions:
ssl-target-name-override: peer0.org2.example.com
ssl-target-name-override: org2peer-api.127-0-0-1.nip.io
grpc.keepalive_time_ms: 600000
tlsCACerts:
path: ./fabric-samples/test-network/organizations/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/msp/tlscacerts/tlsca.org2.example.com-cert.pem

channels:
mychannel:
orderers:
- orderer.example.com
- orderer-api.127-0-0-1.nip.io:8080
peers:
peer0.org1.example.com:
org1peer-api.127-0-0-1.nip.io:8080:
eventSource: true
peer0.org2.example.com:
org2peer-api.127-0-0-1.nip.io:8080:
eventSource: true
yourchannel:
orderers:
- orderer.example.com
- orderer-api.127-0-0-1.nip.io:8080
peers:
peer0.org1.example.com:
org1peer-api.127-0-0-1.nip.io:8080:
eventSource: true
peer0.org2.example.com:
org2peer-api.127-0-0-1.nip.io:8080:
eventSource: true
Original file line number Diff line number Diff line change
Expand Up @@ -32,23 +32,23 @@ organizations:
- mspid: Org1MSP
identities:
certificates:
- name: 'client0.org1.example.com'
- name: 'client0.org1.127-0-0-1.nip.io:8080'
clientPrivateKey:
path: '../fabric-samples/test-network/organizations/peerOrganizations/org1.example.com/users/[email protected]/msp/keystore/priv_sk'
path: '../_cfg/uf/_msp/Org1/org1admin/msp/keystore/cert_sk'
clientSignedCert:
path: '../fabric-samples/test-network/organizations/peerOrganizations/org1.example.com/users/[email protected]/msp/signcerts/[email protected].pem'
path: '../_cfg/uf/_msp/Org1/org1admin/msp/signcerts/org1admin.pem'
connectionProfile:
path: './ccp-org1.yaml'
discover: false

- mspid: Org2MSP
identities:
certificates:
- name: 'client0.org2.example.com'
- name: 'client0.org2.127-0-0-1.nip.io:8080'
clientPrivateKey:
path: '../fabric-samples/test-network/organizations/peerOrganizations/org2.example.com/users/[email protected]/msp/keystore/priv_sk'
path: '../_cfg/uf/_msp/Org2/org2admin/msp/keystore/cert_sk'
clientSignedCert:
path: '../fabric-samples/test-network/organizations/peerOrganizations/org2.example.com/users/[email protected]/msp/signcerts/[email protected].pem'
path: '../_cfg/uf/_msp/Org2/org2admin/msp/signcerts/org2admin.pem'
connectionProfile:
path: './ccp-org2.yaml'
discover: false
Original file line number Diff line number Diff line change
Expand Up @@ -74,4 +74,4 @@ monitors:
- module: docker
options:
interval: 4
containers: ['peer0.org1.example.com', 'peer0.org2.example.com', 'orderer0.example.com', 'orderer1.example.com']
containers: ['org1peer-api.127-0-0-1.nip.io:8080', 'org2peer-api.127-0-0-1.nip.io:8080', 'orderer-api.127-0-0-1.nip.io:8080']
Original file line number Diff line number Diff line change
Expand Up @@ -32,23 +32,23 @@ organizations:
- mspid: Org1MSP
identities:
certificates:
- name: 'client0.org1.example.com'
- name: 'client0.org1.127-0-0-1.nip.io:8080'
clientPrivateKey:
path: '../fabric-samples/test-network/organizations/peerOrganizations/org1.example.com/users/[email protected]/msp/keystore/priv_sk'
path: '../_cfg/uf/_msp/Org1/org1admin/msp/keystore/cert_sk'
clientSignedCert:
path: '../fabric-samples/test-network/organizations/peerOrganizations/org1.example.com/users/[email protected]/msp/signcerts/[email protected].pem'
path: '../_cfg/uf/_msp/Org1/org1admin/msp/signcerts/org1admin.pem'
connectionProfile:
path: '../fabric-samples/test-network/organizations/peerOrganizations/org1.example.com/connection-org1.yaml'
path: '../_cfg/uf/_gateways/org1gateway.json'
discover: true

- mspid: Org2MSP
identities:
certificates:
- name: 'client0.org2.example.com'
- name: 'client0.org2.127-0-0-1.nip.io:8080'
clientPrivateKey:
path: '../fabric-samples/test-network/organizations/peerOrganizations/org2.example.com/users/[email protected]/msp/keystore/priv_sk'
path: '../_cfg/uf/_msp/Org2/org2admin/msp/keystore/cert_sk'
clientSignedCert:
path: '../fabric-samples/test-network/organizations/peerOrganizations/org2.example.com/users/[email protected]/msp/signcerts/[email protected].pem'
path: '../_cfg/uf/_msp/Org2/org2admin/msp/signcerts/org2admin.pem'
connectionProfile:
path: '../fabric-samples/test-network/organizations/peerOrganizations/org2.example.com/connection-org2.yaml'
path: '../_cfg/uf/_gateways/org2gateway.json'
discover: true
Original file line number Diff line number Diff line change
Expand Up @@ -32,23 +32,23 @@ organizations:
- mspid: Org1MSP
identities:
certificates:
- name: 'client0.org1.example.com'
- name: 'client0.org1.127-0-0-1.nip.io:8080'
clientPrivateKey:
path: '../fabric-samples/test-network/organizations/peerOrganizations/org1.example.com/users/[email protected]/msp/keystore/priv_sk'
path: '../_cfg/uf/_msp/Org1/org1admin/msp/keystore/cert_sk'
clientSignedCert:
path: '../fabric-samples/test-network/organizations/peerOrganizations/org1.example.com/users/[email protected]/msp/signcerts/[email protected].pem'
path: '../_cfg/uf/_msp/Org1/org1admin/msp/signcerts/org1admin.pem'
connectionProfile:
path: '../fabric-samples/test-network/organizations/peerOrganizations/org1.example.com/connection-org1.yaml'
path: '../_cfg/uf/_gateways/org1gateway.json'
discover: true

- mspid: Org2MSP
identities:
certificates:
- name: 'client0.org2.example.com'
- name: 'client0.org2.127-0-0-1.nip.io:8080'
clientPrivateKey:
path: '../fabric-samples/test-network/organizations/peerOrganizations/org2.example.com/users/[email protected]/msp/keystore/priv_sk'
path: '../_cfg/uf/_msp/Org2/org2admin/msp/keystore/cert_sk'
clientSignedCert:
path: '../fabric-samples/test-network/organizations/peerOrganizations/org2.example.com/users/[email protected]/msp/signcerts/[email protected].pem'
path: '../_cfg/uf/_msp/Org2/org2admin/msp/signcerts/org2admin.pem'
connectionProfile:
path: '../fabric-samples/test-network/organizations/peerOrganizations/org2.example.com/connection-org2.yaml'
path: '../_cfg/uf/_gateways/org2gateway.json'
discover: true
Original file line number Diff line number Diff line change
Expand Up @@ -77,5 +77,5 @@ monitors:
- module: docker
options:
interval: 4
containers: ['peer0.org1.example.com', 'peer0.org2.example.com', 'orderer0.example.com', 'orderer1.example.com']
containers: ['org1peer-api.127-0-0-1.nip.io:8080', 'org2peer-api.127-0-0-1.nip.io:8080', 'orderer-api.127-0-0-1.nip.io:8080']

Original file line number Diff line number Diff line change
Expand Up @@ -32,31 +32,27 @@ organizations:
- mspid: Org1MSP
identities:
certificates:
- name: 'client0.org1.example.com'
- name: 'client0.org1.127-0-0-1.nip.io:8080'
clientPrivateKey:
path: '../fabric-samples/test-network/organizations/peerOrganizations/org1.example.com/users/[email protected]/msp/keystore/priv_sk'
path: '../_cfg/uf/_msp/Org1/org1admin/msp/keystore/cert_sk'
clientSignedCert:
path: '../fabric-samples/test-network/organizations/peerOrganizations/org1.example.com/users/[email protected]/msp/signcerts/[email protected].pem'
path: '../_cfg/uf/_msp/Org1/org1admin/msp/signcerts/org1admin.pem'
peers:
- endpoint: localhost:7051
- endpoint: org1peer-api.127-0-0-1.nip.io:8080
grpcOptions:
ssl-target-name-override: peer0.org1.example.com
ssl-target-name-override: org1peer-api.127-0-0-1.nip.io
grpc.keepalive_time_ms: 600000
tlsCACerts:
path: ../fabric-samples/test-network/organizations/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/msp/tlscacerts/tlsca.org1.example.com-cert.pem

- mspid: Org2MSP
identities:
certificates:
- name: 'client0.org2.example.com'
- name: 'client0.org2.127-0-0-1.nip.io:8080'
clientPrivateKey:
path: '../fabric-samples/test-network/organizations/peerOrganizations/org2.example.com/users/[email protected]/msp/keystore/priv_sk'
path: '../_cfg/uf/_msp/Org2/org2admin/msp/keystore/cert_sk'
clientSignedCert:
path: '../fabric-samples/test-network/organizations/peerOrganizations/org2.example.com/users/[email protected]/msp/signcerts/[email protected].pem'
path: '../_cfg/uf/_msp/Org2/org2admin/msp/signcerts/org2admin.pem'
peers:
- endpoint: localhost:9051
- endpoint: org1peer-api.127-0-0-1.nip.io:8080
grpcOptions:
ssl-target-name-override: peer0.org2.example.com
ssl-target-name-override: org1peer-api.127-0-0-1.nip.io
grpc.keepalive_time_ms: 600000
tlsCACerts:
path: ../fabric-samples/test-network/organizations/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/msp/tlscacerts/tlsca.org2.example.com-cert.pem
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class MarblesQueryByChannelWorkload extends WorkloadModuleBase {
channel: this.txIndex % 2 === 0 ? 'mychannel' : 'yourchannel',
contractFunction: 'queryMarblesByOwner',
contractArguments: [marbleOwner],
invokerIdentity: 'client0.org1.example.com',
invokerIdentity: 'client0.org1.127-0-0-1.nip.io:8080',
timeout: 10
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class MarblesQueryWorkload extends WorkloadModuleBase {
contractId: this.txIndex % 2 === 0 ? 'mymarbles' : 'yourmarbles',
contractFunction: 'queryMarblesByOwner',
contractArguments: [marbleOwner],
invokerIdentity: 'client0.org1.example.com',
invokerIdentity: 'client0.org1.127-0-0-1.nip.io:8080',
timeout: 10
};

Expand Down
5 changes: 2 additions & 3 deletions packages/caliper-tests-integration/fabric_tests/query.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,8 @@ class MarblesQueryWorkload extends WorkloadModuleBase {
contractId: this.txIndex % 2 === 0 ? 'mymarbles' : 'yourmarbles',
contractFunction: 'queryMarblesByOwner',
contractArguments: [marbleOwner],
invokerIdentity: 'client0.org1.example.com',
targetPeers: ['peer0.org1.example.com'],
timeout: 10
invokerIdentity: 'client0.org1.127-0-0-1.nip.io:8080',
timeout: 10,
};

await this.sutAdapter.sendRequests(args);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,7 @@ class MarblesQueryByChannelWorkload extends WorkloadModuleBase {
channel: this.txIndex % 2 === 0 ? 'mychannel' : 'yourchannel',
contractFunction: 'queryMarblesByOwner',
contractArguments: [marbleOwner],
invokerIdentity: 'client0.org1.example.com',
targetPeers: ['peer0.org1.example.com'],
invokerIdentity: 'client0.org1.127-0-0-1.nip.io:8080',
timeout: 10
};

Expand Down
Loading

0 comments on commit abac822

Please sign in to comment.