cd09d5d5786f814e504af1d3d75be6b41644e516
[integration/test.git] / csit / suites / lispflowmapping / msmr / 030_RPC_Datatypes.robot
1 *** Settings ***
2 Documentation     Test suite to verify data types using RPCs
3 Suite Setup       Create Session    session    http://${ODL_SYSTEM_IP}:${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.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 Service Path
50     [Documentation]    Perform mapping operations with a Service Path EID
51     rpc_add-mapping_sp_ipv4.json    rpc_get-remove_sp.json
52
53 AFI List
54     [Documentation]    Perform mapping operations with an IPv4 EID mapped to an AFI List RLOC
55     rpc_add-mapping_ipv4_list.json    rpc_get-remove_ipv4.json
56
57 Application Data
58     [Documentation]    Perform mapping operations with an IPv4 EID mapped to an Application Data RLOC
59     rpc_add-mapping_ipv4_appdata.json    rpc_get-remove_ipv4.json
60
61 Explicit Locator Path
62     [Documentation]    Perform mapping operations with an IPv4 EID mapped to an ELP RLOC
63     rpc_add-mapping_ipv4_elp.json    rpc_get-remove_ipv4.json
64
65 *** Keywords ***
66 Check Datatype
67     [Arguments]    ${add_mapping_json_file}    ${get_mapping_json_file}
68     [Documentation]    Perform CRD operations using a specific datatype
69     ${add_mapping}=    OperatingSystem.Get File    ${JSON_DIR}/${add_mapping_json_file}
70     ${get_mapping}=    OperatingSystem.Get File    ${JSON_DIR}/${get_mapping_json_file}
71     Set Suite Variable    ${RPC_Datatype__current_json}    ${get_mapping}
72     Post Log Check    ${LFM_RPC_API}:add-mapping    ${add_mapping}
73     Sleep    200ms    Avoid race conditions
74     ${resp}=    Post Log Check    ${LFM_RPC_API}:get-mapping    ${get_mapping}
75     ${eid_record}=    Get Eid Record    ${resp}
76     Dictionary Should Contain Key    ${eid_record}    LocatorRecord
77
78 Remove Datatype And Check Removal
79     Variable Should Exist    ${RPC_Datatype__current_json}
80     Post Log Check    ${LFM_RPC_API}:remove-mapping    ${RPC_Datatype__current_json}
81     Sleep    200ms    Avoid race conditions
82     Check Mapping Removal    ${RPC_Datatype__current_json}
83     Set Suite Variable    ${RPC_Datatype__current_json}    ${EMPTY}