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.
7 Library JsonGenerator.py
11 ${JSON_DIR} ${CURDIR}/../variables/lispflowmapping/Be
15 Authentication Key Should Be
16 [Documentation] Check if the authentication key in the ${resp} is ${password}
17 [Arguments] ${resp} ${password}
18 ${authkey}= Get Authentication Key ${resp}
19 Should Be Equal As Strings ${authkey} ${password}
21 Get Authentication Key
23 ${output}= Get From Dictionary ${resp.json()} output
24 ${mapping_authkey}= Get From Dictionary ${output} mapping-authkey
25 ${authkey}= Get From Dictionary ${mapping_authkey} key-string
29 [Documentation] Check if the RLOC in the ${resp} is ${address}
30 [Arguments] ${resp} ${address}
31 ${eid_record}= Get Eid Record ${resp}
32 ${loc_record}= Get From Dictionary ${eid_record} LocatorRecord
33 ${loc_record_0}= Get From List ${loc_record} 0
34 ${ipv4}= Get Ipv4 Rloc ${loc_record_0}
35 Should Be Equal As Strings ${ipv4} ${address}
39 ${output}= Get From Dictionary ${resp.json()} output
40 ${eid_record}= Get From Dictionary ${output} mapping-record
44 [Arguments] ${loc_record}
45 ${loc}= Get From Dictionary ${loc_record} rloc
46 ${ipv4}= Get From Dictionary ${loc} ipv4
50 [Documentation] Returns the Rloc object pointed to by ${hop_index}
51 [Arguments] ${loc_record} ${hop_index}
52 ${rloc}= Get From Dictionary ${loc_record} rloc
53 ${exp_loc_path}= Get From Dictionary ${rloc} explicit-locator-path
54 ${actual_hop_index}= Evaluate ${hop_index} - 1
55 ${hop}= Get From List ${exp_loc_path} ${actual_hop_index}
60 Post Log Check ${LFM_RPC_API}:get-key ${json} status_codes=${DELETED_STATUS_CODES}
64 Post Log Check ${LFM_RPC_API}:get-mapping ${json} status_codes=${DELETED_STATUS_CODES}
67 [Documentation] Returns mapping record JSON dict
68 [Arguments] ${eid} ${rloc}
69 ${loc_record}= Get LocatorRecord Object ${rloc}
70 ${lisp_address}= Get LispAddress Object ${eid}
71 ${loc_record_list}= Create List ${loc_record}
72 ${mapping_record_json}= Get MappingRecord JSON ${lisp_address} ${loc_record_list}
73 ${mapping}= Wrap input ${mapping_record_json}
76 Post Log Check Authkey
77 [Documentation] Extend the 'Post Log Check' keyword to check for the correct authentication key
78 [Arguments] ${json} ${password}
79 ${resp}= Post Log Check ${LFM_RPC_API}:get-key ${json}
80 Authentication Key Should Be ${resp} ${password}
82 Post Log Check Ipv4 Rloc
83 [Documentation] Extend the 'Post Log Check' keyword to check for the correct IPv4 RLOC
84 [Arguments] ${json} ${rloc}
85 ${resp}= Post Log Check ${LFM_RPC_API}:get-mapping ${json}
86 Ipv4 Rloc Should Be ${resp} ${rloc}
88 Post Log Check LocatorRecord
89 [Documentation] Extend the 'Post Log Check' keyword to check for the existence of a LocatorRecord
91 ${resp}= Post Log Check ${LFM_RPC_API}:get-mapping ${json}
92 ${eid_record}= Get Eid Record ${resp}
93 Dictionary Should Contain Key ${eid_record} LocatorRecord