Skip to content

Commit

Permalink
Basic endorser service and BDD
Browse files Browse the repository at this point in the history
Change-Id: Id811b29aa319e242d505ab80bb330934cf07f352
Signed-off-by: jeffgarratt <garratt.jeff@gmail.com>
  • Loading branch information
jeffgarratt committed Sep 8, 2016
1 parent 543baa3 commit ce733d2
Show file tree
Hide file tree
Showing 16 changed files with 1,371 additions and 92 deletions.
2 changes: 1 addition & 1 deletion bddtests/.behaverc
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ tags=~@issue_767
~@issue_1565
~@issue_RBAC_TCERT_With_Attributes
~@sdk
~@endorser
~@FAB-314
181 changes: 124 additions & 57 deletions bddtests/chaincode_pb2.py

Large diffs are not rendered by default.

97 changes: 97 additions & 0 deletions bddtests/chaincodeevent_pb2.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

68 changes: 68 additions & 0 deletions bddtests/docker-compose-next-4.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
membersrvc0:
extends:
file: compose-defaults.yml
service: membersrvc

orderer0:
extends:
file: docker-compose-orderer-solo.yml
service: orderer0


vp0:
extends:
file: docker-compose-next.yml
service: vpNext
environment:
- CORE_PEER_ID=vp0
- CORE_SECURITY_ENROLLID=test_vp0
- CORE_SECURITY_ENROLLSECRET=MwYpmSRjupbT
- CORE_PEER_PROFILE_ENABLED=true
links:
- membersrvc0
- orderer0
# ports:
# - 7050:6060


vp1:
extends:
file: docker-compose-next.yml
service: vpNext
environment:
- CORE_PEER_ID=vp1
- CORE_PEER_DISCOVERY_ROOTNODE=vp0:7051
- CORE_SECURITY_ENROLLID=test_vp1
- CORE_SECURITY_ENROLLSECRET=5wgHK9qqYaPy
links:
- membersrvc0
- orderer0
- vp0

vp2:
extends:
file: docker-compose-next.yml
service: vpNext
environment:
- CORE_PEER_ID=vp2
- CORE_PEER_DISCOVERY_ROOTNODE=vp0:7051
- CORE_SECURITY_ENROLLID=test_vp2
- CORE_SECURITY_ENROLLSECRET=vQelbRvja7cJ
links:
- membersrvc0
- orderer0
- vp0

vp3:
extends:
file: docker-compose-next.yml
service: vpNext
environment:
- CORE_PEER_ID=vp3
- CORE_PEER_DISCOVERY_ROOTNODE=vp0:7051
- CORE_SECURITY_ENROLLID=test_vp3
- CORE_SECURITY_ENROLLSECRET=9LKqKH5peurL
links:
- membersrvc0
- orderer0
- vp0
13 changes: 13 additions & 0 deletions bddtests/docker-compose-next.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
vpNext:
extends:
file: compose-defaults.yml
service: vp
environment:
- CORE_NEXT=true
- CORE_PEER_ENDORSER_ENABLED=true
- CORE_SECURITY_ENABLED=true
- CORE_PEER_PKI_ECA_PADDR=membersrvc0:7054
- CORE_PEER_PKI_TCA_PADDR=membersrvc0:7054
- CORE_PEER_PKI_TLSCA_PADDR=membersrvc0:7054
- CORE_PEER_PKI_TLS_ROOTCERT_FILE=./bddtests/tlsca.cert

89 changes: 89 additions & 0 deletions bddtests/endorser.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
#
# Test Endorser function
#
# Tags that can be used and will affect test internals:
# @doNotDecompose will NOT decompose the named compose_yaml after scenario ends. Useful for setting up environment and reviewing after scenario.
# @chaincodeImagesUpToDate use this if all scenarios chaincode images are up to date, and do NOT require building. BE SURE!!!

#@chaincodeImagesUpToDate
@endorser
Feature: Endorser
As a application developer
I want to get endorsements and submit transactions and receive events

Scenario: Peers list test, single peer issue #827
Given we compose "docker-compose-1.yml"
When requesting "/network/peers" from "vp0"
Then I should get a JSON response with array "peers" contains "1" elements

# @doNotDecompose
@FAB-184
Scenario Outline: Basic deploy endorsement for chaincode through GRPC to multiple endorsers

Given we compose "<ComposeFile>"
And I wait "1" seconds
And I register with CA supplying username "binhn" and secret "7avZQLwcUe9q" on peers:
| vp0 |

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
| funcName | arg1 | arg2 | arg3 | arg4 |
| init | a | 100 | b | 200 |
And user "binhn" creates a deployment proposal "proposal1" using chaincode spec "cc_spec"
And user "binhn" sends proposal "proposal1" to endorsers with timeout of "2" seconds:
| vp0 | vp1 | vp2 | vp3 |
And user "binhn" stores their last result as "proposal1Responses"
Then user "binhn" expects proposal responses "proposal1Responses" with status "200" from endorsers:
| vp0 | vp1 | vp2 | vp3 |


Examples: Orderer Options
| ComposeFile | Waittime |
| docker-compose-next-4.yml | 60 |


# @doNotDecompose
@FAB-314
Scenario Outline: Advanced deploy endorsement with ESCC for chaincode through GRPC to single endorser

Given we compose "<ComposeFile>"
And I register with CA supplying username "binhn" and secret "7avZQLwcUe9q" on peers:
| vp0 |

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
| funcName | arg1 | arg2 | arg3 | arg4 |
| init | a | 100 | b | 200 |
And user "binhn" sets ESCC to "my_escc" for chaincode spec "cc_spec"
And user "binhn" creates a deployment proposal "proposal1" using chaincode spec "cc_spec"
And user "binhn" sends proposal "proposal1" to endorsers with timeout of "2" seconds:
| vp0 | vp1 | vp2 | vp3 |
And user "binhn" stores their last result as "proposal1Responses"
Then user "binhn" expects proposal responses "proposal1Responses" with status "200" from endorsers:
| vp0 | vp1 | vp2 | vp3 |

Examples: Orderer Options
| ComposeFile | Waittime |
| docker-compose-next-4.yml | 60 |

# @doNotDecompose
@FAB-314
Scenario Outline: Advanced deploy endorsement with VSCC for chaincode through GRPC to single endorser

Given we compose "<ComposeFile>"
And I register with CA supplying username "binhn" and secret "7avZQLwcUe9q" on peers:
| vp0 |

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
| funcName | arg1 | arg2 | arg3 | arg4 |
| init | a | 100 | b | 200 |
And user "binhn" sets VSCC to "my_vscc" for chaincode spec "cc_spec"
And user "binhn" creates a deployment proposal "proposal1" using chaincode spec "cc_spec"
And user "binhn" sends proposal "proposal1" to endorsers with timeout of "2" seconds:
| vp0 | vp1 | vp2 | vp3 |
And user "binhn" stores their last result as "proposal1Responses"
Then user "binhn" expects proposal responses "proposal1Responses" with status "200" from endorsers:
| vp0 | vp1 | vp2 | vp3 |

Examples: Orderer Options
| ComposeFile | Waittime |
| docker-compose-next-4.yml | 60 |

Loading

0 comments on commit ce733d2

Please sign in to comment.