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