Skip to content

Commit f069d85

Browse files
authored
add test for go chaincode in fabric v3 and bump tools version to 3.1.3 (#661)
Signed-off-by: Arne Rutjes <arne123@gmail.com>
1 parent a2ddb3d commit f069d85

14 files changed

Lines changed: 675 additions & 217 deletions

e2e-network/TEST_CASES.md

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
# Test cases
22

3-
| Test case | 01-v2-simple | 02-v2-raft-2orgs | 03-v2-private-data | 04-v2-snapshot | test-05-v3 | test-06-v3-bft |
4-
| ------------------------- |:---------------:|:-----------:|:----------:|:------------------------:|:------------------:|:---------------------:|
5-
| Fabric versions | 2.5.12 | 2.4.3 | 2.5.12 | 2.5.12 | 3.0.0 | 3.0.0 |
6-
| TLS | no | yes | no | yes | yes | yes |
7-
| Channel capabilities | v2 | v2 | v2_5 | v2 | v3_0 | v3_0 |
8-
| Consensus | solo | RAFT | solo | RAFT | RAFT | BFT |
9-
| Orderer nodes | 1 | 3 | 1 | 1 | 3 | 4 |
10-
| Organizations | 1 | 2 | 2 | 1 | 1 | 1 |
11-
| CA database | SQLite | SQLite | SQLite | Postgres | SQLite | SQLite |
12-
| Peer database | LevelDB | LevelDB | LevelDB | CouchDB | LevelDB | LevelDB |
13-
| Peer count | 2 | 2, 2 | 2, 1 | 2 | 2 | 2 |
14-
| Channels | 1 | 2 | 1 | 1 | 1 | 1 |
15-
| Node chaincode | yes | yes | yes | yes | yes | yes |
16-
| Node chaincode upgrade | no | yes | no | no | no | no |
17-
| Node chaincode endorsement| OR | OR | OR, AND | default | OR | OR |
18-
| Private data | no | no | yes | yes | no | no |
19-
| Java chaincode | no | yes | no | no | no | no |
20-
| Go chaincode | no | no | yes | no | no | no |
21-
| Tools | channel scripts | Fablo REST | - | Fablo REST, Explorer | - | - |
22-
| Other Fablo commands | init, reset | stop, start | - | snapshot, prune, restore | - | - |
3+
| Test case | 01-v2-simple | 02-v2-raft-2orgs | 03-v2-private-data | 04-v2-snapshot | test-05-v3 | test-06-v3-bft |
4+
| -------------------------- | :-------------: | :--------------: | :----------------: | :----------------------: | :--------: | :------------: |
5+
| Fabric versions | 2.5.12 | 2.4.3 | 2.5.12 | 2.5.12 | 3.1.0 | 3.1.0 |
6+
| TLS | no | yes | no | yes | yes | yes |
7+
| Channel capabilities | v2 | v2 | v2_5 | v2 | v3_0 | v3_0 |
8+
| Consensus | solo | RAFT | solo | RAFT | RAFT | BFT |
9+
| Orderer nodes | 1 | 3 | 1 | 1 | 3 | 4 |
10+
| Organizations | 1 | 2 | 2 | 1 | 1 | 1 |
11+
| CA database | SQLite | SQLite | SQLite | Postgres | SQLite | SQLite |
12+
| Peer database | LevelDB | LevelDB | LevelDB | CouchDB | LevelDB | LevelDB |
13+
| Peer count | 2 | 2, 2 | 2, 1 | 2 | 2 | 2 |
14+
| Channels | 1 | 2 | 1 | 1 | 1 | 1 |
15+
| Node chaincode | yes | yes | yes | yes | yes | yes |
16+
| Node chaincode upgrade | no | yes | no | no | no | no |
17+
| Node chaincode endorsement | OR | OR | OR, AND | default | OR | OR |
18+
| Private data | no | no | yes | yes | no | no |
19+
| Java chaincode | no | yes | no | no | no | no |
20+
| Go chaincode | no | no | yes | no | yes | no |
21+
| Tools | channel scripts | Fablo REST | - | Fablo REST, Explorer | - | - |
22+
| Other Fablo commands | init, reset | stop, start | - | snapshot, prune, restore | - | - |

e2e-network/docker/test-05-v3.sh

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ FABLO_HOME="$TEST_TMP/../../.."
88

99
export FABLO_HOME
1010

11-
CONFIG="$FABLO_HOME/samples/fablo-config-hlf3-1orgs-1chaincode.json"
11+
CONFIG="$FABLO_HOME/samples/fablo-config-hlf3-1orgs-2chaincodes.json"
1212

1313
networkUp() {
1414
"$FABLO_HOME/fablo-build.sh"
@@ -108,16 +108,24 @@ expectQuery "peer1.org1.example.com" "my-channel1" "chaincode1" \
108108
'{"Args":["KVContract:get", "name"]}' \
109109
'{"success":"Willy Wonka"}'
110110

111+
# Test Go chaincode
112+
expectInvoke "peer0.org1.example.com" "my-channel1" "chaincode-go" \
113+
'{"Args":["KVContract:put", "language", "golang"]}' \
114+
'{\"success\":\"OK\"}'
115+
expectQuery "peer1.org1.example.com" "my-channel1" "chaincode-go" \
116+
'{"Args":["KVContract:get", "language"]}' \
117+
'{"success":"golang"}'
118+
111119
# Verify channel query scripts
112120
(cd "$TEST_TMP" && "$FABLO_HOME/fablo.sh" channel fetch newest my-channel1 org1 peer1)
113121
expectCommand "cat \"$TEST_TMP/newest.block\"" "KVContract:put"
114122

115-
(cd "$TEST_TMP" && "$FABLO_HOME/fablo.sh" channel fetch 3 my-channel1 org1 peer1 "another.block")
123+
(cd "$TEST_TMP" && "$FABLO_HOME/fablo.sh" channel fetch 5 my-channel1 org1 peer1 "another.block")
116124
expectCommand "cat \"$TEST_TMP/another.block\"" "put"
117125

118126
(cd "$TEST_TMP" && "$FABLO_HOME/fablo.sh" channel fetch config my-channel1 org1 peer1 "channel-config.json")
119127
expectCommand "cat \"$TEST_TMP/channel-config.json\"" "\"mod_policy\": \"Admins\","
120128

121-
expectCommand "(cd \"$TEST_TMP\" && \"$FABLO_HOME/fablo.sh\" channel getinfo my-channel1 org1 peer1)" "\"height\":5"
129+
expectCommand "(cd \"$TEST_TMP\" && \"$FABLO_HOME/fablo.sh\" channel getinfo my-channel1 org1 peer1)" "\"height\":8"
122130

123131
echo "🎉 Test passed! 🎉"

0 commit comments

Comments
 (0)