-
Notifications
You must be signed in to change notification settings - Fork 8.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
FAB-3283: Orderer functional behave scaffolding
This is scaffolding for the orderer implementation file for testing the orderer. Change-Id: If8c3ba7201ac5a19d85f0332b685ce9fd77b907a Signed-off-by: Latitia M Haskins <latitia.haskins@gmail.com>
- Loading branch information
Showing
3 changed files
with
116 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# Copyright IBM Corp. 2016 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 validate an orderer service runs as expected | ||
|
||
#@doNotDecompose | ||
Scenario Outline: 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 | | ||
|
||
Scenario Outline: 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 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
# Copyright IBM Corp. 2016 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. | ||
# | ||
|
||
from behave import * | ||
import os | ||
import subprocess | ||
import time | ||
|
||
|
||
ORDERER_TYPES = ["solo", | ||
"kafka", | ||
"solo-msp"] | ||
|
||
PROFILE_TYPES = {"solo": "SampleInsecureSolo", | ||
"kafka": "SampleInsecureKafka", | ||
"solo-msp": "SampleSingleMSPSolo"} | ||
|
||
@given(u'I wait "{seconds}" seconds') | ||
@when(u'I wait "{seconds}" seconds') | ||
@then(u'I wait "{seconds}" seconds') | ||
def step_impl(context, seconds): | ||
time.sleep(float(seconds)) | ||
|
||
|
||
@given(u'we compose "{composeYamlFile}"') | ||
def step_impl(context, composeYamlFile): | ||
pass | ||
|
||
@given(u'a bootstrapped orderer network of type {networkType}') | ||
def step_impl(context, networkType): | ||
pass | ||
|
||
@given(u'an unbootstrapped network using "{dockerFile}"') | ||
def compose_impl(context, dockerFile): | ||
pass | ||
|
||
@when(u'a message is broadcasted') | ||
def step_impl(context): | ||
broadcast_impl(context, 1) | ||
|
||
@when(u'{count} unique messages are broadcasted') | ||
def broadcast_impl(context, count): | ||
pass | ||
|
||
@then(u'all {count} messages are delivered within {timeout} seconds') | ||
def step_impl(context, count, timeout): | ||
pass | ||
|
||
@then(u'all {count} messages are delivered in {numBlocks} within {timeout} seconds') | ||
def step_impl(context, count, numBlocks, timeout): | ||
pass | ||
|
||
@then(u'we get a successful broadcast response') | ||
def step_impl(context): | ||
recv_broadcast_impl(context, 1) | ||
|
||
@then(u'we get {count} successful broadcast responses') | ||
def recv_broadcast_impl(context, count): | ||
pass | ||
|
||
@then(u'the broadcasted message is delivered') | ||
def step_impl(context): | ||
verify_deliver_impl(context, 1, 1) | ||
|
||
@then(u'all {count} messages are delivered in {numBlocks} block') | ||
def verify_deliver_impl(context, count, numBlocks): | ||
pass | ||
|
File renamed without changes.