Skip to content

Commit cc58f62

Browse files
committed
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 <[email protected]>
1 parent 62aec85 commit cc58f62

File tree

3 files changed

+116
-0
lines changed

3 files changed

+116
-0
lines changed

test/feature/ft/orderer_at.feature

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Copyright IBM Corp. 2016 All Rights Reserved.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
#
15+
16+
Feature: Orderer Service
17+
As a user I want to validate an orderer service runs as expected
18+
19+
#@doNotDecompose
20+
Scenario Outline: Message Broadcast
21+
Given a bootstrapped orderer network of type <type>
22+
When a message is broadcasted
23+
Then we get a successful broadcast response
24+
Examples:
25+
| type |
26+
| solo |
27+
| kafka |
28+
29+
Scenario Outline: Broadcasted message delivered.
30+
Given a bootstrapped orderer network of type <type>
31+
When 1 unique messages are broadcasted
32+
Then all 1 messages are delivered within 10 seconds
33+
Examples:
34+
| type |
35+
| solo |
36+
| kafka |
+80
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
# Copyright IBM Corp. 2016 All Rights Reserved.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
#
15+
16+
from behave import *
17+
import os
18+
import subprocess
19+
import time
20+
21+
22+
ORDERER_TYPES = ["solo",
23+
"kafka",
24+
"solo-msp"]
25+
26+
PROFILE_TYPES = {"solo": "SampleInsecureSolo",
27+
"kafka": "SampleInsecureKafka",
28+
"solo-msp": "SampleSingleMSPSolo"}
29+
30+
@given(u'I wait "{seconds}" seconds')
31+
@when(u'I wait "{seconds}" seconds')
32+
@then(u'I wait "{seconds}" seconds')
33+
def step_impl(context, seconds):
34+
time.sleep(float(seconds))
35+
36+
37+
@given(u'we compose "{composeYamlFile}"')
38+
def step_impl(context, composeYamlFile):
39+
pass
40+
41+
@given(u'a bootstrapped orderer network of type {networkType}')
42+
def step_impl(context, networkType):
43+
pass
44+
45+
@given(u'an unbootstrapped network using "{dockerFile}"')
46+
def compose_impl(context, dockerFile):
47+
pass
48+
49+
@when(u'a message is broadcasted')
50+
def step_impl(context):
51+
broadcast_impl(context, 1)
52+
53+
@when(u'{count} unique messages are broadcasted')
54+
def broadcast_impl(context, count):
55+
pass
56+
57+
@then(u'all {count} messages are delivered within {timeout} seconds')
58+
def step_impl(context, count, timeout):
59+
pass
60+
61+
@then(u'all {count} messages are delivered in {numBlocks} within {timeout} seconds')
62+
def step_impl(context, count, numBlocks, timeout):
63+
pass
64+
65+
@then(u'we get a successful broadcast response')
66+
def step_impl(context):
67+
recv_broadcast_impl(context, 1)
68+
69+
@then(u'we get {count} successful broadcast responses')
70+
def recv_broadcast_impl(context, count):
71+
pass
72+
73+
@then(u'the broadcasted message is delivered')
74+
def step_impl(context):
75+
verify_deliver_impl(context, 1, 1)
76+
77+
@then(u'all {count} messages are delivered in {numBlocks} block')
78+
def verify_deliver_impl(context, count, numBlocks):
79+
pass
80+
File renamed without changes.

0 commit comments

Comments
 (0)