7 Library RequestsLibrary
8 Variables ../variables/Variables.py
10 Resource MininetKeywords.robot
14 ${REST_CONTEXT_INTENT} restconf/config/intent:intents/intent
15 ${INTENTS} restconf/config/intent:intents
16 ${VTN_INVENTORY} restconf/operational/vtn-inventory:vtn-nodes
17 ${INTENT_ID} b9a13232-525e-4d8c-be21-cd65e3436033
20 Start NIC VTN Renderer Suite
21 [Documentation] Start Nic VTN Renderer Init Test Suite
22 Create Session session http://${ODL_SYSTEM_IP}:${RESTCONFPORT} auth=${AUTH} headers=${HEADERS}
23 BuiltIn.Wait_Until_Keyword_Succeeds 30 3 Fetch Intent List
25 Stop NIC VTN Renderer Suite
26 [Documentation] Stop Nic VTN Renderer Test Suite
29 Start NIC VTN Rest Test Suite
30 [Documentation] Start Nic VTN Renderer Rest Test Suite
31 Create Session session http://${ODL_SYSTEM_IP}:${RESTCONFPORT} auth=${AUTH} headers=${HEADERS}
33 Start Mininet Linear ${switches}
35 Stop NIC VTN Rest Test Suite
36 [Documentation] Stop Nic VTN Renderer Test Suite
37 Stop Mininet And Exit ${mininet_conn_id}
40 [Documentation] Check if VTN Renderer feature is installed.
41 ${resp}= RequestsLibrary.Get Request session ${INTENTS}
42 Should Be Equal As Strings ${resp.status_code} 200
44 Add Intent Using RestConf
45 [Arguments] ${intent_id} ${intent_data}
46 [Documentation] Create a intent with specified parameters.
47 ${resp}= RequestsLibrary.put Request session ${REST_CONTEXT_INTENT}/${intent_id} data=${intent_data}
48 Should Be Equal As Strings ${resp.status_code} 200
50 Verify Intent Using RestConf
51 [Arguments] ${intent_id}
52 [Documentation] Verify If intent is created.
53 ${resp}= RequestsLibrary.Get Request session ${REST_CONTEXT_INTENT}/${intent_id}
54 Should Be Equal As Strings ${resp.status_code} 200
56 Update Intent Using RestConf
57 [Arguments] ${intent_id} ${intent_data}
58 [Documentation] Update a intent with specified parameters.
59 ${resp}= RequestsLibrary.put Request session ${REST_CONTEXT_INTENT}/${intent_id} data=${intent_data}
60 Should Be Equal As Strings ${resp.status_code} 200
62 Delete Intent Using RestConf
63 [Arguments] ${intent_id}
64 [Documentation] Delete a intent with specified parameters.
65 ${resp}= RequestsLibrary.Delete Request session ${REST_CONTEXT_INTENT}/${intent_id}
66 Should Be Equal As Strings ${resp.status_code} 200
68 Add Intent From Karaf Console
69 [Arguments] ${intent_from} ${intent_to} ${intent_permission}
70 [Documentation] Adds an intent to the controller, and returns the id of the intent created.
71 ${output}= Issue Command On Karaf Console intent:add -f ${intent_from} -t ${intent_to} -a ${intent_permission}
72 Should Contain ${output} Intent created
73 ${output}= Fetch From Left ${output} )
74 ${output_split}= Split String ${output} ${SPACE}
75 ${id}= Get From List ${output_split} 3
78 Remove Intent From Karaf Console
80 [Documentation] Removes an intent from the controller via the provided intent id.
81 ${output}= Issue Command On Karaf Console intent:remove ${id}
82 Should Contain ${output} Intent successfully removed
83 ${output}= Issue Command On Karaf Console log:display | grep "Removed VTN configuration associated with the deleted Intent: "
84 #The below log statements has changed an info to trace mode in Beryllium, and in future release will roll back in same.
85 #Should Contain ${output} Removed VTN configuration associated with the deleted Intent ${id}
87 Mininet Ping Should Succeed
88 [Arguments] ${host1} ${host2}
90 Write ${host1} ping -c 10 ${host2}
91 ${result} Read Until mininet>
92 Should Contain ${result} 64 bytes
94 Mininet Ping Should Not Succeed
95 [Arguments] ${host1} ${host2}
97 Write ${host1} ping -c 3 ${host2}
98 ${result} Read Until mininet>
99 Should Not Contain ${result} 64 bytes