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.
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}
17 Get Authentication Key
19 ${output}= Get From Dictionary ${resp.json()} output
20 ${authkey}= Run Keyword If "${ODL_VERSION}" == "Li" Get Authentication Key Lithium ${output}
21 ... ELSE Get Authentication Key Beryllium ${output}
24 Get Authentication Key Beryllium
26 ${mapping_authkey}= Get From Dictionary ${output} mapping-authkey
27 ${authkey}= Get From Dictionary ${mapping_authkey} key-string
30 Get Authentication Key Lithium
32 ${authkey}= Get From Dictionary ${output} authkey
36 [Arguments] ${resp} ${address}
37 [Documentation] Check if the RLOC in the ${resp} is ${address}
38 ${eid_record}= Get Eid Record ${resp}
39 ${loc_record}= Get From Dictionary ${eid_record} LocatorRecord
40 ${loc_record_0}= Get From List ${loc_record} 0
41 ${ipv4}= Get Ipv4 Rloc ${loc_record_0}
42 Should Be Equal As Strings ${ipv4} ${address}
46 ${output}= Get From Dictionary ${resp.json()} output
47 ${eid_record}= Run Keyword If "${ODL_VERSION}" == "Li" Get Eid Record Lithium ${output}
48 ... ELSE Get Eid Record Beryllium ${output}
49 [Return] ${eid_record}
51 Get Eid Record Beryllium
53 ${eid_record}= Get From Dictionary ${output} mapping-record
54 [Return] ${eid_record}
56 Get Eid Record Lithium
58 ${eid_record}= Get From Dictionary ${output} eidToLocatorRecord
59 ${eid_record}= Get From List ${eid_record} 0
60 [Return] ${eid_record}
63 [Arguments] ${loc_record}
64 ${ipv4}= Run Keyword If "${ODL_VERSION}" == "Li" Get Ipv4 Rloc Lithium ${loc_record}
65 ... ELSE Get Ipv4 Rloc Beryllium ${loc_record}
68 Get Ipv4 Rloc Beryllium
69 [Arguments] ${loc_record}
70 ${loc}= Get From Dictionary ${loc_record} rloc
71 ${ipv4}= Get From Dictionary ${loc} ipv4
75 [Arguments] ${loc_record}
76 ${loc}= Get From Dictionary ${loc_record} LispAddressContainer
77 ${address}= Get From Dictionary ${loc} Ipv4Address
78 ${ipv4}= Get From Dictionary ${address} Ipv4Address
83 Run Keyword If "${ODL_VERSION}" == "Li" Check Mapping Removal Lithium ${json}
84 ... ELSE Post Log Check ${LFM_RPC_API}:get-mapping ${json} 404
86 Check Mapping Removal Lithium
88 ${resp}= Post Log Check ${LFM_RPC_API}:get-mapping ${json}
89 ${output}= Get From Dictionary ${resp.json()} output
90 ${eid_record}= Get From Dictionary ${output} eidToLocatorRecord
91 ${eid_record_0}= Get From List ${eid_record} 0
92 ${action}= Get From Dictionary ${eid_record_0} action
93 Should Be Equal As Strings ${action} NativelyForward
96 [Arguments] ${uri} ${body} ${status_code}=200
97 [Documentation] Post body to uri, log response content, and check status
98 ${resp}= RequestsLibrary.Post session ${uri} ${body}
100 Should Be Equal As Strings ${resp.status_code} ${status_code}
103 Create Session And Set External Variables
104 Create Session session http://${CONTROLLER}:${RESTCONFPORT} auth=${AUTH} headers=${HEADERS}
105 Run Keyword If "${ODL_VERSION}" == "Li" Set Suite Variable ${LFM_RPC_API} ${LFM_RPC_API_LI}