3704cd4a5ef884889c873cb4ccc68c745f63307d
[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    Topology
17     Setup Topology Triangel    version4
18     Wait Until Keyword Succeeds    4    1    Check Export Part One
19     Delete Connections    127.0.0.1    64999    127.0.0.3
20     Delete Connections    127.0.0.3    64999    127.0.0.1
21     Wait Until Keyword Succeeds    4    1    Check Export Part Two
22     Delete Connections    127.0.0.1    64999    127.0.0.2
23     Delete Connections    127.0.0.2    64999    127.0.0.1
24     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    Topology
29     @{list} =    Create List    version1
30     : FOR    ${version}    IN    @{list}
31     \    Setup Topology Triangel    ${version}
32     \    Wait Until Keyword Succeeds    4    1    Check Export Part One
33     \    Delete Connections    127.0.0.1    64999    127.0.0.3
34     \    Delete Connections    127.0.0.3    64999    127.0.0.1
35     \    Wait Until Keyword Succeeds    4    1    Check Export Part Two
36     \    Delete Connections    127.0.0.1    64999    127.0.0.2
37     \    Delete Connections    127.0.0.2    64999    127.0.0.1
38     \    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    Topology
44     Setup Topology Linear    version2    version1
45     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    Topology
50     Setup Topology Linear    version3    version2
51     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    Topology
56     Setup Topology Linear    version4    version3
57     Wait Until Keyword Succeeds    4    1    Check Forwarding V4=>V3
58
59 Most Recent Rule Test
60     [Documentation]    Most Recent Rule
61     [Tags]    SXP    Topology
62     Setup Topology Fork    version4
63     Add Bindings    542    5.5.5.5/32    127.0.0.2
64     Sleep    2s
65     Add Bindings    543    5.5.5.5/32    127.0.0.3
66     Add Bindings    100    15.15.15.15/32    127.0.0.3
67     Sleep    2s
68     Add Bindings    99    15.15.15.15/32    127.0.0.2
69     Wait Until Keyword Succeeds    4    1    Check Most Recent
70
71 Shorthest Path Test
72     [Documentation]    Shorthes Path over Most Recent
73     [Tags]    SXP    Topology
74     Add Connection    version4    listener    127.0.0.5    64999    127.0.0.3
75     Add Connection    version4    speaker    127.0.0.3    64999    127.0.0.5
76     Wait Until Keyword Succeeds    15    1    Verify Connection    version4    listener    127.0.0.5
77     ...    64999    127.0.0.3
78     Setup Topology Fork    version4
79     Add Bindings    542    5.5.5.5/32    127.0.0.2
80     Add Bindings    545    5.5.5.5/32    127.0.0.5
81     Add Bindings    99    15.15.15.15/32    127.0.0.2
82     Add Bindings    9954    105.15.125.15/32    127.0.0.5
83     Add Bindings    95    15.15.15.15/32    127.0.0.5
84     Wait Until Keyword Succeeds    4    1    Check Shorthest Path
85
86 *** Keywords ***
87 Setup Topology Triangel
88     [Arguments]    ${version}
89     [Documentation]    Setup 3 nodes connected to each other
90     Add Bindings    542    5.5.5.5/32    127.0.0.2
91     Add Bindings    543    5.5.5.5/32    127.0.0.3
92     Add Bindings    99    15.15.15.15/32    127.0.0.3
93     Add Connection    ${version}    listener    127.0.0.2    64999    127.0.0.1
94     Add Connection    ${version}    speaker    127.0.0.1    64999    127.0.0.2
95     Wait Until Keyword Succeeds    15    1    Verify Connection    ${version}    listener    127.0.0.2
96     Sleep    1s
97     Add Connection    ${version}    listener    127.0.0.3    64999    127.0.0.1
98     Add Connection    ${version}    speaker    127.0.0.1    64999    127.0.0.3
99     Wait Until Keyword Succeeds    15    1    Verify Connection    ${version}    listener    127.0.0.3
100     Add Connection    ${version}    listener    127.0.0.3    64999    127.0.0.2
101     Add Connection    ${version}    speaker    127.0.0.2    64999    127.0.0.3
102     Wait Until Keyword Succeeds    15    1    Verify Connection    ${version}    speaker    127.0.0.2
103     ...    64999    127.0.0.3
104
105 Setup Topology Linear
106     [Arguments]    ${version}    ${r_version}
107     [Documentation]    Setup 3 nodes connected linearly
108     Add Bindings    6    56.56.56.0/24    127.0.0.2
109     Add Bindings    66    9.9.9.9/32    127.0.0.2
110     Add Bindings    666    2001:db8:0:0:0:0:1428:57ab/128    127.0.0.2
111     Add Bindings    555    2001:db8:85a3:8d3:0:0:0:0/64    127.0.0.2
112     Add Connection    ${version}    listener    127.0.0.2    64999    127.0.0.1
113     Add Connection    ${version}    speaker    127.0.0.1    64999    127.0.0.2
114     Wait Until Keyword Succeeds    15    1    Verify Connection    ${version}    listener    127.0.0.2
115     Add Connection    ${r_version}    speaker    127.0.0.3    64999    127.0.0.1
116     Add Connection    ${r_version}    listener    127.0.0.1    64999    127.0.0.3
117     Wait Until Keyword Succeeds    15    1    Verify Connection    ${r_version}    speaker    127.0.0.3
118
119 Setup Topology Fork
120     [Arguments]    ${version}
121     [Documentation]    Setup 4 nodes in to T topology
122     Add Connection    ${version}    speaker    127.0.0.1    64999    127.0.0.3
123     Add Connection    ${version}    listener    127.0.0.3    64999    127.0.0.1
124     Wait Until Keyword Succeeds    15    1    Verify Connection    ${version}    listener    127.0.0.3
125     Add Connection    ${version}    speaker    127.0.0.1    64999    127.0.0.2
126     Add Connection    ${version}    listener    127.0.0.2    64999    127.0.0.1
127     Wait Until Keyword Succeeds    15    1    Verify Connection    ${version}    listener    127.0.0.2
128     Add Connection    ${version}    speaker    127.0.0.4    64999    127.0.0.1
129     Add Connection    ${version}    listener    127.0.0.1    64999    127.0.0.4
130     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}    Get Bindings
135     log    ${resp}
136     Should Contain Binding    ${resp}    543    5.5.5.5/32
137     Should Not Contain Binding    ${resp}    542    5.5.5.5/32
138     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}    Get Bindings
143     log    ${resp}
144     Should Not Contain Binding    ${resp}    543    5.5.5.5/32
145     Should Contain Binding    ${resp}    542    5.5.5.5/32
146     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}    Get Bindings
151     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}    Get Bindings
158     Should Not Contain Binding    ${resp}    6    56.56.56.0/24    sxp
159     Should Contain Binding    ${resp}    66    9.9.9.9/32    sxp
160     Should Contain Binding    ${resp}    666    2001:db8:0:0:0:0:1428:57ab/128    sxp
161     Should Not Contain Binding    ${resp}    555    2001:db8:85a3:8d3:0:0:0:0/64    sxp
162     Log    Init OK
163     ${resp}    Get Bindings    127.0.0.3
164     Should Not Contain Binding    ${resp}    6    56.56.56.0/24    sxp
165     Should Contain Binding    ${resp}    66    9.9.9.9/32    sxp
166     Should Not Contain Binding    ${resp}    666    2001:db8:0:0:0:0:1428:57ab/128    sxp
167     Should Not Contain Binding    ${resp}    555    2001:db8:85a3:8d3:0:0:0:0/64    sxp
168     Log    Forward OK
169
170 Check Forwarding V3=>V2
171     [Documentation]    Check if appropriate bindings are exported per version
172     ${resp}    Get Bindings
173     Should Contain Binding    ${resp}    6    56.56.56.0/24    sxp
174     Should Contain Binding    ${resp}    66    9.9.9.9/32    sxp
175     Should Contain Binding    ${resp}    666    2001:db8:0:0:0:0:1428:57ab/128    sxp
176     Should Contain Binding    ${resp}    555    2001:db8:85a3:8d3:0:0:0:0/64    sxp
177     Log    Init OK
178     ${resp}    Get Bindings    127.0.0.3
179     Should Not Contain Binding    ${resp}    6    56.56.56.0/24    sxp
180     Should Contain Binding    ${resp}    66    9.9.9.9/32    sxp
181     Should Contain Binding    ${resp}    666    2001:db8:0:0:0:0:1428:57ab/128    sxp
182     Should Not Contain Binding    ${resp}    555    2001:db8:85a3:8d3:0:0:0:0/64    sxp
183     Log    Forward OK
184
185 Check Forwarding V4=>V3
186     [Documentation]    Check if appropriate bindings are exported per version
187     ${resp}    Get Bindings
188     Should Contain Binding    ${resp}    6    56.56.56.0/24
189     Should Contain Binding    ${resp}    66    9.9.9.9/32
190     Should Contain Binding    ${resp}    666    2001:db8:0:0:0:0:1428:57ab/128
191     Should Contain Binding    ${resp}    555    2001:db8:85a3:8d3:0:0:0:0/64
192     Log    Init OK
193     ${resp}    Get Bindings    127.0.0.3
194     Should Contain Binding    ${resp}    6    56.56.56.0/24    sxp
195     Should Contain Binding    ${resp}    66    9.9.9.9/32    sxp
196     Should Contain Binding    ${resp}    666    2001:db8:0:0:0:0:1428:57ab/128    sxp
197     Should Contain Binding    ${resp}    555    2001:db8:85a3:8d3:0:0:0:0/64    sxp
198     Log    Forward OK
199
200 Check Shorthest Path
201     [Documentation]    Checks if Shorthest path rule is applied onto bindings
202     ${resp}    Get Bindings
203     Should Contain Binding    ${resp}    542    5.5.5.5/32
204     Should Contain Binding    ${resp}    9954    105.15.125.15/32
205     Should Contain Binding    ${resp}    99    15.15.15.15/32
206     ${resp}    Get Bindings    127.0.0.4
207     Should Contain Binding    ${resp}    542    5.5.5.5/32
208     Should Contain Binding    ${resp}    9954    105.15.125.15/32
209     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}    Get Bindings
214     Should Contain Binding    ${resp}    543    5.5.5.5/32
215     Should Contain Binding    ${resp}    99    15.15.15.15/32
216     ${resp}    Get Bindings    127.0.0.4
217     Should Contain Binding    ${resp}    543    5.5.5.5/32
218     Should Contain Binding    ${resp}    99    15.15.15.15/32
219
220 Clean Nodes
221     Clean Bindings    127.0.0.1
222     Clean Bindings    127.0.0.2
223     Clean Bindings    127.0.0.3
224     Clean Bindings    127.0.0.4
225     Clean Bindings    127.0.0.5
226     Clean Connections    127.0.0.1
227     Clean Connections    127.0.0.2
228     Clean Connections    127.0.0.3
229     Clean Connections    127.0.0.4
230     Clean Connections    127.0.0.5