add setuputils to topoprocessing csit so karaf log KWs work
[integration/test.git] / csit / suites / topoprocessing / basic-topology-operations / 020_Filtration_nodes.robot
1 *** Settings ***
2 Documentation     Test suite to verify fitration operation on different models.
3 ...               Before test starts, configurational file have to be rewriten to change listners registration datastore type from CONFIGURATION to OPERATIONAL.
4 ...               Need for this change is also a reason why main feature (odl-topoprocessing-framework) is installed after file change and not during boot.
5 ...               Tests themselves install feature required for specific model, clear karaf logs for futher synchronization, send configurational xmls and verify output.
6 ...               Topology-id on the end of each urls must match topology-id from xml. Yang models of components in topology are defined in xmls.
7 Suite Setup       Setup Environment
8 Suite Teardown    Clean Environment
9 Test Setup        SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
10 Test Teardown     Delete Overlay Topology
11 Library           RequestsLibrary
12 Library           SSHLibrary
13 Library           XML
14 Variables         ../../../variables/topoprocessing/TopologyRequests.py
15 Variables         ../../../variables/topoprocessing/TargetFields.py
16 Variables         ../../../variables/Variables.py
17 Resource          ../../../libraries/KarafKeywords.robot
18 Resource          ../../../libraries/Utils.robot
19 Resource          ../../../libraries/TopoprocessingKeywords.robot
20
21 *** Test Cases ***
22 Filtration IPV4 Network Topology Model
23     [Documentation]    Test of ipv4 type of filtration operation on Network Topology model
24     ${request}    Prepare Filtration Topology Request    ${FILTRATION_NT}    network-topology-model    node    network-topo:1
25     ${request}    Insert Filter    ${request}    ${FILTER_IPV4}    ${ISIS_NODE_TE_ROUTER_ID_IPV4}
26     ${request}    Set IPV4 Filter    ${request}    192.168.1.1/24
27     Basic Request Put    ${request}    ${OVERLAY_TOPO_URL}
28     ${resp}    Wait Until Keyword Succeeds    3x    1s    Output Topo Should Be Complete    node_count=2    supporting-node_count=2
29     ...    node-ref_count=2    tp_count=3    tp-ref_count=3
30     Check Filtered Nodes in Topology    ${resp.content}    3    bgp:1    bgp:2
31
32 Filtration IPV4 Inventory Model
33     [Documentation]    Test of ipv4 type of filtration operation on Inventory model
34     ${request}    Prepare Filtration Topology Request    ${FILTRATION_NT}    opendaylight-inventory-model    node    openflow-topo:1
35     ${request}    Insert Filter    ${request}    ${FILTER_IPV4}    ${OPENFLOW_NODE_IP_ADDRESS}
36     ${request}    Set IPV4 Filter    ${request}    192.168.1.1/24
37     Basic Request Put    ${request}    ${OVERLAY_TOPO_URL}
38     ${resp}    Wait Until Keyword Succeeds    3x    1s    Output Topo Should Be Complete    node_count=3    supporting-node_count=3
39     ...    node-ref_count=3    tp_count=8    tp-ref_count=8
40     Check Filtered Nodes in Topology    ${resp.content}    8    of-node:1    of-node:2    of-node:3
41
42 Filtration Range Number Network Topology Model
43     [Documentation]    Test of range number type of filtration operation on Network Topology model
44     ${request}    Prepare Filtration Topology Request    ${FILTRATION_NT}    network-topology-model    node    network-topo:2
45     ${request}    Insert Filter    ${request}    ${FILTER_RANGE_NUMBER}    ${OVSDB_OVS_VERSION}
46     ${request}    Set Range Number Filter    ${request}    20    25
47     Basic Request Put    ${request}    ${OVERLAY_TOPO_URL}
48     ${resp}    Wait Until Keyword Succeeds    3x    1s    Output Topo Should Be Complete    node_count=4    supporting-node_count=4
49     ...    node-ref_count=4    tp_count=5    tp-ref_count=5
50     Check Filtered Nodes in Topology    ${resp.content}    5    bgp:7    bgp:8    bgp:9    bgp:10
51
52 Filtration Range Number Inventory Model
53     [Documentation]    Test of range number type of filtration operation on Inventory model
54     ${request}    Prepare Filtration Topology Request    ${FILTRATION_NT}    opendaylight-inventory-model    node    openflow-topo:2
55     ${request}    Insert Filter    ${request}    ${FILTER_RANGE_NUMBER}    ${OPENFLOW_NODE_SERIAL_NUMBER}
56     ${request}    Set Range Number Filter    ${request}    20    25
57     Basic Request Put    ${request}    ${OVERLAY_TOPO_URL}
58     ${resp}    Wait Until Keyword Succeeds    3x    1s    Output Topo Should Be Complete    node_count=3    supporting-node_count=3
59     ...    node-ref_count=3    tp_count=0    tp-ref_count=0
60     Check Filtered Nodes in Topology    ${resp.content}    0    of-node:8    of-node:9    of-node:10
61
62 Filtration Specific String Network Topology Model
63     [Documentation]    Test of specific string type of filtration operation on Network Topology model
64     ${request}    Prepare Filtration Topology Request    ${FILTRATION_NT}    network-topology-model    node    network-topo:2
65     ${request}    Insert Filter    ${request}    ${FILTER_SPECIFIC_STRING}    ${OVSDB_OVS_VERSION}
66     ${request}    Set Specific String Filter    ${request}    25
67     Basic Request Put    ${request}    ${OVERLAY_TOPO_URL}
68     ${resp}    Wait Until Keyword Succeeds    3x    1s    Output Topo Should Be Complete    node_count=2    supporting-node_count=2
69     ...    node-ref_count=2    tp_count=2    tp-ref_count=2
70     Check Filtered Nodes in Topology    ${resp.content}    2    bgp:9    bgp:10
71
72 Filtration Specific String Inventory Model
73     [Documentation]    Test of specific string type of filtration operation on Inventory model
74     ${request}    Prepare Filtration Topology Request    ${FILTRATION_NT}    opendaylight-inventory-model    node    openflow-topo:2
75     ${request}    Insert Filter    ${request}    ${FILTER_SPECIFIC_STRING}    ${OPENFLOW_NODE_SERIAL_NUMBER}
76     ${request}    Set Specific String Filter    ${request}    21
77     Basic Request Put    ${request}    ${OVERLAY_TOPO_URL}
78     ${resp}    Wait Until Keyword Succeeds    3x    1s    Output Topo Should Be Complete    node_count=2    supporting-node_count=2
79     ...    node-ref_count=2    tp_count=0    tp-ref_count=0
80     Check Filtered Nodes in Topology    ${resp.content}    0    of-node:8    of-node:9
81
82 Filtration Range String Network Topology Model
83     [Documentation]    Test of range string type of filtration operation on Network Topology model
84     ${request}    Prepare Filtration Topology Request    ${FILTRATION_NT}    network-topology-model    node    network-topo:2
85     ${request}    Insert Filter    ${request}    ${FILTER_RANGE_STRING}    ${OVSDB_OVS_VERSION}
86     ${request}    Set Range String Filter    ${request}    20    25
87     Basic Request Put    ${request}    ${OVERLAY_TOPO_URL}
88     ${resp}    Wait Until Keyword Succeeds    3x    1s    Output Topo Should Be Complete    node_count=4    supporting-node_count=4
89     ...    node-ref_count=4    tp_count=5    tp-ref_count=5
90     Check Filtered Nodes in Topology    ${resp.content}    5    bgp:7    bgp:8    bgp:9    bgp:10
91
92 Filtration Range String Inventory Model
93     [Documentation]    Test of range string type of filtration operation on Inventory model
94     ${request}    Prepare Filtration Topology Request    ${FILTRATION_NT}    opendaylight-inventory-model    node    openflow-topo:2
95     ${request}    Insert Filter    ${request}    ${FILTER_RANGE_STRING}    ${OPENFLOW_NODE_SERIAL_NUMBER}
96     ${request}    Set Range String Filter    ${request}    20    25
97     Basic Request Put    ${request}    ${OVERLAY_TOPO_URL}
98     ${resp}    Wait Until Keyword Succeeds    3x    1s    Output Topo Should Be Complete    node_count=3    supporting-node_count=3
99     ...    node-ref_count=3    tp_count=0    tp-ref_count=0
100     Check Filtered Nodes in Topology    ${resp.content}    0    of-node:8    of-node:9    of-node:10
101
102 Filtration IPV6 Network Topology Model
103     [Documentation]    Test of ipv6 type of filtration operation on Network Topology model
104     ${request}    Prepare Filtration Topology Request    ${FILTRATION_NT}    network-topology-model    node    network-topo:3
105     ${request}    Insert Filter    ${request}    ${FILTER_IPV6}    ${ISIS_NODE_TE_ROUTER_ID_IPV6}
106     ${request}    Set IPV6 Filter    ${request}    fe80:0:0:0:0:0:c0a8:101/120
107     Basic Request Put    ${request}    ${OVERLAY_TOPO_URL}
108     ${resp}    Wait Until Keyword Succeeds    3x    1s    Output Topo Should Be Complete    node_count=2    supporting-node_count=2
109     ...    node-ref_count=2    tp_count=1    tp-ref_count=1
110     Check Filtered Nodes in Topology    ${resp.content}    1    bgp:11    bgp:12
111
112 Filtration IPV6 Inventory Model
113     [Documentation]    Test of ipv6 type of filtration operation on Inventory model
114     ${request}    Prepare Filtration Topology Request    ${FILTRATION_NT}    opendaylight-inventory-model    node    openflow-topo:3
115     ${request}    Insert Filter    ${request}    ${FILTER_IPV6}    ${OPENFLOW_NODE_IP_ADDRESS}
116     ${request}    Set IPV6 Filter    ${request}    fe80:0:0:0:0:0:c0a8:201/120
117     Basic Request Put    ${request}    ${OVERLAY_TOPO_URL}
118     ${resp}    Wait Until Keyword Succeeds    3x    1s    Output Topo Should Be Complete    node_count=3    supporting-node_count=3
119     ...    node-ref_count=3    tp_count=0    tp-ref_count=0
120     Check Filtered Nodes in Topology    ${resp.content}    0    of-node:12    of-node:14    of-node:15
121
122 Filtration Script Network Topology Model
123     [Documentation]    Test of script type of filtration operation on Network Topology model
124     ${request}    Prepare Filtration Topology Request    ${FILTRATION_NT}    network-topology-model    node    network-topo:1
125     ${request}    Insert Filter    ${request}    ${FILTER_SCRIPT}    ${ISIS_NODE_TE_ROUTER_ID_IPV4}
126     ${script}    Set Variable    if (node.getValue().indexOf("192.168.1") > -1 ) {filterOut.setResult(true);} else {filterOut.setResult(false);}
127     ${request}    Set Script Filter    ${request}    javascript    ${script}
128     Basic Request Put    ${request}    ${OVERLAY_TOPO_URL}
129     ${resp}    Wait Until Keyword Succeeds    3x    1s    Output Topo Should Be Complete    node_count=3    supporting-node_count=3
130     ...    node-ref_count=3    tp_count=5    tp-ref_count=5
131     Check Filtered Nodes in Topology    ${resp.content}    5    bgp:3    bgp:4    bgp:5
132
133 Filtration Script Inventory Model
134     [Documentation]    Test of script type of filtration operation on Inventory model
135     ${request}    Prepare Filtration Topology Request    ${FILTRATION_NT}    opendaylight-inventory-model    node    openflow-topo:1
136     ${request}    Insert Filter    ${request}    ${FILTER_SCRIPT}    ${OPENFLOW_NODE_IP_ADDRESS}
137     ${script}    Set Variable    if (node.getValue().indexOf("192.168.2") > -1 ) {filterOut.setResult(true);} else {filterOut.setResult(false);}
138     ${request}    Set Script Filter    ${request}    javascript    ${script}
139     Basic Request Put    ${request}    ${OVERLAY_TOPO_URL}
140     ${resp}    Wait Until Keyword Succeeds    3x    1s    Output Topo Should Be Complete    node_count=3    supporting-node_count=3
141     ...    node-ref_count=3    tp_count=8    tp-ref_count=8
142     Check Filtered Nodes in Topology    ${resp.content}    8    of-node:1    of-node:2    of-node:3