|
| 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 | + |
0 commit comments