Change kill -9 to graceful stop command
[integration/test.git] / csit / libraries / controller / DdbCommons.robot
index 5de57bcb31938d51a8f66e880efb6b414d56243e..9db3aab59804548a2f1d35eeb382138dd7ae7d4b 100644 (file)
@@ -28,7 +28,7 @@ ${TRANSACTION_PRODUCTION_TIME_2X_REQ_TIMEOUT}    ${2*${REQUEST_TIMEOUT}}
 ${TRANSACTION_PRODUCTION_TIME}    ${40}
 ${SLEEP_AFTER_TRANSACTIONS_INIT}    5s
 ${ID_PREFIX}      prefix-
-${ID_PREFIX2}     different-prefix-
+${ID_PREFIX2}     prefix-    # different-prefix- has been used before, but currently is neither needed nor supported
 ${SIMPLE_TX}      ${False}
 ${CHAINED_TX}     ${True}
 ${ISOLATED_TRANS_TRUE}    ${True}
@@ -59,7 +59,7 @@ Explicit_Leader_Movement_Test_Templ
     ...    ${shard_type}    ${True}    ${idx_from}    verify_restconf=False
     BuiltIn.Should_Be_Equal    ${idx_to}    ${new_leader}
     ${resp_list} =    MdsalLowlevelPy.Wait_For_Transactions
-    TemplatedRequests.Check_Status_Code    @{resp_list}[0][2]
+    Check_Status_Of_First_Response    ${resp_list}
 
 Explicit_Leader_Movement_PrefBasedShard_Test_Templ
     [Arguments]    ${leader_from}    ${leader_to}    ${shard_name}=${PREF_BASED_SHARD}    ${shard_type}=${SHARD_TYPE}
@@ -75,7 +75,7 @@ Explicit_Leader_Movement_PrefBasedShard_Test_Templ
     ...    ${shard_type}    ${True}    ${idx_from}    verify_restconf=False
     BuiltIn.Should_Be_Equal    ${idx_to}    ${new_leader}
     ${resp_list} =    MdsalLowlevelPy.Wait_For_Transactions
-    TemplatedRequests.Check_Status_Code    @{resp_list}[0][2]
+    Check_Status_Of_First_Response    ${resp_list}
 
 Get_Node_Indexes_For_The_ELM_Test
     [Arguments]    ${leader_from}    ${leader_to}    ${shard_name}    ${shard_type}
@@ -91,21 +91,18 @@ Get_Node_Indexes_For_The_ELM_Test
 Clean_Leader_Shutdown_Test_Templ
     [Arguments]    ${leader_location}    ${shard_name}=${SHARD_NAME}    ${shard_type}=${SHARD_TYPE}
     [Documentation]    Implements clean leader shutdown test scenario.
-    ${removed} =    BuiltIn.Set_Variable    ${False}
     ${producer_idx}    ${actual_leader}    ${follower_list} =    Get_Node_Indexes_For_Clean_Leader_Shutdown_Test    ${leader_location}    ${shard_name}    ${shard_type}
     ${producer_ip_as_list} =    BuiltIn.Create_List    ${ODL_SYSTEM_${producer_idx}_IP}
     ${producer_idx_as_list} =    BuiltIn.Create_List    ${producer_idx}
     MdsalLowlevelPy.Start_Write_Transactions_On_Nodes    ${producer_ip_as_list}    ${producer_idx_as_list}    ${ID_PREFIX}    ${TRANSACTION_PRODUCTION_TIME}    ${TRANSACTION_RATE_1K}    chained_flag=${CHAINED_TX}
     BuiltIn.Sleep    ${SLEEP_AFTER_TRANSACTIONS_INIT}
+    BuiltIn.Comment    Bug 8794 workaround: Use remove-shard-replica until shutdown starts behaving properly.
     ClusterAdmin.Remove_Shard_Replica    ${actual_leader}    ${shard_name}    member-${actual_leader}    ${shard_type}
-    ${removed} =    BuiltIn.Set_Variable    ${True}
+    BuiltIn.Wait_Until_Keyword_Succeeds    60s    5s    Verify_Shard_Replica_Not_Present    ${actual_leader}    ${shard_name}    ${shard_type}
     ${resp_list} =    MdsalLowlevelPy.Wait_For_Transactions
-    TemplatedRequests.Check_Status_Code    @{resp_list}[0][2]
-    [Teardown]    BuiltIn.Run_Keywords    BuiltIn.Run_Keyword_And_Ignore_Error    BuiltIn.Wait_Until_Keyword_Succeeds    60s    5s    ClusterManagement.Get_Leader_And_Followers_For_Shard
-    ...    shard_name=${shard_name}    shard_type=${shard_type}    member_index_list=${follower_list}    verify_restconf=False
-    ...    AND    ClusterAdmin.Add_Shard_Replica    ${actual_leader}    ${shard_name}    ${shard_type}
-    ...    AND    BuiltIn.Wait_Until_Keyword_Succeeds    60s    5s    ClusterManagement.Get_Leader_And_Followers_For_Shard    shard_name=${shard_name}
-    ...    verify_restconf=False    shard_type=${shard_type}
+    Check_Status_Of_First_Response    ${resp_list}
+    [Teardown]    BuiltIn.Run_Keyword_And_Ignore_Error    BuiltIn.Wait_Until_Keyword_Succeeds    120s    5s    ClusterManagement.Get_Leader_And_Followers_For_Shard    shard_name=${shard_name}
+    ...    shard_type=${shard_type}    member_index_list=${follower_list}    verify_restconf=False
 
 Clean_Leader_Shutdown_PrefBasedShard_Test_Templ
     [Arguments]    ${leader_location}    ${shard_name}=${PREF_BASED_SHARD}    ${shard_type}=${SHARD_TYPE}
@@ -115,18 +112,13 @@ Clean_Leader_Shutdown_PrefBasedShard_Test_Templ
     ${producer_idx_as_list} =    BuiltIn.Create_List    ${producer_idx}
     MdsalLowlevelPy.Start_Produce_Transactions_On_Nodes    ${producer_ip_as_list}    ${producer_idx_as_list}    ${ID_PREFIX}    ${TRANSACTION_PRODUCTION_TIME}    ${TRANSACTION_RATE_1K}
     BuiltIn.Sleep    ${SLEEP_AFTER_TRANSACTIONS_INIT}
+    BuiltIn.Comment    Bug 8794 workaround: Use remove-shard-replica until shutdown starts behaving properly.
     ClusterAdmin.Remove_Prefix_Shard_Replica    ${actual_leader}    ${shard_name}    member-${actual_leader}    ${shard_type}
-    BuiltIn.Wait_Until_Keyword_Succeeds    60s    5s    ClusterManagement.Get_Leader_And_Followers_For_Shard    shard_name=${shard_name}!!    shard_type=${shard_type}    member_index_list=${follower_list}
-    ...    verify_restconf=False
-    # TODO: Check on the result of this
-    BuiltIn.Run_Keyword_And_Ignore_Error    ClusterManagement.Get_Raft_State_Of_Shard_At_Member    shard_name=${shard_name}!!    shard_type=${shard_type}    member_index=${actual_leader}
+    BuiltIn.Wait_Until_Keyword_Succeeds    60s    5s    Verify_Shard_Replica_Not_Present    ${actual_leader}    ${shard_name}!!    ${shard_type}
     ${resp_list} =    MdsalLowlevelPy.Wait_For_Transactions
-    TemplatedRequests.Check_Status_Code    @{resp_list}[0][2]
-    [Teardown]    BuiltIn.Run_Keywords    BuiltIn.Run_Keyword_And_Ignore_Error    BuiltIn.Wait_Until_Keyword_Succeeds    60s    5s    ClusterManagement.Get_Leader_And_Followers_For_Shard
-    ...    shard_name=${shard_name}!!    shard_type=${shard_type}    member_index_list=${follower_list}    verify_restconf=False
-    ...    AND    ClusterAdmin.Add_Prefix_Shard_Replica    ${actual_leader}    ${shard_name}    ${shard_type}
-    ...    AND    BuiltIn.Wait_Until_Keyword_Succeeds    60s    5s    ClusterManagement.Get_Leader_And_Followers_For_Shard    shard_name=${shard_name}!!
-    ...    verify_restconf=False    shard_type=${shard_type}
+    Check_Status_Of_First_Response    ${resp_list}
+    [Teardown]    BuiltIn.Run_Keyword_And_Ignore_Error    BuiltIn.Wait_Until_Keyword_Succeeds    120s    5s    ClusterManagement.Get_Leader_And_Followers_For_Shard    shard_name=${shard_name}!!
+    ...    shard_type=${shard_type}    member_index_list=${follower_list}    verify_restconf=False
 
 Get_Node_Indexes_For_Clean_Leader_Shutdown_Test
     [Arguments]    ${leader_location}    ${shard_name}    ${shard_type}
@@ -153,7 +145,7 @@ Leader_Isolation_Test_Templ
     ClusterManagement.Isolate_Member_From_List_Or_All    ${leader}
     ${li_isolated}    BuiltIn.Set_Variable    ${True}
     BuiltIn.Wait_Until_Keyword_Succeeds    60s    5s    ClusterManagement.Verify_Shard_Leader_Elected    ${shard_name}    ${shard_type}    ${True}
-    ...    ${leader}    member_index_list=${follower_list}
+    ...    ${leader}    member_index_list=${follower_list}    verify_restconf=False
     ${heal_date} =    DateTime.Add_Time_To_Date    ${date_start}    ${heal_timeout}
     ${sleep_to_heal} =    Get_Seconds_To_Time    ${heal_date}
     ${resp} =    MdsalLowlevelPy.Get_Next_Transactions_Response
@@ -186,7 +178,7 @@ Leader_Isolation_PrefBasedShard_Test_Templ
     ClusterManagement.Isolate_Member_From_List_Or_All    ${leader}
     ${li_isolated}    BuiltIn.Set_Variable    ${True}
     BuiltIn.Wait_Until_Keyword_Succeeds    60s    5s    ClusterManagement.Verify_Shard_Leader_Elected    ${shard_name}!!    ${shard_type}    ${True}
-    ...    ${leader}    member_index_list=${follower_list}
+    ...    ${leader}    member_index_list=${follower_list}    verify_restconf=False
     ${heal_date} =    DateTime.Add_Time_To_Date    ${date_start}    ${heal_timeout}
     ${sleep_to_heal} =    Get_Seconds_To_Time    ${heal_date}
     ${resp} =    MdsalLowlevelPy.Get_Next_Transactions_Response
@@ -208,7 +200,7 @@ Leader_Isolation_Heal_Within_Rt
     ...    producers shoudl finish without error.
     ${resp_list} =    MdsalLowlevelPy.Wait_For_Transactions
     : FOR    ${resp}    IN    @{resp_list}
-    \    TemplatedRequests.Check_Status_Code    ${resp}[2]
+    \    TemplatedRequests.Check_Status_Code    @{resp}[2]
 
 Module_Leader_Isolation_Heal_Default
     [Arguments]    ${isolated_node}    ${time_to_finish}
@@ -225,7 +217,7 @@ Module_Leader_Isolation_Heal_Default
     ...    reset_globals=${False}
     ${resp_list} =    MdsalLowlevelPy.Wait_For_Transactions
     : FOR    ${resp}    IN    @{resp_list}
-    \    TemplatedRequests.Check_Status_Code    ${resp}[2]
+    \    TemplatedRequests.Check_Status_Code    @{resp}[2]
 
 Prefix_Leader_Isolation_Heal_Default
     [Arguments]    ${isolated_node}    ${time_to_finish}
@@ -241,7 +233,7 @@ Prefix_Leader_Isolation_Heal_Default
     MdsalLowlevelPy.Start_Produce_Transactions_On_Nodes    ${restart_producer_node_ip_as_list}    ${restart_producer_node_idx_as_list}    ${ID_PREFIX2}    ${time_to_finish}    ${TRANSACTION_RATE_1K}    reset_globals=${False}
     ${resp_list} =    MdsalLowlevelPy.Wait_For_Transactions
     : FOR    ${resp}    IN    @{resp_list}
-    \    TemplatedRequests.Check_Status_Code    ${resp}[2]
+    \    TemplatedRequests.Check_Status_Code    @{resp}[2]
 
 Client_Isolation_Test_Templ
     [Arguments]    ${listener_node_role}    ${trans_chain_flag}    ${shard_name}=${SHARD_NAME}    ${shard_type}=${SHARD_TYPE}
@@ -299,7 +291,7 @@ Ongoing_Transactions_Not_Failed_Yet
 Ongoing_Transactions_Failed
     [Documentation]    Verify if write-transaction failed.
     ${resp} =    MdsalLowlevelPy.Get_Next_Transactions_Response
-    Check_Status_Code    ${resp}[2]    explicit_status_codes=${TRANSACTION_FAILED}
+    Check_Status_Code    @{resp}[2]    explicit_status_codes=${TRANSACTION_FAILED}
 
 Get_Seconds_To_Time
     [Arguments]    ${date_in_future}
@@ -308,61 +300,53 @@ Get_Seconds_To_Time
     ${duration} =    DateTime.Subtract_Date_From_Date    ${date_in_future}    ${date_now}
     BuiltIn.Run_Keyword_And_Return    BuiltIn.Convert_To_Integer    ${duration}
 
-Remote_Listener_Test_Templ
-    [Arguments]    ${listener_node_role}    ${shard_name}=${SHARD_NAME}    ${shard_type}=${SHARD_TYPE}
-    [Documentation]    Implements remote listener test scenario.
+Listener_Stability_Test_Templ
+    [Arguments]    ${leader_from}    ${leader_to}    ${shard_name}=${SHARD_NAME}    ${shard_type}=${SHARD_TYPE}
+    [Documentation]    Implements listener stability test scenario for module-based shards.
     ${subscribed} =    BuiltIn.Set_Variable    ${False}
     ${all_indices} =    ClusterManagement.List_All_Indices
-    ${leader}    ${follower_list} =    ClusterManagement.Get_Leader_And_Followers_For_Shard    shard_name=${shard_name}    shard_type=${shard_type}    member_index_list=${all_indices}    verify_restconf=False
-    ${follower1} =    Collections.Get_From_List    ${follower_list}    ${0}
-    ${listener_node_dst} =    BuiltIn.Set_Variable_If    "${listener_node_role}" == "leader"    ${leader}    ${follower1}
-    MdsalLowlevel.Subscribe_Dtcl    ${listener_node_dst}
+    ${idx_from}    ${idx_to}    ${idx_listen} =    Get_Node_Indexes_For_The_ELM_Test    ${leader_from}    ${leader_to}    ${shard_name}
+    ...    ${shard_type}
+    MdsalLowlevel.Subscribe_Dtcl    ${idx_listen}
     ${subscribed} =    BuiltIn.Set_Variable    ${True}
     ${all_ip_list} =    ClusterManagement.Resolve_IP_Address_For_Members    ${all_indices}
     MdsalLowlevelPy.Start_Write_Transactions_On_Nodes    ${all_ip_list}    ${all_indices}    ${ID_PREFIX}    ${TRANSACTION_PRODUCTION_TIME}    ${TRANSACTION_RATE_1K}    chained_flag=${CHAINED_TX}
     BuiltIn.Sleep    ${SLEEP_AFTER_TRANSACTIONS_INIT}
-    ClusterAdmin.Remove_Shard_Replica    ${leader}    ${shard_name}    member-${leader}    ${shard_type}
-    ${newleader}    ${newfollower_list} =    BuiltIn.Wait_Until_Keyword_Succeeds    60s    5s    ClusterManagement.Get_Leader_And_Followers_For_Shard    shard_name=${shard_name}
-    ...    shard_type=${shard_type}    member_index_list=${follower_list}    verify_restconf=False
-    BuiltIn.Should_Not_Be_Equal_As_Numbers    ${leader}    ${newleader}
+    ClusterAdmin.Make_Leader_Local    ${idx_to}    ${shard_name}    ${shard_type}
+    ${new_leader}    ${new_followers} =    BuiltIn.Wait_Until_Keyword_Succeeds    60s    5s    ClusterManagement.Verify_Shard_Leader_Elected    ${shard_name}
+    ...    ${shard_type}    ${True}    ${idx_from}    verify_restconf=False
+    BuiltIn.Should_Be_Equal    ${idx_to}    ${new_leader}
     ${resp_list} =    MdsalLowlevelPy.Wait_For_Transactions
     : FOR    ${resp}    IN    @{resp_list}
-    \    TemplatedRequests.Check_Status_Code    ${resp}[2]
-    ${copy_matches} =    MdsalLowlevel.Unsubscribe_Dtcl    ${listener_node_dst}
+    \    TemplatedRequests.Check_Status_Code    @{resp}[2]
+    ${copy_matches} =    MdsalLowlevel.Unsubscribe_Dtcl    ${idx_listen}
     ${subscribed} =    BuiltIn.Set_Variable    ${False}
     BuiltIn.Should_Be_True    ${copy_matches}
-    [Teardown]    BuiltIn.Run_Keywords    BuiltIn.Run_Keyword_If    ${subscribed}    MdsalLowlevel.Unsubscribe_Dtcl    ${listener_node_dst}
-    ...    AND    ClusterAdmin.Add_Shard_Replica    ${leader}    ${shard_name}    ${shard_type}
-    ...    AND    BuiltIn.Wait_Until_Keyword_Succeeds    60s    5s    ClusterManagement.Get_Leader_And_Followers_For_Shard    shard_name=${shard_name}
-    ...    verify_restconf=False    shard_type=${shard_type}
+    [Teardown]    BuiltIn.Run_Keyword_If    ${subscribed}    MdsalLowlevel.Unsubscribe_Dtcl    ${idx_listen}
 
-Remote_Listener_PrefBasedShard_Test_Templ
-    [Arguments]    ${listener_node_role}    ${shard_name}=${PREF_BASED_SHARD}    ${shard_type}=${SHARD_TYPE}
-    [Documentation]    Implements listener isolation test scenario.
+Listener_Stability_PrefBasedShard_Test_Templ
+    [Arguments]    ${leader_from}    ${leader_to}    ${shard_name}=${PREF_BASED_SHARD}    ${shard_type}=${SHARD_TYPE}
+    [Documentation]    Implements listener stability test scenario for prefix-based shards.
     ${subscribed} =    BuiltIn.Set_Variable    ${False}
     ${all_indices} =    ClusterManagement.List_All_Indices
-    ${leader}    ${follower_list} =    ClusterManagement.Get_Leader_And_Followers_For_Shard    shard_name=${shard_name}!!    shard_type=${shard_type}    member_index_list=${all_indices}    verify_restconf=False
-    ${follower1} =    Collections.Get_From_List    ${follower_list}    ${0}
-    ${listener_node_dst} =    BuiltIn.Set_Variable_If    "${listener_node_role}" == "leader"    ${leader}    ${follower1}
-    MdsalLowlevel.Subscribe_Ddtl    ${listener_node_dst}
+    ${idx_from}    ${idx_to}    ${idx_listen} =    Get_Node_Indexes_For_The_ELM_Test    ${leader_from}    ${leader_to}    ${shard_name}!!
+    ...    ${shard_type}
+    MdsalLowlevel.Subscribe_Ddtl    ${idx_listen}
     ${subscribed} =    BuiltIn.Set_Variable    ${True}
     ${all_ip_list} =    ClusterManagement.Resolve_IP_Address_For_Members    ${all_indices}
     MdsalLowlevelPy.Start_Produce_Transactions_On_Nodes    ${all_ip_list}    ${all_indices}    ${ID_PREFIX}    ${TRANSACTION_PRODUCTION_TIME}    ${TRANSACTION_RATE_1K}
     BuiltIn.Sleep    ${SLEEP_AFTER_TRANSACTIONS_INIT}
-    ClusterAdmin.Remove_Prefix_Shard_Replica    ${leader}    ${shard_name}    member-${leader}    ${shard_type}
-    ${newleader}    ${newfollower_list} =    BuiltIn.Wait_Until_Keyword_Succeeds    60s    5s    ClusterManagement.Get_Leader_And_Followers_For_Shard    shard_name=${shard_name}!!
-    ...    member_index_list=${follower_list}    verify_restconf=False    shard_type=${shard_type}
-    BuiltIn.Should_Not_Be_Equal_As_Numbers    ${leader}    ${newleader}
+    MdsalLowlevel.Become_Prefix_Leader    ${idx_to}    ${shard_name}
+    ${new_leader}    ${new_followers} =    BuiltIn.Wait_Until_Keyword_Succeeds    60s    5s    ClusterManagement.Verify_Shard_Leader_Elected    ${shard_name}!!
+    ...    ${shard_type}    ${True}    ${idx_from}    verify_restconf=False
+    BuiltIn.Should_Be_Equal    ${idx_to}    ${new_leader}
     ${resp_list} =    MdsalLowlevelPy.Wait_For_Transactions
     : FOR    ${resp}    IN    @{resp_list}
-    \    TemplatedRequests.Check_Status_Code    ${resp}[2]
-    ${copy_matches} =    MdsalLowlevel.Unsubscribe_Ddtl    ${listener_node_dst}
+    \    TemplatedRequests.Check_Status_Code    @{resp}[2]
+    ${copy_matches} =    MdsalLowlevel.Unsubscribe_Ddtl    ${idx_listen}
     ${subscribed} =    BuiltIn.Set_Variable    ${False}
     BuiltIn.Should_Be_True    ${copy_matches}
-    [Teardown]    BuiltIn.Run_Keywords    BuiltIn.Run_Keyword_If    ${subscribed}    MdsalLowlevel.Unsubscribe_Ddtl    ${listener_node_dst}
-    ...    AND    ClusterAdmin.Add_Prefix_Shard_Replica    ${leader}    ${shard_name}    ${shard_type}
-    ...    AND    BuiltIn.Wait_Until_Keyword_Succeeds    60s    5s    ClusterManagement.Get_Leader_And_Followers_For_Shard    shard_name=${shard_name}!!
-    ...    verify_restconf=False    shard_type=${shard_type}
+    [Teardown]    BuiltIn.Run_Keyword_If    ${subscribed}    MdsalLowlevel.Unsubscribe_Ddtl    ${idx_listen}
 
 Create_Prefix_Based_Shard_And_Verify
     [Arguments]    ${prefix}=${PREF_BASED_SHARD}
@@ -380,10 +364,10 @@ Remove_Prefix_Based_Shard_And_Verify
     ${node_to_trigger} =    Collections.Get_From_List    ${all_indices}    ${0}
     MdsalLowlevel.Remove_Prefix_Shard    ${node_to_trigger}    ${prefix}
     : FOR    ${idx}    IN    @{all_indices}
-    \    BuiltIn.Wait_Until_Keyword_Succeeds    60s    5s    Verify_Shard_Replica_Removed    ${idx}    ${prefix}!!
+    \    BuiltIn.Wait_Until_Keyword_Succeeds    60s    5s    Verify_Shard_Replica_Not_Present    ${idx}    ${prefix}!!
     \    ...    ${SHARD_TYPE}
 
-Verify_Shard_Replica_Removed
+Verify_Shard_Replica_Not_Present
     [Arguments]    ${member_index}    ${shard_name}    ${shard_type}
     [Documentation]    Verify that shard is removed. Jolokia return 404 for shard memeber.
     ${session} =    Resolve_Http_Session_For_Member    member_index=${member_index}
@@ -393,9 +377,25 @@ Verify_Shard_Replica_Removed
     BuiltIn.Should_Contain    ${text}    "status":404    javax.management.InstanceNotFoundException
 
 Restart_Test_Templ
-    [Documentation]    Kill every odl node and start again.
-    ClusterManagement.Kill_Members_From_List_Or_All
+    [Documentation]    Stop every odl node and start again.
+    ClusterManagement.Stop_Members_From_List_Or_All
     ClusterManagement.Clean_Directories_On_List_Or_All    tmp_dir=/tmp
     ClusterManagement.Start_Members_From_List_Or_All
     BuiltIn.Wait_Until_Keyword_Succeeds    300s    10s    ShardStability.Shards_Stability_Get_Details    ${DEFAULT_SHARD_LIST}    verify_restconf=True
     ClusterManagement.Run_Bash_Command_On_List_Or_All    ps -ef | grep java
+
+Check_Status_Of_First_Response
+    [Arguments]    ${resp_list}
+    [Documentation]    Extract first item from the list, third item of the tuple and call TemplatedRequests to check the http status code.
+    # @{resp_list}[0][2] does not work
+    ${tuple} =    BuiltIn.Set_Variable    @{resp_list}[0]
+    TemplatedRequests.Check_Status_Code    @{tuple}[2]
+
+Change_Use_Tell_Based_Protocol
+    [Arguments]    ${status}    ${DATASTORE_CFG}
+    [Documentation]    Change status use-tell-based-protocol to True or False
+    ClusterManagement.Check_Bash_Command_On_List_Or_All    sed -ie "s/^#use-tell-based-protocol=true/use-tell-based-protocol=true/g" ${DATASTORE_CFG}
+    ClusterManagement.Check_Bash_Command_On_List_Or_All    sed -ie "s/^#use-tell-based-protocol=false/use-tell-based-protocol=false/g" ${DATASTORE_CFG}
+    BuiltIn.Run_Keyword_And_Return_If    "${status}" == "True"    ClusterManagement.Check_Bash_Command_On_List_Or_All    sed -ie "s/^use-tell-based-protocol=false/use-tell-based-protocol=true/g" ${DATASTORE_CFG}
+    BuiltIn.Run_Keyword_And_Return_If    "${status}" == "False"    ClusterManagement.Check_Bash_Command_On_List_Or_All    sed -ie "s/^use-tell-based-protocol=true/use-tell-based-protocol=false/g" ${DATASTORE_CFG}
+    BuiltIn.Fail    Failure in status. Status can be True or False.