Skip to content

Commit

Permalink
[FAB-3846]: Behave test feature file placeholders
Browse files Browse the repository at this point in the history
This commits a number of placeholder tests that
will be executed using the behave framework.

This is only a small representation of the tests that
will be written and executed.

Execute these tests by typing:
  $ behave --tags=-skip

or these tests will be executed when executing the
runDailyTestSuite.sh file with the correct tags and
will generate the results in junit with output files
in the test/regression/daily directory according to
the feature file name.

I have also updated the .gitignore to ignore the
xml files that are generated as a result of executing
the tests for CI ingestion.

Change-Id: I61fc34fd430aace182b8bdffe36d42ad73e2cc6f
Signed-off-by: Latitia M Haskins <latitia.haskins@gmail.com>
  • Loading branch information
lhaskins committed May 18, 2017
1 parent 217b8f6 commit 5522ac8
Show file tree
Hide file tree
Showing 7 changed files with 178 additions and 53 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@ bddtests/volumes
go-carpet-coverage*
# make node-sdk copied files
sdk/node/lib/protos/*
# Test result xml files
report.xml
results.xml
TESTS*.xml
.settings
.project
.gradle
Expand Down
41 changes: 41 additions & 0 deletions test/feature/bootstrap.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Copyright IBM Corp. 2017 All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

Feature: Bootstrapping Hyperledger Fabric
As a user I want to be able to bootstrap my fabric network

@skip
Scenario: FAB-3635: Configuration files generated correctly
Given I have a bootstrapped fabric network
When a user deploys chaincode
Then the chaincode is deployed

@skip
Scenario: FAB-3854: Ensure genesis block contains correct data
Given I have a bootstrapped fabric network
When a user deploys chaincode
Then the chaincode is deployed

@skip
Scenario: FAB-3856: Verify crypto material (non-TLS)
Given I have a bootstrapped fabric network
When a user deploys chaincode
Then the chaincode is deployed

@skip
Scenario: FAB-3858: Verify crypto material (TLS)
Given I have a bootstrapped fabric network
When a user deploys chaincode
Then the chaincode is deployed
13 changes: 0 additions & 13 deletions test/feature/endorser.feature

This file was deleted.

36 changes: 0 additions & 36 deletions test/feature/ft/orderer_at.feature

This file was deleted.

93 changes: 93 additions & 0 deletions test/feature/orderer.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
# Copyright IBM Corp. 2017 All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

Feature: Orderer Service
As a user I want to be able to have my transactions ordered correctly

@skip
Scenario: FAB-1335: Resilient Kafka Orderer and Brokers
Given the kafka default replication factor is 3
And the orderer Batchsize MaxMessageCount is 20
And the orderer BatchTimeout is 10 minutes
And a bootstrapped orderer network of type kafka with 3 brokers
When 10 unique messages are broadcasted
Then we get 10 successful broadcast responses
When the topic partition leader is stopped
And 10 unique messages are broadcasted
Then we get 10 successful broadcast responses
And all 20 messages are delivered in 1 block

@skip
Scenario: FAB-1306: Adding a new Kafka Broker
Given a kafka cluster
And an orderer connected to the kafka cluster
When a new organization NewOrg certificate is added
Then the NewOrg is able to connect to the kafka cluster

@skip
Scenario: FAB-1306: Multiple organizations in a kafka cluster, remove 1
Given a certificate from Org1 is added to the kafka orderer network
And a certificate from Org2 is added to the kafka orderer network
And an orderer connected to the kafka cluster
When authorization for Org2 is removed from the kafka cluster
Then the Org2 cannot connect to the kafka cluster

@skip
Scenario: FAB-1306: Multiple organizations in a cluster - remove all, reinstate 1.
Given a certificate from Org1 is added to the kafka orderer network
And a certificate from Org2 is added to the kafka orderer network
And a certificate from Org3 is added to the kafka orderer network
And an orderer connected to the kafka cluster
When authorization for Org2 is removed from the kafka cluster
Then the Org2 cannot connect to the kafka cluster
And the orderer functions successfully
When authorization for Org1 is removed from the kafka cluster
Then the Org1 cannot connect to the kafka cluster
And the orderer functions successfully
When authorization for Org3 is removed from the kafka cluster
Then the Org3 cannot connect to the kafka cluster
And the zookeeper notifies the orderer of the disconnect
And the orderer stops sending messages to the cluster
When authorization for Org1 is added to the kafka cluster
And I wait "15" seconds
Then the Org1 is able to connect to the kafka cluster
And the orderer functions successfully

@skip
Scenario: FAB-3851: Message Payloads Greater than 1MB
Given I have a bootstrapped fabric network
When a user deploys chaincode
Then the chaincode is deployed

@skip
#@doNotDecompose
Scenario Outline: FAB-3937: Message Broadcast
Given a bootstrapped orderer network of type <type>
When a message is broadcasted
Then we get a successful broadcast response
Examples:
| type |
| solo |
| kafka |

@skip
Scenario Outline: FAB-3938: Broadcasted message delivered.
Given a bootstrapped orderer network of type <type>
When 1 unique messages are broadcasted
Then all 1 messages are delivered within 10 seconds
Examples:
| type |
| solo |
| kafka |
40 changes: 36 additions & 4 deletions test/feature/FAB-3505.feature → test/feature/peer.feature
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#Copyright IBM Corp. 2017 All Rights Reserved.
# Copyright IBM Corp. 2017 All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -13,10 +13,11 @@
# limitations under the License.
#

Feature: FAB-3505 Test chaincode_example02
As a user I want to run chaincode example02
Feature: Peer Service
As a user I want to be able have channels and chaincodes to execute

Scenario Outline: Test chaincode example02 deploy

Scenario Outline: FAB-3505: Test chaincode example02 deploy, invoke, and query
Given I have a bootstrapped fabric network of type <type>
When a user deploys chaincode at path "github.com/hyperledger/fabric/chaincode_example02" with ["init", "a", "1000" , "b", "2000"] with name "mycc"
Then the chaincode is deployed
Expand All @@ -32,9 +33,40 @@ Scenario Outline: Test chaincode example02 deploy
And "Peer1" comes back up
When a user queries on the chaincode named "mycc" with args ["query", "a"] on "Peer1"
Then a user receives expected response is 980
Examples:
| type |
| solo |
| kafka |


Scenario Outline: FAB-1440: Test basic chaincode deploy, invoke, query
Given I have a bootstrapped fabric network of type <type>
When a user deploys chaincode
Then the chaincode is deployed
When a user queries on the chaincode
Then a user receives expected response
Examples:
| type |
| solo |
| kafka |


@skip
Scenario: FAB-3861: Basic Chaincode Execution (example02)
Given I have a bootstrapped fabric network
When a user deploys chaincode
Then the chaincode is deployed


@skip
Scenario: FAB-3865: Multiple Channels Per Peer
Given I have a bootstrapped fabric network
When a user deploys chaincode
Then the chaincode is deployed


@skip
Scenario: FAB-3866: Multiple Chaincodes Per Peer
Given I have a bootstrapped fabric network
When a user deploys chaincode
Then the chaincode is deployed
5 changes: 5 additions & 0 deletions test/regression/daily/runDailyTestSuite.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ DAILYDIR="$GOPATH/src/github.com/hyperledger/fabric/test/regression/daily"
echo "========== System Test Performance Stress tests driven by PTE tool..."
py.test -v --junitxml results_systest_pte.xml systest_pte.py

echo "========== Behave feature and system tests..."
cd ../../feature
behave --junit --junit-directory ../regression/daily/. --tags=-skip --tags=daily
cd -

echo "========== Test Your Chaincode ..."
# TBD - after changeset https://gerrit.hyperledger.org/r/#/c/9163/ is merged,
# replace the previous 2 lines with this new syntax to run all the chaincode tests;
Expand Down

0 comments on commit 5522ac8

Please sign in to comment.