github.com/myafeier/fabric@v1.0.1-0.20170722181825-3a4b1f2bce86/test/feature/steps/orderer_impl.py (about) 1 # Copyright IBM Corp. 2017 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 31 @given(u'a bootstrapped orderer network of type {networkType}') 32 def step_impl(context, networkType): 33 pass 34 35 @given(u'an unbootstrapped network using "{dockerFile}"') 36 def compose_impl(context, dockerFile): 37 pass 38 39 @given(u'an orderer connected to the kafka cluster') 40 def step_impl(context): 41 pass 42 43 @given(u'the orderer Batchsize MaxMessageCount is {maxMsgCount}') 44 def step_impl(context, maxMsgCount): 45 pass 46 47 @given(u'the orderer BatchTimeout is {timeout} {units}') 48 def step_impl(context, timeout, units): 49 pass 50 51 @given(u'a certificate from {organization} is added to the kafka orderer network') 52 def step_impl(context, organization): 53 pass 54 55 @given(u'the kafka default replication factor is {factor}') 56 def step_impl(context, factor): 57 pass 58 59 @given(u'a kafka cluster') 60 def step_impl(context): 61 pass 62 63 @when(u'a message is broadcasted') 64 def step_impl(context): 65 broadcast_impl(context, 1) 66 67 @when(u'{count} unique messages are broadcasted') 68 def broadcast_impl(context, count): 69 pass 70 71 @when(u'the topic partition leader is stopped') 72 def step_impl(context): 73 pass 74 75 @when(u'a new organization {organization} certificate is added') 76 def step_impl(context, organization): 77 pass 78 79 @when(u'authorization for {organization} is removed from the kafka cluster') 80 def step_impl(context, organization): 81 pass 82 83 @when(u'authorization for {organization} is added to the kafka cluster') 84 def step_impl(context, organization): 85 pass 86 87 @then(u'the broadcasted message is delivered') 88 def step_impl(context): 89 verify_deliver_impl(context, 1, 1) 90 91 @then(u'all {count} messages are delivered in {numBlocks} block') 92 def step_impl(context, count, numBlocks): 93 verify_deliver_impl(context, count, numBlocks) 94 95 @then(u'all {count} messages are delivered within {timeout} seconds') 96 def step_impl(context, count, timeout): 97 verify_deliver_impl(context, count, None, timeout) 98 99 @then(u'all {count} messages are delivered in {numBlocks} within {timeout} seconds') 100 def verify_deliver_impl(context, count, numBlocks, timeout=60): 101 pass 102 103 @then(u'we get a successful broadcast response') 104 def step_impl(context): 105 recv_broadcast_impl(context, 1) 106 107 @then(u'we get {count} successful broadcast responses') 108 def recv_broadcast_impl(context, count): 109 pass 110 111 @then(u'the {organization} cannot connect to the kafka cluster') 112 def step_impl(context, organization): 113 pass 114 115 @then(u'the {organization} is able to connect to the kafka cluster') 116 def step_impl(context, organization): 117 pass 118 119 @then(u'the zookeeper notifies the orderer of the disconnect') 120 def step_impl(context): 121 pass 122 123 @then(u'the orderer functions successfully') 124 def step_impl(context): 125 # Check the logs for certain key info - be sure there are no errors in the logs 126 pass 127 128 @then(u'the orderer stops sending messages to the cluster') 129 def step_impl(context): 130 pass