2 Documentation Keywords for sanity test suites testing basic functionality
3 ... using multiple communication protocols
5 Resource ../../variables/Variables.robot
6 Resource IoTDMKeywords.robot
7 Resource IoTDMResources.robot
9 Library OperatingSystem
10 Variables client_libs/onem2m_primitive.py
14 [Documentation] Create AE resource and verify response
17 Sanity Test Retrieve AE
18 [Documentation] Retrieve AE resource and verify response
19 Retrieve Resource ${defAeUri}
22 [Documentation] Update AE resource and verify response
23 ${attr} = Set Variable {"m2m:ae": {"or":"http://hey/you/updated"}}
24 Update Resource ${attr} ${defAeUri}
26 Sanity Test Retrieve Updated AE
27 [Documentation] Retrieve updated AE, verify updated element and verify response
28 ${rsp_primitive} Retrieve Resource ${defAeUri}
29 ${update_or} = Get Primitive Content Attribute ${rsp_primitive} /m2m:ae/or
30 Should Be Equal ${update_or} http://hey/you/updated
33 [Documentation] Delete AE resource and verify response
34 Delete Resource ${defAeUri}
36 Sanity Test Retrieve Deleted AE
37 [Documentation] Try to retrieve already deleted AE. Expect and verify error response
38 ${primitive} = New Retrieve Request Primitive ${defAeUri}
39 Log Primitive ${primitive}
40 ${rsp_primitive} = Send Primitive ${primitive}
41 Log Primitive ${rsp_primitive}
42 ${expected_message} = Set Variable Resource target URI not found: ${defAeUri}
43 Verify Exchange Negative ${primitive} ${rsp_primitive} ${OneM2M.result_code_not_found} ${expected_message}
45 Sanity Test Create AE Container Subscription
46 [Arguments] ${notification_uri}
47 [Documentation] Create AE, Container and Subscription resources. Subscription resource has set
48 ... eventType 3 so notification will be trigerred when child resource of Container resource is
49 ... created. Notifications will be sent to communication Rx channel.
50 ... Verify response of create requests.
52 Create Resource Container ${defAeUri} Container1
53 Create Resource Subscription ${defAeUri}/Container1 ${notification_uri} notifEventType=${OneM2M.net_create_of_direct_child_resource} notifContentType=${OneM2M.nct_resource_id}
55 Sanity Test Create Content Instance And Handle Notification
56 [Documentation] Create contentInstance resource what should trigger notification. Receive the notification
57 ... and create positive response and send. Verify the received notification request.
58 Create Content Instance
59 ${notification} = Receive Notification And Verify
60 # response must be sent becaue Rx is waiting for the response and Rx thread is blocked
61 ${notification_rsp} = Create Notification Response ${notification}
62 Respond Response Primitive ${notification_rsp}
63 Verify Exchange ${notification} ${notification_rsp}
65 Sanity Test Create Content Instance And Use Automatic Notification Response
66 [Documentation] Set up automatic reply for notifications from specific subscription resource. Create
67 ... contentInstance resource what will trigger the notification and check if was handled
69 ${subscription_resource_id} Set Variable ${defAeUri}/Container1/${defSubscriptionName}
70 Add Auto Reply To Notification From Subscription ${subscription_resource_id}
71 Create Content Instance
72 Wait Until Keyword Succeeds 3x 100ms Verify Number Of Auto Replies To Notification From Subscription ${subscription_resource_id} ${1}
73 Remove Auto Reply To Notification From Subscription ${subscription_resource_id}
75 Create Content Instance
76 Create Resource ContentInstance contentValue=testingContentValue parentResourceUri=${defAeUri}/Container1
78 Receive Notification And Verify
79 ${notification} = Receive Request Primitive
80 Verify Request ${notification}
81 ${from} = Get Primitive Param ${notification} ${OneM2M.short_from}
82 Should Be Equal ${from} /${defCseBaseName}
83 ${operation} = Get Primitive Param ${notification} ${OneM2M.short_operation}
84 Should Be Equal As Integers ${operation} ${OneM2M.operation_notify}
85 Return From Keyword ${notification}