Skip to content

Commit

Permalink
test/broker: align identical code
Browse files Browse the repository at this point in the history
06-bridge-b2br-disconnect-qos1 and
06-bridge-br2b-disconnect-qos1 have ~identical header code.

unify the identical bits to make it easier to visually see this.

Signed-off-by: Karl Palsson <[email protected]>
  • Loading branch information
karlp committed Mar 20, 2020
1 parent efb21fb commit 3d45c31
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions test/broker/06-bridge-b2br-disconnect-qos1.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ def write_config(filename, port1, port2, protocol_version):
f.write("topic bridge/# both 1\n")
f.write("notifications false\n")
f.write("restart_timeout 5\n")
f.write("bridge_protocol_version %s\n" %(protocol_version))
f.write("bridge_protocol_version %s\n" % (protocol_version))


def do_test(proto_ver):
if proto_ver == 4:
Expand All @@ -33,12 +34,12 @@ def do_test(proto_ver):
connect_packet = mosq_test.gen_connect(client_id, keepalive=keepalive, clean_session=False, proto_ver=proto_ver_connect)
connack_packet = mosq_test.gen_connack(rc=0, proto_ver=proto_ver)

mid = 1
if proto_ver == 5:
opts = mqtt5_opts.MQTT_SUB_OPT_NO_LOCAL | mqtt5_opts.MQTT_SUB_OPT_RETAIN_AS_PUBLISHED
else:
opts = 0

mid = 1
subscribe_packet = mosq_test.gen_subscribe(mid, "bridge/#", 1 | opts, proto_ver=proto_ver)
suback_packet = mosq_test.gen_suback(mid, 1, proto_ver=proto_ver)

Expand Down

0 comments on commit 3d45c31

Please sign in to comment.