cb88d327da4b9b05a00c5a12261bff65a5eaf2a2
[integration/test.git] / csit / suites / topoprocessing / basic-topology-operations / 040_Filtration_links.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 Teardown     Filtration Links Test Teardown
10 Library           RequestsLibrary
11 Library           SSHLibrary
12 Library           XML
13 Variables         ../../../variables/topoprocessing/TopologyRequests.py
14 Variables         ../../../variables/Variables.py
15 Resource          ../../../libraries/KarafKeywords.robot
16 Resource          ../../../libraries/Utils.robot
17 Resource          ../../../libraries/TopoprocessingKeywords.robot
18
19 *** Test Cases ***
20 Filtration Range Number Network Topology Model
21     [Documentation]    Test of range number type of filtration operation on Network Topology model
22     ${request}    Prepare Filtration Topology Request    ${FILTRATION_NT}    network-topology-model    link    network-topo:1
23     ${request}    Insert Filter    ${request}    ${FILTER_RANGE_NUMBER}    l3-unicast-igp-topology:igp-link-attributes/l3-unicast-igp-topology:metric
24     ${request}    Set Range Number Filter    ${request}    11    13
25     ${resp}    Send Basic Request    ${request}    network-topology:network-topology/topology/topo:1
26     Should Contain    ${resp.content}    <topology-id>topo:1</topology-id>
27     Should Contain X Times    ${resp.content}    <link-id>link:    3
28     Should Contain X Times    ${resp.content}    <link-ref>link:1:4</link-ref>    1
29     Should Contain X Times    ${resp.content}    <link-ref>link:1:3</link-ref>    1
30     Should Contain X Times    ${resp.content}    <link-ref>link:1:2-1</link-ref>    1
31
32 Filtration Range Number Inventory Model
33     [Documentation]    Test of range number type of filtration operation on Inventory model
34     ${request}    Prepare Filtration Topology Request    ${FILTRATION_NT}    opendaylight-inventory-model    link    openflow-topo:3
35     ${request}    Insert Filter    ${request}    ${FILTER_RANGE_NUMBER}    l3-unicast-igp-topology:igp-link-attributes/l3-unicast-igp-topology:metric
36     ${request}    Set Range Number Filter    ${request}    14    15
37     ${resp}    Send Basic Request    ${request}    network-topology:network-topology/topology/topo:1
38     Should Contain    ${resp.content}    <topology-id>topo:1</topology-id>
39     Should Contain X Times    ${resp.content}    <link-id>link:    2
40     Should Contain X Times    ${resp.content}    <link-ref>link:14:12</link-ref>    1
41     Should Contain X Times    ${resp.content}    <link-ref>link:15:13</link-ref>    1
42     [Teardown]    Run Keywords    Filtration Links Test Teardown
43     ...    AND    Report_Failure_Due_To_Bug    4761
44
45 Filtration Specific Number Network Topology Model
46     [Documentation]    Test of specific number type of filtration operation on Network Topology model
47     Pass Execution    Test is being passed due to incorrect target field. Test will be included in execution when corrected.
48     ${request}    Prepare Filtration Topology Request    ${FILTRATION_NT}    network-topology-model    link    network-topo:1
49     ${request}    Insert Filter    ${request}    ${FILTER_SPECIFIC_NUMBER}    l3-unicast-igp-topology:igp-link-attributes/l3-unicast-igp-topology:metric
50     ${request}    Set Specific Number Filter    ${request}    12
51     ${resp}    Send Basic Request    ${request}    network-topology:network-topology/topology/topo:1
52     Should Contain    ${resp.content}    <topology-id>topo:1</topology-id>
53     Should Contain X Times    ${resp.content}    <link-id>link:    2
54     Should Contain X Times    ${resp.content}    <link-ref>link:1:4</link-ref>    1
55     Should Contain X Times    ${resp.content}    <link-ref>link:1:2-1</link-ref>    1
56     [Teardown]    Run Keywords    Filtration Links Test Teardown
57     ...    AND    Report_Failure_Due_To_Bug    4721
58
59 Filtration Specific Number Inventory Model
60     [Documentation]    Test of specific number type of filtration operation on Inventory model
61     Pass Execution    Test is being passed due to incorrect target field. Test will be included in execution when corrected.
62     ${request}    Prepare Filtration Topology Request    ${FILTRATION_NT}    opendaylight-inventory-model    link    openflow-topo:3
63     ${request}    Insert Filter    ${request}    ${FILTER_SPECIFIC_NUMBER}    l3-unicast-igp-topology:igp-link-attributes/l3-unicast-igp-topology:metric
64     ${request}    Set Specific Number Filter    ${request}    16
65     ${resp}    Send Basic Request    ${request}    network-topology:network-topology/topology/topo:1
66     Should Contain    ${resp.content}    <topology-id>topo:1</topology-id>
67     Should Contain X Times    ${resp.content}    <link-id>link:    1
68     Should Contain X Times    ${resp.content}    <link-ref>link:11:12</link-ref>    1
69     [Teardown]    Run Keywords    Filtration Links Test Teardown
70     ...    AND    Report_Failure_Due_To_Bug    4761
71     ...    AND    Report_Failure_Due_To_Bug    4721
72
73 Filtration Specific String Network Topology Model
74     [Documentation]    Test of specific string type of filtration operation on Network Topology model
75     ${request}    Prepare Filtration Topology Request    ${FILTRATION_NT}    network-topology-model    link    network-topo:1
76     ${request}    Insert Filter    ${request}    ${FILTER_SPECIFIC_STRING}    l3-unicast-igp-topology:igp-link-attributes/l3-unicast-igp-topology:name
77     ${request}    Set Specific String Filter    ${request}    linkA
78     ${resp}    Send Basic Request    ${request}    network-topology:network-topology/topology/topo:1
79     Should Contain    ${resp.content}    <topology-id>topo:1</topology-id>
80     Should Contain X Times    ${resp.content}    <link-id>link:    2
81     Should Contain X Times    ${resp.content}    <link-ref>link:1:4</link-ref>    1
82     Should Contain X Times    ${resp.content}    <link-ref>link:1:2-1</link-ref>    1
83
84 Filtration Specific String Inventory Model
85     [Documentation]    Test of specific string type of filtration operation on Inventory model
86     ${request}    Prepare Filtration Topology Request    ${FILTRATION_NT}    opendaylight-inventory-model    link    openflow-topo:3
87     ${request}    Insert Filter    ${request}    ${FILTER_SPECIFIC_STRING}    l3-unicast-igp-topology:igp-link-attributes/l3-unicast-igp-topology:name
88     ${request}    Set Specific String Filter    ${request}    linkD
89     ${resp}    Send Basic Request    ${request}    network-topology:network-topology/topology/topo:1
90     Should Contain    ${resp.content}    <topology-id>topo:1</topology-id>
91     Should Contain X Times    ${resp.content}    <link-id>link:    1
92     Should Contain X Times    ${resp.content}    <link-ref>link:15:13</link-ref>    1
93     [Teardown]    Run Keywords    Filtration Links Test Teardown
94     ...    AND    Report_Failure_Due_To_Bug    4761
95
96 Filtration Range String Network Topology Model
97     [Documentation]    Test of range string type of filtration operation on Network Topology model
98     ${request}    Prepare Filtration Topology Request    ${FILTRATION_NT}    network-topology-model    link    network-topo:1
99     ${request}    Insert Filter    ${request}    ${FILTER_RANGE_STRING}    l3-unicast-igp-topology:igp-link-attributes/l3-unicast-igp-topology:name
100     ${request}    Set Range String Filter    ${request}    linkA    linkB
101     ${resp}    Send Basic Request    ${request}    network-topology:network-topology/topology/topo:1
102     Should Contain    ${resp.content}    <topology-id>topo:1</topology-id>
103     Should Contain X Times    ${resp.content}    <link-id>link:    3
104     Should Contain X Times    ${resp.content}    <link-ref>link:1:4</link-ref>    1
105     Should Contain X Times    ${resp.content}    <link-ref>link:1:3</link-ref>    1
106     Should Contain X Times    ${resp.content}    <link-ref>link:1:2-1</link-ref>    1
107
108 Filtration Range String Inventory Model
109     [Documentation]    Test of range string type of filtration operation on Inventory model
110     ${request}    Prepare Filtration Topology Request    ${FILTRATION_NT}    opendaylight-inventory-model    link    openflow-topo:3
111     ${request}    Insert Filter    ${request}    ${FILTER_RANGE_STRING}    l3-unicast-igp-topology:igp-link-attributes/l3-unicast-igp-topology:name
112     ${request}    Set Range String Filter    ${request}    linkC    linkD
113     ${resp}    Send Basic Request    ${request}    network-topology:network-topology/topology/topo:1
114     Should Contain    ${resp.content}    <topology-id>topo:1</topology-id>
115     Should Contain X Times    ${resp.content}    <link-id>link:    2
116     Should Contain X Times    ${resp.content}    <link-ref>link:14:12</link-ref>    1
117     Should Contain X Times    ${resp.content}    <link-ref>link:15:13</link-ref>    1
118     [Teardown]    Run Keywords    Filtration Links Test Teardown
119     ...    AND    Report_Failure_Due_To_Bug    4761
120
121 Filtration Script Network Topology Model
122     [Documentation]    Test of script type of filtration operation on Network Topology model
123     ${request}    Prepare Filtration Topology Request    ${FILTRATION_NT}    network-topology-model    link    network-topo:1
124     ${request}    Insert Filter    ${request}    ${FILTER_SCRIPT}    l3-unicast-igp-topology:igp-link-attributes/l3-unicast-igp-topology:name
125     ${script}    Set Variable    if (node.getValue().indexOf("linkA") > -1 ) {filterOut.setResult(true);} else {filterOut.setResult(false);}
126     ${request}    Set Script Filter    ${request}    javascript    ${script}
127     ${resp}    Send Basic Request    ${request}    network-topology:network-topology/topology/topo:1
128     Should Contain    ${resp.content}    <topology-id>topo:1</topology-id>
129     Should Contain X Times    ${resp.content}    <link-id>link:    2
130     Should Contain X Times    ${resp.content}    <link-ref>link:1:3</link-ref>    1
131     Should Contain X Times    ${resp.content}    <link-ref>link:1:2-2</link-ref>    1
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    link    openflow-topo:3
136     ${request}    Insert Filter    ${request}    ${FILTER_SCRIPT}    l3-unicast-igp-topology:igp-link-attributes/l3-unicast-igp-topology:name
137     ${script}    Set Variable    if (node.getValue().indexOf("linkA") > -1 ) {filterOut.setResult(true);} else {filterOut.setResult(false);}
138     ${request}    Set Script Filter    ${request}    javascript    ${script}
139     ${resp}    Send Basic Request    ${request}    network-topology:network-topology/topology/topo:1
140     Should Contain    ${resp.content}    <topology-id>topo:1</topology-id>
141     Should Contain X Times    ${resp.content}    <link-id>link:    3
142     Should Contain X Times    ${resp.content}    <link-ref>link:11:12</link-ref>    1
143     Should Contain X Times    ${resp.content}    <link-ref>link:14:12</link-ref>    1
144     Should Contain X Times    ${resp.content}    <link-ref>link:15:13</link-ref>    1
145     [Teardown]    Run Keywords    Filtration Links Test Teardown
146     ...    AND    Report_Failure_Due_To_Bug    4761
147
148 *** Keywords ***
149 Filtration Links Test Teardown
150     Test Teardown    network-topology:network-topology/topology/topo:1
151     Report_Failure_Due_To_Bug    4673