... return ${value_if_false} otherwise.
BuiltIn.Run_Keyword_And_Return Set_Variable_If_At_Least carbon ${value_if_true} ${value_if_false}
+Set_Variable_If_At_Least_Nitrogen
+ [Arguments] ${value_if_true} ${value_if_false}
+ [Documentation] Compare nitrogen to ${ODL_STREAM} and return ${value_if_true} if ${ODL_STREAM} is at least nitrogen,
+ ... return ${value_if_false} otherwise.
+ BuiltIn.Run_Keyword_And_Return Set_Variable_If_At_Least nitrogen ${value_if_true} ${value_if_false}
+
Set_Variable_If_At_Most_Helium
[Arguments] ${value_if_true} ${value_if_false}
[Documentation] Compare stable-helium to ${ODL_STREAM} and return ${value_if_true} if ${ODL_STREAM} is at most stable-helium,
... return ${value_if_false} otherwise.
BuiltIn.Run_Keyword_And_Return Set_Variable_If_At_Most carbon ${value_if_true} ${value_if_false}
+Set_Variable_If_At_Most_Nitrogen
+ [Arguments] ${value_if_true} ${value_if_false}
+ [Documentation] Compare nitrogen to ${ODL_STREAM} and return ${value_if_true} if ${ODL_STREAM} is at most nitrogen,
+ ... return ${value_if_false} otherwise.
+ BuiltIn.Run_Keyword_And_Return Set_Variable_If_At_Most nitrogen ${value_if_true} ${value_if_false}
+
CompareStream__Convert_Input
[Arguments] @{arguments}
[Documentation] Splits arguments into args and kwargs is used in Run_Keyword_If_At_Least_Else and Run_Keyword_If_At_Most_Else.
... run ${kw_name} @{varargs} &{kwargs} and return its value.
BuiltIn.Run_Keyword_And_Return Run_Keyword_If_At_Least carbon ${kw_name} @{varargs} &{kwargs}
+Run_Keyword_If_At_Least_Nitrogen
+ [Arguments] ${kw_name} @{varargs} &{kwargs}
+ [Documentation] Compare nitrogen to ${ODL_STREAM} and in case ${ODL_STREAM} is at least nitrogen,
+ ... run ${kw_name} @{varargs} &{kwargs} and return its value.
+ BuiltIn.Run_Keyword_And_Return Run_Keyword_If_At_Least nitrogen ${kw_name} @{varargs} &{kwargs}
+
Run_Keyword_If_At_Most_Helium
[Arguments] ${kw_name} @{varargs} &{kwargs}
[Documentation] Compare stable-helium to ${ODL_STREAM} and in case ${ODL_STREAM} is at most stable-helium,
... run ${kw_name} @{varargs} &{kwargs} and return its value.
BuiltIn.Run_Keyword_And_Return Run_Keyword_If_At_Most carbon ${kw_name} @{varargs} &{kwargs}
+Run_Keyword_If_At_Most_Nitrogen
+ [Arguments] ${kw_name} @{varargs} &{kwargs}
+ [Documentation] Compare nitrogen to ${ODL_STREAM} and in case ${ODL_STREAM} is at most nitrogen,
+ ... run ${kw_name} @{varargs} &{kwargs} and return its value.
+ BuiltIn.Run_Keyword_And_Return Run_Keyword_If_At_Most nitrogen ${kw_name} @{varargs} &{kwargs}
+
Run_Keyword_If_More_Than_Helium
[Arguments] ${kw_name} @{varargs} &{kwargs}
[Documentation] Compare stable-helium to ${ODL_STREAM} and in case ${ODL_STREAM} is more than stable-helium,
[Documentation] Compare carbon to ${ODL_STREAM} and in case ${ODL_STREAM} is less than carbon,
... run ${kw_name} @{varargs} &{kwargs} and return its value.
BuiltIn.Run_Keyword_And_Return Run_Keyword_If_Less_Than carbon ${kw_name} @{varargs} &{kwargs}
+
+Run_Keyword_If_More_Than_Nitrogen
+ [Arguments] ${kw_name} @{varargs} &{kwargs}
+ [Documentation] Compare nitrogen to ${ODL_STREAM} and in case ${ODL_STREAM} is more than nitrogen,
+ ... run ${kw_name} @{varargs} &{kwargs} and return its value.
+ BuiltIn.Run_Keyword_And_Return Run_Keyword_If_More_Than nitrogen ${kw_name} @{varargs} &{kwargs}
+
+Run_Keyword_If_Less_Than_Nitrogen
+ [Arguments] ${kw_name} @{varargs} &{kwargs}
+ [Documentation] Compare nitrogen to ${ODL_STREAM} and in case ${ODL_STREAM} is less than nitrogen,
+ ... run ${kw_name} @{varargs} &{kwargs} and return its value.
+ BuiltIn.Run_Keyword_And_Return Run_Keyword_If_Less_Than nitrogen ${kw_name} @{varargs} &{kwargs}
Test Setup SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
Test Teardown SetupUtils.Teardown_Test_Show_Bugs_If_Test_Failed
Default Tags 1node carpeople critical
+Library String
Library SSHLibrary
+Resource ${CURDIR}/../../../libraries/CompareStream.robot
Resource ${CURDIR}/../../../libraries/ClusterManagement.robot
Resource ${CURDIR}/../../../libraries/SetupUtils.robot
Resource ${CURDIR}/../../../libraries/SSHKeywords.robot
${cfg_newer} = BuiltIn.Set_Variable ${WORKSPACE}/${BUNDLEFOLDER}/etc/${cfg_filename}
${vanilla_line} = SSHKeywords.Execute_Command_Should_Pass grep 'featuresBoot' "${cfg_older}" | grep -v 'featuresBootAsynchronous'
${csit_line} = SSHKeywords.Execute_Command_Should_Pass grep 'featuresBoot' "${cfg_newer}" | grep -v 'featuresBootAsynchronous'
+ ${karaf4_features} = Extract_Karaf4_Boot_Features ${csit_line}
+ # TODO: this works only if old odl is karaf3. Once old and new odl both are e.g. karaf4 this will create invalid line.
+ ${new_csit_line} = CompareStream.Set_Variable_If_At_Least_Nitrogen ${vanilla_line},${karaf4_features} ${csit_line}
# Replace the vanilla line.
- SSHKeywords.Execute_Command_Should_Pass sed -i 's/${vanilla_line}/${csit_line}/g' "${cfg_older}"
+ SSHKeywords.Execute_Command_Should_Pass sed -i 's/${vanilla_line}/${new_csit_line}/g' "${cfg_older}"
# Verify the replaced line.
${updated_line} = SSHKeywords.Execute_Command_Should_Pass grep 'featuresBoot' "${cfg_older}" | grep -v 'featuresBootAsynchronous'
BuiltIn.Should_Not_Be_Equal ${vanilla_line} ${updated_line}
- BuiltIn.Should_Be_Equal ${csit_line} ${updated_line}
+ BuiltIn.Should_Be_Equal ${new_csit_line} ${updated_line}
Start_Older_Odl
[Documentation] Start older ODL on background.
... This has to be a separate keyword, as it is run under WUKS.
${data_after} = TemplatedRequests.Get_As_Json_Templated folder=${CAR_VAR_DIR} verify=False
BuiltIn.Should_Be_Equal ${data_before} ${data_after}
+
+Extract_Karaf4_Boot_Features
+ [Arguments] ${csit_line}
+ [Documentation] Extract boot features. It is used for the 1st line of karaf4 featuresBoot parameter from org.apache.karaf.features.cfg.
+ ${bfeatures} String.Replace_String ${csit_line} ${Space} ${Empty}
+ ${bfeatures} String.Replace_String ${bfeatures} featuresBoot= ${Empty}
+ ${bfeatures} String.Replace_String ${bfeatures} ,\\ ${Empty}
+ BuiltIn.Return_From_Keyword ${bfeatures}