Migrate Get Requests invocations(libraries)
[integration/test.git] / csit / suites / lispflowmapping / all / 030_RPC_Datatypes.robot
1 *** Settings ***
2 Documentation       Test suite to verify data types using RPCs
3
4 Library             Collections
5 Library             OperatingSystem
6 Library             RequestsLibrary
7 Library             ../../../libraries/Common.py
8 Variables           ../../../variables/Variables.py
9 Resource            ../../../libraries/LISPFlowMapping__Lithium.robot
10 Resource            ../../../libraries/Utils.robot
11
12 Suite Setup         Create Session    session    http://${ODL_SYSTEM_IP}:${RESTCONFPORT}    auth=${AUTH}    headers=${HEADERS}
13 Suite Teardown      Delete All Sessions
14 Test Setup          Set Suite Variable    ${RPC_Datatype__current_json}    ${EMPTY}
15 Test Teardown       Remove Datatype And Check Removal
16 Test Template       Check Datatype
17
18
19 *** Test Cases ***
20 IPv4 Prefix
21     [Documentation]    Perform mapping operations with an IPv4 EID
22     rpc_add-mapping_ipv4_ipv4.json    rpc_get-remove_ipv4.json
23 IPv6 Prefix
24     [Documentation]    Perform mapping operations with an IPv6 EID
25     rpc_add-mapping_ipv6_ipv4.json    rpc_get-remove_ipv6.json
26 MAC Address
27     [Documentation]    Perform mapping operations with a MAC address EID
28     rpc_add-mapping_mac_ipv4.json    rpc_get-remove_mac.json
29 Distinguished Name
30     [Documentation]    Perform mapping operations with a Distinguished Name EID
31     rpc_add-mapping_dn_ipv4.json    rpc_get-remove_dn.json
32 AS Number
33     [Documentation]    Perform mapping operations with an Autonomous System Number EID
34     rpc_add-mapping_as_ipv4.json    rpc_get-remove_as.json
35 Instance ID
36     [Documentation]    Perform mapping operations with an IPv4 EID in Instance ID 1
37     rpc_add-mapping_iid_ipv4.json    rpc_get-remove_iid.json
38 Source/Destination
39     [Documentation]    Perform mapping operations with a Source/Destination EID
40     rpc_add-mapping_srcdst_ipv4.json    rpc_get-remove_srcdst.json
41 Key/Value
42     [Documentation]    Perform mapping operations with a Key/Value EID
43     rpc_add-mapping_kv_ipv4.json    rpc_get-remove_kv.json
44 AFI List
45     [Documentation]    Perform mapping operations with an IPv4 EID mapped to an AFI List RLOC
46     rpc_add-mapping_ipv4_list.json    rpc_get-remove_ipv4.json
47 Application Data
48     [Documentation]    Perform mapping operations with an IPv4 EID mapped to an Application Data RLOC
49     rpc_add-mapping_ipv4_appdata.json    rpc_get-remove_ipv4.json
50 Explicit Locator Path
51     [Documentation]    Perform mapping operations with an IPv4 EID mapped to an ELP RLOC
52     rpc_add-mapping_ipv4_elp.json    rpc_get-remove_ipv4.json
53
54
55 *** Keywords ***
56 Check Datatype
57     [Documentation]    Perform CRD operations using a specific datatype
58     [Arguments]    ${add_mapping_json_file}    ${get_mapping_json_file}
59     ${add_mapping}=    OperatingSystem.Get File    ${JSON_DIR}/${add_mapping_json_file}
60     ${get_mapping}=    OperatingSystem.Get File    ${JSON_DIR}/${get_mapping_json_file}
61     Set Suite Variable    ${RPC_Datatype__current_json}    ${get_mapping}
62     Post Log Check    ${LFM_RPC_API_LI}:add-mapping    ${add_mapping}
63     Sleep    200ms    Avoid race conditions
64     ${resp}=    Post Log Check    ${LFM_RPC_API_LI}:get-mapping    ${get_mapping}
65     ${eid_record}=    Get Eid Record    ${resp}
66     Dictionary Should Contain Key    ${eid_record}    LocatorRecord
67
68 Remove Datatype And Check Removal
69     Variable Should Exist    ${RPC_Datatype__current_json}
70     Post Log Check    ${LFM_RPC_API_LI}:remove-mapping    ${RPC_Datatype__current_json}
71     Sleep    200ms    Avoid race conditions
72     Check Mapping Removal    ${RPC_Datatype__current_json}
73     Set Suite Variable    ${RPC_Datatype__current_json}    ${EMPTY}