Update Robot Framework format - step 2 32/102332/8
authorSangwook Ha <sangwook.ha@verizon.com>
Fri, 9 Sep 2022 23:49:15 +0000 (16:49 -0700)
committerSangwook Ha <sangwook.ha@verizon.com>
Fri, 7 Oct 2022 02:12:05 +0000 (19:12 -0700)
Robotidy has stricter formatting rules for line width, alignment,
section ordering & spacing, etc.

Update the format of Robot Framework files in the following directory
with Robotidy:

- csit/suites/aaa
- csit/suites/alto
- csit/suites/backuprestore

JIRA: INTTEST-132
Change-Id: Iba4d4dc8745a915faf94f4d0f45fe13881e33581
Signed-off-by: Sangwook Ha <sangwook.ha@verizon.com>
csit/suites/aaa/authn/Restconf_Basic_Auth.robot
csit/suites/aaa/keystone/010__keystone_authn.robot
csit/suites/aaa/tls/010__aaa_restconf_tls.robot
csit/suites/alto/basic/010_resourcepool.robot
csit/suites/alto/basic/020_simple_IRD.robot
csit/suites/backuprestore/br-basic/010__br_library_keywords.robot
csit/suites/backuprestore/br-basic/020__br_sfc_tests.robot

index 064cb47f678622ca31a65493ba1bf950573f559a..ce29321cce01daa2c6a4cf5526b5b902a8df165c 100644 (file)
@@ -1,3 +1,4 @@
+*** Comments ***
 #
 # Copyright (c) Lumina Networks 2020 and others.
 # All rights reserved.
@@ -7,26 +8,31 @@
 # and is available at http://www.eclipse.org/legal/epl-v10.html
 #
 
+
 *** Settings ***
-Documentation     Test Basic Authentication support in RESTCONF
-Suite Teardown    Delete All Sessions
-Library           RequestsLibrary
-Library           String
-Resource          ../../../variables/Variables.robot
+Documentation       Test Basic Authentication support in RESTCONF
+
+Library             RequestsLibrary
+Library             String
+Resource            ../../../variables/Variables.robot
+
+Suite Teardown      Delete All Sessions
+
 
 *** Variables ***
-${ADMIN_USER}     ${ODL_RESTCONF_USER}
-${ADMIN_PW}       ${ODL_RESTCONF_PASSWORD}
+${ADMIN_USER}           ${ODL_RESTCONF_USER}
+${ADMIN_PW}             ${ODL_RESTCONF_PASSWORD}
 ${RESTCONF_TEST_URL}    ${MODULES_API}
-${JOLOKIA_TEST_URL}    jolokia
-${JOLOKIA_USER}    ${ODL_RESTCONF_USER}
-${JOLOKIA_PW}     ${ODL_RESTCONF_PASSWORD}
-${BAD_USER}       bad_user
-${BAD_PW}         bad_pw
-${JOLOKIA_BAD_USER}    ${BAD_USER}
-${USERS_REST_URL}    auth/v1/users
-${USER_USER}      user
-${USER_PW}        user
+${JOLOKIA_TEST_URL}     jolokia
+${JOLOKIA_USER}         ${ODL_RESTCONF_USER}
+${JOLOKIA_PW}           ${ODL_RESTCONF_PASSWORD}
+${BAD_USER}             bad_user
+${BAD_PW}               bad_pw
+${JOLOKIA_BAD_USER}     ${BAD_USER}
+${USERS_REST_URL}       auth/v1/users
+${USER_USER}            user
+${USER_PW}              user
+
 
 *** Test Cases ***
 No RESTCONF Credentials
@@ -63,15 +69,16 @@ Correct Jolokia REST Credentials
 
 IDM Endpoints Only Available To admin Role
     [Documentation]    A user with a non-"admin" role should not have access to AAA endpoints
-    ${auth}    Create List    ${USER_USER}    ${USER_PW}
+    ${auth}    Create List    ${USER_USER}    ${USER_PW}
     Create Session    httpbin    http://${ODL_SYSTEM_IP}:${RESTCONFPORT}    auth=${auth}    headers=${HEADERS}
     ${resp} =    RequestsLibrary.Get Request    httpbin    ${USERS_REST_URL}
     Should Be Equal As Numbers    ${resp.status_code}    401
 
+
 *** Keywords ***
 Auth Should Fail
-    [Arguments]    ${url}    ${user}    ${password}
     [Documentation]    Checks the given HTTP RESTCONF response for authentication failure
+    [Arguments]    ${url}    ${user}    ${password}
     @{auth} =    Create List    ${user}    ${password}
     Create Session    httpbin    http://${ODL_SYSTEM_IP}:${RESTCONFPORT}    auth=${auth}    headers=${HEADERS}
     ${resp} =    RequestsLibrary.Get Request    httpbin    ${url}
@@ -81,8 +88,8 @@ Auth Should Fail
     Log    ${resp.content}
 
 Auth Should Pass
-    [Arguments]    ${url}    ${user}    ${password}
     [Documentation]    Checks the given HTTP RESTCONF response for authentication failure
+    [Arguments]    ${url}    ${user}    ${password}
     @{auth} =    Create List    ${user}    ${password}
     Create Session    httpbin    http://${ODL_SYSTEM_IP}:${RESTCONFPORT}    auth=${auth}    headers=${HEADERS}
     ${resp} =    RequestsLibrary.Get Request    httpbin    ${url}
index 9d0dbcc56dd111eb79547d02952eb3b051fa399b..7977a2d9afa2097fc26638971d55b074b31446ba 100644 (file)
@@ -1,29 +1,33 @@
 *** Settings ***
-Documentation     Test suite: Authentication Support for Keystone
+Documentation       Test suite: Authentication Support for Keystone
 ...
-...               This feature implements the user management for ODL NBI REST APIs integrated with OpenStack, so that
-...               the authentication functionality provided by Keystone can be used. This allows consuming ODL NBI REST
-...               APIs using the same authentication procedures as any OpenStack project, such as Nova, Neutron, etc.
-...               bringing the benefits of a centralized / unified user management framework.
+...                 This feature implements the user management for ODL NBI REST APIs integrated with OpenStack, so that
+...                 the authentication functionality provided by Keystone can be used. This allows consuming ODL NBI REST
+...                 APIs using the same authentication procedures as any OpenStack project, such as Nova, Neutron, etc.
+...                 bringing the benefits of a centralized / unified user management framework.
 ...
-...               As a first step, It shall be possible to authenticate users against Keystone by using passwords
-...               provided by the users.
-Suite Setup       Init Suite
-Suite Teardown    Cleanup Suite
-Library           SSHLibrary
-Library           Collections
-Library           OperatingSystem
-Library           RequestsLibrary
-Resource          ../../../libraries/Utils.robot
-Resource          ../../../libraries/TemplatedRequests.robot
-Resource          ../../../libraries/KarafKeywords.robot
-Resource          ../../../libraries/ClusterManagement.robot
-Resource          ../../../variables/Variables.robot
-Resource          ../../../libraries/AAA/DockerKeystone.robot
+...                 As a first step, It shall be possible to authenticate users against Keystone by using passwords
+...                 provided by the users.
+
+Library             SSHLibrary
+Library             Collections
+Library             OperatingSystem
+Library             RequestsLibrary
+Resource            ../../../libraries/Utils.robot
+Resource            ../../../libraries/TemplatedRequests.robot
+Resource            ../../../libraries/KarafKeywords.robot
+Resource            ../../../libraries/ClusterManagement.robot
+Resource            ../../../variables/Variables.robot
+Resource            ../../../libraries/AAA/DockerKeystone.robot
+
+Suite Setup         Init Suite
+Suite Teardown      Cleanup Suite
+
 
 *** Variables ***
-${URI_CERTIFICATE}    /restconf/operations/aaa-cert-rpc:getODLCertificate
-${URI_RESTCONF}    /restconf/operational/ietf-restconf-monitoring:restconf-state
+${URI_CERTIFICATE}      /restconf/operations/aaa-cert-rpc:getODLCertificate
+${URI_RESTCONF}         /restconf/operational/ietf-restconf-monitoring:restconf-state
+
 
 *** Test Cases ***
 Successful Authentication Including Domain
@@ -39,10 +43,14 @@ Successful Authentication Including Domain
     ...    - URL "/restconf/operations/aaa-cert-rpc:getODLCertificate" ia authorized just for "admin" roles according to shiro.ini configuration. As "sdnadmin" has "admin" role in keystone the access is authorized too
     ...
     ...    - URL "/restconf/operational/ietf-restconf-monitoring:restconf-state" is not specified neither in shiro.ini nor in MDSAL Dynamic Authorization so no specific role is required
-    Create Session    session    http://${ODL_SYSTEM_IP}:${RESTCONFPORT}    auth=${AUTH_SDN_DOMAIN}    headers=${HEADERS}
-    ${resp}=    RequestsLibrary.Post Request    session    ${URI_CERTIFICATE}    headers=${HEADERS}
+    Create Session
+    ...    session
+    ...    http://${ODL_SYSTEM_IP}:${RESTCONFPORT}
+    ...    auth=${AUTH_SDN_DOMAIN}
+    ...    headers=${HEADERS}
+    ${resp}    RequestsLibrary.Post Request    session    ${URI_CERTIFICATE}    headers=${HEADERS}
     Should Contain    ${ALLOWED_STATUS_CODES}    ${resp.status_code}
-    ${resp}=    RequestsLibrary.Get Request    session    ${URI_RESTCONF}    headers=${HEADERS}
+    ${resp}    RequestsLibrary.Get Request    session    ${URI_RESTCONF}    headers=${HEADERS}
     Should Contain    ${ALLOWED_STATUS_CODES}    ${resp.status_code}
 
 Successful Authentication Without Domain
@@ -59,9 +67,9 @@ Successful Authentication Without Domain
     ...
     ...    - URL "/restconf/operational/ietf-restconf-monitoring:restconf-state" is not specified neither in shiro.ini nor in MDSAL Dynamic Authorization so no specific role is required
     Create Session    session    http://${ODL_SYSTEM_IP}:${RESTCONFPORT}    auth=${AUTH_CSC_SDN}    headers=${HEADERS}
-    ${resp}=    RequestsLibrary.Post Request    session    ${URI_CERTIFICATE}    headers=${HEADERS}
+    ${resp}    RequestsLibrary.Post Request    session    ${URI_CERTIFICATE}    headers=${HEADERS}
     Should Contain    ${ALLOWED_STATUS_CODES}    ${resp.status_code}
-    ${resp}=    RequestsLibrary.Get Request    session    ${URI_RESTCONF}    headers=${HEADERS}
+    ${resp}    RequestsLibrary.Get Request    session    ${URI_RESTCONF}    headers=${HEADERS}
     Should Contain    ${ALLOWED_STATUS_CODES}    ${resp.status_code}
 
 Unsuccessful Authentication Wrong User
@@ -76,9 +84,9 @@ Unsuccessful Authentication Wrong User
     ...
     ...    Due to authentication fails, authorization is not evaluated
     Create Session    session    http://${ODL_SYSTEM_IP}:${RESTCONFPORT}    auth=${AUTH_INVALID}    headers=${HEADERS}
-    ${resp}=    RequestsLibrary.Post Request    session    ${URI_CERTIFICATE}    headers=${HEADERS}
+    ${resp}    RequestsLibrary.Post Request    session    ${URI_CERTIFICATE}    headers=${HEADERS}
     Should Contain    ${UNAUTHORIZED_STATUS_CODES}    ${resp.status_code}
-    ${resp}=    RequestsLibrary.Get Request    session    ${URI_RESTCONF}    headers=${HEADERS}
+    ${resp}    RequestsLibrary.Get Request    session    ${URI_RESTCONF}    headers=${HEADERS}
     Should Contain    ${UNAUTHORIZED_STATUS_CODES}    ${resp.status_code}
 
 UnSuccessful Authentication Without Domain
@@ -94,9 +102,9 @@ UnSuccessful Authentication Without Domain
     ...
     ...    Due to authentication fails, authorization is not evaluated
     Create Session    session    http://${ODL_SYSTEM_IP}:${RESTCONFPORT}    auth=${AUTH_SDN}    headers=${HEADERS}
-    ${resp}=    RequestsLibrary.Post Request    session    ${URI_CERTIFICATE}    headers=${HEADERS}
+    ${resp}    RequestsLibrary.Post Request    session    ${URI_CERTIFICATE}    headers=${HEADERS}
     Should Contain    ${UNAUTHORIZED_STATUS_CODES}    ${resp.status_code}
-    ${resp}=    RequestsLibrary.Get Request    session    ${URI_RESTCONF}    headers=${HEADERS}
+    ${resp}    RequestsLibrary.Get Request    session    ${URI_RESTCONF}    headers=${HEADERS}
     Should Contain    ${UNAUTHORIZED_STATUS_CODES}    ${resp.status_code}
 
 Unsuccessful Authentication Wrong Domain
@@ -112,10 +120,14 @@ Unsuccessful Authentication Wrong Domain
     ...    Note:
     ...
     ...    Due to authentication fails, authorization is not evaluated
-    Create Session    session    http://${ODL_SYSTEM_IP}:${RESTCONFPORT}    auth=${AUTH_SDN_WRONG_DOM}    headers=${HEADERS}
-    ${resp}=    RequestsLibrary.Post Request    session    ${URI_CERTIFICATE}    headers=${HEADERS}
+    Create Session
+    ...    session
+    ...    http://${ODL_SYSTEM_IP}:${RESTCONFPORT}
+    ...    auth=${AUTH_SDN_WRONG_DOM}
+    ...    headers=${HEADERS}
+    ${resp}    RequestsLibrary.Post Request    session    ${URI_CERTIFICATE}    headers=${HEADERS}
     Should Contain    ${UNAUTHORIZED_STATUS_CODES}    ${resp.status_code}
-    ${resp}=    RequestsLibrary.Get Request    session    ${URI_RESTCONF}    headers=${HEADERS}
+    ${resp}    RequestsLibrary.Get Request    session    ${URI_RESTCONF}    headers=${HEADERS}
     Should Contain    ${UNAUTHORIZED_STATUS_CODES}    ${resp.status_code}
 
 Unsuccessful Basic Authorization
@@ -129,10 +141,14 @@ Unsuccessful Basic Authorization
     ...    - Check that the access to URL "/restconf/operational/ietf-restconf-monitoring:restconf-state" is authorized becaiuse that URL is not specified in shiro.ini and in MDSAL Dynamic Authorization access to all URLs is allowed to all user with "user" role
     Set Suite Variable    ${PUT_DYNAMIC_AUTH_FILE}    ${CURDIR}/../../../variables/aaa/put-dynamic-auth.json
     Provision MDSAL    ${PUT_DYNAMIC_AUTH_FILE}
-    Create Session    session    http://${ODL_SYSTEM_IP}:${RESTCONFPORT}    auth=${AUTH_CSC_NO_ADMIN}    headers=${HEADERS}
-    ${resp_ok}=    RequestsLibrary.Get Request    session    ${URI_RESTCONF}    headers=${HEADERS}
+    Create Session
+    ...    session
+    ...    http://${ODL_SYSTEM_IP}:${RESTCONFPORT}
+    ...    auth=${AUTH_CSC_NO_ADMIN}
+    ...    headers=${HEADERS}
+    ${resp_ok}    RequestsLibrary.Get Request    session    ${URI_RESTCONF}    headers=${HEADERS}
     Should Contain    ${ALLOWED_STATUS_CODES}    ${resp_ok.status_code}
-    ${resp_nook}=    RequestsLibrary.Post Request    session    ${URI_CERTIFICATE}    headers=${HEADERS}
+    ${resp_nook}    RequestsLibrary.Post Request    session    ${URI_CERTIFICATE}    headers=${HEADERS}
     Should Contain    ${UNAUTHORIZED_STATUS_CODES}    ${resp_nook.status_code}
 
 Unsuccessful Dynamic Authorization
@@ -146,10 +162,14 @@ Unsuccessful Dynamic Authorization
     ...    - Check that the access to URL "/restconf/operational/ietf-restconf-monitoring:restconf-state" is NOT authorized because although the URL is not specified in shiro.ini, in MDSAL Dynamic Authorization access to all URLs is allowed just for users with "admin" role and "CSC_user_no_admin" does not have \ "admin" role in keystone but "user" role
     Set Suite Variable    ${PUT_DYNAMIC_AUTH_FILE}    ${CURDIR}/../../../variables/aaa/put-dynamic-auth-2.json
     Provision MDSAL    ${PUT_DYNAMIC_AUTH_FILE}
-    Create Session    session    http://${ODL_SYSTEM_IP}:${RESTCONFPORT}    auth=${AUTH_CSC_NO_ADMIN}    headers=${HEADERS}
-    ${resp_nook}=    RequestsLibrary.Get Request    session    ${URI_RESTCONF}    headers=${HEADERS}
+    Create Session
+    ...    session
+    ...    http://${ODL_SYSTEM_IP}:${RESTCONFPORT}
+    ...    auth=${AUTH_CSC_NO_ADMIN}
+    ...    headers=${HEADERS}
+    ${resp_nook}    RequestsLibrary.Get Request    session    ${URI_RESTCONF}    headers=${HEADERS}
     Should Contain    ${UNAUTHORIZED_STATUS_CODES}    ${resp_nook.status_code}
-    ${resp_nook}=    RequestsLibrary.Post Request    session    ${URI_CERTIFICATE}    headers=${HEADERS}
+    ${resp_nook}    RequestsLibrary.Post Request    session    ${URI_CERTIFICATE}    headers=${HEADERS}
     Should Contain    ${UNAUTHORIZED_STATUS_CODES}    ${resp_nook.status_code}
 
 Unsuccessful Dynamic Authorization 2
@@ -171,15 +191,23 @@ Unsuccessful Dynamic Authorization 2
     ...    - Check that the access to URL "/restconf/operational/ietf-restconf-monitoring:restconf-state" is authorized because the URL is not specified in shiro.ini and in MDSAL Dynamic Authorization access to that URL is allowed just for users with "user" role and "CSC_user_no_admin" does \ have \ "user" role in keystone
     Set Suite Variable    ${PUT_DYNAMIC_AUTH_FILE}    ${CURDIR}/../../../variables/aaa/put-dynamic-auth-3.json
     Provision MDSAL    ${PUT_DYNAMIC_AUTH_FILE}
-    Create Session    session    http://${ODL_SYSTEM_IP}:${RESTCONFPORT}    auth=${AUTH_SDN_DOMAIN}    headers=${HEADERS}
-    ${resp}=    RequestsLibrary.Post Request    session    ${URI_CERTIFICATE}    headers=${HEADERS}
+    Create Session
+    ...    session
+    ...    http://${ODL_SYSTEM_IP}:${RESTCONFPORT}
+    ...    auth=${AUTH_SDN_DOMAIN}
+    ...    headers=${HEADERS}
+    ${resp}    RequestsLibrary.Post Request    session    ${URI_CERTIFICATE}    headers=${HEADERS}
     Should Contain    ${UNAUTHORIZED_STATUS_CODES}    ${resp.status_code}
-    ${resp}=    RequestsLibrary.Get Request    session    ${URI_RESTCONF}    headers=${HEADERS}
+    ${resp}    RequestsLibrary.Get Request    session    ${URI_RESTCONF}    headers=${HEADERS}
     Should Contain    ${UNAUTHORIZED_STATUS_CODES}    ${resp.status_code}
-    Create Session    session    http://${ODL_SYSTEM_IP}:${RESTCONFPORT}    auth=${AUTH_CSC_NO_ADMIN}    headers=${HEADERS}
-    ${resp}=    RequestsLibrary.Get Request    session    ${URI_RESTCONF}    headers=${HEADERS}
+    Create Session
+    ...    session
+    ...    http://${ODL_SYSTEM_IP}:${RESTCONFPORT}
+    ...    auth=${AUTH_CSC_NO_ADMIN}
+    ...    headers=${HEADERS}
+    ${resp}    RequestsLibrary.Get Request    session    ${URI_RESTCONF}    headers=${HEADERS}
     Should Contain    ${ALLOWED_STATUS_CODES}    ${resp.status_code}
-    ${resp}=    RequestsLibrary.Post Request    session    ${URI_CERTIFICATE}    headers=${HEADERS}
+    ${resp}    RequestsLibrary.Post Request    session    ${URI_CERTIFICATE}    headers=${HEADERS}
     Should Contain    ${UNAUTHORIZED_STATUS_CODES}    ${resp.status_code}
 
 Unsuccessful No Keystone Connection
@@ -190,17 +218,26 @@ Unsuccessful No Keystone Connection
     ...    - Put down Keystone
     ...    - All accesses are forbidden
     Cleanup Suite
-    Create Session    session    http://${ODL_SYSTEM_IP}:${RESTCONFPORT}    auth=${AUTH_SDN_DOMAIN}    headers=${HEADERS}
-    ${resp}=    RequestsLibrary.Post Request    session    ${URI_CERTIFICATE}    headers=${HEADERS}
+    Create Session
+    ...    session
+    ...    http://${ODL_SYSTEM_IP}:${RESTCONFPORT}
+    ...    auth=${AUTH_SDN_DOMAIN}
+    ...    headers=${HEADERS}
+    ${resp}    RequestsLibrary.Post Request    session    ${URI_CERTIFICATE}    headers=${HEADERS}
     Should Contain    ${UNAUTHORIZED_STATUS_CODES}    ${resp.status_code}
-    ${resp}=    RequestsLibrary.Get Request    session    ${URI_RESTCONF}    headers=${HEADERS}
+    ${resp}    RequestsLibrary.Get Request    session    ${URI_RESTCONF}    headers=${HEADERS}
     Should Contain    ${UNAUTHORIZED_STATUS_CODES}    ${resp.status_code}
-    Create Session    session    http://${ODL_SYSTEM_IP}:${RESTCONFPORT}    auth=${AUTH_CSC_NO_ADMIN}    headers=${HEADERS}
-    ${resp}=    RequestsLibrary.Get Request    session    ${URI_RESTCONF}    headers=${HEADERS}
+    Create Session
+    ...    session
+    ...    http://${ODL_SYSTEM_IP}:${RESTCONFPORT}
+    ...    auth=${AUTH_CSC_NO_ADMIN}
+    ...    headers=${HEADERS}
+    ${resp}    RequestsLibrary.Get Request    session    ${URI_RESTCONF}    headers=${HEADERS}
     Should Contain    ${UNAUTHORIZED_STATUS_CODES}    ${resp.status_code}
-    ${resp}=    RequestsLibrary.Post Request    session    ${URI_CERTIFICATE}    headers=${HEADERS}
+    ${resp}    RequestsLibrary.Post Request    session    ${URI_CERTIFICATE}    headers=${HEADERS}
     Should Contain    ${UNAUTHORIZED_STATUS_CODES}    ${resp.status_code}
 
+
 *** Keywords ***
 Init Suite
     [Documentation]    The steps included in the Initialization phase are:
@@ -214,7 +251,11 @@ Init Suite
     ...    - Provision Keystone: Populate keystone database with the needed users and roles
     ...
     ...    - Install Keystone certificate into ODL so that the protocol used in the ODL-Keystone communication is HTTPS with server certificate authentication
-    ${TOOLS_SYSTEM_NAME}    Run Command On Remote System    ${TOOLS_SYSTEM_IP}    hostname -f    user=${TOOLS_SYSTEM_USER}    password=${TOOLS_SYSTEM_PASSWORD}
+    ${TOOLS_SYSTEM_NAME}    Run Command On Remote System
+    ...    ${TOOLS_SYSTEM_IP}
+    ...    hostname -f
+    ...    user=${TOOLS_SYSTEM_USER}
+    ...    password=${TOOLS_SYSTEM_PASSWORD}
     Run Docker Keystone
     Configure AAA In Controller    ${TOOLS_SYSTEM_NAME}
     Set Suite Variable    ${PUT_KEYSTONE_CERT_FILE}    ${CURDIR}/../../../variables/aaa/put-keystone-cert.json
@@ -227,12 +268,13 @@ Init Suite
 Cleanup Suite
     [Documentation]    Destoy keystone container
     ${result}    Run Keyword And Return Status    Set Domain To False    ${domain}    ${HEADERS_TOKEN}
-    Run Keyword If    ${result} == True    Delete Keystone Domain    ${domain}    ${HEADERS_TOKEN}
-    Run Keyword If    ${result} == True    Destroy Docker Keystone
+    IF    ${result} == True
+        Delete Keystone Domain    ${domain}    ${HEADERS_TOKEN}
+    END
+    IF    ${result} == True    Destroy Docker Keystone
     SSHLibrary.Close All Connections
 
 Configure AAA In Controller
-    [Arguments]    ${TOOLS_SYSTEM_NAME}
     [Documentation]    With this keyword shiro.ini and aaa-cert-config.xml are modified to configure Keystone Authentication Realm using TLS1.2. Here you have the settings:
     ...
     ...    - shiro.ini:
@@ -250,20 +292,29 @@ Configure AAA In Controller
     ...    <use-config>true</use-config>
     ...
     ...    <tls-protocols>TLSv1.2</tls-protocols>
+    [Arguments]    ${TOOLS_SYSTEM_NAME}
     ${shiro_path}    Run Command On Controller    cmd=cd /;find /|grep shiro.ini|grep etc|grep -v denied
     ${cert_path}    Run Command On Controller    cmd=cd /;find /|grep aaa-cert-config.xml|grep etc|grep -v denied
-    ${result}    Run Command On Controller    cmd=sed -ie 's/#keystoneAuthRealm =.*/keystoneAuthRealm = org.opendaylight.aaa.shiro.realm.KeystoneAuthRealm/g' ${shiro_path}
-    ${result}    Run Command On Controller    cmd=sed -ie 's/#keystoneAuthRealm.url =.*/keystoneAuthRealm.url = https:\\/\\/${TOOLS_SYSTEM_NAME}:35357/g' ${shiro_path}
-    ${result}    Run Command On Controller    cmd=sed -ie 's/securityManager.realms =.*/securityManager.realms = $tokenAuthRealm, $keystoneAuthRealm/g' ${shiro_path}
-    ${result}    Run Command On Controller    cmd=sed -ie 's/#keystoneAuthRealm.sslVerification =.*/keystoneAuthRealm.sslVerification = true/g' ${shiro_path}
-    ${result}    Run Command On Controller    cmd=sed -ie 's/\\/operations\\/aaa-cert-rpc.*/\\/operations\\/aaa-cert-rpc** = authcBasic, roles[admin], dynamicAuthorization/g' ${shiro_path}
-    ${result}    Run Command On Controller    cmd=sed -ie 's/<use-config>.*/<use-config>true<\\/use-config>/g' ${cert_path}
-    ${result}    Run Command On Controller    cmd=sed -ie 's/<tls-protocols.*/<tls-protocols>TLSv1.2<\\/tls-protocols>/g' ${cert_path}
+    ${result}    Run Command On Controller
+    ...    cmd=sed -ie 's/#keystoneAuthRealm =.*/keystoneAuthRealm = org.opendaylight.aaa.shiro.realm.KeystoneAuthRealm/g' ${shiro_path}
+    ${result}    Run Command On Controller
+    ...    cmd=sed -ie 's/#keystoneAuthRealm.url =.*/keystoneAuthRealm.url = https:\\/\\/${TOOLS_SYSTEM_NAME}:35357/g' ${shiro_path}
+    ${result}    Run Command On Controller
+    ...    cmd=sed -ie 's/securityManager.realms =.*/securityManager.realms = $tokenAuthRealm, $keystoneAuthRealm/g' ${shiro_path}
+    ${result}    Run Command On Controller
+    ...    cmd=sed -ie 's/#keystoneAuthRealm.sslVerification =.*/keystoneAuthRealm.sslVerification = true/g' ${shiro_path}
+    ${result}    Run Command On Controller
+    ...    cmd=sed -ie 's/\\/operations\\/aaa-cert-rpc.*/\\/operations\\/aaa-cert-rpc** = authcBasic, roles[admin], dynamicAuthorization/g' ${shiro_path}
+    ${result}    Run Command On Controller
+    ...    cmd=sed -ie 's/<use-config>.*/<use-config>true<\\/use-config>/g' ${cert_path}
+    ${result}    Run Command On Controller
+    ...    cmd=sed -ie 's/<tls-protocols.*/<tls-protocols>TLSv1.2<\\/tls-protocols>/g' ${cert_path}
     ${result}    Run Command On Controller    cmd=cat ${shiro_path}
     Log    ${result}
     ${result}    Run Command On Controller    cmd=cat ${cert_path}
     Log    ${result}
-    ${result}    Run Command On Controller    cmd=sudo sed -i "2i${TOOLS_SYSTEM_IP} \ \ ${TOOLS_SYSTEM_NAME}" /etc/hosts
+    ${result}    Run Command On Controller
+    ...    cmd=sudo sed -i "2i${TOOLS_SYSTEM_IP} \ \ ${TOOLS_SYSTEM_NAME}" /etc/hosts
     ${result}    Run Command On Controller    cmd=cat /etc/hosts
     Log    ${result}
 
@@ -284,8 +335,9 @@ Provision Keystone
     ${domain_local}    Create Keystone Domain    ${HEADERS_TOKEN}    ${CREATE_DOMAIN_FILE}
     Set Suite Variable    ${domain}    ${domain_local}
     Set Suite Variable    ${CREATE_USERS_FILE}    ${CURDIR}/../../../variables/aaa/create-user.json
-    ${normalized_file}=    OperatingSystem.Normalize Path    ${CREATE_USERS_FILE}
-    ${output}    OperatingSystem.Run    sed -i 's/\"domain_id\".*/\"domain_id\"\: \"${domain}\",/g' ${CREATE_USERS_FILE}
+    ${normalized_file}    OperatingSystem.Normalize Path    ${CREATE_USERS_FILE}
+    ${output}    OperatingSystem.Run
+    ...    sed -i 's/\"domain_id\".*/\"domain_id\"\: \"${domain}\",/g' ${CREATE_USERS_FILE}
     ${user}    Create Keystone User in a Domain    ${HEADERS_TOKEN}    ${CREATE_USERS_FILE}
     Grant Admin Role    ${domain}    ${user}    ${admin_role_id}    ${HEADERS_TOKEN}
 
@@ -294,7 +346,11 @@ Provision MDSAL
     Create Session    session_admin    http://${ODL_SYSTEM_IP}:${RESTCONFPORT}    auth=${AUTH}    headers=${HEADERS}
     Set Suite Variable    ${PUT_DYNAMIC_AUTH_URI}    /restconf/config/aaa:http-authorization
     ${body_dyn}    OperatingSystem.Get File    ${PUT_DYNAMIC_AUTH_FILE}
-    ${resp}    RequestsLibrary.Put Request    session_admin    ${PUT_DYNAMIC_AUTH_URI}    data=${body_dyn}    headers=${HEADERS}
+    ${resp}    RequestsLibrary.Put Request
+    ...    session_admin
+    ...    ${PUT_DYNAMIC_AUTH_URI}
+    ...    data=${body_dyn}
+    ...    headers=${HEADERS}
     Should Contain    ${ALLOWED_STATUS_CODES}    ${resp.status_code}
     Delete Request    session_admin    http://${ODL_SYSTEM_IP}:${RESTCONFPORT}
 
@@ -311,7 +367,7 @@ Restart Controller
 Get Controller Modules
     [Documentation]    Get the restconf modules, check 200 status and ietf-restconf presence
     Create Session    session1    http://${ODL_SYSTEM_IP}:${RESTCONFPORT}    auth=${AUTH}    headers=${HEADERS}
-    ${resp}    RequestsLibrary.Get_Request    session1    ${MODULES_API}
+    ${resp}    RequestsLibrary.Get_Request    session1    ${MODULES_API}
     BuiltIn.Log    ${resp.content}
     BuiltIn.Should_Be_Equal    ${resp.status_code}    ${200}
     BuiltIn.Should_Contain    ${resp.content}    ietf-restconf
index 84884ec25b59e8c8ec53c6df045c21f2dcc63349..945fb3b7b244979e44c968a5422300518409e423 100644 (file)
@@ -1,23 +1,27 @@
 *** Settings ***
-Documentation     Test suite for Securing RESTCONF communication.
-...               Note this suite requires PycURLLibrary to handle client certificates. While Requests library is able
-...               to handle server certificates well, it lacks capabilities to deal with client certificates.
-...               TODO: Investigate the possibility to incorporate this into TemplatedRequests
-Suite Setup       Init Suite
-Suite Teardown    Cleanup Suite
-Library           OperatingSystem
-Library           RequestsLibrary
-Library           PycURLLibrary
-Library           SSHLibrary
-Resource          ../../../libraries/ClusterManagement.robot
-Resource          ../../../variables/Variables.robot
-Resource          ../../../libraries/Utils.robot
-Resource          ../../../libraries/KarafKeywords.robot
-Resource          ../../../libraries/SSHKeywords.robot
+Documentation       Test suite for Securing RESTCONF communication.
+...                 Note this suite requires PycURLLibrary to handle client certificates. While Requests library is able
+...                 to handle server certificates well, it lacks capabilities to deal with client certificates.
+...                 TODO: Investigate the possibility to incorporate this into TemplatedRequests
+
+Library             OperatingSystem
+Library             RequestsLibrary
+Library             PycURLLibrary
+Library             SSHLibrary
+Resource            ../../../libraries/ClusterManagement.robot
+Resource            ../../../variables/Variables.robot
+Resource            ../../../libraries/Utils.robot
+Resource            ../../../libraries/KarafKeywords.robot
+Resource            ../../../libraries/SSHKeywords.robot
+
+Suite Setup         Init Suite
+Suite Teardown      Cleanup Suite
+
 
 *** Variables ***
-${RESTCONF_MONITORING_URI}    /restconf/operational/ietf-restconf-monitoring:restconf-state
-${RESTCONF_MONITORING_URL}    https://${ODL_SYSTEM_IP}:${RESTCONFPORT_TLS}${RESTCONF_MONITORING_URI}
+${RESTCONF_MONITORING_URI}      /restconf/operational/ietf-restconf-monitoring:restconf-state
+${RESTCONF_MONITORING_URL}      https://${ODL_SYSTEM_IP}:${RESTCONFPORT_TLS}${RESTCONF_MONITORING_URI}
+
 
 *** Test Cases ***
 Basic Unsecure Restconf Request
@@ -33,7 +37,9 @@ TLS on Restconf without Server Cert
     PycURLLibrary.Add Header    "Content-Type:application/json"
     PycURLLibrary.Add Header    Authorization:Basic YWRtaW46YWRtaW4=
     PycURLLibrary.Request Method    GET
-    Run Keyword And Expect Error    error: (7, 'Failed *${RESTCONFPORT_TLS}* Connection refused')    PycURLLibrary.Perform
+    Run Keyword And Expect Error
+    ...    error: (7, 'Failed *${RESTCONFPORT_TLS}* Connection refused')
+    ...    PycURLLibrary.Perform
     PycURLLibrary.Log Response
 
 Activate TLS
@@ -59,7 +65,9 @@ TLS on Restconf with Server Cert (Self-signed) (insecure)
     PycURLLibrary.Log Response
     PycURLLibrary.Response Status Should Contain    200
     ${resp}    PycURLLibrary.Response
-    Should Contain    ${resp}    "restconf-state":{"capabilities":{"capability":["urn:ietf:params:restconf:capability:depth
+    Should Contain
+    ...    ${resp}
+    ...    "restconf-state":{"capabilities":{"capability":["urn:ietf:params:restconf:capability:depth
 
 TLS on Restconf with Server Cert (CA signed)
     [Documentation]    Tests HTTPS request with ODL TLS config by using CA signed certificates
@@ -74,7 +82,9 @@ TLS on Restconf with Server Cert (CA signed)
     PycURLLibrary.Log Response
     PycURLLibrary.Response Status Should Contain    200
     ${resp}    PycURLLibrary.Response
-    Should Contain    ${resp}    "restconf-state":{"capabilities":{"capability":["urn:ietf:params:restconf:capability:depth
+    Should Contain
+    ...    ${resp}
+    ...    "restconf-state":{"capabilities":{"capability":["urn:ietf:params:restconf:capability:depth
 
 Activate Client Authentication
     [Documentation]    Activates client authentication in odl by means of certificates.
@@ -101,7 +111,9 @@ TLS on Restconf with Server & Client Certs (Self-signed)
     PycURLLibrary.Log Response
     PycURLLibrary.Response Status Should Contain    200
     ${resp}    PycURLLibrary.Response
-    Should Contain    ${resp}    "restconf-state":{"capabilities":{"capability":["urn:ietf:params:restconf:capability:depth
+    Should Contain
+    ...    ${resp}
+    ...    "restconf-state":{"capabilities":{"capability":["urn:ietf:params:restconf:capability:depth
 
 TLS on Restconf with Server & Client Certs (CA signed)
     [Documentation]    Tests HTTPS request with ODL TLS config and client authentication by using CA signed certificates
@@ -119,7 +131,9 @@ TLS on Restconf with Server & Client Certs (CA signed)
     PycURLLibrary.Log Response
     PycURLLibrary.Response Status Should Contain    200
     ${resp}    PycURLLibrary.Response
-    Should Contain    ${resp}    "restconf-state":{"capabilities":{"capability":["urn:ietf:params:restconf:capability:depth
+    Should Contain
+    ...    ${resp}
+    ...    "restconf-state":{"capabilities":{"capability":["urn:ietf:params:restconf:capability:depth
 
 Restconf HTTPS/TLS Jolokia with server and client certificates CA signed
     [Documentation]    Tests HTTPS request with ODL TLS config and client authentication by using CA signed certificates for Jolokia
@@ -137,47 +151,63 @@ Restconf HTTPS/TLS Jolokia with server and client certificates CA signed
     PycURLLibrary.Log Response
     PycURLLibrary.Response Status Should Contain    200
     ${resp}    PycURLLibrary.Response
-    Should Contain    ${resp}    "request":{"mbean":"org.opendaylight.controller:Category=ShardManager,name=shard-manager-config,type=DistributedConfigDatastore"
+    Should Contain
+    ...    ${resp}
+    ...    "request":{"mbean":"org.opendaylight.controller:Category=ShardManager,name=shard-manager-config,type=DistributedConfigDatastore"
+
 
 *** Keywords ***
 Log Certificates in Keystore
     [Documentation]    Shows content of keystore
-    ${output}    Run Command On Remote System    ${ODL_SYSTEM_IP}    ${JAVA_HOME}/bin/keytool -list -storepass 123456 -keystore ${KEYSTORE_PATH}
+    ${output}    Run Command On Remote System
+    ...    ${ODL_SYSTEM_IP}
+    ...    ${JAVA_HOME}/bin/keytool -list -storepass 123456 -keystore ${KEYSTORE_PATH}
     log    ${output}
 
 Clean Up Certificates In Server
     [Documentation]    Cleans keystore content (only for private keys and trusted certificates)
     Log Certificates in Keystore
-    Run Command On Remote System    ${ODL_SYSTEM_IP}    ${JAVA_HOME}/bin/keytool -list -keystore ${KEYSTORE_PATH} -storepass 123456|egrep -e "(trustedCertEntry|PrivateKeyEntry)"|cut -d"," -f1|xargs -I[] ${JAVA_HOME}/bin/keytool -delete -alias [] -keystore ${KEYSTORE_PATH} -storepass 123456
+    Run Command On Remote System
+    ...    ${ODL_SYSTEM_IP}
+    ...    ${JAVA_HOME}/bin/keytool -list -keystore ${KEYSTORE_PATH} -storepass 123456|egrep -e "(trustedCertEntry|PrivateKeyEntry)"|cut -d"," -f1|xargs -I[] ${JAVA_HOME}/bin/keytool -delete -alias [] -keystore ${KEYSTORE_PATH} -storepass 123456
     Log Certificates in Keystore
 
 Generate Server Self-Signed Certificate
     [Documentation]    Generates a self-signed certificate, stores it into keystore and restarts jetty to load changes
-    ${KEYSTORE_DIR}=    Split Path    ${KEYSTORE_PATH}
+    ${KEYSTORE_DIR}    Split Path    ${KEYSTORE_PATH}
     Run Command On Remote System    ${ODL_SYSTEM_IP}    mkdir -p ${KEYSTORE_DIR[0]}
     Log Certificates in Keystore
     # Generate with openssl
-    Run Command On Remote System    ${ODL_SYSTEM_IP}    openssl req -x509 -newkey rsa:4096 -passout pass:myPass -keyout serverkey.pem -out servercert.pem -days 365 -subj "/C=ES/ST=Madrid/L=Madrid/O=OpenDayLight/OU=AAA/CN=OpenDayLight/emailAddress=unknown@unknown.com"
+    Run Command On Remote System
+    ...    ${ODL_SYSTEM_IP}
+    ...    openssl req -x509 -newkey rsa:4096 -passout pass:myPass -keyout serverkey.pem -out servercert.pem -days 365 -subj "/C=ES/ST=Madrid/L=Madrid/O=OpenDayLight/OU=AAA/CN=OpenDayLight/emailAddress=unknown@unknown.com"
     # Convert to pkcs12 (including public and private key together)
-    Run Command On Remote System    ${ODL_SYSTEM_IP}    openssl pkcs12 -export -in servercert.pem -inkey serverkey.pem -out server.p12 -name odl -passin pass:myPass -passout pass:myPass
+    Run Command On Remote System
+    ...    ${ODL_SYSTEM_IP}
+    ...    openssl pkcs12 -export -in servercert.pem -inkey serverkey.pem -out server.p12 -name odl -passin pass:myPass -passout pass:myPass
     # Import Certifcate into keystore
-    Run Command On Remote System    ${ODL_SYSTEM_IP}    ${JAVA_HOME}/bin/keytool -importkeystore -deststorepass 123456 -destkeypass myPass -destkeystore ${KEYSTORE_PATH} -srckeystore server.p12 -srcstoretype PKCS12 -srcstorepass myPass -alias odl
+    Run Command On Remote System
+    ...    ${ODL_SYSTEM_IP}
+    ...    ${JAVA_HOME}/bin/keytool -importkeystore -deststorepass 123456 -destkeypass myPass -destkeystore ${KEYSTORE_PATH} -srckeystore server.p12 -srcstoretype PKCS12 -srcstorepass myPass -alias odl
     Log Certificates in Keystore
     Restart Jetty
 
 Generate Client Self-Signed Certificate
     [Documentation]    Generates a client self-signed certificate, stores it into the keystore (as trusted cert) and
     ...    restarts jettty to load changes
-    ${KEYSTORE_DIR}=    Split Path    ${KEYSTORE_PATH}
+    ${KEYSTORE_DIR}    Split Path    ${KEYSTORE_PATH}
     Run Command On Remote System    ${ODL_SYSTEM_IP}    mkdir -p ${KEYSTORE_DIR[0]}
     Log Certificates in Keystore
     # Generate with openssl
     # Note -nodes is used to avoid passphrase in private key. Also -passout pass:myPass is skipped. This is due to a
     # limitation in pycurl library that does not support key pem files with passphrase in automatic mode (it asks for it)
-    Run    openssl req -x509 -newkey rsa:4096 -nodes -keyout ${USER_HOME}/clientkey.pem -out ${USER_HOME}/clientcert.pem -days 365 -subj "/C=ES/ST=Madrid/L=Madrid/O=OpenDayLight/OU=AAA/CN=MiguelAngelMunoz/emailAddress=myemail@unknown.com"
+    Run
+    ...    openssl req -x509 -newkey rsa:4096 -nodes -keyout ${USER_HOME}/clientkey.pem -out ${USER_HOME}/clientcert.pem -days 365 -subj "/C=ES/ST=Madrid/L=Madrid/O=OpenDayLight/OU=AAA/CN=MiguelAngelMunoz/emailAddress=myemail@unknown.com"
     # Import client's cert as trusted
     Copy File To Odl System    ${ODL_SYSTEM_IP}    ${USER_HOME}/clientcert.pem
-    Run Command On Remote System    ${ODL_SYSTEM_IP}    ${JAVA_HOME}/bin/keytool -import -trustcacerts -file clientcert.pem -keystore ${KEYSTORE_PATH} -storepass 123456 -noprompt
+    Run Command On Remote System
+    ...    ${ODL_SYSTEM_IP}
+    ...    ${JAVA_HOME}/bin/keytool -import -trustcacerts -file clientcert.pem -keystore ${KEYSTORE_PATH} -storepass 123456 -noprompt
     Log Certificates in Keystore
     Restart Jetty
 
@@ -186,19 +216,25 @@ Generate Server CA Signed Certificate
     #Generates Root CA key and certificate (note this has to be self-signed)
     Log Certificates in Keystore
     Run    openssl genrsa -out ${USER_HOME}/rootCA.key 2048
-    Run    openssl req -x509 -new -nodes -key ${USER_HOME}/rootCA.key -sha256 -days 1024 -out ${USER_HOME}/rootCA.pem -subj "/C=ES/ST=Madrid/L=Madrid/O=FakeCA/OU=FakeCA_ODL/CN=www.fakeca.com/emailAddress=unknown@fakeca.com"
+    Run
+    ...    openssl req -x509 -new -nodes -key ${USER_HOME}/rootCA.key -sha256 -days 1024 -out ${USER_HOME}/rootCA.pem -subj "/C=ES/ST=Madrid/L=Madrid/O=FakeCA/OU=FakeCA_ODL/CN=www.fakeca.com/emailAddress=unknown@fakeca.com"
     #Generate server CSR
     Run    openssl genrsa -out ${USER_HOME}/server.key 2048
-    Run    openssl req -new -key ${USER_HOME}/server.key -out ${USER_HOME}/server.csr -subj "/C=ES/ST=Madrid/L=Madrid/O=OpenDayLight/OU=AAA/CN=${ODL_SYSTEM_IP}/emailAddress=unknown@unknown.com"
+    Run
+    ...    openssl req -new -key ${USER_HOME}/server.key -out ${USER_HOME}/server.csr -subj "/C=ES/ST=Madrid/L=Madrid/O=OpenDayLight/OU=AAA/CN=${ODL_SYSTEM_IP}/emailAddress=unknown@unknown.com"
     #Sign CSR
-    Run    openssl x509 -req -in ${USER_HOME}/server.csr -CA ${USER_HOME}/rootCA.pem -CAkey ${USER_HOME}/rootCA.key -CAcreateserial -out ${USER_HOME}/server.crt -days 500 -sha256
+    Run
+    ...    openssl x509 -req -in ${USER_HOME}/server.csr -CA ${USER_HOME}/rootCA.pem -CAkey ${USER_HOME}/rootCA.key -CAcreateserial -out ${USER_HOME}/server.crt -days 500 -sha256
     # Convert to pkcs12 (including public and private key together)
-    Run    openssl pkcs12 -export -in ${USER_HOME}/server.crt -inkey ${USER_HOME}/server.key -out ${USER_HOME}/server.p12 -name odl -passin pass:myPass -passout pass:myPass
+    Run
+    ...    openssl pkcs12 -export -in ${USER_HOME}/server.crt -inkey ${USER_HOME}/server.key -out ${USER_HOME}/server.p12 -name odl -passin pass:myPass -passout pass:myPass
     Copy File To Odl System    ${ODL_SYSTEM_IP}    ${USER_HOME}/server.p12
     # Import Certifcate into keystore
-    ${KEYSTORE_DIR}=    Split Path    ${KEYSTORE_PATH}
+    ${KEYSTORE_DIR}    Split Path    ${KEYSTORE_PATH}
     Run Command On Remote System    ${ODL_SYSTEM_IP}    mkdir -p ${KEYSTORE_DIR[0]}
-    Run Command On Remote System    ${ODL_SYSTEM_IP}    ${JAVA_HOME}/bin/keytool -importkeystore -deststorepass 123456 -destkeypass myPass -destkeystore ${KEYSTORE_PATH} -srckeystore ${USER_HOME}/server.p12 -srcstoretype PKCS12 -srcstorepass myPass -alias odl
+    Run Command On Remote System
+    ...    ${ODL_SYSTEM_IP}
+    ...    ${JAVA_HOME}/bin/keytool -importkeystore -deststorepass 123456 -destkeypass myPass -destkeystore ${KEYSTORE_PATH} -srckeystore ${USER_HOME}/server.p12 -srcstoretype PKCS12 -srcstorepass myPass -alias odl
     Log Certificates in Keystore
     Restart Jetty
 
@@ -207,17 +243,22 @@ Generate Client CA Signed Certificate
     #Generates Root CA key and certificate (note this has to be self-signed)
     Log Certificates in Keystore
     Run    openssl genrsa -out ${USER_HOME}/rootCA_for_clients-key.pem 2048
-    Run    openssl req -x509 -new -nodes -key ${USER_HOME}/rootCA_for_clients-key.pem -sha256 -days 1024 -out ${USER_HOME}/rootCA_for_clients-cert.pem -subj "/C=ES/ST=Madrid/L=Madrid/O=FakeCA_ForClient/OU=FakeCA_ForClient/CN=www.fakecaforclients.com/emailAddress=unknown@fakecaforclients.com"
+    Run
+    ...    openssl req -x509 -new -nodes -key ${USER_HOME}/rootCA_for_clients-key.pem -sha256 -days 1024 -out ${USER_HOME}/rootCA_for_clients-cert.pem -subj "/C=ES/ST=Madrid/L=Madrid/O=FakeCA_ForClient/OU=FakeCA_ForClient/CN=www.fakecaforclients.com/emailAddress=unknown@fakecaforclients.com"
     #Generate client CSR
     Run    openssl genrsa -out ${USER_HOME}/client_ca_signed-key.pem 2048
-    Run    openssl req -new -key ${USER_HOME}/client_ca_signed-key.pem -out ${USER_HOME}/client_ca_signed.csr -subj "/C=ES/ST=Madrid/L=Madrid/O=OpenDayLight/OU=RestClient/CN=RestClient/emailAddress=unknown@unknownclient.com"
+    Run
+    ...    openssl req -new -key ${USER_HOME}/client_ca_signed-key.pem -out ${USER_HOME}/client_ca_signed.csr -subj "/C=ES/ST=Madrid/L=Madrid/O=OpenDayLight/OU=RestClient/CN=RestClient/emailAddress=unknown@unknownclient.com"
     #Sign CSR
-    Run    openssl x509 -req -in ${USER_HOME}/client_ca_signed.csr -CA ${USER_HOME}/rootCA_for_clients-cert.pem -CAkey ${USER_HOME}/rootCA_for_clients-key.pem -CAcreateserial -out ${USER_HOME}/client_ca_signed-cert.pem -days 500 -sha256
+    Run
+    ...    openssl x509 -req -in ${USER_HOME}/client_ca_signed.csr -CA ${USER_HOME}/rootCA_for_clients-cert.pem -CAkey ${USER_HOME}/rootCA_for_clients-key.pem -CAcreateserial -out ${USER_HOME}/client_ca_signed-cert.pem -days 500 -sha256
     Copy File To Odl System    ${ODL_SYSTEM_IP}    ${USER_HOME}/rootCA_for_clients-cert.pem
     # Import RootCA Certifcate into keystore
-    ${KEYSTORE_DIR}=    Split Path    ${KEYSTORE_PATH}
+    ${KEYSTORE_DIR}    Split Path    ${KEYSTORE_PATH}
     Run Command On Remote System    ${ODL_SYSTEM_IP}    mkdir -p ${KEYSTORE_DIR[0]}
-    Run Command On Remote System    ${ODL_SYSTEM_IP}    ${JAVA_HOME}/bin/keytool -import -trustcacerts -file rootCA_for_clients-cert.pem -keystore ${KEYSTORE_PATH} -storepass 123456 -noprompt
+    Run Command On Remote System
+    ...    ${ODL_SYSTEM_IP}
+    ...    ${JAVA_HOME}/bin/keytool -import -trustcacerts -file rootCA_for_clients-cert.pem -keystore ${KEYSTORE_PATH} -storepass 123456 -noprompt
     Log Certificates in Keystore
     Restart Jetty
 
@@ -227,7 +268,9 @@ Disable TLS in ODL
     Run Command On Remote System    ${ODL_SYSTEM_IP}    sed -i '/org.ops4j.pax.web.ssl.keystore=/d' ${CUSTOMPROP}
     Run Command On Remote System    ${ODL_SYSTEM_IP}    sed -i '/org.ops4j.pax.web.ssl.password=/d' ${CUSTOMPROP}
     Run Command On Remote System    ${ODL_SYSTEM_IP}    sed -i '/org.ops4j.pax.web.ssl.keypassword=/d' ${CUSTOMPROP}
-    Run Command On Remote System    ${ODL_SYSTEM_IP}    sed -i '/org.ops4j.pax.web.ssl.clientauthneeded=/d' ${CUSTOMPROP}
+    Run Command On Remote System
+    ...    ${ODL_SYSTEM_IP}
+    ...    sed -i '/org.ops4j.pax.web.ssl.clientauthneeded=/d' ${CUSTOMPROP}
     Restart Karaf
 
 Enable TLS in ODL
@@ -236,9 +279,15 @@ Enable TLS in ODL
     Run Command On Remote System    ${ODL_SYSTEM_IP}    sed -i '/org.ops4j.pax.web.ssl.keystore=/d' ${CUSTOMPROP}
     Run Command On Remote System    ${ODL_SYSTEM_IP}    sed -i '/org.ops4j.pax.web.ssl.password=/d' ${CUSTOMPROP}
     Run Command On Remote System    ${ODL_SYSTEM_IP}    sed -i '/org.ops4j.pax.web.ssl.keypassword=/d' ${CUSTOMPROP}
-    Run Command On Remote System    ${ODL_SYSTEM_IP}    sed -i '/org.ops4j.pax.web.ssl.clientauthneeded=/d' ${CUSTOMPROP}
-    Run Command On Remote System    ${ODL_SYSTEM_IP}    echo "org.osgi.service.http.secure.enabled=true">> ${CUSTOMPROP}
-    Run Command On Remote System    ${ODL_SYSTEM_IP}    echo "org.ops4j.pax.web.ssl.keystore=${KEYSTORE_RELATIVE_PATH}">> ${CUSTOMPROP}
+    Run Command On Remote System
+    ...    ${ODL_SYSTEM_IP}
+    ...    sed -i '/org.ops4j.pax.web.ssl.clientauthneeded=/d' ${CUSTOMPROP}
+    Run Command On Remote System
+    ...    ${ODL_SYSTEM_IP}
+    ...    echo "org.osgi.service.http.secure.enabled=true">> ${CUSTOMPROP}
+    Run Command On Remote System
+    ...    ${ODL_SYSTEM_IP}
+    ...    echo "org.ops4j.pax.web.ssl.keystore=${KEYSTORE_RELATIVE_PATH}">> ${CUSTOMPROP}
     Run Command On Remote System    ${ODL_SYSTEM_IP}    echo "org.ops4j.pax.web.ssl.password=myPass">> ${CUSTOMPROP}
     Run Command On Remote System    ${ODL_SYSTEM_IP}    echo "org.ops4j.pax.web.ssl.keypassword=123456">> ${CUSTOMPROP}
     Restart Karaf
@@ -249,12 +298,20 @@ Enable Client TLS Authentication in ODL
     Run Command On Remote System    ${ODL_SYSTEM_IP}    sed -i '/org.ops4j.pax.web.ssl.keystore=/d' ${CUSTOMPROP}
     Run Command On Remote System    ${ODL_SYSTEM_IP}    sed -i '/org.ops4j.pax.web.ssl.password=/d' ${CUSTOMPROP}
     Run Command On Remote System    ${ODL_SYSTEM_IP}    sed -i '/org.ops4j.pax.web.ssl.keypassword=/d' ${CUSTOMPROP}
-    Run Command On Remote System    ${ODL_SYSTEM_IP}    sed -i '/org.ops4j.pax.web.ssl.clientauthneeded=/d' ${CUSTOMPROP}
-    Run Command On Remote System    ${ODL_SYSTEM_IP}    echo "org.osgi.service.http.secure.enabled=true">> ${CUSTOMPROP}
-    Run Command On Remote System    ${ODL_SYSTEM_IP}    echo "org.ops4j.pax.web.ssl.keystore=${KEYSTORE_RELATIVE_PATH}">> ${CUSTOMPROP}
+    Run Command On Remote System
+    ...    ${ODL_SYSTEM_IP}
+    ...    sed -i '/org.ops4j.pax.web.ssl.clientauthneeded=/d' ${CUSTOMPROP}
+    Run Command On Remote System
+    ...    ${ODL_SYSTEM_IP}
+    ...    echo "org.osgi.service.http.secure.enabled=true">> ${CUSTOMPROP}
+    Run Command On Remote System
+    ...    ${ODL_SYSTEM_IP}
+    ...    echo "org.ops4j.pax.web.ssl.keystore=${KEYSTORE_RELATIVE_PATH}">> ${CUSTOMPROP}
     Run Command On Remote System    ${ODL_SYSTEM_IP}    echo "org.ops4j.pax.web.ssl.password=myPass">> ${CUSTOMPROP}
     Run Command On Remote System    ${ODL_SYSTEM_IP}    echo "org.ops4j.pax.web.ssl.keypassword=123456">> ${CUSTOMPROP}
-    Run Command On Remote System    ${ODL_SYSTEM_IP}    echo "org.ops4j.pax.web.ssl.clientauthneeded=true">> ${CUSTOMPROP}
+    Run Command On Remote System
+    ...    ${ODL_SYSTEM_IP}
+    ...    echo "org.ops4j.pax.web.ssl.clientauthneeded=true">> ${CUSTOMPROP}
     Restart Karaf
 
 Init Suite
index 43c5e53f1380903e8c0bba8297887ba96bc4062b..a37013611065daeb820cbf5d560c18d8f1ab9765 100644 (file)
@@ -1,12 +1,13 @@
 *** Settings ***
-Documentation     Test suite for resourcepool
-Suite Setup       Create Session    session    http://${ODL_SYSTEM_IP}:${RESTCONFPORT}    auth=${AUTH}    headers=${HEADERS}
-Suite Teardown    Delete All Sessions
-Library           RequestsLibrary
-Variables         ../../../variables/Variables.py
-Variables         ../../../variables/alto/Variables.py
-
-*** Variables ***
+Documentation       Test suite for resourcepool
+
+Library             RequestsLibrary
+Variables           ../../../variables/Variables.py
+Variables           ../../../variables/alto/Variables.py
+
+Suite Setup         Create Session    session    http://${ODL_SYSTEM_IP}:${RESTCONFPORT}    auth=${AUTH}    headers=${HEADERS}
+Suite Teardown      Delete All Sessions
+
 
 *** Test Cases ***
 Check the resource pool status
index a23f93898c6d6e7757014a5160de3a35dd33cfd3..0b6332116b8f5dbd32460aa0d5e0f2da9e28b1f4 100644 (file)
@@ -1,20 +1,24 @@
 *** Settings ***
-Documentation     Test suite for ALTO simple IRD (Information Resource Dictionary)
-Suite Setup       Create Session    session    http://${ODL_SYSTEM_IP}:${RESTCONFPORT}    auth=${AUTH}    headers=${HEADERS}
-Suite Teardown    Delete All Sessions
-Library           RequestsLibrary
-Library           ../../../libraries/ALTO/AltoParser.py
-Variables         ../../../variables/Variables.py
-Variables         ../../../variables/alto/Variables.py
-Resource          ${CURDIR}/../../../libraries/TemplatedRequests.robot
+Documentation       Test suite for ALTO simple IRD (Information Resource Dictionary)
+
+Library             RequestsLibrary
+Library             ../../../libraries/ALTO/AltoParser.py
+Variables           ../../../variables/Variables.py
+Variables           ../../../variables/alto/Variables.py
+Resource            ${CURDIR}/../../../libraries/TemplatedRequests.robot
+
+Suite Setup         Create Session    session    http://${ODL_SYSTEM_IP}:${RESTCONFPORT}    auth=${AUTH}    headers=${HEADERS}
+Suite Teardown      Delete All Sessions
+
 
 *** Variables ***
-${THE_FIRST_IRD_RESOURCE_ID}    hello
-${THE_SECOND_IRD_RESOURCE_ID}    world
-${RESOURCE_IN_FIRST_IRD}    test-model-networkmap
-${RESOURCE_IN_SECOND_IRD}    test-model-filtered-costmap
-${BASE_URL}       ${EMPTY}
-${RANDOM_CONTEXT_ID}    ${EMPTY}
+${THE_FIRST_IRD_RESOURCE_ID}        hello
+${THE_SECOND_IRD_RESOURCE_ID}       world
+${RESOURCE_IN_FIRST_IRD}            test-model-networkmap
+${RESOURCE_IN_SECOND_IRD}           test-model-filtered-costmap
+${BASE_URL}                         ${EMPTY}
+${RANDOM_CONTEXT_ID}                ${EMPTY}
+
 
 *** Test Cases ***
 Check the simple IRD information
@@ -24,22 +28,47 @@ Check the simple IRD information
     ${context_id}    ${BASE_URL}    Get Basic Info    ${resp.content}
     Set Suite Variable    ${BASE_URL}
     Set Suite Variable    ${RANDOM_CONTEXT_ID}    ${context_id}
-    Wait Until Keyword Succeeds    20s    2s    Check GET Response Code Equals 200    /${RESOURCE_POOL_BASE}/${context_id}
+    Wait Until Keyword Succeeds
+    ...    20s
+    ...    2s
+    ...    Check GET Response Code Equals 200
+    ...    /${RESOURCE_POOL_BASE}/${context_id}
 
 Create two IRDs
     [Documentation]    Create two IRDs and verify their existence
     Create An IRD    ${DEFAULT_CONTEXT_ID}    ${THE_FIRST_IRD_RESOURCE_ID}
-    Wait Until Keyword Succeeds    5s    1s    Check GET Response Code Equals 200    /${ALTO_OPERATIONAL_IRD_INSTANCE}/${THE_FIRST_IRD_RESOURCE_ID}
+    Wait Until Keyword Succeeds
+    ...    5s
+    ...    1s
+    ...    Check GET Response Code Equals 200
+    ...    /${ALTO_OPERATIONAL_IRD_INSTANCE}/${THE_FIRST_IRD_RESOURCE_ID}
     Create An IRD    ${DEFAULT_CONTEXT_ID}    ${THE_SECOND_IRD_RESOURCE_ID}
-    Wait Until Keyword Succeeds    5s    1s    Check GET Response Code Equals 200    /${ALTO_OPERATIONAL_IRD_INSTANCE}/${THE_SECOND_IRD_RESOURCE_ID}
+    Wait Until Keyword Succeeds
+    ...    5s
+    ...    1s
+    ...    Check GET Response Code Equals 200
+    ...    /${ALTO_OPERATIONAL_IRD_INSTANCE}/${THE_SECOND_IRD_RESOURCE_ID}
 
 Add one IRD configuration entry in one IRD instance
     [Documentation]    Add one IRD configuration entry in an IRD whose name is hello. Link IRD entry to one existed resource.
-    Wait Until Keyword Succeeds    5s    1s    Add An IRD Configuration Entry    ${THE_FIRST_IRD_RESOURCE_ID}    ${DEFAULT_CONTEXT_ID}    ${RESOURCE_IN_FIRST_IRD}
+    Wait Until Keyword Succeeds
+    ...    5s
+    ...    1s
+    ...    Add An IRD Configuration Entry
+    ...    ${THE_FIRST_IRD_RESOURCE_ID}
+    ...    ${DEFAULT_CONTEXT_ID}
+    ...    ${RESOURCE_IN_FIRST_IRD}
     ...    ${BASE_URL}
-    Wait Until Keyword Succeeds    5s    1s    Add An IRD Configuration Entry    ${THE_SECOND_IRD_RESOURCE_ID}    ${DEFAULT_CONTEXT_ID}    ${RESOURCE_IN_SECOND_IRD}
+    Wait Until Keyword Succeeds
+    ...    5s
+    ...    1s
+    ...    Add An IRD Configuration Entry
+    ...    ${THE_SECOND_IRD_RESOURCE_ID}
+    ...    ${DEFAULT_CONTEXT_ID}
+    ...    ${RESOURCE_IN_SECOND_IRD}
     ...    ${BASE_URL}
 
+
 *** Keywords ***
 Check GET Response Code Equals 200
     [Arguments]    ${uri_without_ip_port}
@@ -48,12 +77,17 @@ Check GET Response Code Equals 200
 
 Create An IRD
     [Arguments]    ${context_id}    ${IRD_id}
-    ${body}    Set Variable    {"ird-instance-configuration":{"entry-context":"/alto-resourcepool:context[alto-resourcepool:context-id='${context_id}']","instance-id":"${IRD_id}"}}
+    ${body}    Set Variable
+    ...    {"ird-instance-configuration":{"entry-context":"/alto-resourcepool:context[alto-resourcepool:context-id='${context_id}']","instance-id":"${IRD_id}"}}
     ${resp}    RequestsLibrary.Put Request    session    /${ALTO_CONFIG_IRD_INSTANCE_CONFIG}/${IRD_id}    data=${body}
     Should Contain    ${ALLOWED_STATUS_CODES}    ${resp.status_code}
 
 Add An IRD Configuration Entry
     [Arguments]    ${IRD_id}    ${context_id}    ${resource_id}    ${base_url}
-    ${body}    Set Variable    {"ird-configuration-entry":{"entry-id":"${resource_id}","instance":"/alto-resourcepool:context[alto-resourcepool:context-id='${context_id}']/alto-resourcepool:resource[alto-resourcepool:resource-id='${resource_id}']","path":"${base_url}/${resource_id}"}}
-    ${resp}    RequestsLibrary.Put Request    session    /${ALTO_CONFIG_IRD_INSTANCE_CONFIG}/${IRD_id}/ird-configuration-entry/${resource_id}    data=${body}
+    ${body}    Set Variable
+    ...    {"ird-configuration-entry":{"entry-id":"${resource_id}","instance":"/alto-resourcepool:context[alto-resourcepool:context-id='${context_id}']/alto-resourcepool:resource[alto-resourcepool:resource-id='${resource_id}']","path":"${base_url}/${resource_id}"}}
+    ${resp}    RequestsLibrary.Put Request
+    ...    session
+    ...    /${ALTO_CONFIG_IRD_INSTANCE_CONFIG}/${IRD_id}/ird-configuration-entry/${resource_id}
+    ...    data=${body}
     Should Contain    ${ALLOWED_STATUS_CODES}    ${resp.status_code}
index 7e9df002e92c5522783d859600d0166a88809fce..b2d70037e1ffa1f5ea4a369cf83dbe450f9360d6 100644 (file)
@@ -1,16 +1,19 @@
 *** Settings ***
-Documentation     Test suite for B&R support library itself
-Suite Setup       Run Keywords    Init Suite    ClusterManagement Setup
-Suite Teardown    Delete All Sessions
-Test Setup        Remove All Elements If Exist    ${SERVICE_FUNCTIONS_URI}
-Library           SSHLibrary
-Library           Collections
-Library           OperatingSystem
-Library           RequestsLibrary
-Resource          ../../../variables/Variables.robot
-Resource          ../../../libraries/Utils.robot
-Resource          ../../../libraries/TemplatedRequests.robot
-Resource          ../../../libraries/BackupRestoreKeywords.robot
+Documentation       Test suite for B&R support library itself
+
+Library             SSHLibrary
+Library             Collections
+Library             OperatingSystem
+Library             RequestsLibrary
+Resource            ../../../variables/Variables.robot
+Resource            ../../../libraries/Utils.robot
+Resource            ../../../libraries/TemplatedRequests.robot
+Resource            ../../../libraries/BackupRestoreKeywords.robot
+
+Suite Setup         Run Keywords    Init Suite    ClusterManagement Setup
+Suite Teardown      Delete All Sessions
+Test Setup          Remove All Elements If Exist    ${SERVICE_FUNCTIONS_URI}
+
 
 *** Test Cases ***
 ConditionalBackupRestoreCheck keyword
@@ -30,13 +33,17 @@ BackupRestoreCheck keyword
     [Documentation]    Demostrates how the BackupRestoreCheck keyword can be used in order to create specific testcases performing backup-restore verification
     ${body}    OperatingSystem.Get File    ${SERVICE_FUNCTIONS_FILE}
     Add Elements To URI From File    ${SERVICE_FUNCTIONS_URI}    ${SERVICE_FUNCTIONS_FILE}
-    Run Keyword And Expect Error    *    BackupRestoreCheck    exclusionsOperationalBefore=../variables/backuprestore/json_prefilter.conf
+    Run Keyword And Expect Error
+    ...    *
+    ...    BackupRestoreCheck
+    ...    exclusionsOperationalBefore=../variables/backuprestore/json_prefilter.conf
     ${resp}    RequestsLibrary.Get Request    session    ${SERVICE_FUNCTIONS_URI}
     Should Contain    ${ALLOWED_STATUS_CODES}    ${resp.status_code}
     Remove All Elements At URI    ${SERVICE_FUNCTIONS_URI}
     ${resp}    RequestsLibrary.Get Request    session    ${SERVICE_FUNCTIONS_URI}
     Should Be Equal As Strings    ${resp.status_code}    404
 
+
 *** Keywords ***
 Init Suite
     [Documentation]    Initialize session and ODL version specific variables
@@ -44,7 +51,11 @@ Init Suite
     log    ${ODL_STREAM}
     Set Suite Variable    ${VERSION_DIR}    master
     Set Suite Variable    ${SERVICE_FUNCTIONS_URI}    /restconf/config/service-function:service-functions/
-    Set Suite Variable    ${SERVICE_FUNCTIONS_FILE}    ${CURDIR}/../../../variables/sfc/${VERSION_DIR}/service-functions.json
-    Set Suite Variable    ${SF_DPI102100_URI}    /restconf/config/service-function:service-functions/service-function/dpi-102-100/
+    Set Suite Variable
+    ...    ${SERVICE_FUNCTIONS_FILE}
+    ...    ${CURDIR}/../../../variables/sfc/${VERSION_DIR}/service-functions.json
+    Set Suite Variable
+    ...    ${SF_DPI102100_URI}
+    ...    /restconf/config/service-function:service-functions/service-function/dpi-102-100/
     Set Suite Variable    ${SF_DPI102100_FILE}    ${CURDIR}/../../../variables/sfc/${VERSION_DIR}/sf_dpi_102_100.json
     Set Suite Variable    ${SF_DPL101_FILE}    ${CURDIR}/../../../variables/sfc/${VERSION_DIR}/sf_dpl_101.json
index a953e6e6e2093baae61a86d1f701b5739caaa6b4..546cb3758e9f3f39495a9e658b5cf546e4ba7758 100644 (file)
@@ -1,15 +1,18 @@
 *** Settings ***
-Documentation     Test suite for SFC Service Functions, Operates functions from Restconf APIs.
-Suite Setup       Run Keywords    Init Suite    ClusterManagement Setup
-Suite Teardown    Delete All Sessions
-Library           SSHLibrary
-Library           Collections
-Library           OperatingSystem
-Library           RequestsLibrary
-Resource          ../../../variables/Variables.robot
-Resource          ../../../libraries/Utils.robot
-Resource          ../../../libraries/TemplatedRequests.robot
-Resource          ../../../libraries/BackupRestoreKeywords.robot
+Documentation       Test suite for SFC Service Functions, Operates functions from Restconf APIs.
+
+Library             SSHLibrary
+Library             Collections
+Library             OperatingSystem
+Library             RequestsLibrary
+Resource            ../../../variables/Variables.robot
+Resource            ../../../libraries/Utils.robot
+Resource            ../../../libraries/TemplatedRequests.robot
+Resource            ../../../libraries/BackupRestoreKeywords.robot
+
+Suite Setup         Run Keywords    Init Suite    ClusterManagement Setup
+Suite Teardown      Delete All Sessions
+
 
 *** Test Cases ***
 Basic Environment Setup Tests
@@ -25,8 +28,15 @@ Create and Get Rendered Service Path
     Post Elements To URI As JSON    ${OPERATIONS_CREATE_RSP_URI}    ${CREATE_RSP1_INPUT}
     ${resp}    RequestsLibrary.Get Request    session    ${OPERATIONAL_RSPS_URI}
     Should Contain    ${ALLOWED_STATUS_CODES}    ${resp.status_code}
-    ${elements}=    Create List    SFC1-100-Path-1    "parent-service-function-path":"SFC1-100"    "hop-number":0    "service-index":255    "hop-number":1
-    ...    "service-index":254    "hop-number":2    "service-index":253
+    ${elements}    Create List
+    ...    SFC1-100-Path-1
+    ...    "parent-service-function-path":"SFC1-100"
+    ...    "hop-number":0
+    ...    "service-index":255
+    ...    "hop-number":1
+    ...    "service-index":254
+    ...    "hop-number":2
+    ...    "service-index":253
     ConditionalBackupRestoreCheck
     Check For Elements At URI    ${OPERATIONAL_RSPS_URI}    ${elements}
     Post Elements To URI As JSON    ${OPERATIONS_DELETE_RSP_URI}    ${DELETE_RSP1_INPUT}
@@ -36,8 +46,15 @@ Create Get Rendered Service Path Failure
     Post Elements To URI As JSON    ${OPERATIONS_CREATE_RSP_URI}    ${CREATE_RSP1_INPUT}
     ${resp}    RequestsLibrary.Get Request    session    ${OPERATIONAL_RSPS_URI}
     Should Contain    ${ALLOWED_STATUS_CODES}    ${resp.status_code}
-    ${elements}=    Create List    SFC1-100-Path-1    "parent-service-function-path":"SFC1-100"    "hop-number":0    "service-index":255    "hop-number":1
-    ...    "service-index":254    "hop-number":2    "service-index":253
+    ${elements}    Create List
+    ...    SFC1-100-Path-1
+    ...    "parent-service-function-path":"SFC1-100"
+    ...    "hop-number":0
+    ...    "service-index":255
+    ...    "hop-number":1
+    ...    "service-index":254
+    ...    "hop-number":2
+    ...    "service-index":253
     ConditionalBackupRestoreCheck
     Check For Elements At URI    ${OPERATIONAL_RSPS_URI}    ${elements}
     Post Elements To URI As JSON    ${OPERATIONS_DELETE_RSP_URI}    ${DELETE_RSP1_INPUT}
@@ -50,6 +67,7 @@ Clean Datastore After Tests
     Remove All Elements If Exist    ${SERVICE_CHAINS_URI}
     Remove All Elements If Exist    ${SERVICE_FUNCTION_PATHS_URI}
 
+
 *** Keywords ***
 Post Elements To URI As JSON
     [Arguments]    ${uri}    ${data}
@@ -60,7 +78,7 @@ Get JSON Elements From URI
     [Arguments]    ${uri}
     ${resp}    RequestsLibrary.Get Request    session    ${uri}
     ${value}    To Json    ${resp.content}
-    [Return]    ${value}
+    RETURN    ${value}
 
 Init Suite
     [Documentation]    Create session and initialize ODL version specific variables
@@ -68,36 +86,82 @@ Init Suite
     log    ${ODL_STREAM}
     Set Suite Variable    ${VERSION_DIR}    master
     Set Suite Variable    ${SERVICE_FUNCTIONS_URI}    /restconf/config/service-function:service-functions/
-    Set Suite Variable    ${SERVICE_FUNCTIONS_FILE}    ${CURDIR}/../../../variables/sfc/${VERSION_DIR}/service-functions.json
-    Set Suite Variable    ${SERVICE_FORWARDERS_URI}    /restconf/config/service-function-forwarder:service-function-forwarders/
-    Set Suite Variable    ${SERVICE_FORWARDERS_FILE}    ${CURDIR}/../../../variables/sfc/${VERSION_DIR}/service-function-forwarders.json
+    Set Suite Variable
+    ...    ${SERVICE_FUNCTIONS_FILE}
+    ...    ${CURDIR}/../../../variables/sfc/${VERSION_DIR}/service-functions.json
+    Set Suite Variable
+    ...    ${SERVICE_FORWARDERS_URI}
+    ...    /restconf/config/service-function-forwarder:service-function-forwarders/
+    Set Suite Variable
+    ...    ${SERVICE_FORWARDERS_FILE}
+    ...    ${CURDIR}/../../../variables/sfc/${VERSION_DIR}/service-function-forwarders.json
     Set Suite Variable    ${SERVICE_NODES_URI}    /restconf/config/service-node:service-nodes/
     Set Suite Variable    ${SERVICE_NODES_FILE}    ${CURDIR}/../../../variables/sfc/${VERSION_DIR}/service-nodes.json
     Set Suite Variable    ${SERVICE_CHAINS_URI}    /restconf/config/service-function-chain:service-function-chains/
-    Set Suite Variable    ${SERVICE_CHAINS_FILE}    ${CURDIR}/../../../variables/sfc/${VERSION_DIR}/service-function-chains.json
-    Set Suite Variable    ${SERVICE_FUNCTION_PATHS_URI}    /restconf/config/service-function-path:service-function-paths/
-    Set Suite Variable    ${SERVICE_FUNCTION_PATHS_FILE}    ${CURDIR}/../../../variables/sfc/${VERSION_DIR}/service-function-paths.json
-    Set Suite Variable    ${SERVICE_SCHED_TYPES_URI}    /restconf/config/service-function-scheduler-type:service-function-scheduler-types/
-    Set Suite Variable    ${SERVICE_SCHED_TYPE_URI_BASE}    ${SERVICE_SCHED_TYPES_URI}service-function-scheduler-type/service-function-scheduler-type:
+    Set Suite Variable
+    ...    ${SERVICE_CHAINS_FILE}
+    ...    ${CURDIR}/../../../variables/sfc/${VERSION_DIR}/service-function-chains.json
+    Set Suite Variable
+    ...    ${SERVICE_FUNCTION_PATHS_URI}
+    ...    /restconf/config/service-function-path:service-function-paths/
+    Set Suite Variable
+    ...    ${SERVICE_FUNCTION_PATHS_FILE}
+    ...    ${CURDIR}/../../../variables/sfc/${VERSION_DIR}/service-function-paths.json
+    Set Suite Variable
+    ...    ${SERVICE_SCHED_TYPES_URI}
+    ...    /restconf/config/service-function-scheduler-type:service-function-scheduler-types/
+    Set Suite Variable
+    ...    ${SERVICE_SCHED_TYPE_URI_BASE}
+    ...    ${SERVICE_SCHED_TYPES_URI}service-function-scheduler-type/service-function-scheduler-type:
     Set Suite Variable    ${SERVICE_RANDOM_SCHED_TYPE_URI}    ${SERVICE_SCHED_TYPE_URI_BASE}random
-    Set Suite Variable    ${SERVICE_RANDOM_SCHED_TYPE_FILE}    ${CURDIR}/../../../variables/sfc/${VERSION_DIR}/service-random-schedule-type.json
+    Set Suite Variable
+    ...    ${SERVICE_RANDOM_SCHED_TYPE_FILE}
+    ...    ${CURDIR}/../../../variables/sfc/${VERSION_DIR}/service-random-schedule-type.json
     Set Suite Variable    ${SERVICE_ROUNDROBIN_SCHED_TYPE_URI}    ${SERVICE_SCHED_TYPE_URI_BASE}round-robin
-    Set Suite Variable    ${SERVICE_ROUNDROBIN_SCHED_TYPE_FILE}    ${CURDIR}/../../../variables/sfc/${VERSION_DIR}/service-roundrobin-schedule-type.json
+    Set Suite Variable
+    ...    ${SERVICE_ROUNDROBIN_SCHED_TYPE_FILE}
+    ...    ${CURDIR}/../../../variables/sfc/${VERSION_DIR}/service-roundrobin-schedule-type.json
     Set Suite Variable    ${SERVICE_LOADBALANCE_SCHED_TYPE_URI}    ${SERVICE_SCHED_TYPE_URI_BASE}load-balance
-    Set Suite Variable    ${SERVICE_LOADBALANCE_SCHED_TYPE_FILE}    ${CURDIR}/../../../variables/sfc/${VERSION_DIR}/service-loadbalance-schedule-type.json
+    Set Suite Variable
+    ...    ${SERVICE_LOADBALANCE_SCHED_TYPE_FILE}
+    ...    ${CURDIR}/../../../variables/sfc/${VERSION_DIR}/service-loadbalance-schedule-type.json
     Set Suite Variable    ${SERVICE_SHORTESTPATH_SCHED_TYPE_URI}    ${SERVICE_SCHED_TYPE_URI_BASE}shortest-path
-    Set Suite Variable    ${SERVICE_SHORTESTPATH_SCHED_TYPE_FILE}    ${CURDIR}/../../../variables/sfc/${VERSION_DIR}/service-shortestpath-schedule-type.json
-    Set Suite Variable    ${RENDERED_SERVICE_PATHS_URI}    /restconf/config/rendered-service-path:rendered-service-paths/
-    Set Suite Variable    ${OPERATIONAL_RSPS_URI}    /restconf/operational/rendered-service-path:rendered-service-paths/
-    Set Suite Variable    ${OPERATIONS_CREATE_RSP_URI}    /restconf/operations/rendered-service-path:create-rendered-path/
-    Set Suite Variable    ${OPERATIONS_DELETE_RSP_URI}    /restconf/operations/rendered-service-path:delete-rendered-path
-    Set Suite Variable    ${CREATE_RSP1_INPUT}    {"input":{"parent-service-function-path":"SFC1-100","name":"SFC1-100-Path-1"}}
-    Set Suite Variable    ${CREATE_RSP2_INPUT}    {"input":{"parent-service-function-path":"SFC1-100","name":"SFC1-100-Path-2"}}
-    Set Suite Variable    ${CREATE_RSP3_INPUT}    {"input":{"parent-service-function-path":"SFC1-100","name":"SFC1-100-Path-3"}}
-    Set Suite Variable    ${CREATE_RSP4_INPUT}    {"input":{"parent-service-function-path":"SFC1-100","name":"SFC1-100-Path-4"}}
-    Set Suite Variable    ${CREATE_RSP5_INPUT}    {"input":{"parent-service-function-path":"SFC1-100","name":"SFC1-100-Path-5"}}
-    Set Suite Variable    ${CREATE_RSP6_INPUT}    {"input":{"parent-service-function-path":"SFC1-100","name":"SFC1-100-Path-6"}}
-    Set Suite Variable    ${CREATE_RSP_FAILURE_INPUT}    {"input":{"parent-service-function-path":"SFC1-empty","name":"SFC1-empty-Path-1"}}
+    Set Suite Variable
+    ...    ${SERVICE_SHORTESTPATH_SCHED_TYPE_FILE}
+    ...    ${CURDIR}/../../../variables/sfc/${VERSION_DIR}/service-shortestpath-schedule-type.json
+    Set Suite Variable
+    ...    ${RENDERED_SERVICE_PATHS_URI}
+    ...    /restconf/config/rendered-service-path:rendered-service-paths/
+    Set Suite Variable
+    ...    ${OPERATIONAL_RSPS_URI}
+    ...    /restconf/operational/rendered-service-path:rendered-service-paths/
+    Set Suite Variable
+    ...    ${OPERATIONS_CREATE_RSP_URI}
+    ...    /restconf/operations/rendered-service-path:create-rendered-path/
+    Set Suite Variable
+    ...    ${OPERATIONS_DELETE_RSP_URI}
+    ...    /restconf/operations/rendered-service-path:delete-rendered-path
+    Set Suite Variable
+    ...    ${CREATE_RSP1_INPUT}
+    ...    {"input":{"parent-service-function-path":"SFC1-100","name":"SFC1-100-Path-1"}}
+    Set Suite Variable
+    ...    ${CREATE_RSP2_INPUT}
+    ...    {"input":{"parent-service-function-path":"SFC1-100","name":"SFC1-100-Path-2"}}
+    Set Suite Variable
+    ...    ${CREATE_RSP3_INPUT}
+    ...    {"input":{"parent-service-function-path":"SFC1-100","name":"SFC1-100-Path-3"}}
+    Set Suite Variable
+    ...    ${CREATE_RSP4_INPUT}
+    ...    {"input":{"parent-service-function-path":"SFC1-100","name":"SFC1-100-Path-4"}}
+    Set Suite Variable
+    ...    ${CREATE_RSP5_INPUT}
+    ...    {"input":{"parent-service-function-path":"SFC1-100","name":"SFC1-100-Path-5"}}
+    Set Suite Variable
+    ...    ${CREATE_RSP6_INPUT}
+    ...    {"input":{"parent-service-function-path":"SFC1-100","name":"SFC1-100-Path-6"}}
+    Set Suite Variable
+    ...    ${CREATE_RSP_FAILURE_INPUT}
+    ...    {"input":{"parent-service-function-path":"SFC1-empty","name":"SFC1-empty-Path-1"}}
     Set Suite Variable    ${DELETE_RSP1_INPUT}    {"input":{"name":"SFC1-100-Path-1"}}
     Set Suite Variable    ${DELETE_RSP2_INPUT}    {"input":{"name":"SFC1-100-Path-2"}}
     Set Suite Variable    ${DELETE_RSP3_INPUT}    {"input":{"name":"SFC1-100-Path-3"}}