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