Migrate BgpOperations.robot
[integration/test.git] / csit / libraries / CompareStream.robot
1 *** Settings ***
2 Documentation       This Resource contains list of Keywords Set_Variable_If_At_Least*, Set_Variable_If_At_Most,
3 ...                 Run_Keyword_If_At_Least*, Run_Keyword_If_At_Most*,
4 ...                 Run_Keyword_If_More_Than*, Run_Keyword_If_Less_Than*,
5 ...                 for comparison ${ODL_STREAM} to the given ${lower_bound},
6 ...                 in order to replace ad-hoc conditional execution in suites.
7
8 Library             Collections
9 Library             String
10
11
12 *** Variables ***
13 &{Stream_dict}
14 ...                 neon=${10}
15 ...                 sodium=${11}
16 ...                 magnesium=${12}
17 ...                 aluminium=${13}
18 ...                 silicon=${14}
19 ...                 phosphorus=${15}
20 ...                 sulfur=${16}
21 ...                 chlorine=${17}
22 ...                 argon=${18}
23 ...                 potassium=${19}
24 ...                 calcium=${20}
25 ...                 master=${999}
26
27
28 *** Keywords ***
29 Set_Variable_If_At_Least
30     [Documentation]    Compare ${lower_bound} to ${ODL_STREAM} and return ${value_if_true} if ${ODL_STREAM} is at least ${lower_bound},
31     ...    return ${value_if_false} otherwise.
32     [Arguments]    ${lower_bound}    ${value_if_true}    ${value_if_false}
33     BuiltIn.Run_Keyword_And_Return
34     ...    BuiltIn.Set_Variable_If
35     ...    ${Stream_dict}[${ODL_STREAM}] >= ${Stream_dict}[${lower_bound}]
36     ...    ${value_if_true}
37     ...    ${value_if_false}
38
39 Set_Variable_If_At_Most
40     [Documentation]    Compare ${upper_bound} to ${ODL_STREAM} and return ${value_if_true} if ${ODL_STREAM} is at most ${upper_bound},
41     ...    return ${value_if_false} otherwise.
42     [Arguments]    ${upper_bound}    ${value_if_true}    ${value_if_false}
43     BuiltIn.Run_Keyword_And_Return
44     ...    BuiltIn.Set_Variable_If
45     ...    ${Stream_dict}[${ODL_STREAM}] <= ${Stream_dict}[${upper_bound}]
46     ...    ${value_if_true}
47     ...    ${value_if_false}
48
49 Set_Variable_If_At_Least_Sodium
50     [Documentation]    Compare sodium to ${ODL_STREAM} and return ${value_if_true} if ${ODL_STREAM} is at least sodium,
51     ...    return ${value_if_false} otherwise.
52     [Arguments]    ${value_if_true}    ${value_if_false}
53     BuiltIn.Run_Keyword_And_Return    Set_Variable_If_At_Least    sodium    ${value_if_true}    ${value_if_false}
54
55 Set_Variable_If_At_Least_Magnesium
56     [Documentation]    Compare magnesium to ${ODL_STREAM} and return ${value_if_true} if ${ODL_STREAM} is at least magnesium, return ${value_if_false} otherwise.
57     [Arguments]    ${value_if_true}    ${value_if_false}
58     BuiltIn.Run_Keyword_And_Return    Set_Variable_If_At_Least    magnesium    ${value_if_true}    ${value_if_false}
59
60 Set_Variable_If_At_Least_Aluminium
61     [Documentation]    Compare aluminium to ${ODL_STREAM} and return ${value_if_true} if ${ODL_STREAM} is at least aluminium, return ${value_if_false} otherwise.
62     [Arguments]    ${value_if_true}    ${value_if_false}
63     BuiltIn.Run_Keyword_And_Return    Set_Variable_If_At_Least    aluminium    ${value_if_true}    ${value_if_false}
64
65 Set_Variable_If_At_Least_Silicon
66     [Documentation]    Compare silicon to ${ODL_STREAM} and return ${value_if_true} if ${ODL_STREAM} is at least silicon, return ${value_if_false} otherwise.
67     [Arguments]    ${value_if_true}    ${value_if_false}
68     BuiltIn.Run_Keyword_And_Return    Set_Variable_If_At_Least    silicon    ${value_if_true}    ${value_if_false}
69
70 Set_Variable_If_At_Least_Phosphorus
71     [Documentation]    Compare phosphorus to ${ODL_STREAM} and return ${value_if_true} if ${ODL_STREAM} is at least phosphorus, return ${value_if_false} otherwise.
72     [Arguments]    ${value_if_true}    ${value_if_false}
73     BuiltIn.Run_Keyword_And_Return    Set_Variable_If_At_Least    phosphorus    ${value_if_true}    ${value_if_false}
74
75 Set_Variable_If_At_Least_Sulfur
76     [Documentation]    Compare sulfur to ${ODL_STREAM} and return ${value_if_true} if ${ODL_STREAM} is at least sulfur, return ${value_if_false} otherwise.
77     [Arguments]    ${value_if_true}    ${value_if_false}
78     BuiltIn.Run_Keyword_And_Return    Set_Variable_If_At_Least    sulfur    ${value_if_true}    ${value_if_false}
79
80 Set_Variable_If_At_Least_Chlorine
81     [Documentation]    Compare chlorine to ${ODL_STREAM} and return ${value_if_true} if ${ODL_STREAM} is at least chlorine, return ${value_if_false} otherwise.
82     [Arguments]    ${value_if_true}    ${value_if_false}
83     BuiltIn.Run_Keyword_And_Return    Set_Variable_If_At_Least    chlorine    ${value_if_true}    ${value_if_false}
84
85 Set_Variable_If_At_Least_Argon
86     [Documentation]    Compare argon to ${ODL_STREAM} and return ${value_if_true} if ${ODL_STREAM} is at least argon, return ${value_if_false} otherwise.
87     [Arguments]    ${value_if_true}    ${value_if_false}
88     BuiltIn.Run_Keyword_And_Return    Set_Variable_If_At_Least    argon    ${value_if_true}    ${value_if_false}
89
90 Set_Variable_If_At_Least_Potassium
91     [Documentation]    Compare potassium to ${ODL_STREAM} and return ${value_if_true} if ${ODL_STREAM} is at least potassium, return ${value_if_false} otherwise.
92     [Arguments]    ${value_if_true}    ${value_if_false}
93     BuiltIn.Run_Keyword_And_Return    Set_Variable_If_At_Least    potassium    ${value_if_true}    ${value_if_false}
94
95 Set_Variable_If_At_Least_Calcium
96     [Documentation]    Compare calcium to ${ODL_STREAM} and return ${value_if_true} if ${ODL_STREAM} is at least calcium, return ${value_if_false} otherwise.
97     [Arguments]    ${value_if_true}    ${value_if_false}
98     BuiltIn.Run_Keyword_And_Return    Set_Variable_If_At_Least    calcium    ${value_if_true}    ${value_if_false}
99
100 Set_Variable_If_At_Most_Neon
101     [Documentation]    Compare neon to ${ODL_STREAM} and return ${value_if_true} if ${ODL_STREAM} is at most neon,
102     ...    return ${value_if_false} otherwise.
103     [Arguments]    ${value_if_true}    ${value_if_false}
104     BuiltIn.Run_Keyword_And_Return    Set_Variable_If_At_Most    neon    ${value_if_true}    ${value_if_false}
105
106 Set_Variable_If_At_Most_Sodium
107     [Documentation]    Compare sodium to ${ODL_STREAM} and return ${value_if_true} if ${ODL_STREAM} is at most sodium,
108     ...    return ${value_if_false} otherwise.
109     [Arguments]    ${value_if_true}    ${value_if_false}
110     BuiltIn.Run_Keyword_And_Return    Set_Variable_If_At_Most    sodium    ${value_if_true}    ${value_if_false}
111
112 Set_Variable_If_At_Most_Magnesium
113     [Documentation]    Compare magnesium to ${ODL_STREAM} and return ${value_if_true} if ${ODL_STREAM} is at most magnesium,
114     ...    return ${value_if_false} otherwise.
115     [Arguments]    ${value_if_true}    ${value_if_false}
116     BuiltIn.Run_Keyword_And_Return    Set_Variable_If_At_Most    magnesium    ${value_if_true}    ${value_if_false}
117
118 Set_Variable_If_At_Most_Aluminium
119     [Documentation]    Compare aluminium to ${ODL_STREAM} and return ${value_if_true} if ${ODL_STREAM} is at most aluminium,
120     ...    return ${value_if_false} otherwise.
121     [Arguments]    ${value_if_true}    ${value_if_false}
122     BuiltIn.Run_Keyword_And_Return    Set_Variable_If_At_Most    aluminium    ${value_if_true}    ${value_if_false}
123
124 Set_Variable_If_At_Most_Silicon
125     [Documentation]    Compare silicon to ${ODL_STREAM} and return ${value_if_true} if ${ODL_STREAM} is at most silicon,
126     ...    return ${value_if_false} otherwise.
127     [Arguments]    ${value_if_true}    ${value_if_false}
128     BuiltIn.Run_Keyword_And_Return    Set_Variable_If_At_Most    silicon    ${value_if_true}    ${value_if_false}
129
130 Set_Variable_If_At_Most_Phosphorus
131     [Documentation]    Compare phosphorus to ${ODL_STREAM} and return ${value_if_true} if ${ODL_STREAM} is at most phosphorus,
132     ...    return ${value_if_false} otherwise.
133     [Arguments]    ${value_if_true}    ${value_if_false}
134     BuiltIn.Run_Keyword_And_Return    Set_Variable_If_At_Most    phosphorus    ${value_if_true}    ${value_if_false}
135
136 Set_Variable_If_At_Most_Sulfur
137     [Documentation]    Compare sulfur to ${ODL_STREAM} and return ${value_if_true} if ${ODL_STREAM} is at most sulfur,
138     ...    return ${value_if_false} otherwise.
139     [Arguments]    ${value_if_true}    ${value_if_false}
140     BuiltIn.Run_Keyword_And_Return    Set_Variable_If_At_Most    sulfur    ${value_if_true}    ${value_if_false}
141
142 Set_Variable_If_At_Most_Chlorine
143     [Documentation]    Compare chlorine to ${ODL_STREAM} and return ${value_if_true} if ${ODL_STREAM} is at most chlorine,
144     ...    return ${value_if_false} otherwise.
145     [Arguments]    ${value_if_true}    ${value_if_false}
146     BuiltIn.Run_Keyword_And_Return    Set_Variable_If_At_Most    chlorine    ${value_if_true}    ${value_if_false}
147
148 Set_Variable_If_At_Most_Argon
149     [Documentation]    Compare argon to ${ODL_STREAM} and return ${value_if_true} if ${ODL_STREAM} is at most argon,
150     ...    return ${value_if_false} otherwise.
151     [Arguments]    ${value_if_true}    ${value_if_false}
152     BuiltIn.Run_Keyword_And_Return    Set_Variable_If_At_Most    argon    ${value_if_true}    ${value_if_false}
153
154 Set_Variable_If_At_Most_Potassium
155     [Documentation]    Compare potassium to ${ODL_STREAM} and return ${value_if_true} if ${ODL_STREAM} is at most potassium,
156     ...    return ${value_if_false} otherwise.
157     [Arguments]    ${value_if_true}    ${value_if_false}
158     BuiltIn.Run_Keyword_And_Return    Set_Variable_If_At_Most    potassium    ${value_if_true}    ${value_if_false}
159
160 Set_Variable_If_At_Most_Calcium
161     [Documentation]    Compare calcium to ${ODL_STREAM} and return ${value_if_true} if ${ODL_STREAM} is at most calcium,
162     ...    return ${value_if_false} otherwise.
163     [Arguments]    ${value_if_true}    ${value_if_false}
164     BuiltIn.Run_Keyword_And_Return    Set_Variable_If_At_Most    calcium    ${value_if_true}    ${value_if_false}
165
166 CompareStream__Convert_Input
167     [Documentation]    Splits arguments into args and kwargs is used in Run_Keyword_If_At_Least_Else and Run_Keyword_If_At_Most_Else.
168     ...    The problem is, when the string contains =, but it is not a named argument (name=value). There can be many values containing =, but
169     ...    for sure it is present in xmls. If the string starts with "<" it will be treated as it is xml and splitting for
170     ...    name and value will not be executed.
171     ...    If named argument is passed into this kw, only string data are supported e.g. name=string. Complex variables such as lists or dictionaries
172     ...    are not supported.
173     [Arguments]    @{arguments}
174     ${args}    BuiltIn.Create_List
175     ${kwargs}    BuiltIn.Create_Dictionary
176     FOR    ${arg}    IN    @{arguments}
177         ${arg}    BuiltIn.Convert_To_String    ${arg}
178         ${removed}    String.Remove_String    ${arg}    \n    ${Space}    \t
179         ...    \r
180         IF    "${removed[0]}" == "<"
181             ${splitted}    BuiltIn.Create List    ${arg}
182         ELSE
183             ${splitted}    String.Split_String    ${arg}    separator==    max_split=1
184         END
185         ${len}    BuiltIn.Get_Length    ${splitted}
186         IF    ${len}==1
187             Collections.Append_To_List    ${args}    ${splitted}[0]
188         ELSE
189             Collections.Set_To_Dictionary    ${kwargs}    @{splitted}
190         END
191     END
192     RETURN    ${args}    ${kwargs}
193
194 Run_Keyword_If_At_Least
195     [Documentation]    Compare ${lower_bound} to ${ODL_STREAM} and in case ${ODL_STREAM} is at least ${lower_bound},
196     ...    run ${kw_name} @{varargs} &{kwargs} and return its value.
197     [Arguments]    ${lower_bound}    ${kw_name}    @{varargs}    &{kwargs}
198     BuiltIn.Run_Keyword_And_Return_If
199     ...    ${Stream_dict}[${ODL_STREAM}] >= ${Stream_dict}[${lower_bound}]
200     ...    ${kw_name}
201     ...    @{varargs}
202     ...    &{kwargs}
203
204 Run_Keyword_If_At_Least_Else
205     [Documentation]    Compare ${lower_bound} to ${ODL_STREAM} and in case ${ODL_STREAM} is at least ${lower_bound},
206     ...    run keyword defined before ELSE statement otherwise run keyword defined after ELSE statement and return its value.
207     [Arguments]    ${lower_bound}    @{varargs}
208     ${position}    Collections.Get_Index_From_List    ${varargs}    \ELSE
209     IF    "${position}" == "-1"
210         BuiltIn.Fail    Missing else statement in defined expresion
211     END
212     ${varargs_if}    Collections.Get_Slice_From_List    ${varargs}    0    ${position}
213     ${varargs_else}    Collections.Get_Slice_From_List    ${varargs}    ${position+1}
214     ${args_if}    ${kwargs_if}    CompareStream__Convert_Input    @{varargs_if}
215     ${args_else}    ${kwargs_else}    CompareStream__Convert_Input    @{varargs_else}
216     IF    ${Stream_dict}[${ODL_STREAM}] >= ${Stream_dict}[${lower_bound}]
217         ${resp}    BuiltIn.Run_Keyword    @{args_if}    &{kwargs_if}
218     ELSE
219         ${resp}    BuiltIn.Run_Keyword    @{args_else}    &{kwargs_else}
220     END
221     RETURN    ${resp}
222
223 Run_Keyword_If_At_Most
224     [Documentation]    Compare ${upper_bound} to ${ODL_STREAM} and in case ${ODL_STREAM} is at most ${upper_bound},
225     ...    run ${kw_name} @{varargs} &{kwargs} and return its value.
226     [Arguments]    ${upper_bound}    ${kw_name}    @{varargs}    &{kwargs}
227     BuiltIn.Run_Keyword_And_Return_If
228     ...    ${Stream_dict}[${ODL_STREAM}] <= ${Stream_dict}[${upper_bound}]
229     ...    ${kw_name}
230     ...    @{varargs}
231     ...    &{kwargs}
232
233 Run_Keyword_If_At_Most_Else
234     [Documentation]    Compare ${upper_bound} to ${ODL_STREAM} and in case ${ODL_STREAM} is at most ${upper_bound},
235     ...    run keyword defined before ELSE statement otherwise run keyword defined after ELSE statement and return its value.
236     [Arguments]    ${upper_bound}    @{varargs}
237     ${position}    Collections.Get_Index_From_List    ${varargs}    \ELSE
238     IF    "${position}" == "-1"
239         BuiltIn.Fail    Missing else statement in defined expresion
240     END
241     ${varargs_if}    Collections.Get_Slice_From_List    ${varargs}    0    ${position}
242     ${varargs_else}    Collections.Get_Slice_From_List    ${varargs}    ${position+1}
243     ${args_if}    ${kwargs_if}    CompareStream__Convert_Input    @{varargs_if}
244     ${args_else}    ${kwargs_else}    CompareStream__Convert_Input    @{varargs_else}
245     IF    ${Stream_dict}[${ODL_STREAM}] <= ${Stream_dict}[${upper_bound}]
246         ${resp}    BuiltIn.Run_Keyword    @{args_if}    &{kwargs_if}
247     ELSE
248         ${resp}    BuiltIn.Run_Keyword    @{args_else}    &{kwargs_else}
249     END
250     RETURN    ${resp}
251
252 Run_Keyword_If_More_Than
253     [Documentation]    Compare ${lower_bound} to ${ODL_STREAM} and in case ${ODL_STREAM} is more than ${lower_bound},
254     ...    run ${kw_name} @{varargs} &{kwargs} and return its value.
255     [Arguments]    ${lower_bound}    ${kw_name}    @{varargs}    &{kwargs}
256     BuiltIn.Run_Keyword_And_Return_If
257     ...    ${Stream_dict}[${ODL_STREAM}] > ${Stream_dict}[${lower_bound}]
258     ...    ${kw_name}
259     ...    @{varargs}
260     ...    &{kwargs}
261
262 Run_Keyword_If_Equals
263     [Documentation]    Compare ${stream} to ${ODL_STREAM} and in case ${ODL_STREAM} equals ${stream},
264     ...    run ${kw_name} @{varargs} &{kwargs} and return its value.
265     [Arguments]    ${stream}    ${kw_name}    @{varargs}    &{kwargs}
266     BuiltIn.Run_Keyword_And_Return_If
267     ...    ${Stream_dict}[${ODL_STREAM}] == ${Stream_dict}[${stream}]
268     ...    ${kw_name}
269     ...    @{varargs}
270     ...    &{kwargs}
271
272 Run_Keyword_If_Equals_Else
273     [Documentation]    Compare ${stream} to ${ODL_STREAM} and in case ${ODL_STREAM} equals ${stream},
274     ...    run keyword defined before ELSE statement otherwise run keyword defined after ELSE statement and return its value.
275     [Arguments]    ${stream}    @{varargs}
276     ${position}    Collections.Get_Index_From_List    ${varargs}    \ELSE
277     IF    "${position}" == "-1"
278         BuiltIn.Fail    Missing else statement in defined expresion
279     END
280     ${varargs_if}    Collections.Get_Slice_From_List    ${varargs}    0    ${position}
281     ${varargs_else}    Collections.Get_Slice_From_List    ${varargs}    ${position+1}
282     ${args_if}    ${kwargs_if}    CompareStream__Convert_Input    @{varargs_if}
283     ${args_else}    ${kwargs_else}    CompareStream__Convert_Input    @{varargs_else}
284     IF    ${Stream_dict}[${ODL_STREAM}] == ${Stream_dict}[${stream}]
285         ${resp}    BuiltIn.Run_Keyword    @{args_if}    &{kwargs_if}
286     ELSE
287         ${resp}    BuiltIn.Run_Keyword    @{args_else}    &{kwargs_else}
288     END
289     RETURN    ${resp}
290
291 Run_Keyword_If_Less_Than
292     [Documentation]    Compare ${lower_bound} to ${ODL_STREAM} and in case ${ODL_STREAM} is less than ${lower_bound},
293     ...    run ${kw_name} @{varargs} &{kwargs} and return its value.
294     [Arguments]    ${lower_bound}    ${kw_name}    @{varargs}    &{kwargs}
295     BuiltIn.Run_Keyword_And_Return_If
296     ...    ${Stream_dict}[${ODL_STREAM}] < ${Stream_dict}[${lower_bound}]
297     ...    ${kw_name}
298     ...    @{varargs}
299     ...    &{kwargs}
300
301 Run_Keyword_If_At_Least_Sodium
302     [Documentation]    Compare sodium to ${ODL_STREAM} and in case ${ODL_STREAM} is at least sodium,
303     ...    run ${kw_name} @{varargs} &{kwargs} and return its value.
304     [Arguments]    ${kw_name}    @{varargs}    &{kwargs}
305     BuiltIn.Run_Keyword_And_Return    Run_Keyword_If_At_Least    sodium    ${kw_name}    @{varargs}    &{kwargs}
306
307 Run_Keyword_If_At_Least_Magnesium
308     [Documentation]    Compare magnesium to ${ODL_STREAM} and in case ${ODL_STREAM} is at least magnesium,
309     ...    run ${kw_name} @{varargs} &{kwargs} and return its value.
310     [Arguments]    ${kw_name}    @{varargs}    &{kwargs}
311     BuiltIn.Run_Keyword_And_Return    Run_Keyword_If_At_Least    magnesium    ${kw_name}    @{varargs}    &{kwargs}
312
313 Run_Keyword_If_At_Least_Aluminium
314     [Documentation]    Compare aluminium to ${ODL_STREAM} and in case ${ODL_STREAM} is at least aluminium,
315     ...    run ${kw_name} @{varargs} &{kwargs} and return its value.
316     [Arguments]    ${kw_name}    @{varargs}    &{kwargs}
317     BuiltIn.Run_Keyword_And_Return    Run_Keyword_If_At_Least    aluminium    ${kw_name}    @{varargs}    &{kwargs}
318
319 Run_Keyword_If_At_Least_Silicon
320     [Documentation]    Compare silicon to ${ODL_STREAM} and in case ${ODL_STREAM} is at least silicon,
321     ...    run ${kw_name} @{varargs} &{kwargs} and return its value.
322     [Arguments]    ${kw_name}    @{varargs}    &{kwargs}
323     BuiltIn.Run_Keyword_And_Return    Run_Keyword_If_At_Least    silicon    ${kw_name}    @{varargs}    &{kwargs}
324
325 Run_Keyword_If_At_Least_Phosphorus
326     [Documentation]    Compare phosphorus to ${ODL_STREAM} and in case ${ODL_STREAM} is at least phosphorus,
327     ...    run ${kw_name} @{varargs} &{kwargs} and return its value.
328     [Arguments]    ${kw_name}    @{varargs}    &{kwargs}
329     BuiltIn.Run_Keyword_And_Return    Run_Keyword_If_At_Least    phosphorus    ${kw_name}    @{varargs}    &{kwargs}
330
331 Run_Keyword_If_At_Least_Sulfur
332     [Documentation]    Compare sulfur to ${ODL_STREAM} and in case ${ODL_STREAM} is at least sulfur,
333     ...    run ${kw_name} @{varargs} &{kwargs} and return its value.
334     [Arguments]    ${kw_name}    @{varargs}    &{kwargs}
335     BuiltIn.Run_Keyword_And_Return    Run_Keyword_If_At_Least    sulfur    ${kw_name}    @{varargs}    &{kwargs}
336
337 Run_Keyword_If_At_Least_Chlorine
338     [Documentation]    Compare chlorine to ${ODL_STREAM} and in case ${ODL_STREAM} is at least chlorine,
339     ...    run ${kw_name} @{varargs} &{kwargs} and return its value.
340     [Arguments]    ${kw_name}    @{varargs}    &{kwargs}
341     BuiltIn.Run_Keyword_And_Return    Run_Keyword_If_At_Least    chlorine    ${kw_name}    @{varargs}    &{kwargs}
342
343 Run_Keyword_If_At_Least_Argon
344     [Documentation]    Compare argon to ${ODL_STREAM} and in case ${ODL_STREAM} is at least argon,
345     ...    run ${kw_name} @{varargs} &{kwargs} and return its value.
346     [Arguments]    ${kw_name}    @{varargs}    &{kwargs}
347     BuiltIn.Run_Keyword_And_Return    Run_Keyword_If_At_Least    argon    ${kw_name}    @{varargs}    &{kwargs}
348
349 Run_Keyword_If_At_Least_Potassium
350     [Documentation]    Compare potassium to ${ODL_STREAM} and in case ${ODL_STREAM} is at least potassium,
351     ...    run ${kw_name} @{varargs} &{kwargs} and return its value.
352     [Arguments]    ${kw_name}    @{varargs}    &{kwargs}
353     BuiltIn.Run_Keyword_And_Return    Run_Keyword_If_At_Least    potassium    ${kw_name}    @{varargs}    &{kwargs}
354
355 Run_Keyword_If_At_Least_Calcium
356     [Documentation]    Compare calcium to ${ODL_STREAM} and in case ${ODL_STREAM} is at least calcium,
357     ...    run ${kw_name} @{varargs} &{kwargs} and return its value.
358     [Arguments]    ${kw_name}    @{varargs}    &{kwargs}
359     BuiltIn.Run_Keyword_And_Return    Run_Keyword_If_At_Least    calcium    ${kw_name}    @{varargs}    &{kwargs}
360
361 Run_Keyword_If_At_Most_Neon
362     [Documentation]    Compare neon to ${ODL_STREAM} and in case ${ODL_STREAM} is at most neon,
363     ...    run ${kw_name} @{varargs} &{kwargs} and return its value.
364     [Arguments]    ${kw_name}    @{varargs}    &{kwargs}
365     BuiltIn.Run_Keyword_And_Return    Run_Keyword_If_At_Most    neon    ${kw_name}    @{varargs}    &{kwargs}
366
367 Run_Keyword_If_At_Most_Sodium
368     [Documentation]    Compare sodium to ${ODL_STREAM} and in case ${ODL_STREAM} is at most sodium,
369     ...    run ${kw_name} @{varargs} &{kwargs} and return its value.
370     [Arguments]    ${kw_name}    @{varargs}    &{kwargs}
371     BuiltIn.Run_Keyword_And_Return    Run_Keyword_If_At_Most    sodium    ${kw_name}    @{varargs}    &{kwargs}
372
373 Run_Keyword_If_At_Most_Magnesium
374     [Documentation]    Compare magnesium to ${ODL_STREAM} and in case ${ODL_STREAM} is at most magnesium,
375     ...    run ${kw_name} @{varargs} &{kwargs} and return its value.
376     [Arguments]    ${kw_name}    @{varargs}    &{kwargs}
377     BuiltIn.Run_Keyword_And_Return    Run_Keyword_If_At_Most    magnesium    ${kw_name}    @{varargs}    &{kwargs}
378
379 Run_Keyword_If_At_Most_Aluminium
380     [Documentation]    Compare aluminium to ${ODL_STREAM} and in case ${ODL_STREAM} is at most aluminium,
381     ...    run ${kw_name} @{varargs} &{kwargs} and return its value.
382     [Arguments]    ${kw_name}    @{varargs}    &{kwargs}
383     BuiltIn.Run_Keyword_And_Return    Run_Keyword_If_At_Most    aluminium    ${kw_name}    @{varargs}    &{kwargs}
384
385 Run_Keyword_If_At_Most_Silicon
386     [Documentation]    Compare silicon to ${ODL_STREAM} and in case ${ODL_STREAM} is at most silicon,
387     ...    run ${kw_name} @{varargs} &{kwargs} and return its value.
388     [Arguments]    ${kw_name}    @{varargs}    &{kwargs}
389     BuiltIn.Run_Keyword_And_Return    Run_Keyword_If_At_Most    silicon    ${kw_name}    @{varargs}    &{kwargs}
390
391 Run_Keyword_If_At_Most_Phosphorus
392     [Documentation]    Compare phosphorus to ${ODL_STREAM} and in case ${ODL_STREAM} is at most phosphorus,
393     ...    run ${kw_name} @{varargs} &{kwargs} and return its value.
394     [Arguments]    ${kw_name}    @{varargs}    &{kwargs}
395     BuiltIn.Run_Keyword_And_Return    Run_Keyword_If_At_Most    phosphorus    ${kw_name}    @{varargs}    &{kwargs}
396
397 Run_Keyword_If_At_Most_Sulfur
398     [Documentation]    Compare sulfur to ${ODL_STREAM} and in case ${ODL_STREAM} is at most sulfur,
399     ...    run ${kw_name} @{varargs} &{kwargs} and return its value.
400     [Arguments]    ${kw_name}    @{varargs}    &{kwargs}
401     BuiltIn.Run_Keyword_And_Return    Run_Keyword_If_At_Most    sulfur    ${kw_name}    @{varargs}    &{kwargs}
402
403 Run_Keyword_If_At_Most_Chlorine
404     [Documentation]    Compare chlorine to ${ODL_STREAM} and in case ${ODL_STREAM} is at most chlorine,
405     ...    run ${kw_name} @{varargs} &{kwargs} and return its value.
406     [Arguments]    ${kw_name}    @{varargs}    &{kwargs}
407     BuiltIn.Run_Keyword_And_Return    Run_Keyword_If_At_Most    chlorine    ${kw_name}    @{varargs}    &{kwargs}
408
409 Run_Keyword_If_At_Most_Argon
410     [Documentation]    Compare argon to ${ODL_STREAM} and in case ${ODL_STREAM} is at most argon,
411     ...    run ${kw_name} @{varargs} &{kwargs} and return its value.
412     [Arguments]    ${kw_name}    @{varargs}    &{kwargs}
413     BuiltIn.Run_Keyword_And_Return    Run_Keyword_If_At_Most    argon    ${kw_name}    @{varargs}    &{kwargs}
414
415 Run_Keyword_If_At_Most_Potassium
416     [Documentation]    Compare potassium to ${ODL_STREAM} and in case ${ODL_STREAM} is at most potassium,
417     ...    run ${kw_name} @{varargs} &{kwargs} and return its value.
418     [Arguments]    ${kw_name}    @{varargs}    &{kwargs}
419     BuiltIn.Run_Keyword_And_Return    Run_Keyword_If_At_Most    potassium    ${kw_name}    @{varargs}    &{kwargs}
420
421 Run_Keyword_If_At_Most_Calcium
422     [Documentation]    Compare calcium to ${ODL_STREAM} and in case ${ODL_STREAM} is at most calcium,
423     ...    run ${kw_name} @{varargs} &{kwargs} and return its value.
424     [Arguments]    ${kw_name}    @{varargs}    &{kwargs}
425     BuiltIn.Run_Keyword_And_Return    Run_Keyword_If_At_Most    calcium    ${kw_name}    @{varargs}    &{kwargs}
426
427 Run_Keyword_If_More_Than_Neon
428     [Documentation]    Compare neon to ${ODL_STREAM} and in case ${ODL_STREAM} is more than neon,
429     ...    run ${kw_name} @{varargs} &{kwargs} and return its value.
430     [Arguments]    ${kw_name}    @{varargs}    &{kwargs}
431     BuiltIn.Run_Keyword_And_Return    Run_Keyword_If_More_Than    neon    ${kw_name}    @{varargs}    &{kwargs}
432
433 Run_Keyword_If_More_Than_Sodium
434     [Documentation]    Compare sodium to ${ODL_STREAM} and in case ${ODL_STREAM} is more than sodium,
435     ...    run ${kw_name} @{varargs} &{kwargs} and return its value.
436     [Arguments]    ${kw_name}    @{varargs}    &{kwargs}
437     BuiltIn.Run_Keyword_And_Return    Run_Keyword_If_More_Than    sodium    ${kw_name}    @{varargs}    &{kwargs}
438
439 Run_Keyword_If_More_Than_Magnesium
440     [Documentation]    Compare magnesium to ${ODL_STREAM} and in case ${ODL_STREAM} is more than magnesium,
441     ...    run ${kw_name} @{varargs} &{kwargs} and return its value.
442     [Arguments]    ${kw_name}    @{varargs}    &{kwargs}
443     BuiltIn.Run_Keyword_And_Return    Run_Keyword_If_More_Than    magnesium    ${kw_name}    @{varargs}    &{kwargs}
444
445 Run_Keyword_If_More_Than_Aluminium
446     [Documentation]    Compare aluminium to ${ODL_STREAM} and in case ${ODL_STREAM} is more than aluminium,
447     ...    run ${kw_name} @{varargs} &{kwargs} and return its value.
448     [Arguments]    ${kw_name}    @{varargs}    &{kwargs}
449     BuiltIn.Run_Keyword_And_Return    Run_Keyword_If_More_Than    aluminium    ${kw_name}    @{varargs}    &{kwargs}
450
451 Run_Keyword_If_More_Than_Silicon
452     [Documentation]    Compare silicon to ${ODL_STREAM} and in case ${ODL_STREAM} is more than silicon,
453     ...    run ${kw_name} @{varargs} &{kwargs} and return its value.
454     [Arguments]    ${kw_name}    @{varargs}    &{kwargs}
455     BuiltIn.Run_Keyword_And_Return    Run_Keyword_If_More_Than    silicon    ${kw_name}    @{varargs}    &{kwargs}
456
457 Run_Keyword_If_More_Than_Phosphorus
458     [Documentation]    Compare phosphorus to ${ODL_STREAM} and in case ${ODL_STREAM} is more than phosphorus,
459     ...    run ${kw_name} @{varargs} &{kwargs} and return its value.
460     [Arguments]    ${kw_name}    @{varargs}    &{kwargs}
461     BuiltIn.Run_Keyword_And_Return    Run_Keyword_If_More_Than    phosphorus    ${kw_name}    @{varargs}    &{kwargs}
462
463 Run_Keyword_If_More_Than_Sulfur
464     [Documentation]    Compare sulfur to ${ODL_STREAM} and in case ${ODL_STREAM} is more than sulfur,
465     ...    run ${kw_name} @{varargs} &{kwargs} and return its value.
466     [Arguments]    ${kw_name}    @{varargs}    &{kwargs}
467     BuiltIn.Run_Keyword_And_Return    Run_Keyword_If_More_Than    sulfur    ${kw_name}    @{varargs}    &{kwargs}
468
469 Run_Keyword_If_More_Than_Chlorine
470     [Documentation]    Compare chlorine to ${ODL_STREAM} and in case ${ODL_STREAM} is more than chlorine,
471     ...    run ${kw_name} @{varargs} &{kwargs} and return its value.
472     [Arguments]    ${kw_name}    @{varargs}    &{kwargs}
473     BuiltIn.Run_Keyword_And_Return    Run_Keyword_If_More_Than    chlorine    ${kw_name}    @{varargs}    &{kwargs}
474
475 Run_Keyword_If_More_Than_Argon
476     [Documentation]    Compare argon to ${ODL_STREAM} and in case ${ODL_STREAM} is more than argon,
477     ...    run ${kw_name} @{varargs} &{kwargs} and return its value.
478     [Arguments]    ${kw_name}    @{varargs}    &{kwargs}
479     BuiltIn.Run_Keyword_And_Return    Run_Keyword_If_More_Than    argon    ${kw_name}    @{varargs}    &{kwargs}
480
481 Run_Keyword_If_More_Than_Potassium
482     [Documentation]    Compare potassium to ${ODL_STREAM} and in case ${ODL_STREAM} is more than potassium,
483     ...    run ${kw_name} @{varargs} &{kwargs} and return its value.
484     [Arguments]    ${kw_name}    @{varargs}    &{kwargs}
485     BuiltIn.Run_Keyword_And_Return    Run_Keyword_If_More_Than    potassium    ${kw_name}    @{varargs}    &{kwargs}
486
487 Run_Keyword_If_More_Than_Calcium
488     [Documentation]    Compare calcium to ${ODL_STREAM} and in case ${ODL_STREAM} is more than calcium,
489     ...    run ${kw_name} @{varargs} &{kwargs} and return its value.
490     [Arguments]    ${kw_name}    @{varargs}    &{kwargs}
491     BuiltIn.Run_Keyword_And_Return    Run_Keyword_If_More_Than    calcium    ${kw_name}    @{varargs}    &{kwargs}
492
493 Run_Keyword_If_Less_Than_Sodium
494     [Documentation]    Compare sodium to ${ODL_STREAM} and in case ${ODL_STREAM} is less than sodium,
495     ...    run ${kw_name} @{varargs} &{kwargs} and return its value.
496     [Arguments]    ${kw_name}    @{varargs}    &{kwargs}
497     BuiltIn.Run_Keyword_And_Return    Run_Keyword_If_Less_Than    sodium    ${kw_name}    @{varargs}    &{kwargs}
498
499 Run_Keyword_If_Less_Than_Magnesium
500     [Documentation]    Compare magnesium to ${ODL_STREAM} and in case ${ODL_STREAM} is less than magnesium,
501     ...    run ${kw_name} @{varargs} &{kwargs} and return its value.
502     [Arguments]    ${kw_name}    @{varargs}    &{kwargs}
503     BuiltIn.Run_Keyword_And_Return    Run_Keyword_If_Less_Than    magnesium    ${kw_name}    @{varargs}    &{kwargs}
504
505 Run_Keyword_If_Less_Than_Aluminium
506     [Documentation]    Compare aluminium to ${ODL_STREAM} and in case ${ODL_STREAM} is less than aluminium,
507     ...    run ${kw_name} @{varargs} &{kwargs} and return its value.
508     [Arguments]    ${kw_name}    @{varargs}    &{kwargs}
509     BuiltIn.Run_Keyword_And_Return    Run_Keyword_If_Less_Than    aluminium    ${kw_name}    @{varargs}    &{kwargs}
510
511 Run_Keyword_If_Less_Than_Silicon
512     [Documentation]    Compare silicon to ${ODL_STREAM} and in case ${ODL_STREAM} is less than silicon,
513     ...    run ${kw_name} @{varargs} &{kwargs} and return its value.
514     [Arguments]    ${kw_name}    @{varargs}    &{kwargs}
515     BuiltIn.Run_Keyword_And_Return    Run_Keyword_If_Less_Than    silicon    ${kw_name}    @{varargs}    &{kwargs}
516
517 Run_Keyword_If_Less_Than_Phosphorus
518     [Documentation]    Compare phosphorus to ${ODL_STREAM} and in case ${ODL_STREAM} is less than phosphorus,
519     ...    run ${kw_name} @{varargs} &{kwargs} and return its value.
520     [Arguments]    ${kw_name}    @{varargs}    &{kwargs}
521     BuiltIn.Run_Keyword_And_Return    Run_Keyword_If_Less_Than    phosphorus    ${kw_name}    @{varargs}    &{kwargs}
522
523 Run_Keyword_If_Less_Than_Sulfur
524     [Documentation]    Compare sulfur to ${ODL_STREAM} and in case ${ODL_STREAM} is less than sulfur,
525     ...    run ${kw_name} @{varargs} &{kwargs} and return its value.
526     [Arguments]    ${kw_name}    @{varargs}    &{kwargs}
527     BuiltIn.Run_Keyword_And_Return    Run_Keyword_If_Less_Than    sulfur    ${kw_name}    @{varargs}    &{kwargs}
528
529 Run_Keyword_If_Less_Than_Chlorine
530     [Documentation]    Compare chlorine to ${ODL_STREAM} and in case ${ODL_STREAM} is less than chlorine,
531     ...    run ${kw_name} @{varargs} &{kwargs} and return its value.
532     [Arguments]    ${kw_name}    @{varargs}    &{kwargs}
533     BuiltIn.Run_Keyword_And_Return    Run_Keyword_If_Less_Than    chlorine    ${kw_name}    @{varargs}    &{kwargs}
534
535 Run_Keyword_If_Less_Than_Argon
536     [Documentation]    Compare argon to ${ODL_STREAM} and in case ${ODL_STREAM} is less than argon,
537     ...    run ${kw_name} @{varargs} &{kwargs} and return its value.
538     [Arguments]    ${kw_name}    @{varargs}    &{kwargs}
539     BuiltIn.Run_Keyword_And_Return    Run_Keyword_If_Less_Than    argon    ${kw_name}    @{varargs}    &{kwargs}
540
541 Run_Keyword_If_Less_Than_Potassium
542     [Documentation]    Compare potassium to ${ODL_STREAM} and in case ${ODL_STREAM} is less than potassium,
543     ...    run ${kw_name} @{varargs} &{kwargs} and return its value.
544     [Arguments]    ${kw_name}    @{varargs}    &{kwargs}
545     BuiltIn.Run_Keyword_And_Return    Run_Keyword_If_Less_Than    potassium    ${kw_name}    @{varargs}    &{kwargs}
546
547 Run_Keyword_If_Less_Than_Calcium
548     [Documentation]    Compare calcium to ${ODL_STREAM} and in case ${ODL_STREAM} is less than calcium,
549     ...    run ${kw_name} @{varargs} &{kwargs} and return its value.
550     [Arguments]    ${kw_name}    @{varargs}    &{kwargs}
551     BuiltIn.Run_Keyword_And_Return    Run_Keyword_If_Less_Than    calcium    ${kw_name}    @{varargs}    &{kwargs}