Fix failing LISP tests due to implementation changes
[integration/test.git] / csit / libraries / LISPFlowMapping.robot
1 *** Settings ***
2 Documentation    This resource file defines keywords that are used in more
3 ...              than one lispflowmapping test suite.  Those suites include
4 ...              ../variables/Variables.py, which is where some of the
5 ...              variables are coming from.
6
7 *** Variables ***
8 ${ODL_VERSION}    Be
9
10 *** Keywords ***
11 Check Mapping Removal
12     [Arguments]    ${json}
13     Run Keyword If    "${ODL_VERSION}" == "Li"    Check Mapping Removal Lithium    ${json}    ELSE
14     ...    Post Log Check    ${LFM_RPC_API}:get-mapping    ${json}    404
15
16 Check Mapping Removal Lithium
17     [Arguments]    ${json}
18     ${resp}=    Post Log Check    ${LFM_RPC_API}:get-mapping    ${json}
19     ${output}=    Get From Dictionary    ${resp.json()}    output
20     ${eid_record}=    Get From Dictionary    ${output}    eidToLocatorRecord
21     ${eid_record_0}=    Get From List    ${eid_record}    0
22     ${action}=    Get From Dictionary    ${eid_record_0}    action
23     Should Be Equal As Strings    ${action}    NativelyForward
24
25 Post Log Check
26     [Arguments]    ${uri}    ${body}    ${status_code}=200
27     [Documentation]    Post body to uri, log response content, and check status
28     ${resp}=    RequestsLibrary.Post    session    ${uri}    ${body}
29     Log    ${resp.content}
30     Should Be Equal As Strings    ${resp.status_code}    ${status_code}
31     [Return]    ${resp}
32
33 Create Session And Set External Variables
34     Create Session    session    http://${CONTROLLER}:${RESTCONFPORT}    auth=${AUTH}    headers=${HEADERS}
35     Run Keyword If    "${ODL_VERSION}" == "Li"    Set Suite Variable    ${LFM_RPC_API}    ${LFM_RPC_API_LI}