-
Notifications
You must be signed in to change notification settings - Fork 10
/
chaincode-ops-on-docker.feature
120 lines (99 loc) · 9.73 KB
/
chaincode-ops-on-docker.feature
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
#
# Copyright 2020-2021 Hitachi, Ltd., Hitachi America, Ltd. All Rights Reserved.
#
# SPDX-License-Identifier: Apache-2.0
@on-docker
Feature: Chaincode ops on docker-based Fabric network
Background: Bootstrap a Fabric network with OpsSC on docker
Given download Fabric binaries
Given bootstrap a Fabric network with CAs
Given create mychannel channel
Given create ops-channel channel
Given deploy channel-ops for opssc on ops-channel
Given deploy chaincode-ops for opssc on ops-channel
Given register orgs info for system-channel (type: system) to opssc on ops-channel
Given register orgs info for ops-channel (type: ops) to opssc on ops-channel
Given register orgs info for mychannel (type: application) to opssc on ops-channel
Given bootstrap opssc-api-servers for initial orgs
# Disabled channels are ignored by OpsSC Agents
Given register orgs info for invalid-channel (type: application) to opssc on ops-channel
Given disable invalid-channel channel on opssc via opssc-api-server
Given bootstrap opssc-agents for initial orgs
Then 2 chaincodes should be committed on ops-channel
Scenario: Chaincode ops on docker-based Fabric network by using OpsSC
# New chaincode deployment (golang)
When org1 requests a proposal to deploy the chaincode (name: basic, seq: 1, channel: mychannel) based on basic golang template via opssc-api-server
And org2 votes for the proposal for chaincode (name: basic, seq: 1, channel: mychannel) with opssc-api-server
Then the proposal for chaincode (name: basic, seq: 1, channel: mychannel) should be voted (with agreed) by 2 or more orgs
And the proposal for chaincode (name: basic, seq: 1, channel: mychannel) should be acknowledged (with success) by 2 or more orgs
And the proposal for chaincode (name: basic, seq: 1, channel: mychannel) should be committed (with success) by 1 or more orgs
And the proposal status for chaincode (name: basic, seq: 1, channel: mychannel) should be committed
And chaincode (name: basic, seq: 1, channel: mychannel) should be committed over the fabric network
And chaincode (name: basic, channel: mychannel) based on basic should be able to register the asset (ID: asset101) by invoking CreateAsset func
And chaincode (name: basic, channel: mychannel) based on basic golang should be able to get the asset (ID: asset101) by querying ReadAsset func
# New chaincode deployment (private-data)
When org1 requests a proposal to deploy the chaincode (name: private, seq: 1, channel: mychannel) based on private golang template via opssc-api-server
And org2 votes for the proposal for chaincode (name: private, seq: 1, channel: mychannel) with opssc-api-server
Then the proposal for chaincode (name: private, seq: 1, channel: mychannel) should be voted (with agreed) by 2 or more orgs
And the proposal for chaincode (name: private, seq: 1, channel: mychannel) should be acknowledged (with success) by 2 or more orgs
And the proposal for chaincode (name: private, seq: 1, channel: mychannel) should be committed (with success) by 1 or more orgs
And the proposal status for chaincode (name: private, seq: 1, channel: mychannel) should be committed
And chaincode (name: private, seq: 1, channel: mychannel) should be committed over the fabric network
And chaincode (name: private, channel: mychannel) should be set the collections for private template
# Set max malicious orgs in votes to 0
When consortium sets max malicious orgs in votes (number: 0)
# Chaincode update
When org1 requests a proposal to deploy the chaincode (name: basic, seq: 2, channel: mychannel) based on basic golang template via opssc-api-server
Then the proposal for chaincode (name: basic, seq: 2, channel: mychannel) should be voted (with agreed) by 1 or more orgs
And the proposal for chaincode (name: basic, seq: 2, channel: mychannel) should be acknowledged (with success) by 2 or more orgs
And the proposal for chaincode (name: basic, seq: 2, channel: mychannel) should be committed (with success) by 1 or more orgs
And the proposal status for chaincode (name: basic, seq: 2, channel: mychannel) should be committed
And chaincode (name: basic, seq: 2, channel: mychannel) should be committed over the fabric network
And chaincode (name: basic, channel: mychannel) based on basic should be able to register the asset (ID: asset102) by invoking CreateAsset func
And chaincode (name: basic, channel: mychannel) based on basic golang should be able to get the asset (ID: asset102) by querying ReadAsset func
# Unset max malicious orgs in votes
When consortium unsets max malicious orgs in votes
# Chaincode update for one not yet deployed
When org1 requests a proposal to deploy the chaincode (name: basic2, seq: 2, channel: mychannel) based on basic golang template via opssc-api-server
And org2 votes for the proposal for chaincode (name: basic2, seq: 2, channel: mychannel) with opssc-api-server
Then the proposal for chaincode (name: basic2, seq: 2, channel: mychannel) should be voted (with agreed) by 2 or more orgs
And the proposal for chaincode (name: basic2, seq: 2, channel: mychannel) should be acknowledged (with failure) by 2 or more orgs
# New chaincode deployment (javascript)
When org1 requests a proposal to deploy the chaincode (name: basic-js, seq: 1, channel: mychannel) based on basic javascript template via opssc-api-server
And org2 votes for the proposal for chaincode (name: basic-js, seq: 1, channel: mychannel) with opssc-api-server
Then the proposal for chaincode (name: basic-js, seq: 1, channel: mychannel) should be voted (with agreed) by 2 or more orgs
And the proposal for chaincode (name: basic-js, seq: 1, channel: mychannel) should be acknowledged (with success) by 2 or more orgs
And the proposal for chaincode (name: basic-js, seq: 1, channel: mychannel) should be committed (with success) by 1 or more orgs
And the proposal status for chaincode (name: basic-js, seq: 1, channel: mychannel) should be committed
And chaincode (name: basic-js, seq: 1, channel: mychannel) should be committed over the fabric network
And chaincode (name: basic-js, channel: mychannel) based on basic should be able to register the asset (ID: asset101) by invoking CreateAsset func
And chaincode (name: basic-js, channel: mychannel) based on basic javascript should be able to get the asset (ID: asset101) by querying ReadAsset func
# New chaincode deployment (typescript)
When org1 requests a proposal to deploy the chaincode (name: basic-ts, seq: 1, channel: mychannel) based on basic typescript template via opssc-api-server
And org2 votes for the proposal for chaincode (name: basic-ts, seq: 1, channel: mychannel) with opssc-api-server
Then the proposal for chaincode (name: basic-ts, seq: 1, channel: mychannel) should be voted (with agreed) by 2 or more orgs
And the proposal for chaincode (name: basic-ts, seq: 1, channel: mychannel) should be acknowledged (with success) by 2 or more orgs
And the proposal for chaincode (name: basic-ts, seq: 1, channel: mychannel) should be committed (with success) by 1 or more orgs
And the proposal status for chaincode (name: basic-ts, seq: 1, channel: mychannel) should be committed
And chaincode (name: basic-ts, seq: 1, channel: mychannel) should be committed over the fabric network
And chaincode (name: basic-ts, channel: mychannel) based on basic should be able to register the asset (ID: asset101) by invoking CreateAsset func
And chaincode (name: basic-ts, channel: mychannel) based on basic typescript should be able to get the asset (ID: asset101) by querying ReadAsset func
# Chaincode update proposal is withdrawn
When org1 requests a proposal to deploy the chaincode (name: basic4, seq: 1, channel: mychannel) based on basic golang template via opssc-api-server
And org1 withdraws the proposal for chaincode (name: basic4, seq: 1, channel: mychannel) with opssc-api-server
Then the proposal status for chaincode (name: basic4, seq: 1, channel: mychannel) should be withdrawn
# Vote from each org cannot be updated
When org1 requests a proposal to deploy the chaincode (name: basic3, seq: 1, channel: mychannel) based on basic golang template via opssc-api-server
Then org1 fails to approve the proposal for chaincode (name: basic3, seq: 1, channel: mychannel) with an error (the state is already exists: Org1MSP)
## -- A proposal is not withdrawn with the request of anyone other than the proposer
And org2 fails to withdraw the proposal for chaincode (name: basic3, seq: 1, channel: mychannel) with an error (only the proposer (Org1MSP) can withdraw the proposal)
# Chaincode update rejected
When org1 requests a proposal to deploy the chaincode (name: basic, seq: 3, channel: mychannel) based on basic golang template via opssc-api-server
And org2 votes against the proposal for chaincode (name: basic, seq: 3, channel: mychannel) with opssc-api-server
Then the proposal for chaincode (name: basic, seq: 3, channel: mychannel) should be voted (with disagreed) by 1 or more orgs
And the proposal status for chaincode (name: basic, seq: 3, channel: mychannel) should be rejected
## -- A proposal is not withdrawn after the decision
Then org1 fails to withdraw the proposal for chaincode (name: basic, seq: 3, channel: mychannel) with an error (the voting is already closed)
# Chaincode update proposals rejected for a system or disable channel
Then org1 fails to request a proposal to deploy the chaincode (name: basic, seq: 1, channel: system-channel) based on basic golang template via opssc-api-server
Then org1 fails to request a proposal to deploy the chaincode (name: basic, seq: 1, channel: invalid-channel) based on basic golang template via opssc-api-server