Commit 25808b56 authored by Federico Sismondi's avatar Federico Sismondi

amqp messages format changes

parent e2091738
......@@ -160,7 +160,7 @@ class ApiTests(unittest.TestCase):
# for getting the terminate signal
self.channel.queue_bind(exchange=AMQP_EXCHANGE,
queue=errors_queue_name,
routing_key=MsgSessionTerminate.routing_key)
routing_key=MsgTestingToolTerminate.routing_key)
self.channel.basic_qos(prefetch_count=1)
self.channel.basic_consume(check_for_bus_error, queue=errors_queue_name)
......@@ -179,7 +179,7 @@ class ApiTests(unittest.TestCase):
# prepare the message generator
messages = [] # list of messages to send
messages += user_sequence
messages.append(MsgSessionTerminate()) # message that triggers stop_generator_signal
messages.append(MsgTestingToolTerminate()) # message that triggers stop_generator_signal
thread_msg_gen = MessageGenerator(AMQP_URL, AMQP_EXCHANGE, messages)
logger.debug("Starting Message Generator thread ")
......@@ -215,7 +215,7 @@ class ApiTests(unittest.TestCase):
ch.basic_ack(delivery_tag=method.delivery_tag)
if msg_type == 'session.terminate':
if msg_type == 'testingtool.terminate':
ch.stop_consuming()
return
......@@ -246,7 +246,7 @@ class ApiTests(unittest.TestCase):
# for getting the terminate signal
self.channel.queue_bind(exchange=AMQP_EXCHANGE,
queue=services_queue_name,
routing_key=MsgSessionTerminate.routing_key)
routing_key=MsgTestingToolTerminate.routing_key)
self.channel.basic_qos(prefetch_count=1)
self.channel.basic_consume(check_for_correlated_request_reply, queue=services_queue_name)
......@@ -254,7 +254,7 @@ class ApiTests(unittest.TestCase):
# prepare the message generator
messages = [] # list of messages to send
messages += service_api_calls
messages.append(MsgSessionTerminate()) # message that triggers stop_generator_signal
messages.append(MsgTestingToolTerminate()) # message that triggers stop_generator_signal
thread_msg_gen = MessageGenerator(AMQP_URL, AMQP_EXCHANGE, messages)
logger.debug("[%s] Starting Message Generator thread " % sys._getframe().f_code.co_name)
......@@ -326,7 +326,7 @@ def check_for_bus_error(ch, method, props, body):
try:
m = Message.from_json(body)
if isinstance(m, MsgSessionTerminate):
if isinstance(m, MsgTestingToolTerminate):
ch.stop_consuming()
return
except:
......@@ -387,7 +387,7 @@ def validate_message(ch, method, props, body):
if req_body_dict['_type'] in list_of_messages_to_check:
m = Message.from_json(body)
try:
if isinstance(m, MsgSessionTerminate):
if isinstance(m, MsgTestingToolTerminate):
ch.stop_consuming()
stop_generator()
else:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment