Support the new path option for yang-model-validator
[integration/test.git] / csit / libraries / LISPFlowMapping__Lithium.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 ${JSON_DIR}       ${CURDIR}/../variables/lispflowmapping/Li
9
10 *** Keywords ***
11 Authentication Key Should Be
12     [Arguments]    ${resp}    ${password}
13     [Documentation]    Check if the authentication key in the ${resp} is ${password}
14     ${authkey}=    Get Authentication Key    ${resp}
15     Should Be Equal As Strings    ${authkey}    ${password}
16
17 Get Authentication Key
18     [Arguments]    ${resp}
19     ${output}=    Get From Dictionary    ${resp.json()}    output
20     ${authkey}=    Get From Dictionary    ${output}    authkey
21     [Return]    ${authkey}
22
23 Ipv4 Rloc Should Be
24     [Arguments]    ${resp}    ${address}
25     [Documentation]    Check if the RLOC in the ${resp} is ${address}
26     ${eid_record}=    Get Eid Record    ${resp}
27     ${loc_record}=    Get From Dictionary    ${eid_record}    LocatorRecord
28     ${loc_record_0}=    Get From List    ${loc_record}    0
29     ${ipv4}=    Get Ipv4 Rloc    ${loc_record_0}
30     Should Be Equal As Strings    ${ipv4}    ${address}
31
32 Get Eid Record
33     [Arguments]    ${resp}
34     ${output}=    Get From Dictionary    ${resp.json()}    output
35     ${eid_record}=    Get From Dictionary    ${output}    eidToLocatorRecord
36     ${eid_record}=    Get From List    ${eid_record}    0
37     [Return]    ${eid_record}
38
39 Get Ipv4 Rloc
40     [Arguments]    ${loc_record}
41     ${loc}=    Get From Dictionary    ${loc_record}    LispAddressContainer
42     ${address}=    Get From Dictionary    ${loc}    Ipv4Address
43     ${ipv4}=    Get From Dictionary    ${address}    Ipv4Address
44     [Return]    ${ipv4}
45
46 Check Mapping Removal
47     [Arguments]    ${json}
48     ${resp}=    Post Log Check    ${LFM_RPC_API_LI}:get-mapping    ${json}
49     ${output}=    Get From Dictionary    ${resp.json()}    output
50     ${eid_record}=    Get From Dictionary    ${output}    eidToLocatorRecord
51     ${eid_record_0}=    Get From List    ${eid_record}    0
52     ${action}=    Get From Dictionary    ${eid_record_0}    action
53     Should Be Equal As Strings    ${action}    NativelyForward