Skip to content

Commit ce733d2

Browse files
committed
Basic endorser service and BDD
Change-Id: Id811b29aa319e242d505ab80bb330934cf07f352 Signed-off-by: jeffgarratt <[email protected]>
1 parent 543baa3 commit ce733d2

16 files changed

+1371
-92
lines changed

bddtests/.behaverc

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ tags=~@issue_767
66
~@issue_1565
77
~@issue_RBAC_TCERT_With_Attributes
88
~@sdk
9-
~@endorser
9+
~@FAB-314

bddtests/chaincode_pb2.py

+124-57
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bddtests/chaincodeevent_pb2.py

+97
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bddtests/docker-compose-next-4.yml

+68
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
membersrvc0:
2+
extends:
3+
file: compose-defaults.yml
4+
service: membersrvc
5+
6+
orderer0:
7+
extends:
8+
file: docker-compose-orderer-solo.yml
9+
service: orderer0
10+
11+
12+
vp0:
13+
extends:
14+
file: docker-compose-next.yml
15+
service: vpNext
16+
environment:
17+
- CORE_PEER_ID=vp0
18+
- CORE_SECURITY_ENROLLID=test_vp0
19+
- CORE_SECURITY_ENROLLSECRET=MwYpmSRjupbT
20+
- CORE_PEER_PROFILE_ENABLED=true
21+
links:
22+
- membersrvc0
23+
- orderer0
24+
# ports:
25+
# - 7050:6060
26+
27+
28+
vp1:
29+
extends:
30+
file: docker-compose-next.yml
31+
service: vpNext
32+
environment:
33+
- CORE_PEER_ID=vp1
34+
- CORE_PEER_DISCOVERY_ROOTNODE=vp0:7051
35+
- CORE_SECURITY_ENROLLID=test_vp1
36+
- CORE_SECURITY_ENROLLSECRET=5wgHK9qqYaPy
37+
links:
38+
- membersrvc0
39+
- orderer0
40+
- vp0
41+
42+
vp2:
43+
extends:
44+
file: docker-compose-next.yml
45+
service: vpNext
46+
environment:
47+
- CORE_PEER_ID=vp2
48+
- CORE_PEER_DISCOVERY_ROOTNODE=vp0:7051
49+
- CORE_SECURITY_ENROLLID=test_vp2
50+
- CORE_SECURITY_ENROLLSECRET=vQelbRvja7cJ
51+
links:
52+
- membersrvc0
53+
- orderer0
54+
- vp0
55+
56+
vp3:
57+
extends:
58+
file: docker-compose-next.yml
59+
service: vpNext
60+
environment:
61+
- CORE_PEER_ID=vp3
62+
- CORE_PEER_DISCOVERY_ROOTNODE=vp0:7051
63+
- CORE_SECURITY_ENROLLID=test_vp3
64+
- CORE_SECURITY_ENROLLSECRET=9LKqKH5peurL
65+
links:
66+
- membersrvc0
67+
- orderer0
68+
- vp0

bddtests/docker-compose-next.yml

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
vpNext:
2+
extends:
3+
file: compose-defaults.yml
4+
service: vp
5+
environment:
6+
- CORE_NEXT=true
7+
- CORE_PEER_ENDORSER_ENABLED=true
8+
- CORE_SECURITY_ENABLED=true
9+
- CORE_PEER_PKI_ECA_PADDR=membersrvc0:7054
10+
- CORE_PEER_PKI_TCA_PADDR=membersrvc0:7054
11+
- CORE_PEER_PKI_TLSCA_PADDR=membersrvc0:7054
12+
- CORE_PEER_PKI_TLS_ROOTCERT_FILE=./bddtests/tlsca.cert
13+

bddtests/endorser.feature

+89
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
#
2+
# Test Endorser function
3+
#
4+
# Tags that can be used and will affect test internals:
5+
# @doNotDecompose will NOT decompose the named compose_yaml after scenario ends. Useful for setting up environment and reviewing after scenario.
6+
# @chaincodeImagesUpToDate use this if all scenarios chaincode images are up to date, and do NOT require building. BE SURE!!!
7+
8+
#@chaincodeImagesUpToDate
9+
@endorser
10+
Feature: Endorser
11+
As a application developer
12+
I want to get endorsements and submit transactions and receive events
13+
14+
Scenario: Peers list test, single peer issue #827
15+
Given we compose "docker-compose-1.yml"
16+
When requesting "/network/peers" from "vp0"
17+
Then I should get a JSON response with array "peers" contains "1" elements
18+
19+
# @doNotDecompose
20+
@FAB-184
21+
Scenario Outline: Basic deploy endorsement for chaincode through GRPC to multiple endorsers
22+
23+
Given we compose "<ComposeFile>"
24+
And I wait "1" seconds
25+
And I register with CA supplying username "binhn" and secret "7avZQLwcUe9q" on peers:
26+
| vp0 |
27+
28+
When user "binhn" creates a chaincode spec of type "GOLANG" for chaincode "github.com/hyperledger/fabric/examples/chaincode/go/chaincode_example02" aliased as "cc_spec" with args
29+
| funcName | arg1 | arg2 | arg3 | arg4 |
30+
| init | a | 100 | b | 200 |
31+
And user "binhn" creates a deployment proposal "proposal1" using chaincode spec "cc_spec"
32+
And user "binhn" sends proposal "proposal1" to endorsers with timeout of "2" seconds:
33+
| vp0 | vp1 | vp2 | vp3 |
34+
And user "binhn" stores their last result as "proposal1Responses"
35+
Then user "binhn" expects proposal responses "proposal1Responses" with status "200" from endorsers:
36+
| vp0 | vp1 | vp2 | vp3 |
37+
38+
39+
Examples: Orderer Options
40+
| ComposeFile | Waittime |
41+
| docker-compose-next-4.yml | 60 |
42+
43+
44+
# @doNotDecompose
45+
@FAB-314
46+
Scenario Outline: Advanced deploy endorsement with ESCC for chaincode through GRPC to single endorser
47+
48+
Given we compose "<ComposeFile>"
49+
And I register with CA supplying username "binhn" and secret "7avZQLwcUe9q" on peers:
50+
| vp0 |
51+
52+
When user "binhn" creates a chaincode spec of type "GOLANG" for chaincode "github.com/hyperledger/fabric/examples/chaincode/go/chaincode_example02" aliased as "cc_spec" with args
53+
| funcName | arg1 | arg2 | arg3 | arg4 |
54+
| init | a | 100 | b | 200 |
55+
And user "binhn" sets ESCC to "my_escc" for chaincode spec "cc_spec"
56+
And user "binhn" creates a deployment proposal "proposal1" using chaincode spec "cc_spec"
57+
And user "binhn" sends proposal "proposal1" to endorsers with timeout of "2" seconds:
58+
| vp0 | vp1 | vp2 | vp3 |
59+
And user "binhn" stores their last result as "proposal1Responses"
60+
Then user "binhn" expects proposal responses "proposal1Responses" with status "200" from endorsers:
61+
| vp0 | vp1 | vp2 | vp3 |
62+
63+
Examples: Orderer Options
64+
| ComposeFile | Waittime |
65+
| docker-compose-next-4.yml | 60 |
66+
67+
# @doNotDecompose
68+
@FAB-314
69+
Scenario Outline: Advanced deploy endorsement with VSCC for chaincode through GRPC to single endorser
70+
71+
Given we compose "<ComposeFile>"
72+
And I register with CA supplying username "binhn" and secret "7avZQLwcUe9q" on peers:
73+
| vp0 |
74+
75+
When user "binhn" creates a chaincode spec of type "GOLANG" for chaincode "github.com/hyperledger/fabric/examples/chaincode/go/chaincode_example02" aliased as "cc_spec" with args
76+
| funcName | arg1 | arg2 | arg3 | arg4 |
77+
| init | a | 100 | b | 200 |
78+
And user "binhn" sets VSCC to "my_vscc" for chaincode spec "cc_spec"
79+
And user "binhn" creates a deployment proposal "proposal1" using chaincode spec "cc_spec"
80+
And user "binhn" sends proposal "proposal1" to endorsers with timeout of "2" seconds:
81+
| vp0 | vp1 | vp2 | vp3 |
82+
And user "binhn" stores their last result as "proposal1Responses"
83+
Then user "binhn" expects proposal responses "proposal1Responses" with status "200" from endorsers:
84+
| vp0 | vp1 | vp2 | vp3 |
85+
86+
Examples: Orderer Options
87+
| ComposeFile | Waittime |
88+
| docker-compose-next-4.yml | 60 |
89+

0 commit comments

Comments
 (0)