Skip to content

Commit

Permalink
FAB-3283: Orderer functional behave scaffolding
Browse files Browse the repository at this point in the history
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
lhaskins committed Apr 26, 2017
1 parent 62aec85 commit cc58f62
Show file tree
Hide file tree
Showing 3 changed files with 116 additions and 0 deletions.
36 changes: 36 additions & 0 deletions test/feature/ft/orderer_at.feature
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 |
80 changes: 80 additions & 0 deletions test/feature/ft/steps/orderer_at_impl.py
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.

0 comments on commit cc58f62

Please sign in to comment.