X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=csit%2Flibraries%2FLISPFlowMapping.robot;h=e1efb78d476d8c5ce5178be772180bbb1a61cfe1;hb=7e9d5a330e03b99351c87c82ef96a03408c2584b;hp=6464dc12286e9974a9e46f4d2fbc6ac21c39283c;hpb=dd942881d4014c5e5b68cad168f11d610fc9ae39;p=integration%2Ftest.git diff --git a/csit/libraries/LISPFlowMapping.robot b/csit/libraries/LISPFlowMapping.robot index 6464dc1228..e1efb78d47 100644 --- a/csit/libraries/LISPFlowMapping.robot +++ b/csit/libraries/LISPFlowMapping.robot @@ -3,6 +3,7 @@ Documentation This resource file defines keywords that are used in more ... than one lispflowmapping test suite. Those suites include ... ../variables/Variables.py, which is where some of the ... variables are coming from. +Library JsonGenerator.py *** Variables *** ${JSON_DIR} ${CURDIR}/../variables/lispflowmapping/Be @@ -42,6 +43,48 @@ Get Ipv4 Rloc ${ipv4}= Get From Dictionary ${loc} ipv4 [Return] ${ipv4} +Get Elp Hop + [Arguments] ${loc_record} ${hop_index} + [Documentation] Returns the Rloc object pointed to by ${hop_index} + ${rloc}= Get From Dictionary ${loc_record} rloc + ${exp_loc_path}= Get From Dictionary ${rloc} explicit-locator-path + ${actual_hop_index}= Evaluate ${hop_index} - 1 + ${hop}= Get From List ${exp_loc_path} ${actual_hop_index} + [Return] ${hop} + +Check Key Removal + [Arguments] ${json} + Post Log Check ${LFM_RPC_API}:get-key ${json} 404 + Check Mapping Removal [Arguments] ${json} Post Log Check ${LFM_RPC_API}:get-mapping ${json} 404 + +Get Mapping JSON + [Arguments] ${eid} ${rloc} + [Documentation] Returns mapping record JSON dict + ${loc_record}= Get LocatorRecord Object ${rloc} + ${lisp_address}= Get LispAddress Object ${eid} + ${loc_record_list}= Create List ${loc_record} + ${mapping_record_json}= Get MappingRecord JSON ${lisp_address} ${loc_record_list} + ${mapping}= Wrap input ${mapping_record_json} + [Return] ${mapping} + +Post Log Check Authkey + [Arguments] ${json} ${password} + [Documentation] Extend the 'Post Log Check' keyword to check for the correct authentication key + ${resp}= Post Log Check ${LFM_RPC_API}:get-key ${json} + Authentication Key Should Be ${resp} ${password} + +Post Log Check Ipv4 Rloc + [Arguments] ${json} ${rloc} + [Documentation] Extend the 'Post Log Check' keyword to check for the correct IPv4 RLOC + ${resp}= Post Log Check ${LFM_RPC_API}:get-mapping ${json} + Ipv4 Rloc Should Be ${resp} ${rloc} + +Post Log Check LocatorRecord + [Arguments] ${json} + [Documentation] Extend the 'Post Log Check' keyword to check for the existence of a LocatorRecord + ${resp}= Post Log Check ${LFM_RPC_API}:get-mapping ${json} + ${eid_record}= Get Eid Record ${resp} + Dictionary Should Contain Key ${eid_record} LocatorRecord