Adapt netconf device configuration in daexim CSIT
[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
8 Library             RequestsLibrary
9 Library             SSHLibrary
10 Library             XML
11 Variables           ../../../variables/topoprocessing/TopologyRequests.py
12 Variables           ../../../variables/topoprocessing/TargetFields.py
13 Variables           ../../../variables/Variables.py
14 Resource            ../../../libraries/KarafKeywords.robot
15 Resource            ../../../libraries/Utils.robot
16 Resource            ../../../libraries/TopoprocessingKeywords.robot
17
18 Suite Setup         Setup Environment
19 Suite Teardown      Clean Environment
20 Test Setup          SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
21 Test Teardown       Delete Overlay Topology
22
23
24 *** Test Cases ***
25 Filtration Range Number Network Topology Model
26     [Documentation]    Test of range number type of filtration operation on Network Topology model
27     ${request}    Prepare Filtration Topology Request
28     ...    ${FILTRATION_NT}
29     ...    network-topology-model
30     ...    link
31     ...    network-topo:1
32     ${request}    Insert Filter    ${request}    ${FILTER_RANGE_NUMBER}    ${IGP_LINK_METRIC}
33     ${request}    Set Range Number Filter    ${request}    11    13
34     Basic Request Put    ${request}    ${OVERLAY_TOPO_URL}
35     ${resp}    Wait Until Keyword Succeeds
36     ...    3x
37     ...    1s
38     ...    Output Topo Should Be Complete
39     ...    link_count=3
40     ...    link-ref_count=3
41     Check Filtered Links In Topology    ${resp.content}    link:1:2-1    link:1:3    link:1:4
42
43 Filtration Range Number Inventory Model
44     [Documentation]    Test of range number type of filtration operation on Inventory model
45     ${request}    Prepare Filtration Topology Request
46     ...    ${FILTRATION_NT}
47     ...    opendaylight-inventory-model
48     ...    link
49     ...    openflow-topo:3
50     ${request}    Insert Filter    ${request}    ${FILTER_RANGE_NUMBER}    ${IGP_LINK_METRIC}
51     ${request}    Set Range Number Filter    ${request}    14    15
52     Basic Request Put    ${request}    ${OVERLAY_TOPO_URL}
53     ${resp}    Wait Until Keyword Succeeds
54     ...    3x
55     ...    1s
56     ...    Output Topo Should Be Complete
57     ...    link_count=2
58     ...    link-ref_count=2
59     Check Filtered Links In Topology    ${resp.content}    link:14:12    link:15:13
60
61 Filtration Specific String Network Topology Model
62     [Documentation]    Test of specific string type of filtration operation on Network Topology model
63     ${request}    Prepare Filtration Topology Request
64     ...    ${FILTRATION_NT}
65     ...    network-topology-model
66     ...    link
67     ...    network-topo:1
68     ${request}    Insert Filter    ${request}    ${FILTER_SPECIFIC_STRING}    ${IGP_LINK_NAME}
69     ${request}    Set Specific String Filter    ${request}    linkA
70     Basic Request Put    ${request}    ${OVERLAY_TOPO_URL}
71     ${resp}    Wait Until Keyword Succeeds
72     ...    3x
73     ...    1s
74     ...    Output Topo Should Be Complete
75     ...    link_count=2
76     ...    link-ref_count=2
77     Check Filtered Links In Topology    ${resp.content}    link:1:4    link:1:2-1
78
79 Filtration Specific String Inventory Model
80     [Documentation]    Test of specific string type of filtration operation on Inventory model
81     ${request}    Prepare Filtration Topology Request
82     ...    ${FILTRATION_NT}
83     ...    opendaylight-inventory-model
84     ...    link
85     ...    openflow-topo:3
86     ${request}    Insert Filter    ${request}    ${FILTER_SPECIFIC_STRING}    ${IGP_LINK_NAME}
87     ${request}    Set Specific String Filter    ${request}    linkD
88     Basic Request Put    ${request}    ${OVERLAY_TOPO_URL}
89     ${resp}    Wait Until Keyword Succeeds
90     ...    3x
91     ...    1s
92     ...    Output Topo Should Be Complete
93     ...    link_count=1
94     ...    link-ref_count=1
95     Check Filtered Links In Topology    ${resp.content}    link:15:13
96
97 Filtration Range String Network Topology Model
98     [Documentation]    Test of range string type of filtration operation on Network Topology model
99     ${request}    Prepare Filtration Topology Request
100     ...    ${FILTRATION_NT}
101     ...    network-topology-model
102     ...    link
103     ...    network-topo:1
104     ${request}    Insert Filter    ${request}    ${FILTER_RANGE_STRING}    ${IGP_LINK_NAME}
105     ${request}    Set Range String Filter    ${request}    linkA    linkB
106     Basic Request Put    ${request}    ${OVERLAY_TOPO_URL}
107     ${resp}    Wait Until Keyword Succeeds
108     ...    3x
109     ...    1s
110     ...    Output Topo Should Be Complete
111     ...    link_count=3
112     ...    link-ref_count=3
113     Check Filtered Links In Topology    ${resp.content}    link:1:2-1    link:1:3    link:1:4
114
115 Filtration Range String Inventory Model
116     [Documentation]    Test of range string type of filtration operation on Inventory model
117     ${request}    Prepare Filtration Topology Request
118     ...    ${FILTRATION_NT}
119     ...    opendaylight-inventory-model
120     ...    link
121     ...    openflow-topo:3
122     ${request}    Insert Filter    ${request}    ${FILTER_RANGE_STRING}    ${IGP_LINK_NAME}
123     ${request}    Set Range String Filter    ${request}    linkC    linkD
124     Basic Request Put    ${request}    ${OVERLAY_TOPO_URL}
125     ${resp}    Wait Until Keyword Succeeds
126     ...    3x
127     ...    1s
128     ...    Output Topo Should Be Complete
129     ...    link_count=2
130     ...    link-ref_count=2
131     Check Filtered Links In Topology    ${resp.content}    link:14:12    link:15:13
132
133 Filtration Script Network Topology Model
134     [Documentation]    Test of script type of filtration operation on Network Topology model
135     ${request}    Prepare Filtration Topology Request
136     ...    ${FILTRATION_NT}
137     ...    network-topology-model
138     ...    link
139     ...    network-topo:1
140     ${request}    Insert Filter    ${request}    ${FILTER_SCRIPT}    ${IGP_LINK_NAME}
141     ${script}    Set Variable
142     ...    if (node.getValue().indexOf("linkA") > -1 ) {filterOut.setResult(true);} else {filterOut.setResult(false);}
143     ${request}    Set Script Filter    ${request}    javascript    ${script}
144     Basic Request Put    ${request}    ${OVERLAY_TOPO_URL}
145     ${resp}    Wait Until Keyword Succeeds
146     ...    3x
147     ...    1s
148     ...    Output Topo Should Be Complete
149     ...    link_count=2
150     ...    link-ref_count=2
151     Check Filtered Links In Topology    ${resp.content}    link:1:2-2    link:1:3
152
153 Filtration Script Inventory Model
154     [Documentation]    Test of script type of filtration operation on Inventory model
155     ${request}    Prepare Filtration Topology Request
156     ...    ${FILTRATION_NT}
157     ...    opendaylight-inventory-model
158     ...    link
159     ...    openflow-topo:3
160     ${request}    Insert Filter    ${request}    ${FILTER_SCRIPT}    ${IGP_LINK_NAME}
161     ${script}    Set Variable
162     ...    if (node.getValue().indexOf("linkA") > -1 ) {filterOut.setResult(true);} else {filterOut.setResult(false);}
163     ${request}    Set Script Filter    ${request}    javascript    ${script}
164     Basic Request Put    ${request}    ${OVERLAY_TOPO_URL}
165     ${resp}    Wait Until Keyword Succeeds
166     ...    3x
167     ...    1s
168     ...    Output Topo Should Be Complete
169     ...    link_count=3
170     ...    link-ref_count=3
171     Check Filtered Links In Topology    ${resp.content}    link:11:12    link:14:12    link:15:13