Upgrade RF syntax for v3.2 compatibility
[integration/test.git] / csit / suites / sxp / basic / 040_SSL_Passwords.robot
index ab21813cf176730498df201b178e6890bf522796..567773f307125b39abb4b4e6d1176121b760fcb0 100644 (file)
@@ -1,7 +1,7 @@
 *** Settings ***
 Documentation     Test suite to test SSL security fuctionality
-Suite Setup       Setup SXP Environment Local    6
-Suite Teardown    Clean SXP Environment    6
+Suite Setup       Setup SXP Environment Local    5
+Suite Teardown    Clean SXP Environment    5
 Test Setup        Clean Nodes
 Library           RequestsLibrary
 Library           SSHLibrary
@@ -21,25 +21,25 @@ SSL ConectivityCase 1
     [Tags]    SXP    SSL
     SxpLib.Add Connection    ${version}    speaker    127.0.0.2    64999    127.0.0.1    security_mode=TLS
     SxpLib.Add Connection    ${version}    listener    127.0.0.1    64999    127.0.0.2    security_mode=TLS
-    BuiltIn.Wait Until Keyword Succeeds    15    1    SxpLib.Verify Connection    ${version}    speaker    127.0.0.2
+    BuiltIn.Wait Until Keyword Succeeds    120x    1s    SxpLib.Verify Connection    ${version}    speaker    127.0.0.2
     ...    64999    127.0.0.1
-    BuiltIn.Wait Until Keyword Succeeds    15    1    SxpLib.Verify Connection    ${version}    listener    127.0.0.1
+    BuiltIn.Wait Until Keyword Succeeds    120x    1s    SxpLib.Verify Connection    ${version}    listener    127.0.0.1
     ...    64999    127.0.0.2
     SxpLib.Clean Connections    127.0.0.1
     SxpLib.Clean Connections    127.0.0.2
     SxpLib.Add Connection    ${version}    listener    127.0.0.2    64999    127.0.0.1    security_mode=TLS
     SxpLib.Add Connection    ${version}    speaker    127.0.0.1    64999    127.0.0.2    security_mode=TLS
-    BuiltIn.Wait Until Keyword Succeeds    15    1    SxpLib.Verify Connection    ${version}    listener    127.0.0.2
+    BuiltIn.Wait Until Keyword Succeeds    120x    1s    SxpLib.Verify Connection    ${version}    listener    127.0.0.2
     ...    64999    127.0.0.1
-    BuiltIn.Wait Until Keyword Succeeds    15    1    SxpLib.Verify Connection    ${version}    speaker    127.0.0.1
+    BuiltIn.Wait Until Keyword Succeeds    120x    1s    SxpLib.Verify Connection    ${version}    speaker    127.0.0.1
     ...    64999    127.0.0.2
     SxpLib.Clean Connections    127.0.0.1
     SxpLib.Clean Connections    127.0.0.2
     SxpLib.Add Connection    ${version}    both    127.0.0.2    64999    127.0.0.1    security_mode=TLS
     SxpLib.Add Connection    ${version}    both    127.0.0.1    64999    127.0.0.2    security_mode=TLS
-    BuiltIn.Wait Until Keyword Succeeds    15    1    SxpLib.Verify Connection    ${version}    both    127.0.0.2
+    BuiltIn.Wait Until Keyword Succeeds    120x    1s    SxpLib.Verify Connection    ${version}    both    127.0.0.2
     ...    64999    127.0.0.1
-    BuiltIn.Wait Until Keyword Succeeds    15    1    SxpLib.Verify Connection    ${version}    both    127.0.0.1
+    BuiltIn.Wait Until Keyword Succeeds    120x    1s    SxpLib.Verify Connection    ${version}    both    127.0.0.1
     ...    64999    127.0.0.2
 
 SSL ConectivityCase 2
@@ -47,25 +47,25 @@ SSL ConectivityCase 2
     [Tags]    SXP    SSL
     SxpLib.Add Connection    ${version}    speaker    127.0.0.3    64999    127.0.0.1    security_mode=TLS
     SxpLib.Add Connection    ${version}    listener    127.0.0.1    64999    127.0.0.3    security_mode=TLS
-    WaitForFailure.Verify_Keyword_Never_Passes_Within_Timeout    15    1    SxpLib.Verify Connection    ${version}    speaker    127.0.0.3
+    WaitForFailure.Verify_Keyword_Never_Passes_Within_Timeout    60    1    SxpLib.Verify Connection    ${version}    speaker    127.0.0.3
     ...    64999    127.0.0.1
-    WaitForFailure.Verify_Keyword_Never_Passes_Within_Timeout    15    1    SxpLib.Verify Connection    ${version}    listener    127.0.0.1
+    WaitForFailure.Verify_Keyword_Never_Passes_Within_Timeout    60    1    SxpLib.Verify Connection    ${version}    listener    127.0.0.1
     ...    64999    127.0.0.3
     SxpLib.Clean Connections    127.0.0.1
     SxpLib.Clean Connections    127.0.0.3
     SxpLib.Add Connection    ${version}    listener    127.0.0.3    64999    127.0.0.1    security_mode=TLS
     SxpLib.Add Connection    ${version}    speaker    127.0.0.1    64999    127.0.0.3    security_mode=TLS
-    WaitForFailure.Verify_Keyword_Never_Passes_Within_Timeout    15    1    SxpLib.Verify Connection    ${version}    listener    127.0.0.3
+    WaitForFailure.Verify_Keyword_Never_Passes_Within_Timeout    60    1    SxpLib.Verify Connection    ${version}    listener    127.0.0.3
     ...    64999    127.0.0.1
-    WaitForFailure.Verify_Keyword_Never_Passes_Within_Timeout    15    1    SxpLib.Verify Connection    ${version}    speaker    127.0.0.1
+    WaitForFailure.Verify_Keyword_Never_Passes_Within_Timeout    60    1    SxpLib.Verify Connection    ${version}    speaker    127.0.0.1
     ...    64999    127.0.0.3
     SxpLib.Clean Connections    127.0.0.1
     SxpLib.Clean Connections    127.0.0.3
     SxpLib.Add Connection    ${version}    both    127.0.0.3    64999    127.0.0.1    security_mode=TLS
     SxpLib.Add Connection    ${version}    both    127.0.0.1    64999    127.0.0.3    security_mode=TLS
-    WaitForFailure.Verify_Keyword_Never_Passes_Within_Timeout    15    1    SxpLib.Verify Connection    ${version}    both    127.0.0.3
+    WaitForFailure.Verify_Keyword_Never_Passes_Within_Timeout    60    1    SxpLib.Verify Connection    ${version}    both    127.0.0.3
     ...    64999    127.0.0.1
-    WaitForFailure.Verify_Keyword_Never_Passes_Within_Timeout    15    1    SxpLib.Verify Connection    ${version}    both    127.0.0.1
+    WaitForFailure.Verify_Keyword_Never_Passes_Within_Timeout    60    1    SxpLib.Verify Connection    ${version}    both    127.0.0.1
     ...    64999    127.0.0.3
 
 SSL ConectivityCase 3
@@ -73,57 +73,57 @@ SSL ConectivityCase 3
     [Tags]    SXP    SSL
     SxpLib.Add Connection    ${version}    speaker    127.0.0.4    64999    127.0.0.1    security_mode=TLS
     SxpLib.Add Connection    ${version}    listener    127.0.0.1    64999    127.0.0.4    security_mode=TLS
-    WaitForFailure.Verify_Keyword_Never_Passes_Within_Timeout    15    1    SxpLib.Verify Connection    ${version}    speaker    127.0.0.4
+    WaitForFailure.Verify_Keyword_Never_Passes_Within_Timeout    60    1    SxpLib.Verify Connection    ${version}    speaker    127.0.0.4
     ...    64999    127.0.0.1
-    WaitForFailure.Verify_Keyword_Never_Passes_Within_Timeout    15    1    SxpLib.Verify Connection    ${version}    listener    127.0.0.1
+    WaitForFailure.Verify_Keyword_Never_Passes_Within_Timeout    60    1    SxpLib.Verify Connection    ${version}    listener    127.0.0.1
     ...    64999    127.0.0.4
     SxpLib.Clean Connections    127.0.0.1
     SxpLib.Clean Connections    127.0.0.4
     SxpLib.Add Connection    ${version}    listener    127.0.0.4    64999    127.0.0.1    security_mode=TLS
     SxpLib.Add Connection    ${version}    speaker    127.0.0.1    64999    127.0.0.4    security_mode=TLS
-    WaitForFailure.Verify_Keyword_Never_Passes_Within_Timeout    15    1    SxpLib.Verify Connection    ${version}    listener    127.0.0.4
+    WaitForFailure.Verify_Keyword_Never_Passes_Within_Timeout    60    1    SxpLib.Verify Connection    ${version}    listener    127.0.0.4
     ...    64999    127.0.0.1
-    WaitForFailure.Verify_Keyword_Never_Passes_Within_Timeout    15    1    SxpLib.Verify Connection    ${version}    speaker    127.0.0.1
+    WaitForFailure.Verify_Keyword_Never_Passes_Within_Timeout    60    1    SxpLib.Verify Connection    ${version}    speaker    127.0.0.1
     ...    64999    127.0.0.4
     SxpLib.Clean Connections    127.0.0.1
     SxpLib.Clean Connections    127.0.0.4
     SxpLib.Add Connection    ${version}    both    127.0.0.4    64999    127.0.0.1    security_mode=TLS
     SxpLib.Add Connection    ${version}    both    127.0.0.1    64999    127.0.0.4    security_mode=TLS
-    WaitForFailure.Verify_Keyword_Never_Passes_Within_Timeout    15    1    SxpLib.Verify Connection    ${version}    both    127.0.0.4
+    WaitForFailure.Verify_Keyword_Never_Passes_Within_Timeout    60    1    SxpLib.Verify Connection    ${version}    both    127.0.0.4
     ...    64999    127.0.0.1
-    WaitForFailure.Verify_Keyword_Never_Passes_Within_Timeout    15    1    SxpLib.Verify Connection    ${version}    both    127.0.0.1
+    WaitForFailure.Verify_Keyword_Never_Passes_Within_Timeout    60    1    SxpLib.Verify Connection    ${version}    both    127.0.0.1
     ...    64999    127.0.0.4
 
 SSL ConectivityCase 4
     [Documentation]    Test of SSL security in topology consisting of SXP-nodes that does not uses any security,
-    ...    uses TCP-MD5 and SSL security. Each node conatains series of bindings that in the end should
+    ...    uses TCP-MD5 and SSL security. Each node contains series of bindings that in the end should
     ...    be all propagated to node-5 in topology.
     [Tags]    SXP    SSL
     SxpLib.Add Connection    ${version}    listener    127.0.0.2    64999    127.0.0.1    security_mode=TLS
     SxpLib.Add Connection    ${version}    speaker    127.0.0.1    64999    127.0.0.2    security_mode=TLS
-    BuiltIn.Wait Until Keyword Succeeds    15    1    SxpLib.Verify Connection    ${version}    listener    127.0.0.2
+    BuiltIn.Wait Until Keyword Succeeds    120x    1s    SxpLib.Verify Connection    ${version}    listener    127.0.0.2
     ...    64999    127.0.0.1
-    BuiltIn.Wait Until Keyword Succeeds    15    1    SxpLib.Verify Connection    ${version}    speaker    127.0.0.1
+    BuiltIn.Wait Until Keyword Succeeds    120x    1s    SxpLib.Verify Connection    ${version}    speaker    127.0.0.1
     ...    64999    127.0.0.2
     SxpLib.Add Connection    ${version}    listener    127.0.0.3    64999    127.0.0.1    paswd
     SxpLib.Add Connection    ${version}    speaker    127.0.0.1    64999    127.0.0.3    paswd
-    BuiltIn.Wait Until Keyword Succeeds    15    1    SxpLib.Verify Connection    ${version}    listener    127.0.0.3
+    BuiltIn.Wait Until Keyword Succeeds    120x    1s    SxpLib.Verify Connection    ${version}    listener    127.0.0.3
     ...    64999    127.0.0.1
-    BuiltIn.Wait Until Keyword Succeeds    15    1    SxpLib.Verify Connection    ${version}    speaker    127.0.0.1
+    BuiltIn.Wait Until Keyword Succeeds    120x    1s    SxpLib.Verify Connection    ${version}    speaker    127.0.0.1
     ...    64999    127.0.0.3
     SxpLib.Add Connection    ${version}    listener    127.0.0.4    64999    127.0.0.1
     SxpLib.Add Connection    ${version}    speaker    127.0.0.1    64999    127.0.0.4
-    BuiltIn.Wait Until Keyword Succeeds    15    1    SxpLib.Verify Connection    ${version}    listener    127.0.0.4
+    BuiltIn.Wait Until Keyword Succeeds    120x    1s    SxpLib.Verify Connection    ${version}    listener    127.0.0.4
     ...    64999    127.0.0.1
-    BuiltIn.Wait Until Keyword Succeeds    15    1    SxpLib.Verify Connection    ${version}    speaker    127.0.0.1
+    BuiltIn.Wait Until Keyword Succeeds    120x    1s    SxpLib.Verify Connection    ${version}    speaker    127.0.0.1
     ...    64999    127.0.0.4
     SxpLib.Add Connection    ${version}    speaker    127.0.0.5    64999    127.0.0.1    security_mode=TLS
     SxpLib.Add Connection    ${version}    listener    127.0.0.1    64999    127.0.0.5    security_mode=TLS
-    BuiltIn.Wait Until Keyword Succeeds    15    1    SxpLib.Verify Connection    ${version}    speaker    127.0.0.5
+    BuiltIn.Wait Until Keyword Succeeds    120x    1s    SxpLib.Verify Connection    ${version}    speaker    127.0.0.5
     ...    64999    127.0.0.1
-    BuiltIn.Wait Until Keyword Succeeds    15    1    SxpLib.Verify Connection    ${version}    listener    127.0.0.1
+    BuiltIn.Wait Until Keyword Succeeds    120x    1s    SxpLib.Verify Connection    ${version}    listener    127.0.0.1
     ...    64999    127.0.0.5
-    BuiltIn.Wait Until Keyword Succeeds    15    1    Verify Topology Bindings    6
+    BuiltIn.Wait Until Keyword Succeeds    120x    1s    Verify Topology Bindings    5
 
 *** Keywords ***
 Setup SXP Environment Local
@@ -132,10 +132,11 @@ Setup SXP Environment Local
     RequestsLibrary.Create Session    session    http://${ODL_SYSTEM_IP}:${RESTCONFPORT}    auth=${AUTH}    timeout=${DEFAULT_TIMEOUT_HTTP}    max_retries=0
     SSHKeywords.Open_Connection_To_ODL_System
     ${ODL_SYSTEM_JAVA_HOME}    SSHLibrary.Execute_Command    java -XshowSettings:properties -version 2>&1 | grep java.home | sed 's/.*= //'
-    : FOR    ${node}    IN RANGE    1    ${node_range}
-    \    SSHKeywords.Execute_Command_Should_Pass    ${ODL_SYSTEM_JAVA_HOME}/bin/keytool -genkeypair -alias odl-sxp-${node} -keyalg RSA -storepass ${password} -keypass ${password} -dname "CN=www.opendaylight.org, OU=csit, O=ODL, L=N/A, S=N/A, C=N/A" -keystore csit-keystore-${node}
-    \    SSHKeywords.Execute_Command_Should_Pass    ${ODL_SYSTEM_JAVA_HOME}/bin/keytool -exportcert -keystore csit-keystore-${node} -alias odl-sxp-${node} -storepass ${password} -file odl-sxp-${node}.cer
-    # Node-1 TRUSTS Node-2, Node-5
+    FOR    ${node}    IN RANGE    1    ${node_range}+1
+        SSHKeywords.Execute_Command_Should_Pass    ${ODL_SYSTEM_JAVA_HOME}/bin/keytool -genkeypair -alias odl-sxp-${node} -keyalg RSA -storepass ${password} -keypass ${password} -dname "CN=www.opendaylight.org, OU=csit, O=ODL, L=N/A, S=N/A, C=N/A" -keystore csit-keystore-${node}
+        SSHKeywords.Execute_Command_Should_Pass    ${ODL_SYSTEM_JAVA_HOME}/bin/keytool -exportcert -keystore csit-keystore-${node} -alias odl-sxp-${node} -storepass ${password} -file odl-sxp-${node}.cer
+        # Node-1 TRUSTS Node-2, Node-5
+    END
     SSHKeywords.Execute_Command_Should_Pass    ${ODL_SYSTEM_JAVA_HOME}/bin/keytool -importcert -keystore csit-truststore-1 -alias odl-sxp-2 -storepass ${password} -keypass ${password} -file odl-sxp-2.cer -noprompt
     SSHKeywords.Execute_Command_Should_Pass    ${ODL_SYSTEM_JAVA_HOME}/bin/keytool -importcert -keystore csit-truststore-1 -alias odl-sxp-5 -storepass ${password} -keypass ${password} -file odl-sxp-5.cer -noprompt
     # Node-2 TRUSTS Node-1
@@ -149,19 +150,23 @@ Setup SXP Environment Local
     SSHKeywords.Execute_Command_Should_Pass    mv ./csit-keystore-* ${ssl_stores}
     SSHKeywords.Execute_Command_Should_Pass    mv ./csit-truststore-* ${ssl_stores}
     SSHLibrary.Close Connection
-    : FOR    ${node}    IN RANGE    1    ${node_range}
-    \    ${SSL}    BuiltIn.Create Dictionary    truststore=${ssl_stores}/csit-truststore-${node}    keystore=${ssl_stores}/csit-keystore-${node}    password=${password}
-    \    ${rnd_retry_time} =    BuiltIn.Evaluate    random.randint(1, 5)    modules=random
-    \    SxpLib.Add Node    127.0.0.${node}    ${EMPTY}    ssl_stores=${SSL}    retry_open_timer=${rnd_retry_time}
-    \    SxpLib.Add Bindings    ${node}00    1.1.1.${node}/32    127.0.0.${node}
-    \    SxpLib.Add Bindings    ${node}00    2.2.2.${node}/32    127.0.0.${node}
+    FOR    ${node}    IN RANGE    1    ${node_range}+1
+        ${SSL}    BuiltIn.Create Dictionary    truststore=${ssl_stores}/csit-truststore-${node}    keystore=${ssl_stores}/csit-keystore-${node}    password=${password}
+        ${rnd_retry_time} =    BuiltIn.Evaluate    random.randint(1, 5)    modules=random
+        SxpLib.Add Node    127.0.0.${node}    ${EMPTY}    ssl_stores=${SSL}    retry_open_timer=${rnd_retry_time}
+        BuiltIn.Wait Until Keyword Succeeds    20x    10s    SxpLib.Check Node started    127.0.0.${node}    system=${ODL_SYSTEM_IP}
+        SxpLib.Add Bindings    ${node}00    1.1.1.${node}/32    127.0.0.${node}
+        SxpLib.Add Bindings    ${node}00    2.2.2.${node}/32    127.0.0.${node}
+    END
 
 Verify Topology Bindings
     [Arguments]    ${node_range}
     [Documentation]    Create session to Controller
     ${resp}    SxpLib.Get Bindings    127.0.0.5
-    : FOR    ${node}    IN RANGE    1    ${node_range}
-    \    SxpLib.Should Contain Binding    ${resp}    ${node}00    2.2.2.${node}/32
+    FOR    ${node}    IN RANGE    1    ${node_range}+1
+        SxpLib.Should Contain Binding    ${resp}    ${node}00    1.1.1.${node}/32
+        SxpLib.Should Contain Binding    ${resp}    ${node}00    2.2.2.${node}/32
+    END
 
 Clean Nodes
     [Documentation]    Cleanup of resources alocated by test suite