2 Documentation Test suite measuring binding export and forwarding speed.
4 Library ../../../libraries/Sxp.py
5 Resource ../../../libraries/SxpLib.robot
6 Library Remote http://${ODL_SYSTEM_IP}:8270/ExportTestLibrary WITH NAME ExportLibrary
8 Test Setup Setup SXP Environment
9 Test Teardown Clean Custom SXP Environment
14 ${SOURCE_IP} 127.1.0.1
15 ${DESTINATION_IP} 127.2.0.1
17 ${EXPORT_AMOUNT} 65536
22 ${DOMAIN_1} test-domain
27 [Documentation] Test binding export speed without any filters
28 Add Bindings Range 112 84213760 ${EXPORT_AMOUNT}
29 ${export_speed} Simple Export ${EXPORT_AMOUNT} ${TEST_SAMPLES}
30 Log Average export speed ${export_speed} bindings/s.
31 Should Be True ${export_speed} > ${MINIMAL_SPEED}
33 Binding Forwarding Export Test
34 [Documentation] Test binding forwarding speed without any filters
35 ${export_speed} Forwarding Export ${EXPORT_AMOUNT} ${TEST_SAMPLES}
36 Log Average export speed ${export_speed} bindings/s.
37 Should Be True ${export_speed} > ${MINIMAL_SPEED}
39 Binding Outbound Filter Export Test
40 [Documentation] Test binding export speed with Outbound filter and multiple passrates.
41 Add Bindings Range 112 84213760 ${EXPORT_AMOUNT}
42 FOR ${num} IN RANGE 16 20
43 ${passrate} Evaluate 100.0/(2**(${num} - 16))
44 ${exported_bindings} Evaluate int(math.ceil( ${EXPORT_AMOUNT}*${passrate}/100 )) modules=math
45 ${exported_bindings} Convert To String ${exported_bindings}
46 Setup Filter ${num} outbound
47 ${export_speed} Simple Export ${exported_bindings} ${TEST_SAMPLES}
48 Log Outbound Export speed ${export_speed} with passrate ${passrate}%.
49 Should Be True ${export_speed} > ${MINIMAL_SPEED}
52 Binding Inbound Filter Forwarding Export Test
53 [Documentation] Test binding forwarding speed with Inbound filter and multiple passrates.
54 FOR ${num} IN RANGE 16 20
55 ${passrate} Evaluate 100.0/(2**(${num} - 16))
56 ${exported_bindings} Evaluate math.ceil( ${EXPORT_AMOUNT}*${passrate}/100 ) modules=math
57 ${exported_bindings} Convert To String ${exported_bindings}
58 Setup Filter ${num} inbound-discarding
59 ${export_speed} Forwarding Export ${exported_bindings} ${TEST_SAMPLES}
60 Log Outbound Export speed ${export_speed} with passrate ${passrate}%.
61 Should Be True ${export_speed} > ${MINIMAL_SPEED}
64 Binding Inbound-Discarding Filter Forwarding Export Test
65 [Documentation] Test binding forwarding speed with Inbound-discarding filter and multiple passrates.
66 FOR ${num} IN RANGE 16 20
67 ${passrate} Evaluate 100.0/(2**(${num} - 16))
68 ${exported_bindings} Evaluate math.ceil( ${EXPORT_AMOUNT}*${passrate}/100 ) modules=math
69 ${exported_bindings} Convert To String ${exported_bindings}
70 Setup Filter ${num} inbound-discarding
71 ${export_speed} Forwarding Export ${exported_bindings} ${TEST_SAMPLES}
72 Log Outbound Export speed ${export_speed} with passrate ${passrate}%.
73 Should Be True ${export_speed} > ${MINIMAL_SPEED}
76 Binding Domain Filter Export Test
77 [Documentation] Test binding export speed with domain filter and multiple passrates.
78 Add Bindings Range 112 84213760 ${EXPORT_AMOUNT}
79 FOR ${num} IN RANGE 16 20
80 ${passrate} Evaluate 100.0/(2**(${num} - 16))
81 ${exported_bindings} Evaluate math.ceil( ${EXPORT_AMOUNT}*${passrate}/100 ) modules=math
82 ${exported_bindings} Convert To String ${exported_bindings}
83 Run Keyword And Ignore Error Setup Domain Filter ${num} ${DOMAIN_1}
84 ${export_speed} Simple Export ${exported_bindings} ${TEST_SAMPLES} ${DOMAIN_1}
85 Log Outbound Export speed ${export_speed} with passrate ${passrate}%.
86 Should Be True ${export_speed} > ${MINIMAL_SPEED}
89 Binding Domain Filter Forwarding Export Test
90 [Documentation] Test binding forward speed with domain filter and multiple passrates.
91 FOR ${num} IN RANGE 16 20
92 ${passrate} Evaluate 100.0/(2**(${num} - 16))
93 ${exported_bindings} Evaluate math.ceil( ${EXPORT_AMOUNT}*${passrate}/100 ) modules=math
94 ${exported_bindings} Convert To String ${exported_bindings}
95 Run Keyword And Ignore Error Setup Domain Filter ${num} ${DOMAIN_1}
96 ${export_speed} Forwarding Export ${exported_bindings} ${TEST_SAMPLES} ${DOMAIN_1}
97 Log Outbound Export speed ${export_speed} with passrate ${passrate}%.
98 Should Be True ${export_speed} > ${MINIMAL_SPEED}
101 Binding Combined Filter Export Test
102 [Documentation] Test binding export speed with domain filter, Outbound filter and multiple passrates.
103 Add Bindings Range 112 84213760 ${EXPORT_AMOUNT}
104 FOR ${num} IN RANGE 16 20
105 ${passrate} Evaluate 100.0/(2**(${num} - 16))
106 ${exported_bindings} Evaluate math.ceil( ${EXPORT_AMOUNT}*${passrate}/100 ) modules=math
107 ${exported_bindings} Convert To String ${exported_bindings}
108 Run Keyword And Ignore Error Setup Domain Filter ${num} ${DOMAIN_1}
109 Setup Filter ${num} outbound
110 ${export_speed} Simple Export ${exported_bindings} ${TEST_SAMPLES} ${DOMAIN_1}
111 Log Outbound Export speed ${export_speed} with passrate ${passrate}%.
112 Should Be True ${export_speed} > ${MINIMAL_SPEED}
115 Binding Combined Filter Forwarding Export Test
116 [Documentation] Test binding forward speed with domain filter, Inbound-discarding filter and multiple passrates.
117 FOR ${num} IN RANGE 16 20
118 ${passrate} Evaluate 100.0/(2**(${num} - 16))
119 ${exported_bindings} Evaluate math.ceil( ${EXPORT_AMOUNT}*${passrate}/100 ) modules=math
120 ${exported_bindings} Convert To String ${exported_bindings}
121 Run Keyword And Ignore Error Setup Domain Filter ${num} ${DOMAIN_1}
122 Setup Filter ${num} inbound-discarding
123 ${export_speed} Forwarding Export ${exported_bindings} ${TEST_SAMPLES} ${DOMAIN_1}
124 Log Outbound Export speed ${export_speed} with passrate ${passrate}%.
125 Should Be True ${export_speed} > ${MINIMAL_SPEED}
130 Setup Binding Export Topology
131 [Documentation] Adds connections to local and remote nodes and wait until they are connected
132 [Arguments] ${version}=version4 ${PASSWORD}=${EMPTY} ${destination_nodes}=3 ${destination_domain}=global
133 Setup Simple Binding Export Topology
136 ... ${destination_nodes}
138 ... ${destination_domain}
139 FOR ${num} IN RANGE 0 ${destination_nodes}
140 ${DESTINATION_NODE} Get Ip From Number And Ip ${num} ${DESTINATION_IP}
141 ExportLibrary.Add Connection ${version} listener 127.0.0.1 64999 ${PASSWORD}
142 ... ${DESTINATION_NODE}
143 Wait Until Keyword Succeeds 15 1 Verify Connection ${version} speaker
144 ... ${DESTINATION_NODE} 64999 domain=${destination_domain}
147 Setup Simple Binding Export Topology
148 [Documentation] Adds connections to local and remote nodes and wait until they are connected
149 [Arguments] ${version}=version4 ${PASSWORD}=${EMPTY} ${destination_nodes}=3 ${source_nodes}=1 ${destination_domain}=global
150 FOR ${num} IN RANGE 0 ${source_nodes}
151 ${SOURCE_NODE} Get Ip From Number And Ip ${num} ${SOURCE_IP}
152 ExportLibrary.Add Node ${SOURCE_NODE} ${version} 64999 ${PASSWORD}
153 ExportLibrary.Add Connection ${version} speaker 127.0.0.1 64999 ${PASSWORD}
156 FOR ${num} IN RANGE 0 ${destination_nodes}
157 ${DESTINATION_NODE} Get Ip From Number And Ip ${num} ${DESTINATION_IP}
158 ExportLibrary.Add Destination Node ${DESTINATION_NODE} ${version} 64999 ${PASSWORD}
159 Add Connection ${version} speaker ${DESTINATION_NODE} 64999 password=${PASSWORD}
160 ... domain=${destination_domain}
162 ExportLibrary.Start Nodes
163 FOR ${num} IN RANGE 0 ${source_nodes}
164 ${SOURCE_NODE} Get Ip From Number And Ip ${num} ${SOURCE_IP}
165 Add Connection ${version} listener ${SOURCE_NODE} 64999 password=${PASSWORD}
166 Wait Until Keyword Succeeds 60 2 Verify Connection ${version} listener
167 ... ${SOURCE_NODE} 64999
171 [Documentation] Starts SXP nodes and checks if bindings are already exported, this is repeated N times
172 [Arguments] ${check_amount} ${samples}=10 ${destination_domain}=global
174 FOR ${num} IN RANGE 0 ${samples}
175 Setup Simple Binding Export Topology destination_domain=${destination_domain}
176 ExportLibrary.Set Export Amount ${check_amount}
177 ExportLibrary.Initiate Simple Export 127.0.0.1
178 ${ELEMENT} Wait Until Keyword Succeeds 120 1 Check Bindings Exported
179 Append To List ${ITEMS} ${ELEMENT}
183 ${export_speed} Get Average Of Items ${ITEMS}
184 RETURN ${export_speed}
187 [Documentation] Starts SXP nodes and checks if bindings are already forwarded, this is repeated N times
188 [Arguments] ${check_amount} ${samples}=10 ${destination_domain}=global
190 FOR ${num} IN RANGE 0 ${samples}
191 Setup Binding Export Topology destination_domain=${destination_domain}
192 ExportLibrary.Set Export Amount ${check_amount}
193 ExportLibrary.Initiate Export 132.5.0.0/16 112
194 ${ELEMENT} Wait Until Keyword Succeeds 360 1 Check Bindings Exported
195 Append To List ${ITEMS} ${ELEMENT}
199 ${export_speed} Get Average Of Items ${ITEMS}
200 RETURN ${export_speed}
202 Check Bindings Exported
203 [Documentation] Checking if bindings were exported and return export speed
204 ${all_exported} ExportLibrary.All Exported
205 Should Be True ${all_exported}
206 ${bindings_exported} ExportLibrary.Get Bindings Exchange Count
207 Log ${bindings_exported}
208 ${export_time} ExportLibrary.Get Export Time
210 ${export_speed} Evaluate ${bindings_exported}/${export_time}
212 RETURN ${export_speed}
215 [Documentation] Creates peer-group and its filter with specific matching.
216 [Arguments] ${bits} ${type}
217 Add PeerGroup GROUP ${EMPTY}
218 ${entry} Get Filter Entry 10 permit pl=132.5.0.0/${bits}
219 Add Filter GROUP ${type} ${entry}
222 [Documentation] Creates domain and its filter with specific matching.
223 [Arguments] ${bits} ${domain}
225 ${domains} Add Domains ${domain}
226 ${entry} Get Filter Entry 10 permit pl=132.5.0.0/${bits}
227 Add Domain Filter ${DOMAIN_0} ${domains} ${entry}
230 ExportLibrary.Clean Library
232 Clean Connections domain=${DOMAIN_1}
235 Clean Custom SXP Environment
236 [Documentation] Cleans test resources
238 Clean SXP Environment