Added SXP filtering tests
[integration/test.git] / csit / suites / sxp / topology / 010_Topology_Features.robot
1 *** Settings ***
2 Documentation     Test suite to verify Behaviour in different topologies
3 Suite Setup       Setup SXP Environment
4 Suite Teardown    Clean SXP Environment
5 Test Setup        Clean Nodes
6 Library           RequestsLibrary
7 Library           SSHLibrary
8 Library           ../../../libraries/Sxp.py
9 Resource          ../../../libraries/SxpLib.robot
10 Resource          ../../../libraries/Utils.robot
11 Resource          ../../../libraries/KarafKeywords.robot
12 Resource          ../../../variables/Variables.py
13
14 *** Variables ***
15
16 *** Test Cases ***
17 Export Test
18     [Documentation]    Test behaviour after shutting down connections in Version4
19     Setup Topology Triangel    version4
20     ${resp}    Get Bindings Master Database
21     Should Contain Binding With Peer Sequence    ${resp}    542    5.5.5.5/32    127.0.0.3    0    sxp
22     Should Contain Binding With Peer Sequence    ${resp}    99    15.15.15.15/32    127.0.0.3    0    sxp
23     Delete Connections    127.0.0.1    64999    127.0.0.3
24     Sleep    2s
25     ${resp}    Get Bindings Master Database
26     Should Contain Binding With Peer Sequence    ${resp}    542    5.5.5.5/32    127.0.0.2    0    sxp
27     Should Contain Binding With Peer Sequence    ${resp}    99    15.15.15.15/32    127.0.0.3    1    sxp
28     Delete Connections    127.0.0.1    64999    127.0.0.2
29     Sleep    2s
30     ${resp}    Get Bindings Master Database
31     Should Not Contain Binding With Peer Sequence    ${resp}    542    5.5.5.5/32    127.0.0.2    0    sxp
32     Should Not Contain Binding With Peer Sequence    ${resp}    99    15.15.15.15/32    127.0.0.3    1    sxp
33
34 Export Test Legacy
35     [Documentation]    Test behaviour after shutting down connections in Legacy versions
36     @{list} =    Create List    version1
37     : FOR    ${version}    IN    @{list}
38     \    Setup Topology Triangel    ${version}
39     \    ${resp}    Get Bindings Master Database
40     \    Should Contain Binding    ${resp}    542    5.5.5.5/32    sxp
41     \    Should Contain Binding    ${resp}    99    15.15.15.15/32    sxp
42     \    Delete Connections    127.0.0.1    64999    127.0.0.3
43     \    Sleep    2s
44     \    ${resp}    Get Bindings Master Database
45     \    Should Contain Binding    ${resp}    542    5.5.5.5/32    sxp
46     \    Should Contain Binding    ${resp}    99    15.15.15.15/32    sxp
47     \    Delete Connections    127.0.0.1    64999    127.0.0.2
48     \    Sleep    2s
49     \    ${resp}    Get Bindings Master Database
50     \    Should Not Contain Binding    ${resp}    542    5.5.5.5/32    sxp
51     \    Should Not Contain Binding    ${resp}    99    15.15.15.15/32    sxp
52     \    Log    ${version} OK
53     \    Clean Nodes
54
55 Forwarding Test V2=>V1
56     [Documentation]    Version 2 => 1 functionality
57     Setup Topology Linear    version2    version1
58     ${resp}    Get Bindings Master Database
59     Should Not Contain Binding    ${resp}    6    56.56.56.0/24    sxp
60     Should Contain Binding    ${resp}    66    9.9.9.9/32    sxp
61     Should Contain Binding    ${resp}    666    2001:db8:0:0:0:0:1428:57ab/128    sxp
62     Should Not Contain Binding    ${resp}    555    2001:db8:85a3:8d3:0:0:0:0/64    sxp
63     Log    Init OK
64     ${resp}    Get Bindings Master Database    127.0.0.3
65     Should Not Contain Binding    ${resp}    6    56.56.56.0/24    sxp
66     Should Contain Binding    ${resp}    66    9.9.9.9/32    sxp
67     Should Not Contain Binding    ${resp}    666    2001:db8:0:0:0:0:1428:57ab/128    sxp
68     Should Not Contain Binding    ${resp}    555    2001:db8:85a3:8d3:0:0:0:0/64    sxp
69     Log    Forward OK
70
71 Forwarding Test V3=>V2
72     [Documentation]    Version 3 => 2 functionality
73     Setup Topology Linear    version3    version2
74     ${resp}    Get Bindings Master Database
75     Should Contain Binding    ${resp}    6    56.56.56.0/24    sxp
76     Should Contain Binding    ${resp}    66    9.9.9.9/32    sxp
77     Should Contain Binding    ${resp}    666    2001:db8:0:0:0:0:1428:57ab/128    sxp
78     Should Contain Binding    ${resp}    555    2001:db8:85a3:8d3:0:0:0:0/64    sxp
79     Log    Init OK
80     ${resp}    Get Bindings Master Database    127.0.0.3
81     Should Not Contain Binding    ${resp}    6    56.56.56.0/24    sxp
82     Should Contain Binding    ${resp}    66    9.9.9.9/32    sxp
83     Should Contain Binding    ${resp}    666    2001:db8:0:0:0:0:1428:57ab/128    sxp
84     Should Not Contain Binding    ${resp}    555    2001:db8:85a3:8d3:0:0:0:0/64    sxp
85     Log    Forward OK
86
87 Forwarding Test V4=>V3
88     [Documentation]    Version 4 => 3 functionality
89     Setup Topology Linear    version4    version3
90     ${resp}    Get Bindings Master Database
91     Should Contain Binding With Peer Sequence    ${resp}    6    56.56.56.0/24    127.0.0.2    0    sxp
92     Should Contain Binding With Peer Sequence    ${resp}    66    9.9.9.9/32    127.0.0.2    0    sxp
93     Should Contain Binding With Peer Sequence    ${resp}    666    2001:db8:0:0:0:0:1428:57ab/128    127.0.0.2    0    sxp
94     Should Contain Binding With Peer Sequence    ${resp}    555    2001:db8:85a3:8d3:0:0:0:0/64    127.0.0.2    0    sxp
95     Log    Init OK
96     ${resp}    Get Bindings Master Database    127.0.0.3
97     Should Contain Binding    ${resp}    6    56.56.56.0/24    sxp
98     Should Contain Binding    ${resp}    66    9.9.9.9/32    sxp
99     Should Contain Binding    ${resp}    666    2001:db8:0:0:0:0:1428:57ab/128    sxp
100     Should Contain Binding    ${resp}    555    2001:db8:85a3:8d3:0:0:0:0/64    sxp
101     Log    Forward OK
102
103 Most Recent Rule Test
104     [Documentation]    Most Recent Rule
105     Setup Topology Fork    version4
106     Add Binding    542    5.5.5.5/32    127.0.0.2
107     Sleep    2s
108     Add Binding    542    5.5.5.5/32    127.0.0.3
109     Add Binding    99    15.15.15.15/32    127.0.0.3
110     Sleep    2s
111     Add Binding    99    15.15.15.15/32    127.0.0.2
112     Sleep    1s
113     ${resp}    Get Bindings Master Database
114     Should Contain Binding With Peer Sequence    ${resp}    542    5.5.5.5/32    127.0.0.3    0    sxp
115     Should Contain Binding With Peer Sequence    ${resp}    99    15.15.15.15/32    127.0.0.2    0    sxp
116     ${resp}    Get Bindings Master Database    127.0.0.4
117     Should Contain Binding With Peer Sequence    ${resp}    542    5.5.5.5/32    127.0.0.3    1    sxp
118     Should Contain Binding With Peer Sequence    ${resp}    99    15.15.15.15/32    127.0.0.2    1    sxp
119
120 Shorthest Path Test
121     [Documentation]    Shorthes Path over Most Recent
122     Add Connection    version4    listener    127.0.0.5    64999    127.0.0.3
123     Add Connection    version4    speaker    127.0.0.3    64999    127.0.0.5
124     Setup Topology Fork    version4
125     Add Binding    542    5.5.5.5/32    127.0.0.2
126     Sleep    2s
127     Add Binding    542    5.5.5.5/32    127.0.0.5
128     Add Binding    99    15.15.15.15/32    127.0.0.2
129     Add Binding    9954    105.15.125.15/32    127.0.0.5
130     Sleep    2s
131     Add Binding    99    15.15.15.15/32    127.0.0.5
132     ${resp}    Get Bindings Master Database
133     Should Contain Binding With Peer Sequence    ${resp}    542    5.5.5.5/32    127.0.0.2    0    sxp
134     Should Contain Binding With Peer Sequence    ${resp}    9954    105.15.125.15/32    127.0.0.5    1    sxp
135     Should Contain Binding With Peer Sequence    ${resp}    99    15.15.15.15/32    127.0.0.2    0    sxp
136     ${resp}    Get Bindings Master Database    127.0.0.4
137     Should Contain Binding With Peer Sequence    ${resp}    542    5.5.5.5/32    127.0.0.2    1    sxp
138     Should Contain Binding With Peer Sequence    ${resp}    9954    105.15.125.15/32    127.0.0.5    2    sxp
139     Should Contain Binding With Peer Sequence    ${resp}    99    15.15.15.15/32    127.0.0.2    1    sxp
140
141 *** Keywords ***
142 Setup Topology Triangel
143     [Arguments]    ${version}
144     [Documentation]    Setup 3 nodes connected to each other
145     Add Binding    542    5.5.5.5/32    127.0.0.2
146     Add Binding    542    5.5.5.5/32    127.0.0.3
147     Add Binding    99    15.15.15.15/32    127.0.0.3
148     Add Connection    ${version}    listener    127.0.0.2    64999    127.0.0.1
149     Add Connection    ${version}    listener    127.0.0.3    64999    127.0.0.1
150     Sleep    1s
151     Add Connection    ${version}    speaker    127.0.0.1    64999    127.0.0.2
152     Add Connection    ${version}    listener    127.0.0.3    64999    127.0.0.2
153     Sleep    2s
154     Add Connection    ${version}    speaker    127.0.0.1    64999    127.0.0.3
155     Add Connection    ${version}    speaker    127.0.0.2    64999    127.0.0.3
156     Sleep    3s
157
158 Setup Topology Linear
159     [Arguments]    ${version}    ${r_version}
160     [Documentation]    Setup 3 nodes connected linearly
161     Add Binding    6    56.56.56.0/24    127.0.0.2
162     Add Binding    66    9.9.9.9/32    127.0.0.2
163     Add Binding    666    2001:db8:0:0:0:0:1428:57ab/128    127.0.0.2
164     Add Binding    555    2001:db8:85a3:8d3:0:0:0:0/64    127.0.0.2
165     Add Connection    ${version}    listener    127.0.0.2    64999    127.0.0.1
166     Add Connection    ${r_version}    speaker    127.0.0.3    64999    127.0.0.1
167     Sleep    1s
168     Add Connection    ${version}    speaker    127.0.0.1    64999    127.0.0.2
169     Add Connection    ${r_version}    listener    127.0.0.1    64999    127.0.0.3
170     Sleep    2s
171
172 Setup Topology Fork
173     [Arguments]    ${version}
174     [Documentation]    Setup 4 nodes in to T topology
175     Add Connection    ${version}    listener    127.0.0.2    64999    127.0.0.1
176     Add Connection    ${version}    listener    127.0.0.3    64999    127.0.0.1
177     Add Connection    ${version}    speaker    127.0.0.4    64999    127.0.0.1
178     Sleep    2s
179     Add Connection    ${version}    speaker    127.0.0.1    64999    127.0.0.2
180     Add Connection    ${version}    speaker    127.0.0.1    64999    127.0.0.3
181     Add Connection    ${version}    listener    127.0.0.1    64999    127.0.0.4
182     Sleep    3s
183
184 Clean Nodes
185     Clean Connections    127.0.0.1
186     Clean Connections    127.0.0.2
187     Clean Connections    127.0.0.3
188     Clean Connections    127.0.0.4
189     Clean Connections    127.0.0.5
190     Sleep    5s
191     Clean Bindings    127.0.0.1
192     Clean Bindings    127.0.0.2
193     Clean Bindings    127.0.0.3
194     Clean Bindings    127.0.0.4
195     Clean Bindings    127.0.0.5
196     Sleep    5s