Commit 76f55dfc authored by Federico Sismondi's avatar Federico Sismondi

messages v++, and new messages examples for testing 6lowpan testing tool to cli.py

parent 7db00168
......@@ -567,14 +567,13 @@ if __name__ == '__main__':
filename="TD_COAP_CORE_01.pcap",
value=PCAP_TC_COAP_01_base64,
),
'tat3': MsgInteropTestCaseAnalyze(
testcase_id="TD_COAP_CORE_04",
testcase_ref="http://f-interop.paris.inria.fr/tests/TD_COAP_CORE_04_v01",
file_enc="pcap_base64",
filename="TD_COAP_CORE_04.pcap",
value=PCAP_COAP_TC4_OVER_TUN_INTERFACE_base64,
)
# 'tat3': MsgInteropTestCaseAnalyze(
# testcase_id="TD_COAP_CORE_04",
# testcase_ref="http://f-interop.paris.inria.fr/tests/TD_COAP_CORE_04_v01",
# file_enc="pcap_base64",
# filename="TD_COAP_CORE_04.pcap",
# value=PCAP_COAP_TC4_OVER_TUN_INTERFACE_base64,
# )
})
......@@ -613,15 +612,14 @@ if __name__ == '__main__':
filename="TD_COAP_CORE_01.pcap",
value=PCAP_COAP_GET_OVER_TUN_INTERFACE_base64,
),
# pcap sniffed using AMQP based packet sniffer
'dis7': MsgDissectionDissectCapture(
file_enc="pcap_base64",
filename="TD_COAP_CORE_04.pcap",
value=PCAP_COAP_TC4_OVER_TUN_INTERFACE_base64,
),
# # pcap sniffed using AMQP based packet sniffer
# 'dis7': MsgDissectionDissectCapture(
# file_enc="pcap_base64",
# filename="TD_COAP_CORE_04.pcap",
# value=PCAP_COAP_TC4_OVER_TUN_INTERFACE_base64,
# ),
})
testing_tool_emulation = OrderedDict({
# testing tool is ready to start session
'tt1': MsgTestingToolReady(),
......@@ -631,6 +629,30 @@ if __name__ == '__main__':
# 'tt11': MsgStepCheckExecute(step_id="TD_COAP_CORE_01_v01_step_02"),
# 'tt12': MsgStepCheckExecute(step_id="TD_COAP_CORE_01_v01_step_03"),
'tt13': MsgStepVerifyExecute(step_id="TD_COAP_CORE_01_v01_step_04"),
'tt100': MsgTestSuiteReport(),
# for 6lowpan TT tests
's_hc_01': MsgStepStimuliExecute(step_id='TD_6LowPAN_HC_01_step_01', node='eut1'),
's_hc_02': MsgStepStimuliExecute(step_id='TD_6LowPAN_HC_02_step_01', node='eut1'),
's_hc_03': MsgStepStimuliExecute(step_id='TD_6LowPAN_HC_03_step_01', node='eut1'),
's_hc_04': MsgStepStimuliExecute(step_id='TD_6LowPAN_HC_04_step_01', node='eut1'),
's_hc_05': MsgStepStimuliExecute(step_id='TD_6LowPAN_HC_05_step_01', node='eut1'),
's_hc_06': MsgStepStimuliExecute(step_id='TD_6LowPAN_HC_06_step_01', node='eut1'),
's_hc_07': MsgStepStimuliExecute(step_id='TD_6LowPAN_HC_07_step_01', node='eut1'),
's_format_01': MsgStepStimuliExecute(step_id='TD_6LowPAN_FORMAT_01_step_01', node='eut1'),
's_format_03': MsgStepStimuliExecute(step_id='TD_6LowPAN_FORMAT_03_step_01', node='eut1'),
's_format_04': MsgStepStimuliExecute(step_id='TD_6LowPAN_FORMAT_04_step_01', node='eut1'),
's_format_06': MsgStepStimuliExecute(step_id='TD_6LowPAN_FORMAT_06_step_01', node='eut1'),
'tc_hc_01': MsgTestCaseReady(testcase_id='TD_6LowPAN_HC_01'),
'tc_hc_02': MsgTestCaseReady(testcase_id='TD_6LowPAN_HC_02'),
'tc_hc_03': MsgTestCaseReady(testcase_id='TD_6LowPAN_HC_03'),
'tc_hc_04': MsgTestCaseReady(testcase_id='TD_6LowPAN_HC_04'),
'tc_hc_05': MsgTestCaseReady(testcase_id='TD_6LowPAN_HC_05'),
'tc_hc_06': MsgTestCaseReady(testcase_id='TD_6LowPAN_HC_06'),
'tc_hc_07': MsgTestCaseReady(testcase_id='TD_6LowPAN_HC_07'),
'tc_format_01': MsgTestCaseReady(testcase_id='TD_6LowPAN_FORMAT_01'),
'tc_format_03': MsgTestCaseReady(testcase_id='TD_6LowPAN_FORMAT_03'),
'tc_format_04': MsgTestCaseReady(testcase_id='TD_6LowPAN_FORMAT_04'),
'tc_format_06': MsgTestCaseReady(testcase_id='TD_6LowPAN_FORMAT_06'),
})
event_type = params[0]
......
......@@ -27,7 +27,7 @@ Usage:
>>> from messages import * # doctest: +SKIP
>>> m = MsgTestCaseSkip()
>>> m
MsgTestCaseSkip(_api_version = 0.1.39, _type = testcoordination.testcase.skip, testcase_id = TD_COAP_CORE_02_v01, )
MsgTestCaseSkip(_api_version = 0.1.40, _type = testcoordination.testcase.skip, node = someNode, testcase_id = TD_COAP_CORE_02_v01, )
>>> m.routing_key
'control.testcoordination'
>>> m.message_id # doctest: +SKIP
......@@ -38,18 +38,18 @@ MsgTestCaseSkip(_api_version = 0.1.39, _type = testcoordination.testcase.skip, t
# also we can modify some of the fields (rewrite the default ones)
>>> m = MsgTestCaseSkip(testcase_id = 'TD_COAP_CORE_03_v01')
>>> m
MsgTestCaseSkip(_api_version = 0.1.39, _type = testcoordination.testcase.skip, testcase_id = TD_COAP_CORE_03_v01, )
MsgTestCaseSkip(_api_version = 0.1.40, _type = testcoordination.testcase.skip, node = someNode, testcase_id = TD_COAP_CORE_03_v01, )
>>> m.testcase_id
'TD_COAP_CORE_03_v01'
# and even export the message in json format (for example for sending the message though the amqp event bus)
>>> m.to_json()
'{"_api_version": "0.1.39", "_type": "testcoordination.testcase.skip", "testcase_id": "TD_COAP_CORE_03_v01"}'
'{"_api_version": "0.1.40", "_type": "testcoordination.testcase.skip", "node": "someNode", "testcase_id": "TD_COAP_CORE_03_v01"}'
# We can use the Message class to import json into Message objects:
>>> m=MsgTestSuiteStart()
>>> m.to_json()
'{"_api_version": "0.1.39", "_type": "testcoordination.testsuite.start"}'
'{"_api_version": "0.1.40", "_type": "testcoordination.testsuite.start", "description": "Event test suite START"}'
>>> json_message = m.to_json()
>>> obj=Message.from_json(json_message)
>>> type(obj)
......@@ -62,8 +62,7 @@ MsgTestCaseSkip(_api_version = 0.1.39, _type = testcoordination.testcase.skip, t
# the error reply (note that we pass the message of the request to build the reply):
>>> err = MsgErrorReply(m)
>>> err
MsgErrorReply(_api_version = 0.1.39, _type = sniffing.start, error_code = Some error code TBD, error_message = Some
error message TBD, ok = False, )
MsgErrorReply(_api_version = 0.1.40, _type = sniffing.start, error_code = Some error code TBD, error_message = Some error message TBD, ok = False, )
>>> m.reply_to
'control.sniffing.service.reply'
>>> err.routing_key
......@@ -81,7 +80,7 @@ import time
import json
import uuid
API_VERSION = '0.1.39'
API_VERSION = '0.1.40'
# TODO use metaclasses instead?
......@@ -1004,8 +1003,9 @@ class MsgTestCaseSkip(Message):
_msg_data_template = {
"_type": "testcoordination.testcase.skip",
"testcase_id": "TD_COAP_CORE_02_v01",
"node": "TBD",
"description": "Skip testcase",
"testcase_id": None,
"node": "someNode",
}
......@@ -1849,7 +1849,6 @@ class MsgPerformanceStats(Message):
"stats": {},
}
message_types_dict = {
"log": MsgSessionLog, # Any -> Any
"chat": MsgSessionChat, # GUI_x -> GUI_y
......@@ -1917,6 +1916,7 @@ message_types_dict = {
}
if __name__ == '__main__':
# m1=MsgTestCaseStart()
# print(json.dumps(m1.to_dict()))
......
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