Convert Sleep to WUKS in lispflowmapping CSIT
[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 Library           ../../../libraries/JsonGenerator.py
13 Variables         ../../../variables/Variables.py
14 Resource          ../../../libraries/LISPFlowMapping.robot
15 Resource          ../../../libraries/Utils.robot
16
17 *** Test Cases ***
18 IPv4 Prefix
19     [Documentation]    Perform mapping operations with an IPv4 EID
20     ipv4:192.0.2.1/32    ipv4:10.10.10.10    ipv4:192.0.2.1/32
21
22 IPv6 Prefix
23     [Documentation]    Perform mapping operations with an IPv6 EID
24     ipv6:2001:db8::1/128    ipv4:10.10.10.10    ipv6:2001:db8::1/128
25
26 MAC Address
27     [Documentation]    Perform mapping operations with a MAC address EID
28     mac:00:11:22:33:44:55    ipv4:10.10.10.10    mac:00:11:22:33:44:55
29
30 Distinguished Name
31     [Documentation]    Perform mapping operations with a Distinguished Name EID
32     dn:stringAsIs    ipv4:10.10.10.10    dn:stringAsIs
33
34 AS Number
35     [Documentation]    Perform mapping operations with an Autonomous System Number EID
36     as:64500    ipv4:10.10.10.10    as:64500
37
38 Source/Destination
39     [Documentation]    Perform mapping operations with a Source/Destination EID
40     srcdst:192.0.2.1/32|192.0.2.2/32    ipv4:10.10.10.10    srcdst:192.0.2.1/32|192.0.2.2/32
41
42 Key/Value
43     [Documentation]    Perform mapping operations with a Key/Value EID
44     kv:192.0.2.1->192.0.2.2    ipv4:10.10.10.10    kv:192.0.2.1->192.0.2.2
45
46 Service Path
47     [Documentation]    Perform mapping operations with a Service Path EID
48     sp:42(3)    ipv4:10.10.10.10    sp:42(3)
49
50 AFI List
51     [Documentation]    Perform mapping operations with an IPv4 EID mapped to an AFI List RLOC
52     ipv4:192.0.2.1/32    list:{10.10.10.10,2001:db8::1}    ipv4:192.0.2.1/32
53
54 Application Data
55     [Documentation]    Perform mapping operations with an IPv4 EID mapped to an Application Data RLOC
56     ipv4:192.0.2.1/32    appdata:10.10.10.10!128!17!80-81!6667-7000    ipv4:192.0.2.1/32
57
58 Explicit Locator Path
59     [Documentation]    Perform mapping operations with an IPv4 EID mapped to an ELP RLOC
60     ipv4:192.0.2.1/32    elp:{20.20.20.20|lps->30.30.30.30|ls}    ipv4:192.0.2.1/32
61
62 *** Keywords ***
63 Check Datatype
64     [Arguments]    ${add_mapping_eid}    ${add_mapping_rloc}    ${get_mapping_eid}
65     [Documentation]    Perform CRD operations using a specific datatype
66     ${add_mapping}=    Get Mapping JSON    ${add_mapping_eid}    ${add_mapping_rloc}
67     ${get_mapping}=    Get LispAddress JSON And Wrap input    ${get_mapping_eid}
68     Set Suite Variable    ${RPC_Datatype__current_json}    ${get_mapping}
69     Post Log Check    ${LFM_RPC_API}:add-mapping    ${add_mapping}
70     Wait Until Keyword Succeeds    5s    200ms    Post Log Check LocatorRecord    ${get_mapping}
71
72 Remove Datatype And Check Removal
73     Variable Should Exist    ${RPC_Datatype__current_json}
74     Post Log Check    ${LFM_RPC_API}:remove-mapping    ${RPC_Datatype__current_json}
75     Wait Until Keyword Succeeds    5s    200ms    Check Mapping Removal    ${RPC_Datatype__current_json}
76     Set Suite Variable    ${RPC_Datatype__current_json}    ${EMPTY}
77
78 Post Log Check LocatorRecord
79     [Arguments]    ${get_mapping}
80     [Documentation]    Extend the 'Post Log Check' keyword to check for the existence of a LocatorRecord
81     ${resp}=    Post Log Check    ${LFM_RPC_API}:get-mapping    ${get_mapping}
82     ${eid_record}=    Get Eid Record    ${resp}
83     Dictionary Should Contain Key    ${eid_record}    LocatorRecord