X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=csit%2Flibraries%2FCompareStream.robot;h=2d1e4f1524631a75227240a66b21c9c9da8a8b20;hb=b074651b4d27d286d8ddbae25c323390730a62d9;hp=fa008ebea26701c1039b31eadc8fc5b7a8927565;hpb=c6c70b009fda995295e032c4070132154e44b038;p=integration%2Ftest.git diff --git a/csit/libraries/CompareStream.robot b/csit/libraries/CompareStream.robot index fa008ebea2..2d1e4f1524 100644 --- a/csit/libraries/CompareStream.robot +++ b/csit/libraries/CompareStream.robot @@ -8,20 +8,20 @@ Library Collections Library String *** Variables *** -&{Stream_dict} carbon=${6} nitrogen=${7} oxygen=${8} fluorine=${9} neon=${10} sodium=${11} magnesium=${12} aluminium=${13} +&{Stream_dict} carbon=${6} nitrogen=${7} oxygen=${8} fluorine=${9} neon=${10} sodium=${11} magnesium=${12} aluminium=${13} silicon=${14} phosphorus=${15} *** Keywords *** Set_Variable_If_At_Least [Arguments] ${lower_bound} ${value_if_true} ${value_if_false} [Documentation] Compare ${lower_bound} to ${ODL_STREAM} and return ${value_if_true} if ${ODL_STREAM} is at least ${lower_bound}, ... return ${value_if_false} otherwise. - BuiltIn.Run_Keyword_And_Return BuiltIn.Set_Variable_If &{Stream_dict}[${ODL_STREAM}] >= &{Stream_dict}[${lower_bound}] ${value_if_true} ${value_if_false} + BuiltIn.Run_Keyword_And_Return BuiltIn.Set_Variable_If ${Stream_dict}[${ODL_STREAM}] >= ${Stream_dict}[${lower_bound}] ${value_if_true} ${value_if_false} Set_Variable_If_At_Most [Arguments] ${upper_bound} ${value_if_true} ${value_if_false} [Documentation] Compare ${upper_bound} to ${ODL_STREAM} and return ${value_if_true} if ${ODL_STREAM} is at most ${upper_bound}, ... return ${value_if_false} otherwise. - BuiltIn.Run_Keyword_And_Return BuiltIn.Set_Variable_If &{Stream_dict}[${ODL_STREAM}] <= &{Stream_dict}[${upper_bound}] ${value_if_true} ${value_if_false} + BuiltIn.Run_Keyword_And_Return BuiltIn.Set_Variable_If ${Stream_dict}[${ODL_STREAM}] <= ${Stream_dict}[${upper_bound}] ${value_if_true} ${value_if_false} Set_Variable_If_At_Least_Carbon [Arguments] ${value_if_true} ${value_if_false} @@ -69,6 +69,11 @@ Set_Variable_If_At_Least_Aluminium [Documentation] Compare aluminium to ${ODL_STREAM} and return ${value_if_true} if ${ODL_STREAM} is atleast aluminium, return ${value_if_false} otherwise. BuiltIn.Run_Keyword_And_Return Set_Variable_If_At_Least aluminium ${value_if_true} ${value_if_false} +Set_Variable_If_At_Least_Silicon + [Arguments] ${value_if_true} ${value_if_false} + [Documentation] Compare silicon to ${ODL_STREAM} and return ${value_if_true} if ${ODL_STREAM} is atleast silicon, return ${value_if_false} otherwise. + BuiltIn.Run_Keyword_And_Return Set_Variable_If_At_Least silicon ${value_if_true} ${value_if_false} + Set_Variable_If_At_Most_Carbon [Arguments] ${value_if_true} ${value_if_false} [Documentation] Compare carbon to ${ODL_STREAM} and return ${value_if_true} if ${ODL_STREAM} is at most carbon, @@ -134,7 +139,7 @@ CompareStream__Convert_Input ${splitted} BuiltIn.Run_Keyword_If "${removed[0]}" == "<" BuiltIn.Create List ${arg} ... ELSE String.Split_String ${arg} separator== max_split=1 ${len} BuiltIn.Get_Length ${splitted} - Run Keyword If ${len}==1 Collections.Append_To_List ${args} @{splitted}[0] + Run Keyword If ${len}==1 Collections.Append_To_List ${args} ${splitted}[0] ... ELSE Collections.Set_To_Dictionary ${kwargs} @{splitted} END BuiltIn.Return_From_Keyword ${args} ${kwargs} @@ -143,7 +148,7 @@ Run_Keyword_If_At_Least [Arguments] ${lower_bound} ${kw_name} @{varargs} &{kwargs} [Documentation] Compare ${lower_bound} to ${ODL_STREAM} and in case ${ODL_STREAM} is at least ${lower_bound}, ... run ${kw_name} @{varargs} &{kwargs} and return its value. - BuiltIn.Run_Keyword_And_Return_If &{Stream_dict}[${ODL_STREAM}] >= &{Stream_dict}[${lower_bound}] ${kw_name} @{varargs} &{kwargs} + BuiltIn.Run_Keyword_And_Return_If ${Stream_dict}[${ODL_STREAM}] >= ${Stream_dict}[${lower_bound}] ${kw_name} @{varargs} &{kwargs} Run_Keyword_If_At_Least_Else [Arguments] ${lower_bound} @{varargs} @@ -155,7 +160,7 @@ Run_Keyword_If_At_Least_Else ${varargs_else} Collections.Get_Slice_From_List ${varargs} ${position+1} ${args_if} ${kwargs_if} CompareStream__Convert_Input @{varargs_if} ${args_else} ${kwargs_else} CompareStream__Convert_Input @{varargs_else} - ${resp} BuiltIn.Run_Keyword_If &{Stream_dict}[${ODL_STREAM}] >= &{Stream_dict}[${lower_bound}] @{args_if} &{kwargs_if} + ${resp} BuiltIn.Run_Keyword_If ${Stream_dict}[${ODL_STREAM}] >= ${Stream_dict}[${lower_bound}] @{args_if} &{kwargs_if} ... ELSE @{args_else} &{kwargs_else} [Return] ${resp} @@ -163,7 +168,7 @@ Run_Keyword_If_At_Most [Arguments] ${upper_bound} ${kw_name} @{varargs} &{kwargs} [Documentation] Compare ${upper_bound} to ${ODL_STREAM} and in case ${ODL_STREAM} is at most ${upper_bound}, ... run ${kw_name} @{varargs} &{kwargs} and return its value. - BuiltIn.Run_Keyword_And_Return_If &{Stream_dict}[${ODL_STREAM}] <= &{Stream_dict}[${upper_bound}] ${kw_name} @{varargs} &{kwargs} + BuiltIn.Run_Keyword_And_Return_If ${Stream_dict}[${ODL_STREAM}] <= ${Stream_dict}[${upper_bound}] ${kw_name} @{varargs} &{kwargs} Run_Keyword_If_At_Most_Else [Arguments] ${upper_bound} @{varargs} @@ -175,7 +180,7 @@ Run_Keyword_If_At_Most_Else ${varargs_else} Collections.Get_Slice_From_List ${varargs} ${position+1} ${args_if} ${kwargs_if} CompareStream__Convert_Input @{varargs_if} ${args_else} ${kwargs_else} CompareStream__Convert_Input @{varargs_else} - ${resp} BuiltIn.Run_Keyword_If &{Stream_dict}[${ODL_STREAM}] >= &{Stream_dict}[${lower_bound}] @{args_if} &{kwargs_if} + ${resp} BuiltIn.Run_Keyword_If ${Stream_dict}[${ODL_STREAM}] >= ${Stream_dict}[${lower_bound}] @{args_if} &{kwargs_if} ... ELSE @{args_else} &{kwargs_else} [Return] ${resp} @@ -183,13 +188,13 @@ Run_Keyword_If_More_Than [Arguments] ${lower_bound} ${kw_name} @{varargs} &{kwargs} [Documentation] Compare ${lower_bound} to ${ODL_STREAM} and in case ${ODL_STREAM} is more than ${lower_bound}, ... run ${kw_name} @{varargs} &{kwargs} and return its value. - BuiltIn.Run_Keyword_And_Return_If &{Stream_dict}[${ODL_STREAM}] > &{Stream_dict}[${lower_bound}] ${kw_name} @{varargs} &{kwargs} + BuiltIn.Run_Keyword_And_Return_If ${Stream_dict}[${ODL_STREAM}] > ${Stream_dict}[${lower_bound}] ${kw_name} @{varargs} &{kwargs} Run_Keyword_If_Equals [Arguments] ${stream} ${kw_name} @{varargs} &{kwargs} [Documentation] Compare ${stream} to ${ODL_STREAM} and in case ${ODL_STREAM} equals ${stream}, ... run ${kw_name} @{varargs} &{kwargs} and return its value. - BuiltIn.Run_Keyword_And_Return_If &{Stream_dict}[${ODL_STREAM}] == &{Stream_dict}[${stream}] ${kw_name} @{varargs} &{kwargs} + BuiltIn.Run_Keyword_And_Return_If ${Stream_dict}[${ODL_STREAM}] == ${Stream_dict}[${stream}] ${kw_name} @{varargs} &{kwargs} Run_Keyword_If_Equals_Else [Arguments] ${stream} @{varargs} @@ -201,7 +206,7 @@ Run_Keyword_If_Equals_Else ${varargs_else} Collections.Get_Slice_From_List ${varargs} ${position+1} ${args_if} ${kwargs_if} CompareStream__Convert_Input @{varargs_if} ${args_else} ${kwargs_else} CompareStream__Convert_Input @{varargs_else} - ${resp} BuiltIn.Run_Keyword_If &{Stream_dict}[${ODL_STREAM}] == &{Stream_dict}[${stream}] @{args_if} &{kwargs_if} + ${resp} BuiltIn.Run_Keyword_If ${Stream_dict}[${ODL_STREAM}] == ${Stream_dict}[${stream}] @{args_if} &{kwargs_if} ... ELSE @{args_else} &{kwargs_else} [Return] ${resp} @@ -209,7 +214,7 @@ Run_Keyword_If_Less_Than [Arguments] ${lower_bound} ${kw_name} @{varargs} &{kwargs} [Documentation] Compare ${lower_bound} to ${ODL_STREAM} and in case ${ODL_STREAM} is less than ${lower_bound}, ... run ${kw_name} @{varargs} &{kwargs} and return its value. - BuiltIn.Run_Keyword_And_Return_If &{Stream_dict}[${ODL_STREAM}] < &{Stream_dict}[${lower_bound}] ${kw_name} @{varargs} &{kwargs} + BuiltIn.Run_Keyword_And_Return_If ${Stream_dict}[${ODL_STREAM}] < ${Stream_dict}[${lower_bound}] ${kw_name} @{varargs} &{kwargs} Run_Keyword_If_At_Least_Carbon [Arguments] ${kw_name} @{varargs} &{kwargs} @@ -259,6 +264,18 @@ Run_Keyword_If_At_Least_Aluminium ... run ${kw_name} @{varargs} &{kwargs} and return its value. BuiltIn.Run_Keyword_And_Return Run_Keyword_If_At_Least aluminium ${kw_name} @{varargs} &{kwargs} +Run_Keyword_If_At_Least_Silicon + [Arguments] ${kw_name} @{varargs} &{kwargs} + [Documentation] Compare silicon to ${ODL_STREAM} and in case ${ODL_STREAM} is at least silicon, + ... run ${kw_name} @{varargs} &{kwargs} and return its value. + BuiltIn.Run_Keyword_And_Return Run_Keyword_If_At_Least silicon ${kw_name} @{varargs} &{kwargs} + +Run_Keyword_If_At_Least_Phosphorus + [Arguments] ${kw_name} @{varargs} &{kwargs} + [Documentation] Compare phosphorus to ${ODL_STREAM} and in case ${ODL_STREAM} is at least phosphorus, + ... run ${kw_name} @{varargs} &{kwargs} and return its value. + BuiltIn.Run_Keyword_And_Return Run_Keyword_If_At_Least phosphorus ${kw_name} @{varargs} &{kwargs} + Run_Keyword_If_At_Most_Carbon [Arguments] ${kw_name} @{varargs} &{kwargs} [Documentation] Compare carbon to ${ODL_STREAM} and in case ${ODL_STREAM} is at most carbon, @@ -307,6 +324,12 @@ Run_Keyword_If_At_Most_Aluminium ... run ${kw_name} @{varargs} &{kwargs} and return its value. BuiltIn.Run_Keyword_And_Return Run_Keyword_If_At_Most aluminium ${kw_name} @{varargs} &{kwargs} +Run_Keyword_If_At_Most_Silicon + [Arguments] ${kw_name} @{varargs} &{kwargs} + [Documentation] Compare silicon to ${ODL_STREAM} and in case ${ODL_STREAM} is at most silicon, + ... run ${kw_name} @{varargs} &{kwargs} and return its value. + BuiltIn.Run_Keyword_And_Return Run_Keyword_If_At_Most silicon ${kw_name} @{varargs} &{kwargs} + Run_Keyword_If_More_Than_Carbon [Arguments] ${kw_name} @{varargs} &{kwargs} [Documentation] Compare carbon to ${ODL_STREAM} and in case ${ODL_STREAM} is more than carbon, @@ -396,3 +419,9 @@ Run_Keyword_If_Less_Than_Magnesium [Documentation] Compare magnesium to ${ODL_STREAM} and in case ${ODL_STREAM} is less than magnesium, ... run ${kw_name} @{varargs} &{kwargs} and return its value. BuiltIn.Run_Keyword_And_Return Run_Keyword_If_Less_Than magnesium ${kw_name} @{varargs} &{kwargs} + +Run_Keyword_If_Less_Than_Silicon + [Arguments] ${kw_name} @{varargs} &{kwargs} + [Documentation] Compare silicon to ${ODL_STREAM} and in case ${ODL_STREAM} is less than silicon, + ... run ${kw_name} @{varargs} &{kwargs} and return its value. + BuiltIn.Run_Keyword_And_Return Run_Keyword_If_Less_Than silicon ${kw_name} @{varargs} &{kwargs}