Upgrade RF syntax for v3.2 compatibility
[integration/test.git] / csit / suites / nic / basic / 010_Restconf_OK.robot
index e00a2a4e8624f3190f37866d67a1b5fa2d545e44..ceb27292e73008e82968c73e013d7bc6351b9394 100644 (file)
@@ -1,6 +1,6 @@
 *** Settings ***
 Documentation     Test suite to verify Restconf is OK
-Suite Setup       Create Session    session    http://${CONTROLLER}:${RESTCONFPORT}    auth=${AUTH}    headers=${HEADERS_XML}
+Suite Setup       Create Session    session    http://${ODL_SYSTEM_IP}:${RESTCONFPORT}    auth=${AUTH}    headers=${HEADERS_XML}
 Suite Teardown    Delete All Sessions
 Library           RequestsLibrary
 Library           Collections
@@ -24,38 +24,41 @@ ${INTENT_CONTEXT}    /restconf/config/intent:intents
 *** Test Cases ***
 Get Controller Modules
     [Documentation]    Get the controller modules via Restconf
-    ${resp}    RequestsLibrary.Get    session    ${REST_CONTEXT}
+    ${resp}    RequestsLibrary.Get Request    session    ${REST_CONTEXT}
     Log    ${resp.content}
     Should Be Equal As Strings    ${resp.status_code}    200
     Should Contain    ${resp.content}    ietf-restconf
 
 Verify REST Command Add, Update and Remove
-    REST Delete All Intents
-    : FOR    ${intent}    IN    @{all_intents_bad}
-    \    ${intent_id}=    REST Add Intent    @{intent}
-    \    Append To List    ${all_intents_ids}    ${intent_id}
+    FOR    ${intent}    IN    @{all_intents_bad}
+        ${intent_id}=    REST Add Intent    @{intent}
+        Append To List    ${all_intents_ids}    ${intent_id}
+    END
     ${resp}=    REST Get List of Intents
-    : FOR    ${intent_id}    IN    @{all_intents_ids}
-    \    Should Contain    ${resp}    ${intent_id}
+    FOR    ${intent_id}    IN    @{all_intents_ids}
+        Should Contain    ${resp}    ${intent_id}
+    END
     ${size}=    Get Length    ${all_intents_correct}
-    : FOR    ${index}    IN RANGE    ${size}
-    \    ${intent}=    Get From List    ${all_intents_correct}    ${index}
-    \    ${intent_id}=    Get From List    ${all_intents_ids}    ${index}
-    \    REST Update Intent By Id    ${intent_id}    @{intent}
-    \    ${intent_from}=    Get From List    ${intent}    0
-    \    ${intent_to}=    Get From List    ${intent}    1
-    \    ${intent_permission}=    Get From List    ${intent}    2
-    \    ${resp}=    REST Get Intent From Id    ${intent_id}
-    \    Should Contain    ${resp}    ${intent_from}
-    \    Should Contain    ${resp}    ${intent_to}
-    \    Should Contain    ${resp}    ${intent_permission}
-    : FOR    ${id}    IN    @{all_intents_ids}
-    \    REST Delete Intent By Id    ${id}
+    FOR    ${index}    IN RANGE    ${size}
+        ${intent}=    Get From List    ${all_intents_correct}    ${index}
+        ${intent_id}=    Get From List    ${all_intents_ids}    ${index}
+        REST Update Intent By Id    ${intent_id}    @{intent}
+        ${intent_from}=    Get From List    ${intent}    0
+        ${intent_to}=    Get From List    ${intent}    1
+        ${intent_permission}=    Get From List    ${intent}    2
+        ${resp}=    REST Get Intent From Id    ${intent_id}
+        Should Contain    ${resp}    ${intent_from}
+        Should Contain    ${resp}    ${intent_to}
+        Should Contain    ${resp}    ${intent_permission}
+    END
+    FOR    ${id}    IN    @{all_intents_ids}
+        REST Delete Intent By Id    ${id}
+    END
 
 *** Keywords ***
 REST Get List of Intents
     [Documentation]    Get the list of intents configured
-    ${resp}    RequestsLibrary.Get    session    ${INTENT_CONTEXT}
+    ${resp}    RequestsLibrary.Get Request    session    ${INTENT_CONTEXT}
     Should Be Equal As Strings    ${resp.status_code}    200
     Should Contain    ${resp.content}    "intents"
     [Return]    ${resp.content}
@@ -63,7 +66,7 @@ REST Get List of Intents
 REST Get Intent From Id
     [Arguments]    ${id}
     [Documentation]    Get the intent detail from id
-    ${resp}    RequestsLibrary.Get    session    ${INTENT_CONTEXT}/intent/${id}
+    ${resp}    RequestsLibrary.Get Request    session    ${INTENT_CONTEXT}/intent/${id}
     Log Json    ${resp.content}
     Should Be Equal As Strings    ${resp.status_code}    200
     Should Contain    ${resp.content}    ${id}
@@ -87,7 +90,7 @@ REST Add Intent
     ${headers}=    Create Dictionary    Content-Type=application/json
     ${id}=    Generate Random UUID
     ${data}=    Catenate    {"intent":{"id": "${id}","subjects":[{"order": 1,"end-point-group": {"name": "${intent_from}"}},{"order": 2,"end-point-group": { "name": "${intent_to}"}}],"actions": [{"order": 1,"${intent_permission}": {}}]}}
-    ${resp}    RequestsLibrary.Post    session    ${INTENT_CONTEXT}    headers=${headers}    data=${data}
+    ${resp}    RequestsLibrary.Post Request    session    ${INTENT_CONTEXT}    headers=${headers}    data=${data}
     Should Be Equal As Strings    ${resp.status_code}    204
     [Return]    ${id}
 
@@ -96,14 +99,14 @@ REST Update Intent By Id
     [Documentation]    Make an Intent and return the id of the new intent
     ${headers}=    Create Dictionary    Content-Type=application/json
     ${data}=    Catenate    {"intent":{"id": "${id}","subjects":[{"order": 1,"end-point-group": {"name": "${intent_from}"}},{"order": 2,"end-point-group": { "name": "${intent_to}"}}],"actions": [{"order": 1,"${intent_permission}": {}}]}}
-    ${resp}    RequestsLibrary.Put    session    ${INTENT_CONTEXT}/intent/${id}    headers=${headers}    data=${data}
+    ${resp}    RequestsLibrary.Put Request    session    ${INTENT_CONTEXT}/intent/${id}    headers=${headers}    data=${data}
     Should Be Equal As Strings    ${resp.status_code}    200
     [Return]    ${resp}
 
 REST Delete All Intents
     [Documentation]    Delete all of the Intents
     ${headers}=    Create Dictionary    Content-Type=application/json
-    ${resp}    RequestsLibrary.Delete    session    ${INTENT_CONTEXT}    headers=${headers}
+    ${resp}    RequestsLibrary.Delete Request    session    ${INTENT_CONTEXT}    headers=${headers}
     Log    ${resp}
     Should Be Equal As Strings    ${resp.status_code}    200
     [Return]    ${resp.content}
@@ -112,7 +115,7 @@ REST Delete Intent By Id
     [Arguments]    ${id}
     [Documentation]    Delete Intent by Id
     ${headers}=    Create Dictionary    Content-Type=application/json
-    ${resp}    RequestsLibrary.Delete    session    ${INTENT_CONTEXT}/intent/${id}    headers=${headers}
+    ${resp}    RequestsLibrary.Delete Request    session    ${INTENT_CONTEXT}/intent/${id}    headers=${headers}
     Log    ${resp}
     Should Be Equal As Strings    ${resp.status_code}    200
     [Return]    ${resp.content}