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