*** Settings *** Documentation Test suite for Static Route Suite Setup Create Session session http://${CONTROLLER}:${RESTPORT} auth=${AUTH} headers=${HEADERS} Suite Teardown Delete All Sessions Library SSHLibrary Library Collections Library ../../../libraries/RequestsLibrary.py Library ../../../libraries/Common.py Variables ../../../variables/Variables.py *** Variables *** ${name} test_route1 ${key} staticRoute ${REST_CONTEXT} /controller/nb/v2/staticroute ${REST_CONTEXT_HT} /controller/nb/v2/hosttracker *** Test Cases *** Add a static route [Documentation] Add a static route, list to validate the result. [Tags] apps ${body} Create Dictionary name ${name} prefix 192.168.1.0/24 nextHop ... 10.0.0.2 ${resp} Put session ${REST_CONTEXT}/${CONTAINER}/route/${name} data=${body} Should Be Equal As Strings ${resp.status_code} 201 ${resp} Get session ${REST_CONTEXT}/${CONTAINER}/routes Should Be Equal As Strings ${resp.status_code} 200 Response status code error ${result} To JSON ${resp.content} ${content} Get From Dictionary ${result} ${key} List Should Contain Value ${content} ${body} Sleep 30 # This works locally but NOT in OpenDaylight #Check flow in flow stats # [Documentation] Show flow stats and validate result # [Tags] apps # ${resp} Get session ${REST_CONTEXT_ST}/${CONTAINER}/flow # Should Be Equal As Strings ${resp.status_code} 200 # Log ${resp.content} # Should Contain X Times ${resp.content} 10.0.0.2 3 Remove a static route [Documentation] Remove a static route, list to validate the result. [Tags] apps ${body} Create Dictionary name ${name} prefix 192.168.1.0/24 nextHop ... 10.0.0.2 ${resp} Delete session ${REST_CONTEXT}/${CONTAINER}/route/${name} Should Be Equal As Strings ${resp.status_code} 204 ${resp} Get session ${REST_CONTEXT}/${CONTAINER}/routes Should Be Equal As Strings ${resp.status_code} 200 ${result} To JSON ${resp.content} ${content} Get From Dictionary ${result} ${key} List Should Not Contain Value ${content} ${body}