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