*** Settings *** Documentation ODL controller clustering test case using the gherkin syntax. ... ... This test has a workflow similar to the keyword-driven ... examples. The difference is that the keywords use higher ... abstraction level and their arguments are embedded into ... the keyword names. ... ... This kind of _gherkin_ syntax has been made popular by ... [http://cukes.info|Cucumber]. It works well especially when ... tests act as examples that need to be easily understood also ... by the business people. Resource resource.txt Library Selenium2Library Library SSHLibrary Library Collections Library RequestsLibrary Library ../../libraries/Common.py Variables ../../variables/Variables.py *** Test Cases *** Two controllers running Given C1 a controller in cluster of two controllers And C2 a controller in cluster of two controllers And all switches are introduced to both controllers When C1 is up and running And C2 is up and running Then the system is working with C1 and C2 *** Keywords *** C1 is up and running Open Browser To Login Page 1 Input Username admin Input Password admin Submit Credentials Welcome Page 1 Should Be Open [Teardown] Close Browser C2 is up and running Open Browser To Login Page 2 Input Username admin Input Password admin Submit Credentials Welcome Page 2 Should Be Open [Teardown] Close Browser Open Browser To Login Page 1 Set Selenium Speed ${DELAY2} Open Browser ${LOGIN URL1} ${BROWSER} Maximize Browser Window Login Page Should Be Open Open Browser To Login Page 2 Set Selenium Speed ${DELAY2} Open Browser ${LOGIN URL2} ${BROWSER} Maximize Browser Window Login Page Should Be Open Login Page Should Be Open Title Should Be OpenDaylight - Login Input Username [Arguments] ${username} Input Text j_username ${username} Input Password [Arguments] ${password} Input Text j_password ${password} Submit Credentials Click Button Log In Welcome Page 1 Should Be Open Location Should Be ${LOGIN URL1} Title Should Be OpenDaylight Welcome Page 2 Should Be Open Location Should Be ${LOGIN URL2} Title Should Be OpenDaylight C1 a controller in cluster of two controllers Open Connection ${Controller1_IP} prompt=> Login ${VM USERNAME} ${VM PASSWORD} Write cd controller-base/opendaylight Write sudo ./run.sh -Dsupernodes=${Controller1_IP}:${Controller2_IP} -start Open Connection ${HOST} Login ${VM USERNAME} ${VM PASSWORD} ${stdout}= Execute Command sudo ovs-vsctl show Should Contain X Times ${stdout} Controller "tcp:${CONTROLLER1}" 3 C2 a controller in cluster of two controllers Open Connection ${Controller2_IP} prompt=> Login ${VM USERNAME} ${VM PASSWORD} Write cd controller-base/opendaylight Write sudo ./run.sh -Dsupernodes=${Controller1_IP}:${Controller2_IP} -start Open Connection ${HOST} Login ${VM USERNAME} ${VM PASSWORD} ${stdout}= Execute Command sudo ovs-vsctl show Should Contain X Times ${stdout} Controller "tcp:${CONTROLLER2}" 3 all switches are introduced to both controllers Open Connection ${HOST} Login ${VM USERNAME} ${VM PASSWORD} # ${stdout1}= Execute Command sudo ovs-vsctl set-controller s1 tcp:${CONTROLLER1} tcp:${CONTROLLER2} # ${stdout2}= Execute Command sudo ovs-vsctl set-controller s2 tcp:${CONTROLLER1} tcp:${CONTROLLER2} # ${stdout2}= Execute Command sudo ovs-vsctl set-controller s3 tcp:${CONTROLLER1} tcp:${CONTROLLER2} ${stdout}= Execute Command sudo ovs-vsctl show Should Contain X Times ${stdout} Controller "tcp:${CONTROLLER1}" 3 Should Contain X Times ${stdout} Controller "tcp:${CONTROLLER2}" 3 Should Contain ${stdout} Bridge "s1" Should Contain ${stdout} Bridge "s2" Should Contain ${stdout} Bridge "s3" Should Contain X Times ${stdout} is_connected: true 6 ${stdout}= Execute Command sudo ovs-vsctl get-controller "s1" Should Contain ${stdout} ${CONTROLLER1} Should Contain ${stdout} ${CONTROLLER2} ${stdout}= Execute Command sudo ovs-vsctl get-controller "s2" Should Contain ${stdout} ${CONTROLLER1} Should Contain ${stdout} ${CONTROLLER2} ${stdout}= Execute Command sudo ovs-vsctl get-controller "s3" Should Contain ${stdout} ${CONTROLLER1} Should Contain ${stdout} ${CONTROLLER2} the system is working with C1 and C2 ${headers} Create Dictionary Content-Type application/json Create Session session http://${Controller1_IP}:8080 headers=${headers} auth=${auth} ${resp} Get session ${REST_CONTEXT}/${CONTAINER} Should Be Equal As Strings ${resp.status_code} 200 Response status code error Log ${resp.content} Should Contain X Times ${resp.content} ${nodeconn1} 2 Should Contain X Times ${resp.content} ${nodeconn2} 2 Should Contain X Times ${resp.content} ${nodeconn3} 2 Should Contain X Times ${resp.content} ${nodeconn4} 2 ${headers} Create Dictionary Content-Type application/json Create Session session http://${Controller2_IP}:8080 headers=${headers} auth=${auth} ${resp} Get session ${REST_CONTEXT}/${CONTAINER} Should Be Equal As Strings ${resp.status_code} 200 Response status code error Log ${resp.content} Should Contain X Times ${resp.content} ${nodeconn1} 2 Should Contain X Times ${resp.content} ${nodeconn2} 2 Should Contain X Times ${resp.content} ${nodeconn3} 2 Should Contain X Times ${resp.content} ${nodeconn4} 2