SXP: format test suite
[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    6
4 Suite Teardown    Clean SXP Environment    6
5 Test Teardown     Clean Nodes
6 Library           RequestsLibrary
7 Library           SSHLibrary
8 Library           ../../../libraries/Sxp.py
9 Resource          ../../../libraries/SxpLib.robot
10
11 *** Variables ***
12
13 *** Test Cases ***
14 Export Test
15     [Documentation]    Test behaviour after shutting down connections in Version4
16     [Tags]    SXP    TopoBuiltIn.Logy
17     Setup TopoBuiltIn.Logy Triangel    version4
18     BuiltIn.Wait Until Keyword Succeeds    4    1    Check Export Part One
19     SxpLib.Delete Connections    127.0.0.1    64999    127.0.0.3
20     SxpLib.Delete Connections    127.0.0.3    64999    127.0.0.1
21     BuiltIn.Wait Until Keyword Succeeds    4    1    Check Export Part Two
22     SxpLib.Delete Connections    127.0.0.1    64999    127.0.0.2
23     SxpLib.Delete Connections    127.0.0.2    64999    127.0.0.1
24     BuiltIn.Wait Until Keyword Succeeds    4    1    Check Export Part Three
25
26 Export Test Legacy
27     [Documentation]    Test behaviour after shutting down connections in Legacy versions
28     [Tags]    SXP    TopoBuiltIn.Logy
29     @{list} =    Create List    version1
30     : FOR    ${version}    IN    @{list}
31     \    Setup TopoBuiltIn.Logy Triangel    ${version}
32     \    BuiltIn.Wait Until Keyword Succeeds    4    1    Check Export Part One
33     \    SxpLib.Delete Connections    127.0.0.1    64999    127.0.0.3
34     \    SxpLib.Delete Connections    127.0.0.3    64999    127.0.0.1
35     \    BuiltIn.Wait Until Keyword Succeeds    4    1    Check Export Part Two
36     \    SxpLib.Delete Connections    127.0.0.1    64999    127.0.0.2
37     \    SxpLib.Delete Connections    127.0.0.2    64999    127.0.0.1
38     \    BuiltIn.Wait Until Keyword Succeeds    4    1    Check Export Part Three
39     \    Clean Nodes
40
41 Forwarding Test V2=>V1
42     [Documentation]    Version 2 => 1 functionality
43     [Tags]    SXP    TopoBuiltIn.Logy
44     Setup TopoBuiltIn.Logy Linear    version2    version1
45     BuiltIn.Wait Until Keyword Succeeds    4    1    Check Forwarding V2=>V1
46
47 Forwarding Test V3=>V2
48     [Documentation]    Version 3 => 2 functionality
49     [Tags]    SXP    TopoBuiltIn.Logy
50     Setup TopoBuiltIn.Logy Linear    version3    version2
51     BuiltIn.Wait Until Keyword Succeeds    4    1    Check Forwarding V3=>V2
52
53 Forwarding Test V4=>V3
54     [Documentation]    Version 4 => 3 functionality
55     [Tags]    SXP    TopoBuiltIn.Logy
56     Setup TopoBuiltIn.Logy Linear    version4    version3
57     BuiltIn.Wait Until Keyword Succeeds    4    1    Check Forwarding V4=>V3
58
59 Most Recent Rule Test
60     [Documentation]    Most Recent Rule
61     [Tags]    SXP    TopoBuiltIn.Logy
62     Setup TopoBuiltIn.Logy Fork    version4
63     SxpLib.Add Bindings    542    5.5.5.5/32    127.0.0.2
64     BuiltIn.Sleep    2s
65     SxpLib.Add Bindings    543    5.5.5.5/32    127.0.0.3
66     SxpLib.Add Bindings    100    15.15.15.15/32    127.0.0.3
67     BuiltIn.Sleep    2s
68     SxpLib.Add Bindings    99    15.15.15.15/32    127.0.0.2
69     BuiltIn.Wait Until Keyword Succeeds    4    1    Check Most Recent
70
71 Shorthest Path Test
72     [Documentation]    Shorthes Path over Most Recent
73     [Tags]    SXP    TopoBuiltIn.Logy
74     SxpLib.Add Connection    version4    listener    127.0.0.5    64999    127.0.0.3
75     SxpLib.Add Connection    version4    speaker    127.0.0.3    64999    127.0.0.5
76     BuiltIn.Wait Until Keyword Succeeds    15    1    Verify Connection    version4    listener    127.0.0.5
77     ...    64999    127.0.0.3
78     Setup TopoBuiltIn.Logy Fork    version4
79     SxpLib.Add Bindings    542    5.5.5.5/32    127.0.0.2
80     SxpLib.Add Bindings    545    5.5.5.5/32    127.0.0.5
81     SxpLib.Add Bindings    99    15.15.15.15/32    127.0.0.2
82     SxpLib.Add Bindings    9954    105.15.125.15/32    127.0.0.5
83     SxpLib.Add Bindings    95    15.15.15.15/32    127.0.0.5
84     BuiltIn.Wait Until Keyword Succeeds    4    1    Check Shorthest Path
85
86 *** Keywords ***
87 Setup TopoBuiltIn.Logy Triangel
88     [Arguments]    ${version}
89     [Documentation]    Setup 3 nodes connected to each other
90     SxpLib.Add Bindings    542    5.5.5.5/32    127.0.0.2
91     SxpLib.Add Bindings    543    5.5.5.5/32    127.0.0.3
92     SxpLib.Add Bindings    99    15.15.15.15/32    127.0.0.3
93     SxpLib.Add Connection    ${version}    listener    127.0.0.2    64999    127.0.0.1
94     SxpLib.Add Connection    ${version}    speaker    127.0.0.1    64999    127.0.0.2
95     BuiltIn.Wait Until Keyword Succeeds    15    1    Verify Connection    ${version}    listener    127.0.0.2
96     BuiltIn.Sleep    1s
97     SxpLib.Add Connection    ${version}    listener    127.0.0.3    64999    127.0.0.1
98     SxpLib.Add Connection    ${version}    speaker    127.0.0.1    64999    127.0.0.3
99     BuiltIn.Wait Until Keyword Succeeds    15    1    Verify Connection    ${version}    listener    127.0.0.3
100     SxpLib.Add Connection    ${version}    listener    127.0.0.3    64999    127.0.0.2
101     SxpLib.Add Connection    ${version}    speaker    127.0.0.2    64999    127.0.0.3
102     BuiltIn.Wait Until Keyword Succeeds    15    1    Verify Connection    ${version}    speaker    127.0.0.2
103     ...    64999    127.0.0.3
104
105 Setup TopoBuiltIn.Logy Linear
106     [Arguments]    ${version}    ${r_version}
107     [Documentation]    Setup 3 nodes connected linearly
108     SxpLib.Add Bindings    6    56.56.56.0/24    127.0.0.2
109     SxpLib.Add Bindings    66    9.9.9.9/32    127.0.0.2
110     SxpLib.Add Bindings    666    2001:db8:0:0:0:0:1428:57ab/128    127.0.0.2
111     SxpLib.Add Bindings    555    2001:db8:85a3:8d3:0:0:0:0/64    127.0.0.2
112     SxpLib.Add Connection    ${version}    listener    127.0.0.2    64999    127.0.0.1
113     SxpLib.Add Connection    ${version}    speaker    127.0.0.1    64999    127.0.0.2
114     BuiltIn.Wait Until Keyword Succeeds    15    1    Verify Connection    ${version}    listener    127.0.0.2
115     SxpLib.Add Connection    ${r_version}    speaker    127.0.0.3    64999    127.0.0.1
116     SxpLib.Add Connection    ${r_version}    listener    127.0.0.1    64999    127.0.0.3
117     BuiltIn.Wait Until Keyword Succeeds    15    1    Verify Connection    ${r_version}    speaker    127.0.0.3
118
119 Setup TopoBuiltIn.Logy Fork
120     [Arguments]    ${version}
121     [Documentation]    Setup 4 nodes in to T topoBuiltIn.Logy
122     SxpLib.Add Connection    ${version}    speaker    127.0.0.1    64999    127.0.0.3
123     SxpLib.Add Connection    ${version}    listener    127.0.0.3    64999    127.0.0.1
124     BuiltIn.Wait Until Keyword Succeeds    15    1    Verify Connection    ${version}    listener    127.0.0.3
125     SxpLib.Add Connection    ${version}    speaker    127.0.0.1    64999    127.0.0.2
126     SxpLib.Add Connection    ${version}    listener    127.0.0.2    64999    127.0.0.1
127     BuiltIn.Wait Until Keyword Succeeds    15    1    Verify Connection    ${version}    listener    127.0.0.2
128     SxpLib.Add Connection    ${version}    speaker    127.0.0.4    64999    127.0.0.1
129     SxpLib.Add Connection    ${version}    listener    127.0.0.1    64999    127.0.0.4
130     BuiltIn.Wait Until Keyword Succeeds    15    1    Verify Connection    ${version}    speaker    127.0.0.4
131
132 Check Export Part One
133     [Documentation]    Checks if Bindings 542 5.5.5.5/32 is replaced by 543 5.5.5.5/32
134     ${resp} =    SxpLib.Get Bindings
135     BuiltIn.Log    ${resp}
136     SxpLib.Should Contain Binding    ${resp}    543    5.5.5.5/32
137     Should Not Contain Binding    ${resp}    542    5.5.5.5/32
138     SxpLib.Should Contain Binding    ${resp}    99    15.15.15.15/32
139
140 Check Export Part Two
141     [Documentation]    Checks if Bindings 542 5.5.5.5/32 was updated after peer shutdown
142     ${resp} =    SxpLib.Get Bindings
143     BuiltIn.Log    ${resp}
144     Should Not Contain Binding    ${resp}    543    5.5.5.5/32
145     SxpLib.Should Contain Binding    ${resp}    542    5.5.5.5/32
146     SxpLib.Should Contain Binding    ${resp}    99    15.15.15.15/32
147
148 Check Export Part Three
149     [Documentation]    Checks if database is empty after peers shutdown
150     ${resp} =    SxpLib.Get Bindings
151     BuiltIn.Log    ${resp}
152     Should Not Contain Binding    ${resp}    542    5.5.5.5/32
153     Should Not Contain Binding    ${resp}    99    15.15.15.15/32
154
155 Check Forwarding V2=>V1
156     [Documentation]    Check if appropriate bindings are exported per version
157     ${resp} =    SxpLib.Get Bindings
158     Should Not Contain Binding    ${resp}    6    56.56.56.0/24
159     SxpLib.Should Contain Binding    ${resp}    66    9.9.9.9/32
160     SxpLib.Should Contain Binding    ${resp}    666    2001:db8:0:0:0:0:1428:57ab/128
161     Should Not Contain Binding    ${resp}    555    2001:db8:85a3:8d3:0:0:0:0/64
162     BuiltIn.Log    Init OK
163     ${resp} =    SxpLib.Get Bindings    127.0.0.3
164     Should Not Contain Binding    ${resp}    6    56.56.56.0/24
165     SxpLib.Should Contain Binding    ${resp}    66    9.9.9.9/32
166     Should Not Contain Binding    ${resp}    666    2001:db8:0:0:0:0:1428:57ab/128
167     Should Not Contain Binding    ${resp}    555    2001:db8:85a3:8d3:0:0:0:0/64
168     BuiltIn.Log    Forward OK
169
170 Check Forwarding V3=>V2
171     [Documentation]    Check if appropriate bindings are exported per version
172     ${resp} =    SxpLib.Get Bindings
173     SxpLib.Should Contain Binding    ${resp}    6    56.56.56.0/24
174     SxpLib.Should Contain Binding    ${resp}    66    9.9.9.9/32
175     SxpLib.Should Contain Binding    ${resp}    666    2001:db8:0:0:0:0:1428:57ab/128
176     SxpLib.Should Contain Binding    ${resp}    555    2001:db8:85a3:8d3:0:0:0:0/64
177     BuiltIn.Log    Init OK
178     ${resp} =    SxpLib.Get Bindings    127.0.0.3
179     Should Not Contain Binding    ${resp}    6    56.56.56.0/24
180     SxpLib.Should Contain Binding    ${resp}    66    9.9.9.9/32
181     SxpLib.Should Contain Binding    ${resp}    666    2001:db8:0:0:0:0:1428:57ab/128
182     Should Not Contain Binding    ${resp}    555    2001:db8:85a3:8d3:0:0:0:0/64
183     BuiltIn.Log    Forward OK
184
185 Check Forwarding V4=>V3
186     [Documentation]    Check if appropriate bindings are exported per version
187     ${resp} =    SxpLib.Get Bindings
188     SxpLib.Should Contain Binding    ${resp}    6    56.56.56.0/24
189     SxpLib.Should Contain Binding    ${resp}    66    9.9.9.9/32
190     SxpLib.Should Contain Binding    ${resp}    666    2001:db8:0:0:0:0:1428:57ab/128
191     SxpLib.Should Contain Binding    ${resp}    555    2001:db8:85a3:8d3:0:0:0:0/64
192     BuiltIn.Log    Init OK
193     ${resp} =    SxpLib.Get Bindings    127.0.0.3
194     SxpLib.Should Contain Binding    ${resp}    6    56.56.56.0/24
195     SxpLib.Should Contain Binding    ${resp}    66    9.9.9.9/32
196     SxpLib.Should Contain Binding    ${resp}    666    2001:db8:0:0:0:0:1428:57ab/128
197     SxpLib.Should Contain Binding    ${resp}    555    2001:db8:85a3:8d3:0:0:0:0/64
198     BuiltIn.Log    Forward OK
199
200 Check Shorthest Path
201     [Documentation]    Checks if Shorthest path rule is applied onto bindings
202     ${resp} =    SxpLib.Get Bindings
203     SxpLib.Should Contain Binding    ${resp}    542    5.5.5.5/32
204     SxpLib.Should Contain Binding    ${resp}    9954    105.15.125.15/32
205     SxpLib.Should Contain Binding    ${resp}    99    15.15.15.15/32
206     ${resp} =    SxpLib.Get Bindings    127.0.0.4
207     SxpLib.Should Contain Binding    ${resp}    542    5.5.5.5/32
208     SxpLib.Should Contain Binding    ${resp}    9954    105.15.125.15/32
209     SxpLib.Should Contain Binding    ${resp}    99    15.15.15.15/32
210
211 Check Most Recent
212     [Documentation]    Checks if MostRecent rule is applied onto bindings
213     ${resp} =    SxpLib.Get Bindings
214     SxpLib.Should Contain Binding    ${resp}    543    5.5.5.5/32
215     SxpLib.Should Contain Binding    ${resp}    99    15.15.15.15/32
216     ${resp} =    SxpLib.Get Bindings    127.0.0.4
217     SxpLib.Should Contain Binding    ${resp}    543    5.5.5.5/32
218     SxpLib.Should Contain Binding    ${resp}    99    15.15.15.15/32
219
220 Clean Nodes
221     SxpLib.Clean Bindings    127.0.0.1
222     SxpLib.Clean Bindings    127.0.0.2
223     SxpLib.Clean Bindings    127.0.0.3
224     SxpLib.Clean Bindings    127.0.0.4
225     SxpLib.Clean Bindings    127.0.0.5
226     SxpLib.Clean Connections    127.0.0.1
227     SxpLib.Clean Connections    127.0.0.2
228     SxpLib.Clean Connections    127.0.0.3
229     SxpLib.Clean Connections    127.0.0.4
230     SxpLib.Clean Connections    127.0.0.5