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 Library JsonGenerator.py
9 ${JSON_DIR} ${CURDIR}/../variables/lispflowmapping/Be
12 Authentication Key Should Be
13 [Arguments] ${resp} ${password}
14 [Documentation] Check if the authentication key in the ${resp} is ${password}
15 ${authkey}= Get Authentication Key ${resp}
16 Should Be Equal As Strings ${authkey} ${password}
18 Get Authentication Key
20 ${output}= Get From Dictionary ${resp.json()} output
21 ${mapping_authkey}= Get From Dictionary ${output} mapping-authkey
22 ${authkey}= Get From Dictionary ${mapping_authkey} key-string
26 [Arguments] ${resp} ${address}
27 [Documentation] Check if the RLOC in the ${resp} is ${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}
36 ${output}= Get From Dictionary ${resp.json()} output
37 ${eid_record}= Get From Dictionary ${output} mapping-record
38 [Return] ${eid_record}
41 [Arguments] ${loc_record}
42 ${loc}= Get From Dictionary ${loc_record} rloc
43 ${ipv4}= Get From Dictionary ${loc} ipv4
47 [Arguments] ${loc_record} ${hop_index}
48 [Documentation] Returns the Rloc object pointed to by ${hop_index}
49 ${rloc}= Get From Dictionary ${loc_record} rloc
50 ${exp_loc_path}= Get From Dictionary ${rloc} explicit-locator-path
51 ${actual_hop_index}= Evaluate ${hop_index} - 1
52 ${hop}= Get From List ${exp_loc_path} ${actual_hop_index}
57 Post Log Check ${LFM_RPC_API}:get-mapping ${json} 404
60 [Arguments] ${eid} ${rloc}
61 [Documentation] Returns mapping record JSON dict
62 ${loc_record}= Get LocatorRecord Object ${rloc}
63 ${lisp_address}= Get LispAddress Object ${eid}
64 ${loc_record_list}= Create List ${loc_record}
65 ${mapping_record_json}= Get MappingRecord JSON ${lisp_address} ${loc_record_list}
66 ${mapping}= Wrap input ${mapping_record_json}