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