From 8599dfab47fe1d26e1a8727337b0092cc98b7931 Mon Sep 17 00:00:00 2001 From: David Boucher Date: Thu, 12 Oct 2023 11:50:49 +0200 Subject: [PATCH 01/84] fix(broker): little fixes in broker --- broker/bam/inc/com/centreon/broker/bam/computable.hh | 2 +- broker/bam/src/bool_constant.cc | 2 +- broker/neb/src/set_log_data.cc | 2 +- common/src/process_stat.cc | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/broker/bam/inc/com/centreon/broker/bam/computable.hh b/broker/bam/inc/com/centreon/broker/bam/computable.hh index 255e12fa29e..68eff9a4534 100644 --- a/broker/bam/inc/com/centreon/broker/bam/computable.hh +++ b/broker/bam/inc/com/centreon/broker/bam/computable.hh @@ -59,7 +59,7 @@ class computable { * @brief This method is used by the dump() method. It gives a summary of this * computable main informations. * - * @return A multiline strings with various informations. + * @return A multiline string with various informations. */ virtual std::string object_info() const = 0; /** diff --git a/broker/bam/src/bool_constant.cc b/broker/bam/src/bool_constant.cc index fd68c36aa20..35306713e33 100644 --- a/broker/bam/src/bool_constant.cc +++ b/broker/bam/src/bool_constant.cc @@ -1,5 +1,5 @@ /* - * Copyright 2016, 2023 Centreon + * Copyright 2014, 2023 Centreon * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/broker/neb/src/set_log_data.cc b/broker/neb/src/set_log_data.cc index b7924a1f082..ad18e3ebbfa 100644 --- a/broker/neb/src/set_log_data.cc +++ b/broker/neb/src/set_log_data.cc @@ -284,7 +284,7 @@ bool neb::set_pb_log_data(neb::pb_log_entry& le, const std::string& output) { auto typ = *it; ++it; auto lasts = *it; - lasts = StripLeadingAsciiWhitespace(lasts); + lasts = absl::StripLeadingAsciiWhitespace(lasts); auto args = absl::StrSplit(lasts, ';'); auto ait = args.begin(); diff --git a/common/src/process_stat.cc b/common/src/process_stat.cc index 691e711f88a..ad12cf31578 100644 --- a/common/src/process_stat.cc +++ b/common/src/process_stat.cc @@ -104,13 +104,13 @@ process_stat::process_stat(pid_t process_id) if (first_char == 'r') { if (second_char == 'c') { // rchar _query_read_bytes = extract_io_value(line, file_path); - } else if (second_char = 'e') { // read_bytes + } else if (second_char == 'e') { // read_bytes _real_read_bytes = extract_io_value(line, file_path); } } else if (first_char == 'w') { if (second_char == 'c') { // wchar _query_write_bytes = extract_io_value(line, file_path); - } else if (second_char = 'e') { // write_bytes + } else if (second_char == 'e') { // write_bytes _real_write_bytes = extract_io_value(line, file_path); } } From 3cf454ff388147422b4e588c6aba4895704debf7 Mon Sep 17 00:00:00 2001 From: David Boucher Date: Thu, 12 Oct 2023 11:51:25 +0200 Subject: [PATCH 02/84] fix(tests): fixes in various tests --- tests/resources/Common.py | 16 +++++++++------- tests/resources/specific-duplication.py | 2 ++ 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/tests/resources/Common.py b/tests/resources/Common.py index 7e1bc46c4a1..ae760cb80b4 100644 --- a/tests/resources/Common.py +++ b/tests/resources/Common.py @@ -419,14 +419,14 @@ def find_line_from(lines, date): def check_reschedule(log: str, date, content: str): try: - f = open(log, "r") - lines = f.readlines() - f.close() + with open(log, "r") as f: + lines = f.readlines() + idx = find_line_from(lines, date) retry_check = False normal_check = False - r = re.compile(".* last check at (.*) and next check at (.*)$") + r = re.compile(r".* last check at (.*) and next check at (.*)$") for i in range(idx, len(lines)): line = lines[i] if content in line: @@ -436,14 +436,16 @@ def check_reschedule(log: str, date, content: str): if m: delta = int(datetime.strptime(m[2], "%Y-%m-%dT%H:%M:%S").timestamp()) - int( datetime.strptime(m[1], "%Y-%m-%dT%H:%M:%S").timestamp()) - if delta == 60: + if abs(delta - 60) < 2: retry_check = True - elif delta == 300: + elif abs(delta - 300) < 2: normal_check = True + else: + logger.console( + f"We have a line whose distance between last check and next check is {delta}s") else: logger.console( f"Unable to find last check and next check in the line '{line}'") - return False, False logger.console(f"loop finished with {retry_check}, {normal_check}") return retry_check, normal_check except IOError: diff --git a/tests/resources/specific-duplication.py b/tests/resources/specific-duplication.py index 5393c69047a..62b16d5e363 100644 --- a/tests/resources/specific-duplication.py +++ b/tests/resources/specific-duplication.py @@ -147,6 +147,8 @@ def create_md5_list(content): 196619, # pb index mapping => produced on new conf 65555, # service check 0x1001a, # responsive_instance => periodically generated by cbd + 0x10027, # pb_host_check + 0x10028, # pb_service_check 0x1002e, # pb_responsive_instance ]: if md5 in lst: From 5c3480cafc10e5212a245518909cde2c822d9ca7 Mon Sep 17 00:00:00 2001 From: David Boucher Date: Thu, 12 Oct 2023 11:51:54 +0200 Subject: [PATCH 03/84] fix(tests): cleanup and little fixes --- .../broker-engine/retention-duplicates.robot | 245 +++++++++--------- tests/broker-engine/scheduler.robot | 14 +- tests/broker/sql.robot | 2 +- tests/migration/migration.robot | 81 +++--- 4 files changed, 169 insertions(+), 173 deletions(-) diff --git a/tests/broker-engine/retention-duplicates.robot b/tests/broker-engine/retention-duplicates.robot index f1237389157..6ce2d654cd3 100644 --- a/tests/broker-engine/retention-duplicates.robot +++ b/tests/broker-engine/retention-duplicates.robot @@ -33,16 +33,16 @@ BERD1 Broker Config Log module0 lua debug Config Broker rrd Clear Retention - ${start}= Get Current Date + ${start} Get Current Date Start Broker Start Engine - ${content}= Create List lua: initializing the Lua virtual machine - ${result}= Find In Log with timeout ${centralLog} ${start} ${content} 30 - Should Be True ${result} msg=Lua not started in cbd - ${result}= Find In Log with timeout ${moduleLog0} ${start} ${content} 30 - Should Be True ${result} msg=Lua not started in centengine - ${result}= Check Connections - Should Be True ${result} msg=Engine and Broker not connected. + ${content} Create List lua: initializing the Lua virtual machine + ${result} Find In Log with timeout ${centralLog} ${start} ${content} 30 + Should Be True ${result} Lua not started in cbd + ${result} Find In Log with timeout ${moduleLog0} ${start} ${content} 30 + Should Be True ${result} Lua not started in centengine + ${result} Check Connections + Should Be True ${result} Engine and Broker not connected. Sleep 5s Kindly Stop Broker Sleep 5s @@ -51,10 +51,10 @@ BERD1 Sleep 25s Stop Engine Kindly Stop Broker - ${result}= Files Contain Same Json /tmp/lua-engine.log /tmp/lua.log - Should Be True ${result} msg=Contents of /tmp/lua.log and /tmp/lua-engine.log do not match. - ${result}= Check Multiplicity When Broker Restarted /tmp/lua-engine.log /tmp/lua.log - Should Be True ${result} msg=There are events sent several times, see /tmp/lua-engine.log and /tmp/lua.log + ${result} Files Contain Same Json /tmp/lua-engine.log /tmp/lua.log + Should Be True ${result} Contents of /tmp/lua.log and /tmp/lua-engine.log do not match. + ${result} Check Multiplicity When Broker Restarted /tmp/lua-engine.log /tmp/lua.log + Should Be True ${result} There are events sent several times, see /tmp/lua-engine.log and /tmp/lua.log BERD2 [Documentation] Starting/stopping Engine does not create duplicated events. @@ -74,26 +74,26 @@ BERD2 Broker Config Log module0 neb debug Config Broker rrd Clear Retention - ${start}= Get Current Date + ${start} Get Current Date Start Broker Start Engine - ${content}= Create List lua: initializing the Lua virtual machine - ${result}= Find In Log with timeout ${centralLog} ${start} ${content} 30 - Should Be True ${result} msg=Lua not started in cbd - ${result}= Find In Log with timeout ${moduleLog0} ${start} ${content} 30 - Should Be True ${result} msg=Lua not started in centengine - ${result}= Check Connections - Should Be True ${result} msg=Engine and Broker not connected. + ${content} Create List lua: initializing the Lua virtual machine + ${result} Find In Log with timeout ${centralLog} ${start} ${content} 30 + Should Be True ${result} Lua not started in cbd + ${result} Find In Log with timeout ${moduleLog0} ${start} ${content} 30 + Should Be True ${result} Lua not started in centengine + ${result} Check Connections + Should Be True ${result} Engine and Broker not connected. Sleep 15s Stop Engine Start Engine Sleep 25s Stop Engine Kindly Stop Broker - ${result}= Files Contain Same Json /tmp/lua-engine.log /tmp/lua.log - Should Be True ${result} msg=Contents of /tmp/lua.log and /tmp/lua-engine.log do not match. - ${result}= Check Multiplicity When Engine Restarted /tmp/lua-engine.log /tmp/lua.log - Should Be True ${result} msg=There are events sent several times, see /tmp/lua-engine.log and /tmp/lua.log + ${result} Files Contain Same Json /tmp/lua-engine.log /tmp/lua.log + Should Be True ${result} Contents of /tmp/lua.log and /tmp/lua-engine.log do not match. + ${result} Check Multiplicity When Engine Restarted /tmp/lua-engine.log /tmp/lua.log + Should Be True ${result} There are events sent several times, see /tmp/lua-engine.log and /tmp/lua.log BERDUC1 [Documentation] Starting/stopping Broker does not create duplicated events in usual cases @@ -114,16 +114,16 @@ BERDUC1 Broker Config Log module0 neb debug Config Broker rrd Clear Retention - ${start}= Get Current Date + ${start} Get Current Date Start Broker Start Engine - ${content}= Create List lua: initializing the Lua virtual machine - ${result}= Find In Log with timeout ${centralLog} ${start} ${content} 30 - Should Be True ${result} msg=Lua not started in cbd - ${result}= Find In Log with timeout ${moduleLog0} ${start} ${content} 30 - Should Be True ${result} msg=Lua not started in centengine - ${result}= Check Connections - Should Be True ${result} msg=Engine and Broker not connected. + ${content} Create List lua: initializing the Lua virtual machine + ${result} Find In Log with timeout ${centralLog} ${start} ${content} 30 + Should Be True ${result} Lua not started in cbd + ${result} Find In Log with timeout ${moduleLog0} ${start} ${content} 30 + Should Be True ${result} Lua not started in centengine + ${result} Check Connections + Should Be True ${result} Engine and Broker not connected. Sleep 5s Kindly Stop Broker Sleep 5s @@ -132,8 +132,8 @@ BERDUC1 Sleep 25s Stop Engine Kindly Stop Broker - ${result}= Check Multiplicity When Broker Restarted /tmp/lua-engine.log /tmp/lua.log - Should Be True ${result} msg=There are events sent several times, see /tmp/lua-engine.log and /tmp/lua.log + ${result} Check Multiplicity When Broker Restarted /tmp/lua-engine.log /tmp/lua.log + Should Be True ${result} There are events sent several times, see /tmp/lua-engine.log and /tmp/lua.log BERDUCU1 [Documentation] Starting/stopping Broker does not create duplicated events in usual cases with unified_sql @@ -153,14 +153,14 @@ BERDUCU1 Broker Config Flush Log module0 0 Config Broker rrd Clear Retention - ${start}= Get Current Date + ${start} Get Current Date Start Broker Start Engine - ${content}= Create List lua: initializing the Lua virtual machine - ${result}= Find In Log with timeout ${centralLog} ${start} ${content} 30 - Should Be True ${result} msg=Lua not started in cbd - ${result}= Find In Log with timeout ${moduleLog0} ${start} ${content} 30 - Should Be True ${result} msg=Lua not started in centengine + ${content} Create List lua: initializing the Lua virtual machine + ${result} Find In Log with timeout ${centralLog} ${start} ${content} 30 + Should Be True ${result} Lua not started in cbd + ${result} Find In Log with timeout ${moduleLog0} ${start} ${content} 30 + Should Be True ${result} Lua not started in centengine Sleep 5s Kindly Stop Broker Sleep 5s @@ -169,8 +169,8 @@ BERDUCU1 Sleep 25s Stop Engine Kindly Stop Broker - ${result}= Check Multiplicity When Broker Restarted /tmp/lua-engine.log /tmp/lua.log - Should Be True ${result} msg=There are events sent several times, see /tmp/lua-engine.log and /tmp/lua.log + ${result} Check Multiplicity When Broker Restarted /tmp/lua-engine.log /tmp/lua.log + Should Be True ${result} There are events sent several times, see /tmp/lua-engine.log and /tmp/lua.log BERDUC2 [Documentation] Starting/stopping Engine does not create duplicated events in usual cases @@ -188,16 +188,16 @@ BERDUC2 Broker Config Flush Log central 0 Broker Config Flush Log module0 0 Config Broker rrd - ${start}= Get Current Date + ${start} Get Current Date Start Broker Start Engine - ${content}= Create List lua: initializing the Lua virtual machine - ${result}= Find In Log with timeout ${centralLog} ${start} ${content} 30 - Should Be True ${result} msg=Lua not started in cbd - ${result}= Find In Log with timeout ${moduleLog0} ${start} ${content} 30 - Should Be True ${result} msg=Lua not started in centengine - ${result}= Check Connections - Should Be True ${result} msg=Engine and Broker not connected. + ${content} Create List lua: initializing the Lua virtual machine + ${result} Find In Log with timeout ${centralLog} ${start} ${content} 30 + Should Be True ${result} Lua not started in cbd + ${result} Find In Log with timeout ${moduleLog0} ${start} ${content} 30 + Should Be True ${result} Lua not started in centengine + ${result} Check Connections + Should Be True ${result} Engine and Broker not connected. Sleep 5s Stop Engine Sleep 5s @@ -206,8 +206,8 @@ BERDUC2 Sleep 25s Stop Engine Kindly Stop Broker - ${result}= Check Multiplicity When Engine Restarted /tmp/lua-engine.log /tmp/lua.log - Should Be True ${result} msg=There are events sent several times, see /tmp/lua-engine.log and /tmp/lua.log + ${result} Check Multiplicity When Engine Restarted /tmp/lua-engine.log /tmp/lua.log + Should Be True ${result} There are events sent several times, see /tmp/lua-engine.log and /tmp/lua.log BERDUCU2 [Documentation] Starting/stopping Engine does not create duplicated events in usual cases with unified_sql @@ -227,16 +227,16 @@ BERDUCU2 Broker Config Flush Log central 0 Broker Config Flush Log module0 0 Config Broker rrd - ${start}= Get Current Date + ${start} Get Current Date Start Broker Start Engine - ${content}= Create List lua: initializing the Lua virtual machine - ${result}= Find In Log with timeout ${centralLog} ${start} ${content} 30 - Should Be True ${result} msg=Lua not started in cbd - ${result}= Find In Log with timeout ${moduleLog0} ${start} ${content} 30 - Should Be True ${result} msg=Lua not started in centengine - ${result}= Check Connections - Should Be True ${result} msg=Engine and Broker not connected. + ${content} Create List lua: initializing the Lua virtual machine + ${result} Find In Log with timeout ${centralLog} ${start} ${content} 30 + Should Be True ${result} Lua not started in cbd + ${result} Find In Log with timeout ${moduleLog0} ${start} ${content} 30 + Should Be True ${result} Lua not started in centengine + ${result} Check Connections + Should Be True ${result} Engine and Broker not connected. Sleep 5s Stop Engine Sleep 5s @@ -245,8 +245,8 @@ BERDUCU2 Sleep 25s Stop Engine Kindly Stop Broker - ${result}= Check Multiplicity When Engine Restarted /tmp/lua-engine.log /tmp/lua.log - Should Be True ${result} msg=There are events sent several times, see /tmp/lua-engine.log and /tmp/lua.log + ${result} Check Multiplicity When Engine Restarted /tmp/lua-engine.log /tmp/lua.log + Should Be True ${result} There are events sent several times, see /tmp/lua-engine.log and /tmp/lua.log BERDUC3U1 [Documentation] Starting/stopping Broker does not create duplicated events in usual cases with unified_sql and BBDO 3.0 @@ -260,7 +260,6 @@ BERDUC3U1 Config Broker Sql Output central unified_sql Config Broker module Broker Config Add Lua Output module0 test-doubles ${SCRIPTS}test-doubles.lua - Broker Config Log module0 lua debug Broker Config Flush Log central 0 Broker Config Flush Log module0 0 Config Broker rrd @@ -268,16 +267,16 @@ BERDUC3U1 Broker Config Add Item central bbdo_version 3.0.0 Broker Config Add Item rrd bbdo_version 3.0.0 Clear Retention - ${start}= Get Current Date + ${start} Get Current Date Start Broker Start Engine - ${content}= Create List lua: initializing the Lua virtual machine - ${result}= Find In Log with timeout ${centralLog} ${start} ${content} 30 - Should Be True ${result} msg=Lua not started in cbd - ${result}= Find In Log with timeout ${moduleLog0} ${start} ${content} 30 - Should Be True ${result} msg=Lua not started in centengine - ${result}= Check Connections - Should Be True ${result} msg=Engine and Broker not connected. + ${content} Create List lua: initializing the Lua virtual machine + ${result} Find In Log with timeout ${centralLog} ${start} ${content} 30 + Should Be True ${result} Lua not started in cbd + ${result} Find In Log with timeout ${moduleLog0} ${start} ${content} 30 + Should Be True ${result} Lua not started in centengine + ${result} Check Connections + Should Be True ${result} Engine and Broker not connected. Sleep 5s Kindly Stop Broker Sleep 5s @@ -286,8 +285,8 @@ BERDUC3U1 Sleep 25s Stop Engine Kindly Stop Broker - ${result}= Check Multiplicity When Broker Restarted /tmp/lua-engine.log /tmp/lua.log - Should Be True ${result} msg=There are events sent several times, see /tmp/lua-engine.log and /tmp/lua.log + ${result} Check Multiplicity When Broker Restarted /tmp/lua-engine.log /tmp/lua.log + Should Be True ${result} There are events sent several times, see /tmp/lua-engine.log and /tmp/lua.log BERDUC3U2 [Documentation] Starting/stopping Engine does not create duplicated events in usual cases with unified_sql and BBDO 3.0 @@ -310,29 +309,29 @@ BERDUC3U2 Broker Config Add Item module0 bbdo_version 3.0.0 Broker Config Add Item central bbdo_version 3.0.0 Broker Config Add Item rrd bbdo_version 3.0.0 - ${start}= Get Current Date + ${start} Get Current Date Start Broker Start Engine # Let's wait for the lua to be correctly initialized - ${content}= Create List lua: initializing the Lua virtual machine - ${result}= Find In Log with timeout ${centralLog} ${start} ${content} 30 - Should Be True ${result} msg=Lua not started in cbd - ${result}= Find In Log with timeout ${moduleLog0} ${start} ${content} 30 - Should Be True ${result} msg=Lua not started in centengine + ${content} Create List lua: initializing the Lua virtual machine + ${result} Find In Log with timeout ${centralLog} ${start} ${content} 30 + Should Be True ${result} Lua not started in cbd + ${result} Find In Log with timeout ${moduleLog0} ${start} ${content} 30 + Should Be True ${result} Lua not started in centengine # Let's wait for all the services configuration. - ${content}= Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() + ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 - ${start}= Get Round Current Date + ${start} Get Round Current Date # Let's wait for a first service status. - ${content}= Create List SQL: pb service .* status .* type .* check result output - ${result}= Find Regex In Log with Timeout ${centralLog} ${start} ${content} 60 - Should Be True ${result[0]} msg=We did not get any pb service status for 60s + ${content} Create List SQL: pb service .* status .* type .* check result output + ${result} Find Regex In Log with Timeout ${centralLog} ${start} ${content} 60 + Should Be True ${result[0]} We did not get any pb service status for 60s - ${result}= Check Connections - Should Be True ${result} msg=Engine and Broker not connected. + ${result} Check Connections + Should Be True ${result} Engine and Broker not connected. Sleep 5s Stop Engine Sleep 5s @@ -341,8 +340,8 @@ BERDUC3U2 Sleep 25s Stop Engine Kindly Stop Broker - ${result}= Check Multiplicity When Engine Restarted /tmp/lua-engine.log /tmp/lua.log - Should Be True ${result} msg=There are events sent several times, see /tmp/lua-engine.log and /tmp/lua.log + ${result} Check Multiplicity When Engine Restarted /tmp/lua-engine.log /tmp/lua.log + Should Be True ${result} There are events sent several times, see /tmp/lua-engine.log and /tmp/lua.log BERDUCA300 [Documentation] Starting/stopping Engine is stopped ; it should emit a stop event and receive an ack event with events to clean from broker. @@ -367,33 +366,33 @@ BERDUCA300 Broker Config Add Item module0 bbdo_version 3.0.0 Broker Config Add Item central bbdo_version 3.0.0 Broker Config Add Item rrd bbdo_version 3.0.0 - ${start}= Get Current Date + ${start} Get Current Date Start Broker Start Engine - ${result}= Check Connections - Should Be True ${result} msg=Engine and Broker not connected. + ${result} Check Connections + Should Be True ${result} Engine and Broker not connected. # Let's wait for all the services configuration. - ${content}= Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() + ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 Stop Engine - ${content}= Create List BBDO: sending pb stop packet to peer - ${result}= Find in Log with Timeout ${moduleLog0} ${start} ${content} 30 - Should Be True ${result} msg=Engine should send a pb stop message to cbd. + ${content} Create List BBDO: sending pb stop packet to peer + ${result} Find in Log with Timeout ${moduleLog0} ${start} ${content} 30 + Should Be True ${result} Engine should send a pb stop message to cbd. - ${content}= Create List BBDO: received pb stop from peer - ${result}= Find in Log with Timeout ${centralLog} ${start} ${content} 30 - Should Be True ${result} msg=Broker should receive a pb stop message from engine. + ${content} Create List BBDO: received pb stop from peer + ${result} Find in Log with Timeout ${centralLog} ${start} ${content} 30 + Should Be True ${result} Broker should receive a pb stop message from engine. - ${content}= Create List send acknowledgement for [0-9]+ events - ${result}= Find Regex in Log with Timeout ${centralLog} ${start} ${content} 30 - Should Be True ${result[0]} msg=Broker should send an ack for handled events. + ${content} Create List send acknowledgement for [0-9]+ events + ${result} Find Regex in Log with Timeout ${centralLog} ${start} ${content} 30 + Should Be True ${result[0]} Broker should send an ack for handled events. - ${content}= Create List BBDO: received acknowledgement for [0-9]+ events before finishing - ${result}= Find Regex in Log with Timeout ${moduleLog0} ${start} ${content} 30 - Should Be True ${result[0]} msg=Engine should receive an ack for handled events from broker. + ${content} Create List BBDO: received acknowledgement for [0-9]+ events before finishing + ${result} Find Regex in Log with Timeout ${moduleLog0} ${start} ${content} 30 + Should Be True ${result[0]} Engine should receive an ack for handled events from broker. Kindly Stop Broker @@ -420,32 +419,32 @@ BERDUCA301 Broker Config Add Item module0 bbdo_version 3.0.1 Broker Config Add Item central bbdo_version 3.0.1 Broker Config Add Item rrd bbdo_version 3.0.1 - ${start}= Get Current Date + ${start} Get Current Date Start Broker Start Engine - ${result}= Check Connections - Should Be True ${result} msg=Engine and Broker not connected. + ${result} Check Connections + Should Be True ${result} Engine and Broker not connected. # Let's wait for all the services configuration. - ${content}= Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() + ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 Stop Engine - ${content}= Create List BBDO: sending pb stop packet to peer - ${result}= Find in Log with Timeout ${moduleLog0} ${start} ${content} 30 - Should Be True ${result} msg=Engine should send a pb stop message to cbd. + ${content} Create List BBDO: sending pb stop packet to peer + ${result} Find in Log with Timeout ${moduleLog0} ${start} ${content} 30 + Should Be True ${result} Engine should send a pb stop message to cbd. - ${content}= Create List BBDO: received pb stop from peer - ${result}= Find in Log with Timeout ${centralLog} ${start} ${content} 30 - Should Be True ${result} msg=Broker should receive a pb stop message from engine. + ${content} Create List BBDO: received pb stop from peer + ${result} Find in Log with Timeout ${centralLog} ${start} ${content} 30 + Should Be True ${result} Broker should receive a pb stop message from engine. - ${content}= Create List send pb acknowledgement for [0-9]+ events - ${result}= Find Regex in Log with Timeout ${centralLog} ${start} ${content} 30 - Should Be True ${result[0]} msg=Broker should send an ack for handled events. + ${content} Create List send pb acknowledgement for [0-9]+ events + ${result} Find Regex in Log with Timeout ${centralLog} ${start} ${content} 30 + Should Be True ${result[0]} Broker should send an ack for handled events. - ${content}= Create List BBDO: received acknowledgement for [0-9]+ events before finishing - ${result}= Find Regex in Log with Timeout ${moduleLog0} ${start} ${content} 30 - Should Be True ${result[0]} msg=Engine should receive an ack for handled events from broker. + ${content} Create List BBDO: received acknowledgement for [0-9]+ events before finishing + ${result} Find Regex in Log with Timeout ${moduleLog0} ${start} ${content} 30 + Should Be True ${result[0]} Engine should receive an ack for handled events from broker. Kindly Stop Broker diff --git a/tests/broker-engine/scheduler.robot b/tests/broker-engine/scheduler.robot index e77313640ac..42757389fe8 100644 --- a/tests/broker-engine/scheduler.robot +++ b/tests/broker-engine/scheduler.robot @@ -30,18 +30,16 @@ ENRSCHE1 Engine Config Set Value ${0} log_level_checks debug Engine Config Set Value ${0} log_flush_period 0 True - ${start}= Get Current Date + ${start} Get Current Date Start Broker Start Engine - ${result}= Check Connections - Should Be True ${result} msg=Engine and Broker not connected + ${result} Check Connections + Should Be True ${result} Engine and Broker not connected - ${pid}= Get Process Id e0 - ${content}= Set Variable Rescheduling next check of host: host_14 + ${content} Set Variable Rescheduling next check of host: host_14 - ${result1} ${result2}= check reschedule with timeout ${engineLog0} ${start} ${content} 240 + ${result1} ${result2} check reschedule with timeout ${engineLog0} ${start} ${content} 240 Should Be True ${result1} msg=the delta of last_check and next_check is not equal to 60. Should Be True ${result2} msg=the delta of last_check and next_check is not equal to 300. - Stop Engine - Kindly Stop Broker + [Teardown] Stop Engine Kindly Stop Broker diff --git a/tests/broker/sql.robot b/tests/broker/sql.robot index 72d442300b8..d8cfc11a704 100644 --- a/tests/broker/sql.robot +++ b/tests/broker/sql.robot @@ -278,7 +278,7 @@ BDBM1 ${result} Get Broker Stats Size central mysql manager Should Be True ... ${result} >= ${c} + 1 - ... The stats file should contain at less ${c} + 1 connections to the database. + ... The stats file should contain at least ${c} + 1 connections to the database. Kindly Stop Broker Stop Engine END diff --git a/tests/migration/migration.robot b/tests/migration/migration.robot index 8d6f4504f88..724f36d025a 100644 --- a/tests/migration/migration.robot +++ b/tests/migration/migration.robot @@ -17,7 +17,7 @@ Test Setup Stop Processes *** Test Cases *** MIGRATION - [Documentation] Migration bbdo2 => sql/storage => unified_sql => bbdo3 + [Documentation] Migration bbdo2 with sql/storage to bbdo2 with unified_sql and then to bbdo3 with unified_sql and then to bbdo2 with unified_sql and then to bbdo2 with sql/storage [Tags] broker engine services protobuf Log To Console Pure legacy mode @@ -29,77 +29,77 @@ MIGRATION Broker Config Log central core error Broker Config Log rrd rrd trace Clear Retention - ${start}= Get Current Date + ${start} Get Current Date Start Broker Start Engine - ${contentCentral}= Create List SQL: processing service status event - ${result}= Find In Log With Timeout ${centralLog} ${start} ${contentCentral} 200 - Should Be True ${result} msg=No service status processed by the sql output for 200s - ${contentRRD}= Create List RRD: output::write - ${result}= Find In Log With Timeout ${rrdLog} ${start} ${contentRRD} 30 - Should Be True ${result} msg=No metric sent to rrd cbd for 30s + ${contentCentral} Create List SQL: processing service status event + ${result} Find In Log With Timeout ${centralLog} ${start} ${contentCentral} 200 + Should Be True ${result} No service status processed by the sql output for 200s + ${contentRRD} Create List RRD: output::write + ${result} Find In Log With Timeout ${rrdLog} ${start} ${contentRRD} 30 + Should Be True ${result} No metric sent to rrd cbd for 30s Config Broker Sql Output central unified_sql - ${start}= Get Current Date + ${start} Get Current Date - Log To Console Move to unified_sql + Log To Console Move to BBDO 2.0.0 with unified_sql Kindly Stop Broker Start Broker Stop Engine Start Engine Sleep 2s - ${contentCentral}= Create List SQL: processing service status event - ${result}= Find In Log With Timeout ${centralLog} ${start} ${contentCentral} 200 - Should Be True ${result} msg=No service status processed by the unified_sql output for 200s - ${contentRRD}= Create List RRD: output::write - ${result}= Find In Log With Timeout ${rrdLog} ${start} ${contentRRD} 30 - Should Be True ${result} msg=No metric sent to rrd cbd by unified_sql for 30s + ${contentCentral} Create List SQL: processing service status event + ${result} Find In Log With Timeout ${centralLog} ${start} ${contentCentral} 200 + Should Be True ${result} No service status processed by the unified_sql output for 200s + ${contentRRD} Create List RRD: output::write + ${result} Find In Log With Timeout ${rrdLog} ${start} ${contentRRD} 30 + Should Be True ${result} No metric sent to rrd cbd by unified_sql for 30s Broker Config Add Item module0 bbdo_version 3.0.0 Broker Config Add Item module1 bbdo_version 3.0.0 Broker Config Add Item module2 bbdo_version 3.0.0 Broker Config Add Item central bbdo_version 3.0.0 Broker Config Add Item rrd bbdo_version 3.0.0 - ${start}= Get Current Date + ${start} Get Current Date - Log To Console Move to BBDO 3.0.0 + Log To Console Move to BBDO 3.0.0 with unified_sql Kindly Stop Broker Start Broker Stop Engine Start Engine Sleep 2s - ${contentCentral}= Create List status check result output: - ${result}= Find In Log With Timeout ${centralLog} ${start} ${contentCentral} 200 - Should Be True ${result} msg=No pb service status processed by the unified_sql output with BBDO3 for 200s - ${contentRRD}= Create List RRD: output::write - ${result}= Find In Log With Timeout ${rrdLog} ${start} ${contentRRD} 30 - Should Be True ${result} msg=No metric sent to rrd cbd by unified_sql for 30s + ${contentCentral} Create List status check result output: + ${result} Find In Log With Timeout ${centralLog} ${start} ${contentCentral} 200 + Should Be True ${result} No pb service status processed by the unified_sql output with BBDO3 for 200s + ${contentRRD} Create List RRD: output::write + ${result} Find In Log With Timeout ${rrdLog} ${start} ${contentRRD} 30 + Should Be True ${result} No metric sent to rrd cbd by unified_sql for 30s Broker Config Remove Item module0 bbdo_version Broker Config Remove Item module1 bbdo_version Broker Config Remove Item module2 bbdo_version Broker Config Remove Item central bbdo_version Broker Config Remove Item rrd bbdo_version - ${start}= Get Current Date + ${start} Get Current Date - Log To Console Move back to BBDO 2.0.0 + Log To Console Move back to BBDO 2.0.0 with unified_sql Kindly Stop Broker Start Broker Stop Engine Start Engine Sleep 2s - ${contentCentral}= Create List SQL: processing service status event - ${result}= Find In Log With Timeout ${centralLog} ${start} ${contentCentral} 200 - Should Be True ${result} msg=No service status processed by the unified_sql output for 200s - ${contentRRD}= Create List RRD: output::write - ${result}= Find In Log With Timeout ${rrdLog} ${start} ${contentRRD} 30 - Should Be True ${result} msg=No metric sent to rrd cbd by unified_sql for 30s + ${contentCentral} Create List SQL: processing service status event + ${result} Find In Log With Timeout ${centralLog} ${start} ${contentCentral} 200 + Should Be True ${result} No service status processed by the unified_sql output for 200s + ${contentRRD} Create List RRD: output::write + ${result} Find In Log With Timeout ${rrdLog} ${start} ${contentRRD} 30 + Should Be True ${result} No metric sent to rrd cbd by unified_sql for 30s - Log To Console Move back to sql/storage + Log To Console Move back to BBDO 2.0.0 with sql/storage Config Broker Sql Output central sql/perfdata Kindly Stop Broker Start Broker @@ -107,12 +107,11 @@ MIGRATION Start Engine Sleep 2s - ${contentCentral}= Create List SQL: processing service status event - ${result}= Find In Log With Timeout ${centralLog} ${start} ${contentCentral} 200 - Should Be True ${result} msg=No service status processed by the sql output for 200s - ${contentRRD}= Create List RRD: output::write - ${result}= Find In Log With Timeout ${rrdLog} ${start} ${contentRRD} 30 - Should Be True ${result} msg=No metric sent to rrd cbd for 30s + ${contentCentral} Create List SQL: processing service status event + ${result} Find In Log With Timeout ${centralLog} ${start} ${contentCentral} 200 + Should Be True ${result} No service status processed by the sql output for 200s + ${contentRRD} Create List RRD: output::write + ${result} Find In Log With Timeout ${rrdLog} ${start} ${contentRRD} 30 + Should Be True ${result} No metric sent to rrd cbd for 30s - Stop Engine - Kindly Stop Broker + [Teardown] Run Keywords Stop Engine Kindly Stop Broker From 55f9ad4341fe04ade7902a782994ae48996c57d1 Mon Sep 17 00:00:00 2001 From: David Boucher Date: Wed, 11 Oct 2023 13:26:22 +0200 Subject: [PATCH 04/84] fix(tests): scheduler test is split into 2 tests, retry check and then normal check --- tests/broker-engine/scheduler.robot | 16 ++++++++--- tests/resources/Common.py | 43 +++++++++++++---------------- 2 files changed, 31 insertions(+), 28 deletions(-) diff --git a/tests/broker-engine/scheduler.robot b/tests/broker-engine/scheduler.robot index 42757389fe8..054c8c574f2 100644 --- a/tests/broker-engine/scheduler.robot +++ b/tests/broker-engine/scheduler.robot @@ -39,7 +39,15 @@ ENRSCHE1 ${content} Set Variable Rescheduling next check of host: host_14 - ${result1} ${result2} check reschedule with timeout ${engineLog0} ${start} ${content} 240 - Should Be True ${result1} msg=the delta of last_check and next_check is not equal to 60. - Should Be True ${result2} msg=the delta of last_check and next_check is not equal to 300. - [Teardown] Stop Engine Kindly Stop Broker + # We check a retry check rescheduling + Process Host Check Result host_14 1 host_14 is down + + ${result} Check Reschedule With Timeout ${engineLog0} ${start} ${content} True 240 + Should Be True ${result} The delta between last_check and next_check is not equal to 60 as expected for a retry check + + # We check a normal check rescheduling + ${start} Get Current Date + ${result} Check Reschedule With Timeout ${engineLog0} ${start} ${content} False 240 + Should Be True ${result} The delta between last_check and next_check is not equal to 300 as expected for a normal check + + [Teardown] Run Keywords Stop Engine AND Kindly Stop Broker diff --git a/tests/resources/Common.py b/tests/resources/Common.py index ae760cb80b4..6a8023df2a5 100644 --- a/tests/resources/Common.py +++ b/tests/resources/Common.py @@ -345,9 +345,9 @@ def engine_log_table_duplicate(result: list): def check_engine_logs_are_duplicated(log: str, date): try: - f = open(log, "r") - lines = f.readlines() - f.close() + with open(log, "r") as f: + lines = f.readlines() + idx = find_line_from(lines, date) count_true = 0 count_false = 0 @@ -417,16 +417,18 @@ def find_line_from(lines, date): return idx -def check_reschedule(log: str, date, content: str): +def check_reschedule(log: str, date, content: str, retry: bool): try: with open(log, "r") as f: lines = f.readlines() idx = find_line_from(lines, date) - retry_check = False - normal_check = False r = re.compile(r".* last check at (.*) and next check at (.*)$") + if retry: + target = 60 + else: + target = 300 for i in range(idx, len(lines)): line = lines[i] if content in line: @@ -436,32 +438,25 @@ def check_reschedule(log: str, date, content: str): if m: delta = int(datetime.strptime(m[2], "%Y-%m-%dT%H:%M:%S").timestamp()) - int( datetime.strptime(m[1], "%Y-%m-%dT%H:%M:%S").timestamp()) - if abs(delta - 60) < 2: - retry_check = True - elif abs(delta - 300) < 2: - normal_check = True - else: - logger.console( - f"We have a line whose distance between last check and next check is {delta}s") - else: - logger.console( - f"Unable to find last check and next check in the line '{line}'") - logger.console(f"loop finished with {retry_check}, {normal_check}") - return retry_check, normal_check + # delta is near target + if abs(delta - target) < 2: + return True + logger.console(f"loop finished without finding a line '{content}' with a duration of {target}s") + return False except IOError: logger.console("The file '{}' does not exist".format(log)) - return False, False + return False -def check_reschedule_with_timeout(log: str, date, content: str, timeout: int): +def check_reschedule_with_timeout(log: str, date, content: str, retry: bool, timeout: int): limit = time.time() + timeout c = "" while time.time() < limit: - v1, v2 = check_reschedule(log, date, content) - if v1 and v2: - return v1, v2 + v = check_reschedule(log, date, content, retry) + if v: + return True time.sleep(5) - return False, False + return False def clear_commands_status(): From f1c61a4fd542257887782fb9e584f4fae471a6d1 Mon Sep 17 00:00:00 2001 From: David Boucher Date: Wed, 11 Oct 2023 14:11:32 +0200 Subject: [PATCH 05/84] fix(tests): external-commands2 contained an issue in its last check --- tests/broker-engine/external-commands2.robot | 101 ++++++++++--------- tests/resources/Common.py | 7 +- 2 files changed, 55 insertions(+), 53 deletions(-) diff --git a/tests/broker-engine/external-commands2.robot b/tests/broker-engine/external-commands2.robot index 05aebda0c19..be020c39bea 100644 --- a/tests/broker-engine/external-commands2.robot +++ b/tests/broker-engine/external-commands2.robot @@ -38,7 +38,7 @@ BEEXTCMD30 ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} - ... msg=An Initial host state on host_1 should be raised before we can start our external commands. + ... An Initial host state on host_1 should be raised before we can start our external commands. Disable Host Notifications ${use_grpc} host_1 Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} @@ -90,7 +90,7 @@ BEEXTCMD31 ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} - ... msg=An Initial host state on host_1 should be raised before we can start our external commands. + ... An Initial host state on host_1 should be raised before we can start our external commands. Disable Host Svc Checks ${use_grpc} host_1 Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} @@ -180,7 +180,7 @@ BEEXTCMD32 ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} - ... msg=An Initial host state on host_1 should be raised before we can start our external commands. + ... An Initial host state on host_1 should be raised before we can start our external commands. Disable Host Svc Checks ${use_grpc} host_1 Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} @@ -258,7 +258,7 @@ BEEXTCMD33 ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} - ... msg=An Initial host state on host_1 should be raised before we can start our external commands. + ... An Initial host state on host_1 should be raised before we can start our external commands. Disable Host Svc Notifications ${use_grpc} host_1 Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} @@ -309,7 +309,7 @@ BEEXTCMD34 ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} - ... msg=An Initial host state on host_1 should be raised before we can start our external commands. + ... An Initial host state on host_1 should be raised before we can start our external commands. Disable Host Svc Notifications ${use_grpc} host_1 Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} @@ -365,7 +365,7 @@ BEEXTCMD35 ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} - ... msg=An Initial host state on host_1 should be raised before we can start our external commands. + ... An Initial host state on host_1 should be raised before we can start our external commands. Disable Passive Host Checks ${use_grpc} host_1 Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} @@ -430,7 +430,7 @@ BEEXTCMD36 ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} - ... msg=An Initial host state on host_1 should be raised before we can start our external commands. + ... An Initial host state on host_1 should be raised before we can start our external commands. Disable Passive Host Checks ${use_grpc} host_1 Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} @@ -482,7 +482,7 @@ BEEXTCMD37 ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} - ... msg=An Initial host state on host_1 should be raised before we can start our external commands. + ... An Initial host state on host_1 should be raised before we can start our external commands. Disable Passive Svc Checks ${use_grpc} host_1 service_1 Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} @@ -551,7 +551,7 @@ BEEXTCMD38 ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} - ... msg=An Initial host state on host_1 should be raised before we can start our external commands. + ... An Initial host state on host_1 should be raised before we can start our external commands. Disable Passive Svc Checks ${use_grpc} host_1 service_1 Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} @@ -607,7 +607,7 @@ BEEXTCMD39 ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} - ... msg=An Initial host state on host_1 should be raised before we can start our external commands. + ... An Initial host state on host_1 should be raised before we can start our external commands. Stop Obsessing Over Host ${use_grpc} host_1 Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} @@ -654,7 +654,7 @@ BEEXTCMD40 ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} - ... msg=An Initial host state on host_1 should be raised before we can start our external commands. + ... An Initial host state on host_1 should be raised before we can start our external commands. Stop Obsessing Over Host ${use_grpc} host_1 Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} @@ -706,7 +706,7 @@ BEEXTCMD41 ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} - ... msg=An Initial host state on host_1 should be raised before we can start our external commands. + ... An Initial host state on host_1 should be raised before we can start our external commands. Stop Obsessing Over Svc ${use_grpc} host_1 service_1 Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} @@ -757,7 +757,7 @@ BEEXTCMD42 ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} - ... msg=An Initial host state on host_1 should be raised before we can start our external commands. + ... An Initial host state on host_1 should be raised before we can start our external commands. Stop Obsessing Over Svc ${use_grpc} host_1 service_1 Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} @@ -814,7 +814,7 @@ BEEXTCMD_GRPC1 ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} - ... msg=An Initial host state on host_1 should be raised before we can start our external commands. + ... An Initial host state on host_1 should be raised before we can start our external commands. Change Normal Svc Check Interval ${use_grpc} host_1 service_1 10 Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} @@ -853,7 +853,7 @@ BEEXTCMD_GRPC2 ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} - ... msg=An Initial host state on host_1 should be raised before we can start our external commands. + ... An Initial host state on host_1 should be raised before we can start our external commands. Change Normal Svc Check Interval ${use_grpc} host_1 service_1 15 Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} @@ -898,7 +898,7 @@ BEEXTCMD_GRPC3 ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} - ... msg=An Initial host state on host_1 should be raised before we can start our external commands. + ... An Initial host state on host_1 should be raised before we can start our external commands. Change Normal Host Check Interval ${use_grpc} host_1 10 Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} @@ -936,7 +936,7 @@ BEEXTCMD_GRPC4 ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} - ... msg=An Initial host state on host_1 should be raised before we can start our external commands. + ... An Initial host state on host_1 should be raised before we can start our external commands. Change Normal Host Check Interval ${use_grpc} host_1 15 Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} @@ -1025,7 +1025,7 @@ BEEXTCMD_REVERSE_GRPC2 ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} - ... msg=An Initial host state on host_1 should be raised before we can start our external commands. + ... An Initial host state on host_1 should be raised before we can start our external commands. Change Normal Svc Check Interval ${use_grpc} host_1 service_1 15 Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} @@ -1074,7 +1074,7 @@ BEEXTCMD_REVERSE_GRPC3 ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} - ... msg=An Initial host state on host_1 should be raised before we can start our external commands. + ... An Initial host state on host_1 should be raised before we can start our external commands. Change Normal Host Check Interval ${use_grpc} host_1 10 Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} @@ -1116,7 +1116,7 @@ BEEXTCMD_REVERSE_GRPC4 ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} - ... msg=An Initial host state on host_1 should be raised before we can start our external commands. + ... An Initial host state on host_1 should be raised before we can start our external commands. Sleep 1s Change Normal Host Check Interval ${use_grpc} host_1 15 @@ -1160,7 +1160,7 @@ BEEXTCMD_COMPRESS_GRPC1 ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} - ... msg=An Initial host state on host_1 should be raised before we can start our external commands. + ... An Initial host state on host_1 should be raised before we can start our external commands. Change Normal Svc Check Interval ${use_grpc} host_1 service_1 10 Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} @@ -1193,11 +1193,11 @@ BEATOI11 Start Engine ${content}= Create List check_for_external_commands ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 - Should Be True ${result} msg=No check for external commands executed for 1mn. + Should Be True ${result} No check for external commands executed for 1mn. SEND CUSTOM HOST NOTIFICATION host_1 1 admin foobar ${content}= Create List EXTERNAL COMMAND: SEND_CUSTOM_HOST_NOTIFICATION;host_1;1;admin;foobar ${result}= Find In Log With Timeout ${engineLog0} ${start} ${content} 60 - Should Be True ${result} msg=command argument notification_option must be an integer between 0 and 7. + Should Be True ${result} command argument notification_option must be an integer between 0 and 7. Stop Engine Kindly Stop Broker @@ -1215,12 +1215,12 @@ BEATOI12 Start Engine ${content}= Create List check_for_external_commands ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 - Should Be True ${result} msg=No check for external commands executed for 1mn. + Should Be True ${result} No check for external commands executed for 1mn. SEND CUSTOM HOST NOTIFICATION host_1 8 admin foobar ${content}= Create List ... Error: could not send custom host notification: '8' must be an integer between 0 and 7 ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 - Should Be True ${result} msg=command argument notification_option must be an integer between 0 and 7. + Should Be True ${result} command argument notification_option must be an integer between 0 and 7. Stop Engine Kindly Stop Broker @@ -1238,12 +1238,12 @@ BEATOI13 Start Engine ${content}= Create List check_for_external_commands ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 - Should Be True ${result} msg=No check for external commands executed for 1mn. + Should Be True ${result} No check for external commands executed for 1mn. ${date}= Get Current Date result_format=epoch SCHEDULE SERVICE DOWNTIME host_1 service_1 -1 ${content}= Create List Error: could not schedule downtime : duration ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 - Should Be True ${result} msg=command argument duration must be an integer >= 0. + Should Be True ${result} command argument duration must be an integer >= 0. Stop Engine Kindly Stop Broker @@ -1261,16 +1261,16 @@ BEATOI21 Start Engine ${content}= Create List check_for_external_commands ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 - Should Be True ${result} msg=No check for external commands executed for 1mn. + Should Be True ${result} No check for external commands executed for 1mn. ADD HOST COMMENT host_1 1 user comment ${content}= Create List ADD_HOST_COMMENT ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 - Should Be True ${result} msg=the comment with id:1 was not added. + Should Be True ${result} the comment with id:1 was not added. ${com_id}= Find Internal Id ${start} True 30 - Should Be True ${com_id}>0 msg=Comment id should be a positive integer. + Should Be True ${com_id}>0 Comment id should be a positive integer. DEL HOST COMMENT ${com_id} ${result}= Find Internal Id ${start} False 30 - Should Be True ${result} msg=the comment with id:${com_id} was not deleted. + Should Be True ${result} the comment with id:${com_id} was not deleted. Stop Engine Kindly Stop Broker @@ -1289,18 +1289,18 @@ BEATOI22 Start Engine ${content}= Create List check_for_external_commands ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 - Should Be True ${result} msg=No check for external commands executed for 1mn. + Should Be True ${result} No check for external commands executed for 1mn. ADD HOST COMMENT host_1 1 user comment ${content}= Create List ADD_HOST_COMMENT ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 - Should Be True ${result} msg=the comment with id:1 was not added. + Should Be True ${result} the comment with id:1 was not added. ${com_id}= Find Internal Id ${start} True 30 DEL HOST COMMENT -1 ${content}= Create List Error: could not delete comment : comment_id ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 - Should Be True ${result} msg=comment_id must be an unsigned integer. + Should Be True ${result} comment_id must be an unsigned integer. ${result}= Find Internal Id ${start} True 30 - Should Be True ${result} msg=comment with id:-1 was deleted. + Should Be True ${result} comment with id:-1 was deleted. Stop Engine Kindly Stop Broker @@ -1318,12 +1318,12 @@ BEATOI23 Start Engine ${content}= Create List check_for_external_commands ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 - Should Be True ${result} msg=No check for external commands executed for 1mn. + Should Be True ${result} No check for external commands executed for 1mn. ${date}= Get Current Date result_format=epoch ADD SVC COMMENT host_1 service_1 0 user comment ${content}= Create List ADD_SVC_COMMENT ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 - Should Be True ${result} msg=command argument persistent_flag must be 0 or 1. + Should Be True ${result} command argument persistent_flag must be 0 or 1. Stop Engine Kindly Stop Broker @@ -1342,7 +1342,7 @@ BECUSTOMHOSTVAR Start Engine ${content}= Create List check_for_external_commands ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 - Should Be True ${result} msg=No check for external commands executed for 1mn. + Should Be True ${result} No check for external commands executed for 1mn. ${date}= Get Current Date result_format=epoch CHANGE CUSTOM HOST VAR COMMAND host_1 SNMPVERSION 789456 @@ -1377,7 +1377,7 @@ BECUSTOMSVCVAR Start Engine ${content}= Create List check_for_external_commands ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 - Should Be True ${result} msg=No check for external commands executed for 1mn. + Should Be True ${result} No check for external commands executed for 1mn. ${date}= Get Current Date result_format=epoch CHANGE CUSTOM SVC VAR COMMAND host_1 service_1 CRITICAL 456123 @@ -1412,7 +1412,7 @@ BESERVCHECK Start Engine ${content}= Create List check_for_external_commands ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 - Should Be True ${result} msg=No check for external commands executed for 1mn. + Should Be True ${result} No check for external commands executed for 1mn. Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} Execute SQL String UPDATE services set command_line='toto', next_check=0 where service_id=1 and host_id=1 schedule_forced_svc_check host_1 service_1 @@ -1422,10 +1422,10 @@ BESERVCHECK ... service_1 ... 30 ... ${VarRoot}/lib/centreon-engine/check.pl ${command_param} - Should Be True ${result} msg=service table not updated + Should Be True ${result} service table not updated BEHOSTCHECK - [Documentation] external command CHECK_SERVICE_RESULT + [Documentation] external command CHECK_HOST_RESULT [Tags] broker engine host extcmd atoi Config Engine ${1} ${50} ${20} Config Broker central @@ -1434,14 +1434,15 @@ BEHOSTCHECK Broker Config Add Item module0 bbdo_version 3.0.0 Broker Config Add Item central bbdo_version 3.0.0 Config Broker Sql Output central unified_sql - ${start}= Get Current Date + ${start} Get Current Date Start Broker Start Engine - ${content}= Create List check_for_external_commands - ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 - Should Be True ${result} msg=No check for external commands executed for 1mn. + ${content} Create List check_for_external_commands + ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + Should Be True ${result} No check for external commands executed for 1mn. + Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} - Execute SQL String UPDATE hosts set command_line='toto' where name='host_1' - schedule_forced_host_check host_1 - ${result}= check_host_check_with_timeout host_1 30 ${VarRoot}/lib/centreon-engine/check.pl 0 1 - Should Be True ${result} msg=hosts table not updated + Execute SQL String UPDATE hosts SET command_line='toto' WHERE name='host_1' + Schedule Forced Host Check host_1 + ${result} Check Host Check With Timeout host_1 30 ${VarRoot}/lib/centreon-engine/check.pl 0 + Should Be True ${result} hosts table not updated diff --git a/tests/resources/Common.py b/tests/resources/Common.py index 6a8023df2a5..2357c617ce9 100644 --- a/tests/resources/Common.py +++ b/tests/resources/Common.py @@ -441,7 +441,8 @@ def check_reschedule(log: str, date, content: str, retry: bool): # delta is near target if abs(delta - target) < 2: return True - logger.console(f"loop finished without finding a line '{content}' with a duration of {target}s") + logger.console( + f"loop finished without finding a line '{content}' with a duration of {target}s") return False except IOError: logger.console("The file '{}' does not exist".format(log)) @@ -874,12 +875,12 @@ def check_host_check_with_timeout(hostname: str, timeout: int, command_line: str with connection: with connection.cursor() as cursor: cursor.execute( - f"SELECT h.command_line FROM hosts h WHERE h.name=\"{hostname}\"") + f"SELECT command_line FROM hosts WHERE name='{hostname}'") result = cursor.fetchall() if len(result) > 0: logger.console( f"command_line={result[0]['command_line']} ") - if result[0]['command_line'] is not None and result[0]['command_line'] == command_line: + if result[0]['command_line'] is not None and command_line in result[0]['command_line']: return True time.sleep(1) return False From ce4c012830b056c4d9c7a46d5d9dfd12d3c8789e Mon Sep 17 00:00:00 2001 From: David Boucher Date: Thu, 12 Oct 2023 12:26:05 +0200 Subject: [PATCH 06/84] fix(tests): several tests should be fixed --- broker/bam/src/bool_operation.cc | 5 ++++ broker/bam/src/connector.cc | 3 ++- broker/bam/src/monitoring_stream.cc | 1 + tests/bam/boolean_rules.robot | 36 +++++++++++++++++++++++----- tests/broker-engine/start-stop.robot | 5 ++-- tests/resources/Broker.py | 13 ++++++++++ 6 files changed, 53 insertions(+), 10 deletions(-) diff --git a/broker/bam/src/bool_operation.cc b/broker/bam/src/bool_operation.cc index f9744832078..fb01d18872b 100644 --- a/broker/bam/src/bool_operation.cc +++ b/broker/bam/src/bool_operation.cc @@ -110,14 +110,19 @@ std::string bool_operation::object_info() const { switch (_type) { case addition: op = "PLUS"; + break; case substraction: op = "MINUS"; + break; case multiplication: op = "MUL"; + break; case division: op = "DIV"; + break; case modulo: op = "MODULO"; + break; default: return "unknown operation"; } diff --git a/broker/bam/src/connector.cc b/broker/bam/src/connector.cc index 6200287027f..6a2f83f2076 100644 --- a/broker/bam/src/connector.cc +++ b/broker/bam/src/connector.cc @@ -47,7 +47,8 @@ static constexpr multiplexing::muxer_filter _monitoring_stream_filter = { neb::downtime::static_type(), neb::pb_downtime::static_type(), bam::ba_status::static_type(), bam::pb_ba_status::static_type(), bam::kpi_status::static_type(), bam::pb_kpi_status::static_type(), - inherited_downtime::static_type(), pb_inherited_downtime::static_type()}; + inherited_downtime::static_type(), pb_inherited_downtime::static_type(), + extcmd::pb_ba_info::static_type()}; static constexpr multiplexing::muxer_filter _reporting_stream_filter = { bam::kpi_event::static_type(), diff --git a/broker/bam/src/monitoring_stream.cc b/broker/bam/src/monitoring_stream.cc index d0fa6d492ed..7f5317ef0cf 100644 --- a/broker/bam/src/monitoring_stream.cc +++ b/broker/bam/src/monitoring_stream.cc @@ -581,6 +581,7 @@ int monitoring_stream::write(std::shared_ptr const& data) { _write_external_command(cmd); } break; case extcmd::pb_ba_info::static_type(): { + log_v2::bam()->info("BAM: dump BA"); extcmd::pb_ba_info const& e = *std::static_pointer_cast(data); auto& obj = e.obj(); diff --git a/tests/bam/boolean_rules.robot b/tests/bam/boolean_rules.robot index 7b5612ee465..89928a3e543 100644 --- a/tests/bam/boolean_rules.robot +++ b/tests/bam/boolean_rules.robot @@ -39,13 +39,13 @@ BABOO Set Services Passive ${0} service_302 Set Services Passive ${0} service_303 - ${id_ba__sid} Create Ba ba-worst worst 70 80 - Add Service KPI host_16 service_302 ${id_ba__sid[0]} 40 30 20 - Add Service KPI host_16 service_303 ${id_ba__sid[0]} 40 30 20 + ${id_ba_worst__sid} Create Ba ba-worst worst 70 80 + Add Service KPI host_16 service_302 ${id_ba_worst__sid[0]} 40 30 20 + Add Service KPI host_16 service_303 ${id_ba_worst__sid[0]} 40 30 20 - ${id_ba__sid} Create Ba boolean-ba impact 70 80 + ${id_boolean_ba__sid} Create Ba boolean-ba impact 70 80 Add Boolean Kpi - ... ${id_ba__sid[0]} + ... ${id_boolean_ba__sid[0]} ... {host_16 service_302} {IS} {CRITICAL} {OR} {host_16 service_303} {IS} {CRITICAL} ... True ... 100 @@ -75,17 +75,21 @@ BABOO ${result} Check Service Resource Status With Timeout host_16 service_302 2 30 HARD Should Be True ${result} The service (host_16:service_302) should be CRITICAL. ${result} Check Ba Status With Timeout ba-worst 2 30 + Dump Ba On Error ${result} ${id_ba_worst__sid[0]} Should Be True ${result} The 'ba-worst' BA is not CRITICAL as expected ${result} Check Ba Status With Timeout boolean-ba 2 30 + Dump Ba On Error ${result} ${id_boolean_ba__sid[0]} Should Be True ${result} The 'boolean-ba' BA is not CRITICAL as expected Process Service Check Result host_16 service_302 0 output ok for service_302 ${result} Check Ba Status With Timeout ba-worst 0 30 + Dump Ba On Error ${result} ${id_ba_worst__sid[0]} + Should Be True ${result} The 'ba-worst' BA is not OK as expected ${result} Check Service Resource Status With Timeout host_16 service_302 0 30 HARD Should Be True ${result} The service (host_16:service_302) should be OK. - Should Be True ${result} The 'ba-worst' BA is not OK as expected ${result} Check Ba Status With Timeout boolean-ba 0 30 + Dump Ba On Error ${result} ${id_boolean_ba__sid[0]} Should Be True ${result} The 'boolean-ba' BA is not OK as expected END @@ -139,6 +143,7 @@ BABOOOR ... output critical for service_302 ${result} Check Ba Status With Timeout boolean-ba 2 30 + Dump Ba On Error ${result} ${id_ba__sid[0]} Should Be True ${result} The 'boolean-ba' BA is not CRITICAL as expected [Teardown] Run Keywords Stop Engine AND Kindly Stop Broker @@ -191,6 +196,7 @@ BABOOAND ... output critical for service_302 ${result} Check Ba Status With Timeout boolean-ba 2 30 + Dump Ba On Error ${result} ${id_ba__sid[0]} Should Be True ${result} The 'boolean-ba' BA is not CRITICAL as expected [Teardown] Run Keywords Stop Engine AND Kindly Stop Broker @@ -240,6 +246,8 @@ BABOOORREL ... service_302 ... 2 ... output critical for service_302 + ${result} Check Service Status With Timeout host_16 service_302 2 30 HARD + Should Be True ${result} The service (host_16,service_302) is not CRITICAL/HARD as expected # 303 is set to critical => {host_16 service_303} {IS} {OK} is then False Repeat Keyword @@ -249,6 +257,8 @@ BABOOORREL ... service_303 ... 2 ... output critical for service_303 + ${result} Check Service Status With Timeout host_16 service_303 2 30 HARD + Should Be True ${result} The service (host_16,service_303) is not CRITICAL/HARD as expected # 304 is set to ok => {host_16 service_304} {IS} {OK} is then True Repeat Keyword @@ -258,8 +268,11 @@ BABOOORREL ... service_304 ... 0 ... output ok for service_304 + ${result} Check Service Status With Timeout host_16 service_304 0 30 HARD + Should Be True ${result} The service (host_16,service_304) is not OK/HARD as expected ${result} Check Ba Status With Timeout boolean-ba 2 30 + Dump Ba On Error ${result} ${id_ba__sid[0]} Should Be True ${result} The 'boolean-ba' BA is not CRITICAL as expected Update Boolean Rule @@ -274,6 +287,7 @@ BABOOORREL ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} A message telling check_for_external_commands() should be available. ${result} Check Ba Status With Timeout boolean-ba 0 30 + Dump Ba On Error ${result} ${id_ba__sid[0]} Should Be True ${result} The 'boolean-ba' BA is not OK as expected Update Boolean Rule @@ -288,6 +302,7 @@ BABOOORREL ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} A message telling check_for_external_commands() should be available. ${result} Check Ba Status With Timeout boolean-ba 2 30 + Dump Ba On Error ${result} ${id_ba__sid[0]} Should Be True ${result} The 'boolean-ba' BA is not CRITICAL as expected [Teardown] Run Keywords Stop Engine AND Kindly Stop Broker @@ -342,6 +357,7 @@ BABOOCOMPL FOR ${i} IN RANGE ${1} ${21} ${2} ${result} Check Ba Status With Timeout boolean-ba 2 30 + Dump Ba On Error ${result} ${id_ba__sid[0]} Should Be True ${result} Step${i}: The 'boolean-ba' BA is not CRITICAL as expected Repeat Keyword ... 3 times @@ -353,6 +369,7 @@ BABOOCOMPL END ${result} Check Ba Status With Timeout boolean-ba 0 30 + Dump Ba On Error ${result} ${id_ba__sid[0]} Should Be True ${result} The 'boolean-ba' BA is not OK as expected [Teardown] Run Keywords Stop Engine AND Kindly Stop Broker @@ -369,3 +386,10 @@ BAM Setup Execute SQL String DELETE FROM mod_bam_reporting_ba_events Execute SQL String ALTER TABLE mod_bam_reporting_ba_events AUTO_INCREMENT = 1 Execute SQL String SET GLOBAL FOREIGN_KEY_CHECKS=1 + +Dump Ba On Error + [Arguments] ${result} ${ba_id} + IF not ${result} + Save Logs + Dump Ba 51001 ${ba_id} failed/${Test Name}/ba_${ba_id}.dot + END diff --git a/tests/broker-engine/start-stop.robot b/tests/broker-engine/start-stop.robot index 3acb5450886..b812fa1a7ac 100644 --- a/tests/broker-engine/start-stop.robot +++ b/tests/broker-engine/start-stop.robot @@ -95,9 +95,8 @@ BESS5 Start Broker Start Engine ${result} Check Connections - Should Be True ${result} - Kindly Stop Broker - Stop Engine + Should Be True ${result} Broker and Engine seem not connected + [Teardown] Run Keywords Kindly Stop Broker AND Stop Engine BESS_GRPC1 [Documentation] Start-Stop grpc version Broker/Engine - Broker started first - Broker stopped first diff --git a/tests/resources/Broker.py b/tests/resources/Broker.py index 2fa10b46f03..6895df3c5aa 100755 --- a/tests/resources/Broker.py +++ b/tests/resources/Broker.py @@ -2065,3 +2065,16 @@ def check_victoria_metric(request_body: str, min_timestamp: int, **to_check): def check_victoria_status(request_body: str, min_timestamp: int, **to_check): return check_victoria_data(request_body, "status", min_timestamp, **to_check) + + +def dump_ba(port, index: int, filename: str): + with grpc.insecure_channel(f"127.0.0.1:{port}") as channel: + stub = broker_pb2_grpc.BrokerStub(channel) + info = broker_pb2.BaInfo() + info.id = index + info.output_file = filename + try: + stub.GetBa(info) + logger.console(f"BA {index} dump to {filename}") + except: + logger.console("gRPC server not ready") From 73cc685d857374ea23d60b316eb257bee132f872 Mon Sep 17 00:00:00 2001 From: David Boucher Date: Thu, 12 Oct 2023 13:24:59 +0200 Subject: [PATCH 07/84] fix(tests): services-and-bulk-stmt.robot --- tests/broker-engine/services-and-bulk-stmt.robot | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/broker-engine/services-and-bulk-stmt.robot b/tests/broker-engine/services-and-bulk-stmt.robot index 3458f1a3318..f8b1841bd55 100644 --- a/tests/broker-engine/services-and-bulk-stmt.robot +++ b/tests/broker-engine/services-and-bulk-stmt.robot @@ -397,7 +397,7 @@ metric_mapping END Wait Until Created /tmp/test.log 30s - ${grep_res} Grep File /tmp/test.log "name: metric1 corresponds to metric id" + ${grep_res} Grep File /tmp/test.log name: metric1 corresponds to metric id Should Not Be Empty ${grep_res} metric name "metric1" not found *** Keywords *** From 8fd685d42c02a11536e285331e8df919d81e6e56 Mon Sep 17 00:00:00 2001 From: David Boucher Date: Thu, 12 Oct 2023 17:37:33 +0200 Subject: [PATCH 08/84] fix(tests): forced_checks fixed --- tests/engine/forced_checks.robot | 58 +++++++++++++------------ tests/resources/Engine.py | 24 +++++++--- tests/resources/engine-scripts/check.pl | 9 +++- 3 files changed, 56 insertions(+), 35 deletions(-) diff --git a/tests/engine/forced_checks.robot b/tests/engine/forced_checks.robot index 676fb196c2f..eba7481a21d 100644 --- a/tests/engine/forced_checks.robot +++ b/tests/engine/forced_checks.robot @@ -18,31 +18,35 @@ EFHC1 [Documentation] Engine is configured with hosts and we force checks on one 5 times on bbdo2 [Tags] engine external_cmd log-v2 Config Engine ${1} + # We force the check command of host_1 to return 2 as status. + Config Host Command Status ${0} checkh1 2 Config Broker central Config Broker rrd Config Broker module ${1} Engine Config Set Value ${0} log_legacy_enabled ${0} Engine Config Set Value ${0} log_v2_enabled ${1} + Engine Config Set Value ${0} log_level_events info + Engine Config Set Value ${0} log_flush_period 0 Clear Retention Clear DB hosts - ${start}= Get Current Date + ${start} Get Current Date Start Engine Start Broker - ${result}= Check host status host_1 4 1 False - Should be true ${result} msg=host_1 should be pending + ${result} Check host status host_1 4 1 False + Should be true ${result} host_1 should be pending - ${content}= Create List INITIAL HOST STATE: host_1; - ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${content} Create List INITIAL HOST STATE: host_1; + ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} - ... msg=An Initial host state on host_1 should be raised before we can start our external commands. + ... An Initial host state on host_1 should be raised before we can start our external commands. Process host check result host_1 0 host_1 UP FOR ${i} IN RANGE ${4} - Schedule Forced HOST CHECK host_1 ${VarRoot}/lib/centreon-engine/config0/rw/centengine.cmd + Schedule Forced Host Check host_1 ${VarRoot}/lib/centreon-engine/config0/rw/centengine.cmd Sleep 5s END - ${content}= Create List + ${content} Create List ... EXTERNAL COMMAND: SCHEDULE_FORCED_HOST_CHECK;host_1; ... HOST ALERT: host_1;DOWN;SOFT;1; ... EXTERNAL COMMAND: SCHEDULE_FORCED_HOST_CHECK;host_1; @@ -50,16 +54,16 @@ EFHC1 ... EXTERNAL COMMAND: SCHEDULE_FORCED_HOST_CHECK;host_1; ... HOST ALERT: host_1;DOWN;HARD;3; - ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 - Should Be True ${result} msg=Message about SCHEDULE FORCED CHECK and HOST ALERT should be available in log. + ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + Should Be True ${result} Message about SCHEDULE FORCED CHECK and HOST ALERT should be available in log. - ${result}= Check host status host_1 1 1 False - Should be true ${result} msg=host_1 should be down/hard + ${result} Check host status host_1 1 1 False + Should be true ${result} host_1 should be down/hard Stop Engine Kindly Stop Broker EFHC2 - [Documentation] Engine is configured with hosts and we force checks on one 5 times on bbdo2 + [Documentation] Engine is configured with hosts and we force check on one 5 times on bbdo2 [Tags] engine external_cmd log-v2 Config Engine ${1} Config Broker central @@ -76,7 +80,7 @@ EFHC2 ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} - ... msg=An Initial host state on host_1 should be raised before we can start our external commands. + ... An Initial host state on host_1 should be raised before we can start our external commands. Process host check result host_1 0 host_1 UP FOR ${i} IN RANGE ${4} Schedule Forced HOST CHECK host_1 ${VarRoot}/lib/centreon-engine/config0/rw/centengine.cmd @@ -91,10 +95,10 @@ EFHC2 ... HOST ALERT: host_1;DOWN;HARD;3; ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 - Should Be True ${result} msg=Message about SCHEDULE FORCED CHECK and HOST ALERT should be available in log. + Should Be True ${result} Message about SCHEDULE FORCED CHECK and HOST ALERT should be available in log. ${result}= Check host status host_1 1 1 False - Should be true ${result} msg=host_1 should be down/hard + Should be true ${result} host_1 should be down/hard Stop Engine Kindly Stop Broker @@ -120,12 +124,12 @@ EFHCU1 Start Engine Start Broker ${result}= Check host status host_1 4 1 True - Should be true ${result} msg=host_1 should be pending + Should be true ${result} host_1 should be pending ${content}= Create List INITIAL HOST STATE: host_1; ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} - ... msg=An Initial host state on host_1 should be raised before we can start our external commands. + ... An Initial host state on host_1 should be raised before we can start our external commands. Process host check result host_1 0 host_1 UP FOR ${i} IN RANGE ${4} Schedule Forced HOST CHECK host_1 ${VarRoot}/lib/centreon-engine/config0/rw/centengine.cmd @@ -140,10 +144,10 @@ EFHCU1 ... HOST ALERT: host_1;DOWN;HARD;3; ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 - Should Be True ${result} msg=Message about SCHEDULE FORCED CHECK and HOST ALERT should be available in log. + Should Be True ${result} Message about SCHEDULE FORCED CHECK and HOST ALERT should be available in log. ${result}= Check host status host_1 1 1 True - Should be true ${result} msg=host_1 should be down/hard + Should be true ${result} host_1 should be down/hard Stop Engine Kindly Stop Broker @@ -168,12 +172,12 @@ EFHCU2 Start Engine Start Broker ${result}= Check host status host_1 4 1 True - Should be true ${result} msg=host_1 should be pending + Should be true ${result} host_1 should be pending ${content}= Create List INITIAL HOST STATE: host_1; ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} - ... msg=An Initial host state on host_1 should be raised before we can start our external commands. + ... An Initial host state on host_1 should be raised before we can start our external commands. Process host check result host_1 0 host_1 UP FOR ${i} IN RANGE ${4} Schedule Forced HOST CHECK host_1 ${VarRoot}/lib/centreon-engine/config0/rw/centengine.cmd @@ -188,10 +192,10 @@ EFHCU2 ... HOST ALERT: host_1;DOWN;HARD;3; ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 - Should Be True ${result} msg=Message about SCHEDULE FORCED CHECK and HOST ALERT should be available in log. + Should Be True ${result} Message about SCHEDULE FORCED CHECK and HOST ALERT should be available in log. ${result}= Check host status host_1 1 1 True - Should be true ${result} msg=host_1 should be down/hard + Should be true ${result} host_1 should be down/hard Stop Engine Kindly Stop Broker @@ -218,14 +222,14 @@ EMACROS ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} - ... msg=An Initial host state on host_1 should be raised before we can start our external commands. + ... An Initial host state on host_1 should be raised before we can start our external commands. schedule_forced_svc_check host_1 service_1 Sleep 5s ${content}= Create List ... ResourceFile: /tmp/etc/centreon-engine/config0/resource.cfg - LogFile: /tmp/var/log/centreon-engine/config0/centengine.log - AdminEmail: titus@bidibule.com - AdminPager: admin ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 - Should Be True ${result} msg=AdminEmail: titus@bidibule.com - AdminPager: admin not found in log. + Should Be True ${result} AdminEmail: titus@bidibule.com - AdminPager: admin not found in log. Stop Engine Kindly Stop Broker @@ -261,7 +265,7 @@ EMACROS_NOTIF ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} - ... msg=An Initial host state on host_1 should be raised before we can start our external commands. + ... An Initial host state on host_1 should be raised before we can start our external commands. FOR ${i} IN RANGE 3 Process Service Check result host_1 service_1 2 critical diff --git a/tests/resources/Engine.py b/tests/resources/Engine.py index e87983832d1..f8cb3554d4f 100755 --- a/tests/resources/Engine.py +++ b/tests/resources/Engine.py @@ -1648,11 +1648,9 @@ def schedule_forced_svc_check(host: str, svc: str, pipe: str = VAR_ROOT + "/lib/ def schedule_forced_host_check(host: str, pipe: str = VAR_ROOT + "/lib/centreon-engine/config0/rw/centengine.cmd"): now = int(time.time()) - f = open(pipe, "w") - cmd = "[{1}] SCHEDULE_FORCED_HOST_CHECK;{0};{1}\n".format(host, now) - f.write(cmd) - f.close() - time.sleep(0.05) + cmd = f"[{now}] SCHEDULE_FORCED_HOST_CHECK;{host};{now}\n" + with open(pipe, "w") as f: + f.write(cmd) def create_severities_file(poller: int, nb: int, offset: int = 1): @@ -2210,4 +2208,18 @@ def send_bench(id: int, port: int): with grpc.insecure_channel("127.0.0.1:{}".format(port)) as channel: stub = engine_pb2_grpc.EngineStub(channel) stub.SendBench(engine_pb2.BenchParam(id=id, ts=ts)) - \ No newline at end of file + +def config_host_command_status(idx: int, cmd_name: str, status: int): + filename = f"{ETC_ROOT}/centreon-engine/config{idx}/commands.cfg" + with open(filename, "r") as f: + lines = f.readlines() + + r = re.compile(rf"^\s*command_name\s+{cmd_name}\s*$") + for i in range(len(lines)): + if r.match(lines[i]): + lines[i + 1] = f" command_line {ENGINE_HOME}/check.pl 0 {status}\n" + break + + with open(filename, "w") as f: + f.writelines(lines) + diff --git a/tests/resources/engine-scripts/check.pl b/tests/resources/engine-scripts/check.pl index a9579cf484b..14683999048 100755 --- a/tests/resources/engine-scripts/check.pl +++ b/tests/resources/engine-scripts/check.pl @@ -10,7 +10,7 @@ $d = ($d + 3 * $ARGV[0]) & 0x1ff; } -if ($#ARGV ne 0) { +if ($#ARGV gt 1) { die "The script must be used with one integer argument\n"; } @@ -18,6 +18,11 @@ if ($ARGV[0] eq 0) { printf("Host check $dd"); + if ($#ARGV eq 1) { + $status = $ARGV[1]; + } else { + $status = 0; + } } else { if (open(FH, '<', "/tmp/states")) { @@ -51,4 +56,4 @@ printf("Test check $ARGV[0] | metric=%.2f;%.2f;%.2f\n", $d, $w, $c); exit $status; } -exit 0; +exit $status; From 5228000eb58fb63fe0fd3012e6cb8229e833f264 Mon Sep 17 00:00:00 2001 From: David Boucher Date: Thu, 12 Oct 2023 18:14:58 +0200 Subject: [PATCH 09/84] fix(tests): Tests on forced checks improved --- tests/engine/forced_checks.robot | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/engine/forced_checks.robot b/tests/engine/forced_checks.robot index eba7481a21d..8a19aa2704f 100644 --- a/tests/engine/forced_checks.robot +++ b/tests/engine/forced_checks.robot @@ -66,6 +66,9 @@ EFHC2 [Documentation] Engine is configured with hosts and we force check on one 5 times on bbdo2 [Tags] engine external_cmd log-v2 Config Engine ${1} + + # We force the check command of host_1 to return 2 as status. + Config Host Command Status ${0} checkh1 2 Config Broker central Config Broker rrd Config Broker module ${1} @@ -106,6 +109,9 @@ EFHCU1 [Documentation] Engine is configured with hosts and we force checks on one 5 times on bbdo3. Bbdo3 has no impact on this behavior. resources table is cleared before starting broker. [Tags] engine external_cmd Config Engine ${1} + + # We force the check command of host_1 to return 2 as status. + Config Host Command Status ${0} checkh1 2 Config Broker central Config Broker rrd Config Broker module ${1} @@ -155,6 +161,9 @@ EFHCU2 [Documentation] Engine is configured with hosts and we force checks on one 5 times on bbdo3. Bbdo3 has no impact on this behavior. [Tags] engine external_cmd Config Engine ${1} + + # We force the check command of host_1 to return 2 as status. + Config Host Command Status ${0} checkh1 2 Config Broker central Config Broker rrd Config Broker module ${1} From b0d51c5ed0d4acff01981250d33db142f3aa1321 Mon Sep 17 00:00:00 2001 From: David Boucher Date: Fri, 13 Oct 2023 09:01:33 +0200 Subject: [PATCH 10/84] fix(tests): coding style better followed --- tests/bam/inherited_downtime.robot | 222 +++++----- tests/bam/pb_inherited_downtime.robot | 214 +++++----- tests/broker-database/networkFailure.robot | 84 ++-- tests/broker-engine/acknowledgement.robot | 180 ++++---- tests/broker-engine/anomaly-detection.robot | 142 +++---- tests/broker-engine/bbdo-protobuf.robot | 46 +- tests/broker-engine/compression.robot | 18 +- tests/broker-engine/delete-poller.robot | 64 +-- tests/broker-engine/downtimes.robot | 112 ++--- tests/broker-engine/external-commands.robot | 332 +++++++-------- tests/broker-engine/external-commands2.robot | 330 +++++++-------- tests/broker-engine/hostgroups.robot | 58 +-- .../hosts-with-notes-and-actions.robot | 18 +- tests/broker-engine/log-v2_engine.robot | 212 +++++----- tests/broker-engine/muxer_filter.robot | 136 +++--- tests/broker-engine/output-tables.robot | 132 +++--- tests/broker-engine/reverse-connection.robot | 110 ++--- tests/broker-engine/rrd-from-db.robot | 140 +++---- tests/broker-engine/rrdcached-from-db.robot | 106 ++--- tests/broker-engine/rrdcached.robot | 52 +-- tests/broker-engine/servicegroups.robot | 24 +- .../services-with-notes-and-actions.robot | 18 +- tests/broker-engine/services.robot | 10 +- tests/broker-engine/tags.robot | 394 +++++++++--------- tests/broker-engine/tls.robot | 162 +++---- tests/broker-engine/victoria.robot | 8 +- tests/broker/bbdo-server-client-ko.robot | 36 +- .../broker/bbdo-server-client-reversed.robot | 92 ++-- tests/broker/bbdo-server-client.robot | 100 ++--- tests/broker/command-line.robot | 32 +- tests/broker/filters.robot | 16 +- tests/broker/grpc-stream.robot | 4 +- tests/broker/log.robot | 30 +- tests/ccc/ccc.robot | 64 +-- tests/connector_perl/connector_perl.robot | 16 +- tests/connector_ssh/connector_ssh.robot | 52 +-- tests/engine/forced_checks.robot | 58 +-- tests/engine/perl-connectors.robot | 14 +- tests/resources/db_variables.robot | 2 +- tests/resources/resources.robot | 8 +- tests/severities/hosts.robot | 82 ++-- tests/severities/severities.robot | 122 +++--- 42 files changed, 2026 insertions(+), 2026 deletions(-) diff --git a/tests/bam/inherited_downtime.robot b/tests/bam/inherited_downtime.robot index 7002b822cc9..12bee1eff8e 100644 --- a/tests/bam/inherited_downtime.robot +++ b/tests/bam/inherited_downtime.robot @@ -29,49 +29,49 @@ BEBAMIDT1 Clone Engine Config To DB Add Bam Config To Engine - @{svc}= Set Variable ${{ [("host_16", "service_314")] }} + @{svc} Set Variable ${{ [("host_16", "service_314")] }} Create BA With Services test worst ${svc} Add Bam Config To Broker central # Command of service_314 is set to critical - ${cmd_1}= Get Command Id 314 + ${cmd_1} Get Command Id 314 Log To Console service_314 has command id ${cmd_1} Set Command Status ${cmd_1} 2 Start Broker - ${start}= Get Current Date + ${start} Get Current Date Start Engine # Let's wait for the initial service states. - ${content}= Create List INITIAL SERVICE STATE: host_50;service_1000; - ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; + ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} - ... msg=An Initial service state on service (50, 1000) should be raised before we can start external commands. + ... An Initial service state on service (50, 1000) should be raised before we can start external commands. # KPI set to critical Repeat Keyword 3 times Process Service Check Result host_16 service_314 2 output critical for 314 - ${result}= Check Service Status With Timeout host_16 service_314 2 60 HARD - Should Be True ${result} msg=The service (host_16,service_314) is not CRITICAL as expected + ${result} Check Service Status With Timeout host_16 service_314 2 60 HARD + Should Be True ${result} The service (host_16,service_314) is not CRITICAL as expected # The BA should become critical - ${result}= Check Ba Status With Timeout test 2 60 - Should Be True ${result} msg=The BA ba_1 is not CRITICAL as expected + ${result} Check Ba Status With Timeout test 2 60 + Should Be True ${result} The BA ba_1 is not CRITICAL as expected # A downtime is put on service_314 Schedule Service Downtime host_16 service_314 3600 - ${result}= Check Service Downtime With Timeout host_16 service_314 1 60 - Should Be True ${result} msg=The service (host_16, service_314) is not in downtime as it should be - ${result}= Check Service Downtime With Timeout _Module_BAM_1 ba_1 1 60 - Should Be True ${result} msg=The BA ba_1 is not in downtime as it should + ${result} Check Service Downtime With Timeout host_16 service_314 1 60 + Should Be True ${result} The service (host_16, service_314) is not in downtime as it should be + ${result} Check Service Downtime With Timeout _Module_BAM_1 ba_1 1 60 + Should Be True ${result} The BA ba_1 is not in downtime as it should # The downtime is deleted Delete Service Downtime host_16 service_314 - ${result}= Check Service Downtime With Timeout host_16 service_314 0 60 - Should Be True ${result} msg=The service (host_16, service_314) is in downtime and should not. + ${result} Check Service Downtime With Timeout host_16 service_314 0 60 + Should Be True ${result} The service (host_16, service_314) is in downtime and should not. - ${result}= Check Downtimes With Timeout 0 60 - Should Be True ${result} msg=We should have no more running downtimes + ${result} Check Downtimes With Timeout 0 60 + Should Be True ${result} We should have no more running downtimes - ${result}= Check Service Downtime With Timeout _Module_BAM_1 ba_1 0 60 - Should Be True ${result} msg=The BA ba_1 is in downtime as it should not + ${result} Check Service Downtime With Timeout _Module_BAM_1 ba_1 0 60 + Should Be True ${result} The BA ba_1 is in downtime as it should not Stop Engine Kindly Stop Broker @@ -89,54 +89,54 @@ BEBAMIDT2 Clone Engine Config To DB Add Bam Config To Engine - @{svc}= Set Variable ${{ [("host_16", "service_314")] }} + @{svc} Set Variable ${{ [("host_16", "service_314")] }} Create BA With Services test worst ${svc} Add Bam Config To Broker central # Command of service_314 is set to critical - ${cmd_1}= Get Command Id 314 + ${cmd_1} Get Command Id 314 Log To Console service_314 has command id ${cmd_1} Set Command Status ${cmd_1} 2 Start Broker - ${start}= Get Current Date + ${start} Get Current Date Start Engine # Let's wait for the initial service states. - ${content}= Create List INITIAL SERVICE STATE: host_50;service_1000; - ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; + ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} - ... msg=An Initial service state on service (50, 1000) should be raised before we can start external commands. + ... An Initial service state on service (50, 1000) should be raised before we can start external commands. # KPI set to critical Repeat Keyword 3 times Process Service Check Result host_16 service_314 2 output critical for 314 - ${result}= Check Service Status With Timeout host_16 service_314 2 60 - Should Be True ${result} msg=The service (host_16,service_314) is not CRITICAL as expected + ${result} Check Service Status With Timeout host_16 service_314 2 60 + Should Be True ${result} The service (host_16,service_314) is not CRITICAL as expected # The BA should become critical - ${result}= Check Ba Status With Timeout test 2 60 - Should Be True ${result} msg=The BA ba_1 is not CRITICAL as expected + ${result} Check Ba Status With Timeout test 2 60 + Should Be True ${result} The BA ba_1 is not CRITICAL as expected # A downtime is put on service_314 Schedule Service Downtime host_16 service_314 3600 - ${result}= Check Service Downtime With Timeout host_16 service_314 1 60 - Should Be True ${result} msg=The service (host_16, service_314) is not in downtime as it should be + ${result} Check Service Downtime With Timeout host_16 service_314 1 60 + Should Be True ${result} The service (host_16, service_314) is not in downtime as it should be - ${result}= Check Downtimes With Timeout 2 60 - Should Be True ${result} msg=We should have one running downtime + ${result} Check Downtimes With Timeout 2 60 + Should Be True ${result} We should have one running downtime - ${result}= Check Service Downtime With Timeout _Module_BAM_1 ba_1 1 60 - Should Be True ${result} msg=The BA ba_1 is not in downtime as it should + ${result} Check Service Downtime With Timeout _Module_BAM_1 ba_1 1 60 + Should Be True ${result} The BA ba_1 is not in downtime as it should FOR ${i} IN RANGE 2 # Engine is restarted Stop Engine - ${start}= Get Current Date + ${start} Get Current Date Start Engine # Let's wait for the initial service states. - ${content}= Create List INITIAL SERVICE STATE: host_50;service_1000; - ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; + ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} - ... msg=An Initial service state on service (50, 1000) should be raised before we can start external commands. + ... An Initial service state on service (50, 1000) should be raised before we can start external commands. # Broker is restarted log to console Broker is stopped (step ${i}) @@ -146,18 +146,18 @@ BEBAMIDT2 END # There are still two downtimes: the one on the ba and the one on the kpi. - ${result}= Check Downtimes With Timeout 2 60 - Should Be True ${result} msg=We should have two downtimes + ${result} Check Downtimes With Timeout 2 60 + Should Be True ${result} We should have two downtimes # The downtime is deleted Delete Service Downtime host_16 service_314 - ${result}= Check Service Downtime With Timeout host_16 service_314 0 60 - Should Be True ${result} msg=The service (host_16, service_314) is in downtime and should not. - ${result}= Check Downtimes With Timeout 0 60 - Should Be True ${result} msg=We should have no more downtime + ${result} Check Service Downtime With Timeout host_16 service_314 0 60 + Should Be True ${result} The service (host_16, service_314) is in downtime and should not. + ${result} Check Downtimes With Timeout 0 60 + Should Be True ${result} We should have no more downtime - ${result}= Check Service Downtime With Timeout _Module_BAM_1 ba_1 0 60 - Should Be True ${result} msg=The BA ba_1 is in downtime as it should not + ${result} Check Service Downtime With Timeout _Module_BAM_1 ba_1 0 60 + Should Be True ${result} The BA ba_1 is in downtime as it should not log to console Broker is stopped (end of BEBAMIDT2) Stop Engine @@ -184,90 +184,90 @@ BEBAMIGNDT1 Clone Engine Config To DB Add Bam Config To Engine - @{svc}= Set Variable ${{ [("host_16", "service_313"), ("host_16", "service_314")] }} + @{svc} Set Variable ${{ [("host_16", "service_313"), ("host_16", "service_314")] }} Create BA With Services test worst ${svc} ignore Add Bam Config To Broker central # Command of service_313 is set to ok - ${cmd_1}= Get Command Id 313 + ${cmd_1} Get Command Id 313 Log To Console service_313 has command id ${cmd_1} Set Command Status ${cmd_1} 0 # Command of service_314 is set to critical - ${cmd_2}= Get Command Id 314 + ${cmd_2} Get Command Id 314 Log To Console service_314 has command id ${cmd_2} Set Command Status ${cmd_2} 2 Start Broker - ${start}= Get Current Date + ${start} Get Current Date Start Engine # Let's wait for the initial service states. - ${content}= Create List INITIAL SERVICE STATE: host_50;service_1000; - ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; + ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} - ... msg=An Initial service state on service (50, 1000) should be raised before we can start external commands. + ... An Initial service state on service (50, 1000) should be raised before we can start external commands. # KPI set to ok Repeat Keyword 3 times Process Service Check Result host_16 service_313 0 output critical for 313 - ${result}= Check Service Status With Timeout host_16 service_313 0 60 - Should Be True ${result} msg=The service (host_16,service_313) is not OK as expected + ${result} Check Service Status With Timeout host_16 service_313 0 60 + Should Be True ${result} The service (host_16,service_313) is not OK as expected # KPI set to critical Repeat Keyword 3 times Process Service Check Result host_16 service_314 2 output critical for 314 - ${result}= Check Service Status With Timeout host_16 service_314 2 60 - Should Be True ${result} msg=The service (host_16,service_314) is not CRITICAL as expected + ${result} Check Service Status With Timeout host_16 service_314 2 60 + Should Be True ${result} The service (host_16,service_314) is not CRITICAL as expected # The BA should become critical - ${result}= Check Ba Status With Timeout test 2 60 - Should Be True ${result} msg=The BA ba_1 is not CRITICAL as expected + ${result} Check Ba Status With Timeout test 2 60 + Should Be True ${result} The BA ba_1 is not CRITICAL as expected Log To console The BA is critical. # Two downtimes are applied on service_314 Schedule Service Downtime host_16 service_314 3600 - ${result}= Check Service Downtime With Timeout host_16 service_314 1 60 - Should Be True ${result} msg=The service (host_16, service_314) is not in downtime as it should be + ${result} Check Service Downtime With Timeout host_16 service_314 1 60 + Should Be True ${result} The service (host_16, service_314) is not in downtime as it should be Log to console One downtime applied to service_314. Schedule Service Downtime host_16 service_314 1800 - ${result}= Check Service Downtime With Timeout host_16 service_314 2 60 - Should Be True ${result} msg=The service (host_16, service_314) is not in downtime as it should be + ${result} Check Service Downtime With Timeout host_16 service_314 2 60 + Should Be True ${result} The service (host_16, service_314) is not in downtime as it should be Log to console Two downtimes applied to service_314. - ${result}= Check Service Downtime With Timeout _Module_BAM_1 ba_1 0 60 - Should Be True ${result} msg=The BA ba_1 is in downtime but should not + ${result} Check Service Downtime With Timeout _Module_BAM_1 ba_1 0 60 + Should Be True ${result} The BA ba_1 is in downtime but should not Log to console The BA is configured to ignore kpis in downtime - ${result}= Check Ba Status With Timeout test 0 60 - Should Be True ${result} msg=The service in downtime should be ignored while computing the state of this BA. + ${result} Check Ba Status With Timeout test 0 60 + Should Be True ${result} The service in downtime should be ignored while computing the state of this BA. Log to console The BA is OK, since the critical service is in downtime. # The first downtime is deleted Delete Service Downtime host_16 service_314 - ${result}= Check Service Downtime With Timeout host_16 service_314 1 60 - Should Be True ${result} msg=The service (host_16, service_314) does not contain 1 downtime as it should + ${result} Check Service Downtime With Timeout host_16 service_314 1 60 + Should Be True ${result} The service (host_16, service_314) does not contain 1 downtime as it should Log to console Still one downtime applied to service_314. - ${result}= Check Downtimes With Timeout 1 60 - Should Be True ${result} msg=We should have one downtime + ${result} Check Downtimes With Timeout 1 60 + Should Be True ${result} We should have one downtime - ${result}= Check Ba Status With Timeout test 0 60 - Should Be True ${result} msg=The BA is not OK whereas the service_314 is still in downtime. + ${result} Check Ba Status With Timeout test 0 60 + Should Be True ${result} The BA is not OK whereas the service_314 is still in downtime. Log to console The BA is still OK # The second downtime is deleted Delete Service Downtime host_16 service_314 - ${result}= Check Service Downtime With Timeout host_16 service_314 0 60 - Should Be True ${result} msg=The service (host_16, service_314) does not contain 0 downtime as it should + ${result} Check Service Downtime With Timeout host_16 service_314 0 60 + Should Be True ${result} The service (host_16, service_314) does not contain 0 downtime as it should Log to console No more downtime applied to service_314. - ${result}= Check Downtimes With Timeout 0 60 - Should Be True ${result} msg=We should have no more running downtimes + ${result} Check Downtimes With Timeout 0 60 + Should Be True ${result} We should have no more running downtimes - ${result}= Check Ba Status With Timeout test 2 60 - Should Be True ${result} msg=The critical service is no more in downtime, the BA should be critical. + ${result} Check Ba Status With Timeout test 2 60 + Should Be True ${result} The critical service is no more in downtime, the BA should be critical. Log to console The BA is now critical (no more downtime) Stop Engine @@ -287,78 +287,78 @@ BEBAMIGNDT2 Clone Engine Config To DB Add Bam Config To Engine - @{svc}= Set Variable ${{ [("host_16", "service_313"), ("host_16", "service_314")] }} + @{svc} Set Variable ${{ [("host_16", "service_313"), ("host_16", "service_314")] }} Create BA With Services test worst ${svc} ignore Add Bam Config To Broker central # Command of service_314 is set to critical - ${cmd_1}= Get Command Id 313 + ${cmd_1} Get Command Id 313 Log To Console service_314 has command id ${cmd_1} Set Command Status ${cmd_1} 0 - ${cmd_2}= Get Command Id 314 + ${cmd_2} Get Command Id 314 Log To Console service_314 has command id ${cmd_2} Set Command Status ${cmd_2} 2 Start Broker - ${start}= Get Current Date + ${start} Get Current Date Start Engine # Let's wait for the initial service states. - ${content}= Create List INITIAL SERVICE STATE: host_50;service_1000; - ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; + ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} - ... msg=An Initial service state on service (50, 1000) should be raised before we can start external commands. + ... An Initial service state on service (50, 1000) should be raised before we can start external commands. # KPI set to ok Repeat Keyword 3 times Process Service Check Result host_16 service_313 0 output critical for 313 - ${result}= Check Service Status With Timeout host_16 service_313 0 60 - Should Be True ${result} msg=The service (host_16,service_313) is not OK as expected + ${result} Check Service Status With Timeout host_16 service_313 0 60 + Should Be True ${result} The service (host_16,service_313) is not OK as expected # KPI set to critical Repeat Keyword 3 times Process Service Check Result host_16 service_314 2 output critical for 314 - ${result}= Check Service Status With Timeout host_16 service_314 2 60 - Should Be True ${result} msg=The service (host_16,service_314) is not CRITICAL as expected + ${result} Check Service Status With Timeout host_16 service_314 2 60 + Should Be True ${result} The service (host_16,service_314) is not CRITICAL as expected # The BA should become critical - ${result}= Check Ba Status With Timeout test 2 60 - Should Be True ${result} msg=The BA ba_1 is not CRITICAL as expected + ${result} Check Ba Status With Timeout test 2 60 + Should Be True ${result} The BA ba_1 is not CRITICAL as expected Log To console The BA is critical. # Two downtimes are applied on service_314 Schedule Service Downtime host_16 service_314 60 - ${result}= Check Service Downtime With Timeout host_16 service_314 1 60 - Should Be True ${result} msg=The service (host_16, service_314) is not in downtime as it should be + ${result} Check Service Downtime With Timeout host_16 service_314 1 60 + Should Be True ${result} The service (host_16, service_314) is not in downtime as it should be Log to console One downtime applied to service_314. Schedule Service Downtime host_16 service_314 30 - ${result}= Check Service Downtime With Timeout host_16 service_314 2 60 - Should Be True ${result} msg=The service (host_16, service_314) is not in downtime as it should be + ${result} Check Service Downtime With Timeout host_16 service_314 2 60 + Should Be True ${result} The service (host_16, service_314) is not in downtime as it should be Log to console Two downtimes applied to service_314. - ${result}= Check Service Downtime With Timeout _Module_BAM_1 ba_1 0 60 - Should Be True ${result} msg=The BA ba_1 is in downtime but should not + ${result} Check Service Downtime With Timeout _Module_BAM_1 ba_1 0 60 + Should Be True ${result} The BA ba_1 is in downtime but should not Log to console The BA is configured to ignore kpis in downtime - ${result}= Check Ba Status With Timeout test 0 60 - Should Be True ${result} msg=The service in downtime should be ignored while computing the state of this BA. + ${result} Check Ba Status With Timeout test 0 60 + Should Be True ${result} The service in downtime should be ignored while computing the state of this BA. Log to console The BA is OK, since the critical service is in downtime. # The first downtime should reach its end Log to console After 30s, the first downtime should be finished. - ${result}= Check Service Downtime With Timeout host_16 service_314 1 60 - Should Be True ${result} msg=The service (host_16, service_314) does not contain 1 downtime as it should + ${result} Check Service Downtime With Timeout host_16 service_314 1 60 + Should Be True ${result} The service (host_16, service_314) does not contain 1 downtime as it should Log to console Still one downtime applied to service_314. Log to console After 30s, the second downtime should be finished. - ${result}= Check Ba Status With Timeout test 0 60 - Should Be True ${result} msg=The BA is not OK whereas the service_314 is still in downtime. + ${result} Check Ba Status With Timeout test 0 60 + Should Be True ${result} The BA is not OK whereas the service_314 is still in downtime. Log to console The BA is still OK - ${result}= Check Downtimes With Timeout 0 60 - Should Be True ${result} msg=We should have no more running downtimes + ${result} Check Downtimes With Timeout 0 60 + Should Be True ${result} We should have no more running downtimes # The second downtime finishes - ${result}= Check Ba Status With Timeout test 2 60 - Should Be True ${result} msg=The critical service is no more in downtime, the BA should be critical. + ${result} Check Ba Status With Timeout test 2 60 + Should Be True ${result} The critical service is no more in downtime, the BA should be critical. Log to console The BA is now critical (no more downtime) Stop Engine @@ -369,7 +369,7 @@ BEBAMIGNDT2 BAM Setup Stop Processes Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} - ${date}= Get Current Date result_format=epoch + ${date} Get Current Date result_format=epoch log to console date=${date} Execute SQL String ... UPDATE downtimes SET deletion_time=${date}, actual_end_time=${date} WHERE actual_end_time is null diff --git a/tests/bam/pb_inherited_downtime.robot b/tests/bam/pb_inherited_downtime.robot index 52c0bb86474..c5d46bf921e 100644 --- a/tests/bam/pb_inherited_downtime.robot +++ b/tests/bam/pb_inherited_downtime.robot @@ -30,48 +30,48 @@ BEBAMIDTU1 Clone Engine Config To DB Add Bam Config To Engine - @{svc}= Set Variable ${{ [("host_16", "service_314")] }} + @{svc} Set Variable ${{ [("host_16", "service_314")] }} Create BA With Services test worst ${svc} Add Bam Config To Broker central # Command of service_314 is set to critical - ${cmd_1}= Get Command Id 314 + ${cmd_1} Get Command Id 314 Log To Console service_314 has command id ${cmd_1} Set Command Status ${cmd_1} 2 Start Broker - ${start}= Get Current Date + ${start} Get Current Date Start Engine # Let's wait for the initial service states. - ${content}= Create List INITIAL SERVICE STATE: host_50;service_1000; - ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; + ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} - ... msg=An Initial service state on service (50, 1000) should be raised before we can start external commands. + ... An Initial service state on service (50, 1000) should be raised before we can start external commands. # KPI set to critical Repeat Keyword 3 times Process Service Check Result host_16 service_314 2 output critical for 314 - ${result}= Check Service Status With Timeout host_16 service_314 2 60 HARD - Should Be True ${result} msg=The service (host_16,service_314) is not CRITICAL as expected + ${result} Check Service Status With Timeout host_16 service_314 2 60 HARD + Should Be True ${result} The service (host_16,service_314) is not CRITICAL as expected # The BA should become critical - ${result}= Check Ba Status With Timeout test 2 60 - Should Be True ${result} msg=The BA ba_1 is not CRITICAL as expected + ${result} Check Ba Status With Timeout test 2 60 + Should Be True ${result} The BA ba_1 is not CRITICAL as expected # A downtime is put on service_314 Schedule Service Downtime host_16 service_314 3600 - ${result}= Check Service Downtime With Timeout host_16 service_314 1 60 - Should Be True ${result} msg=The service (host_16, service_314) is not in downtime as it should be - ${result}= Check Service Downtime With Timeout _Module_BAM_1 ba_1 1 60 - Should Be True ${result} msg=The BA ba_1 is not in downtime as it should + ${result} Check Service Downtime With Timeout host_16 service_314 1 60 + Should Be True ${result} The service (host_16, service_314) is not in downtime as it should be + ${result} Check Service Downtime With Timeout _Module_BAM_1 ba_1 1 60 + Should Be True ${result} The BA ba_1 is not in downtime as it should # The downtime is deleted Delete Service Downtime host_16 service_314 - ${result}= Check Service Downtime With Timeout host_16 service_314 0 60 - Should Be True ${result} msg=The service (host_16, service_314) is in downtime and should not. + ${result} Check Service Downtime With Timeout host_16 service_314 0 60 + Should Be True ${result} The service (host_16, service_314) is in downtime and should not. - ${result}= Check Downtimes With Timeout 0 60 - Should Be True ${result} msg=No downtime should still be running. - ${result}= Check Service Downtime With Timeout _Module_BAM_1 ba_1 0 60 - Should Be True ${result} msg=The BA ba_1 is in downtime as it should not + ${result} Check Downtimes With Timeout 0 60 + Should Be True ${result} No downtime should still be running. + ${result} Check Service Downtime With Timeout _Module_BAM_1 ba_1 0 60 + Should Be True ${result} The BA ba_1 is in downtime as it should not Stop Engine Kindly Stop Broker @@ -93,50 +93,50 @@ BEBAMIDTU2 Clone Engine Config To DB Add Bam Config To Engine - @{svc}= Set Variable ${{ [("host_16", "service_314")] }} + @{svc} Set Variable ${{ [("host_16", "service_314")] }} Create BA With Services test worst ${svc} Add Bam Config To Broker central # Command of service_314 is set to critical - ${cmd_1}= Get Command Id 314 + ${cmd_1} Get Command Id 314 Log To Console service_314 has command id ${cmd_1} Set Command Status ${cmd_1} 2 Start Broker - ${start}= Get Current Date + ${start} Get Current Date Start Engine # Let's wait for the initial service states. - ${content}= Create List INITIAL SERVICE STATE: host_50;service_1000; - ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; + ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} - ... msg=An Initial service state on service (50, 1000) should be raised before we can start external commands. + ... An Initial service state on service (50, 1000) should be raised before we can start external commands. # KPI set to critical Repeat Keyword 3 times Process Service Check Result host_16 service_314 2 output critical for 314 - ${result}= Check Service Status With Timeout host_16 service_314 2 60 - Should Be True ${result} msg=The service (host_16,service_314) is not CRITICAL as expected + ${result} Check Service Status With Timeout host_16 service_314 2 60 + Should Be True ${result} The service (host_16,service_314) is not CRITICAL as expected # The BA should become critical - ${result}= Check Ba Status With Timeout test 2 60 - Should Be True ${result} msg=The BA ba_1 is not CRITICAL as expected + ${result} Check Ba Status With Timeout test 2 60 + Should Be True ${result} The BA ba_1 is not CRITICAL as expected # A downtime is put on service_314 Schedule Service Downtime host_16 service_314 3600 - ${result}= Check Service Downtime With Timeout host_16 service_314 1 60 - Should Be True ${result} msg=The service (host_16, service_314) is not in downtime as it should be - ${result}= Check Service Downtime With Timeout _Module_BAM_1 ba_1 1 60 - Should Be True ${result} msg=The BA ba_1 is not in downtime as it should + ${result} Check Service Downtime With Timeout host_16 service_314 1 60 + Should Be True ${result} The service (host_16, service_314) is not in downtime as it should be + ${result} Check Service Downtime With Timeout _Module_BAM_1 ba_1 1 60 + Should Be True ${result} The BA ba_1 is not in downtime as it should FOR ${i} IN RANGE 2 # Engine is restarted Stop Engine - ${start}= Get Current Date + ${start} Get Current Date Start Engine # Let's wait for the initial service states. - ${content}= Create List INITIAL SERVICE STATE: host_50;service_1000; - ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; + ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} - ... msg=An Initial service state on service (50, 1000) should be raised before we can start external commands. + ... An Initial service state on service (50, 1000) should be raised before we can start external commands. # Broker is restarted log to console Broker is stopped (step ${i}) @@ -146,19 +146,19 @@ BEBAMIDTU2 END # There are still two downtimes: the one on the ba and the one on the kpi. - ${result}= Number Of Downtimes is 2 60 - Should Be True ${result} msg=We should only have only two downtimes + ${result} Number Of Downtimes is 2 60 + Should Be True ${result} We should only have only two downtimes # The downtime is deleted Delete Service Downtime host_16 service_314 - ${result}= Check Service Downtime With Timeout host_16 service_314 0 60 - Should Be True ${result} msg=The service (host_16, service_314) is in downtime and should not. - ${result}= Check Service Downtime With Timeout _Module_BAM_1 ba_1 0 60 - Should Be True ${result} msg=The BA ba_1 is in downtime as it should not + ${result} Check Service Downtime With Timeout host_16 service_314 0 60 + Should Be True ${result} The service (host_16, service_314) is in downtime and should not. + ${result} Check Service Downtime With Timeout _Module_BAM_1 ba_1 0 60 + Should Be True ${result} The BA ba_1 is in downtime as it should not # We should have no more downtime - ${result}= Number Of Downtimes Is 0 60 - Should Be True ${result} msg=We should have no more downtime + ${result} Number Of Downtimes Is 0 60 + Should Be True ${result} We should have no more downtime log to console Broker is stopped (end of BEBAMIDT2) Stop Engine @@ -188,90 +188,90 @@ BEBAMIGNDTU1 Clone Engine Config To DB Add Bam Config To Engine - @{svc}= Set Variable ${{ [("host_16", "service_313"), ("host_16", "service_314")] }} + @{svc} Set Variable ${{ [("host_16", "service_313"), ("host_16", "service_314")] }} Create BA With Services test worst ${svc} ignore Add Bam Config To Broker central # Command of service_313 is set to ok - ${cmd_1}= Get Command Id 313 + ${cmd_1} Get Command Id 313 Log To Console service_313 has command id ${cmd_1} Set Command Status ${cmd_1} 0 # Command of service_314 is set to critical - ${cmd_2}= Get Command Id 314 + ${cmd_2} Get Command Id 314 Log To Console service_314 has command id ${cmd_2} Set Command Status ${cmd_2} 2 Start Broker - ${start}= Get Current Date + ${start} Get Current Date Start Engine # Let's wait for the initial service states. - ${content}= Create List INITIAL SERVICE STATE: host_50;service_1000; - ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; + ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} - ... msg=An Initial service state on service (50, 1000) should be raised before we can start external commands. + ... An Initial service state on service (50, 1000) should be raised before we can start external commands. # KPI set to ok Repeat Keyword 3 times Process Service Check Result host_16 service_313 0 output critical for 313 - ${result}= Check Service Status With Timeout host_16 service_313 0 60 - Should Be True ${result} msg=The service (host_16,service_313) is not OK as expected + ${result} Check Service Status With Timeout host_16 service_313 0 60 + Should Be True ${result} The service (host_16,service_313) is not OK as expected # KPI set to critical Repeat Keyword 3 times Process Service Check Result host_16 service_314 2 output critical for 314 - ${result}= Check Service Status With Timeout host_16 service_314 2 60 - Should Be True ${result} msg=The service (host_16,service_314) is not CRITICAL as expected + ${result} Check Service Status With Timeout host_16 service_314 2 60 + Should Be True ${result} The service (host_16,service_314) is not CRITICAL as expected # The BA should become critical - ${result}= Check Ba Status With Timeout test 2 60 - Should Be True ${result} msg=The BA ba_1 is not CRITICAL as expected + ${result} Check Ba Status With Timeout test 2 60 + Should Be True ${result} The BA ba_1 is not CRITICAL as expected Log To console The BA is critical. # Two downtimes are applied on service_314 Schedule Service Downtime host_16 service_314 3600 - ${result}= Check Service Downtime With Timeout host_16 service_314 1 60 - Should Be True ${result} msg=The service (host_16, service_314) is not in downtime as it should be + ${result} Check Service Downtime With Timeout host_16 service_314 1 60 + Should Be True ${result} The service (host_16, service_314) is not in downtime as it should be Log to console One downtime applied to service_314. Schedule Service Downtime host_16 service_314 1800 - ${result}= Check Service Downtime With Timeout host_16 service_314 2 60 - Should Be True ${result} msg=The service (host_16, service_314) is not in downtime as it should be + ${result} Check Service Downtime With Timeout host_16 service_314 2 60 + Should Be True ${result} The service (host_16, service_314) is not in downtime as it should be Log to console Two downtimes applied to service_314. - ${result}= Check Service Downtime With Timeout _Module_BAM_1 ba_1 0 60 - Should Be True ${result} msg=The BA ba_1 is in downtime but should not + ${result} Check Service Downtime With Timeout _Module_BAM_1 ba_1 0 60 + Should Be True ${result} The BA ba_1 is in downtime but should not Log to console The BA is configured to ignore kpis in downtime - ${result}= Check Ba Status With Timeout test 0 60 - Should Be True ${result} msg=The service in downtime should be ignored while computing the state of this BA. + ${result} Check Ba Status With Timeout test 0 60 + Should Be True ${result} The service in downtime should be ignored while computing the state of this BA. Log to console The BA is OK, since the critical service is in downtime. # The first downtime is deleted Delete Service Downtime host_16 service_314 - ${result}= Check Service Downtime With Timeout host_16 service_314 1 60 - Should Be True ${result} msg=The service (host_16, service_314) does not contain 1 downtime as it should + ${result} Check Service Downtime With Timeout host_16 service_314 1 60 + Should Be True ${result} The service (host_16, service_314) does not contain 1 downtime as it should Log to console Still one downtime applied to service_314. - ${result}= Check Ba Status With Timeout test 0 60 - Should Be True ${result} msg=The BA is not OK whereas the service_314 is still in downtime. + ${result} Check Ba Status With Timeout test 0 60 + Should Be True ${result} The BA is not OK whereas the service_314 is still in downtime. Log to console The BA is still OK - ${result}= Check Downtimes With Timeout 1 60 - Should Be True ${result} msg=We should have one running downtime + ${result} Check Downtimes With Timeout 1 60 + Should Be True ${result} We should have one running downtime # The second downtime is deleted Delete Service Downtime host_16 service_314 - ${result}= Check Service Downtime With Timeout host_16 service_314 0 60 - Should Be True ${result} msg=The service (host_16, service_314) does not contain 0 downtime as it should + ${result} Check Service Downtime With Timeout host_16 service_314 0 60 + Should Be True ${result} The service (host_16, service_314) does not contain 0 downtime as it should Log to console No more downtime applied to service_314. - ${result}= Check Downtimes With Timeout 0 60 - Should Be True ${result} msg=We should have no more running downtimes + ${result} Check Downtimes With Timeout 0 60 + Should Be True ${result} We should have no more running downtimes - ${result}= Check Ba Status With Timeout test 2 60 - Should Be True ${result} msg=The critical service is no more in downtime, the BA should be critical. + ${result} Check Ba Status With Timeout test 2 60 + Should Be True ${result} The critical service is no more in downtime, the BA should be critical. Log to console The BA is now critical (no more downtime) Stop Engine @@ -295,75 +295,75 @@ BEBAMIGNDTU2 Clone Engine Config To DB Add Bam Config To Engine - @{svc}= Set Variable ${{ [("host_16", "service_313"), ("host_16", "service_314")] }} + @{svc} Set Variable ${{ [("host_16", "service_313"), ("host_16", "service_314")] }} Create BA With Services test worst ${svc} ignore Add Bam Config To Broker central # Command of service_314 is set to critical - ${cmd_1}= Get Command Id 313 + ${cmd_1} Get Command Id 313 Log To Console service_314 has command id ${cmd_1} Set Command Status ${cmd_1} 0 - ${cmd_2}= Get Command Id 314 + ${cmd_2} Get Command Id 314 Log To Console service_314 has command id ${cmd_2} Set Command Status ${cmd_2} 2 Start Broker - ${start}= Get Current Date + ${start} Get Current Date Start Engine # Let's wait for the initial service states. - ${content}= Create List INITIAL SERVICE STATE: host_50;service_1000; - ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; + ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} - ... msg=An Initial service state on service (50, 1000) should be raised before we can start external commands. + ... An Initial service state on service (50, 1000) should be raised before we can start external commands. # KPI set to ok Repeat Keyword 3 times Process Service Check Result host_16 service_313 0 output critical for 313 - ${result}= Check Service Status With Timeout host_16 service_313 0 60 - Should Be True ${result} msg=The service (host_16,service_313) is not OK as expected + ${result} Check Service Status With Timeout host_16 service_313 0 60 + Should Be True ${result} The service (host_16,service_313) is not OK as expected # KPI set to critical Repeat Keyword 3 times Process Service Check Result host_16 service_314 2 output critical for 314 - ${result}= Check Service Status With Timeout host_16 service_314 2 60 - Should Be True ${result} msg=The service (host_16,service_314) is not CRITICAL as expected + ${result} Check Service Status With Timeout host_16 service_314 2 60 + Should Be True ${result} The service (host_16,service_314) is not CRITICAL as expected # The BA should become critical - ${result}= Check Ba Status With Timeout test 2 60 - Should Be True ${result} msg=The BA ba_1 is not CRITICAL as expected + ${result} Check Ba Status With Timeout test 2 60 + Should Be True ${result} The BA ba_1 is not CRITICAL as expected Log To console The BA is critical. # Two downtimes are applied on service_314 Schedule Service Downtime host_16 service_314 90 - ${result}= Check Service Downtime With Timeout host_16 service_314 1 60 - Should Be True ${result} msg=The service (host_16, service_314) is not in downtime as it should be + ${result} Check Service Downtime With Timeout host_16 service_314 1 60 + Should Be True ${result} The service (host_16, service_314) is not in downtime as it should be Log to console One downtime applied to service_314. Schedule Service Downtime host_16 service_314 30 - ${result}= Check Service Downtime With Timeout host_16 service_314 2 60 - Should Be True ${result} msg=The service (host_16, service_314) is not in downtime as it should be + ${result} Check Service Downtime With Timeout host_16 service_314 2 60 + Should Be True ${result} The service (host_16, service_314) is not in downtime as it should be Log to console Two downtimes applied to service_314. - ${result}= Check Service Downtime With Timeout _Module_BAM_1 ba_1 0 60 - Should Be True ${result} msg=The BA ba_1 is in downtime but should not + ${result} Check Service Downtime With Timeout _Module_BAM_1 ba_1 0 60 + Should Be True ${result} The BA ba_1 is in downtime but should not Log to console The BA is configured to ignore kpis in downtime - ${result}= Check Ba Status With Timeout test 0 60 - Should Be True ${result} msg=The service in downtime should be ignored while computing the state of this BA. + ${result} Check Ba Status With Timeout test 0 60 + Should Be True ${result} The service in downtime should be ignored while computing the state of this BA. Log to console The BA is OK, since the critical service is in downtime. # The first downtime should reach its end Log to console After 30s, the first downtime should be finished. - ${result}= Check Service Downtime With Timeout host_16 service_314 1 60 - Should Be True ${result} msg=The service (host_16, service_314) does not contain 1 downtime as it should + ${result} Check Service Downtime With Timeout host_16 service_314 1 60 + Should Be True ${result} The service (host_16, service_314) does not contain 1 downtime as it should Log to console Still one downtime applied to service_314. Log to console After 30s, the second downtime should be finished. - ${result}= Check Ba Status With Timeout test 0 60 - Should Be True ${result} msg=The BA is not OK whereas the service_314 is still in downtime. + ${result} Check Ba Status With Timeout test 0 60 + Should Be True ${result} The BA is not OK whereas the service_314 is still in downtime. Log to console The BA is still OK # The second downtime finishes - ${result}= Check Ba Status With Timeout test 2 90 - Should Be True ${result} msg=The critical service is no more in downtime, the BA should be critical. + ${result} Check Ba Status With Timeout test 2 90 + Should Be True ${result} The critical service is no more in downtime, the BA should be critical. Log to console The BA is now critical (no more downtime) Stop Engine @@ -374,7 +374,7 @@ BEBAMIGNDTU2 BAM Setup Stop Processes Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} - ${date}= Get Current Date result_format=epoch + ${date} Get Current Date result_format=epoch log to console Cleaning downtimes at date=${date} Execute SQL String ... UPDATE downtimes SET deletion_time=${date}, actual_end_time=${date} WHERE actual_end_time is null diff --git a/tests/broker-database/networkFailure.robot b/tests/broker-database/networkFailure.robot index 3b72fd5b27d..6bb5ab97753 100644 --- a/tests/broker-database/networkFailure.robot +++ b/tests/broker-database/networkFailure.robot @@ -52,19 +52,19 @@ NetworkDBFail6 Broker Config Log central sql trace Config Broker rrd Config Broker module - ${start}= Get Current Date + ${start} Get Current Date Start Broker Start Engine - ${result}= Check Connections - Should Be True ${result} msg=Broker and Engine are not connected - ${content}= Create List run query: SELECT - ${result}= Find In Log With Timeout ${centralLog} ${start} ${content} 40 - Should Be True ${result} msg=No SELECT done by broker in the DB + ${result} Check Connections + Should Be True ${result} Broker and Engine are not connected + ${content} Create List run query: SELECT + ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 40 + Should Be True ${result} No SELECT done by broker in the DB Disable Eth Connection On Port port=3306 Sleep 1m Reset Eth Connection - ${content}= Create List 0 events acknowledged - ${result}= Find In Log With Timeout ${centralLog} ${start} ${content} 40 + ${content} Create List 0 events acknowledged + ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 40 Stop Engine Kindly Stop Broker @@ -80,21 +80,21 @@ NetworkDBFailU6 Broker Config Log central sql trace Config Broker rrd Config Broker module - ${start}= Get Current Date + ${start} Get Current Date Start Broker Start Engine - ${result}= Check Connections - Should Be True ${result} msg=Broker and Engine are not connected - ${content}= Create List run query: SELECT - ${result}= Find In Log With Timeout ${centralLog} ${start} ${content} 40 - Should Be True ${result} msg=No SELECT done by broker in the DB + ${result} Check Connections + Should Be True ${result} Broker and Engine are not connected + ${content} Create List run query: SELECT + ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 40 + Should Be True ${result} No SELECT done by broker in the DB Disable Eth Connection On Port port=3306 Log to console Waiting for 1m while the connection to the DB is cut. Sleep 1m Log to console Reestablishing the connection and test last steps. Reset Eth Connection - ${content}= Create List 0 events acknowledged - ${result}= Find In Log With Timeout ${centralLog} ${start} ${content} 40 + ${content} Create List 0 events acknowledged + ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 40 Stop Engine Kindly Stop Broker @@ -111,23 +111,23 @@ NetworkDBFail7 Broker Config Log central sql trace Config Broker rrd Config Broker module - ${start}= Get Current Date + ${start} Get Current Date Start Broker Start Engine - ${result}= Check Connections - Should Be True ${result} msg=Broker and Engine are not connected - ${content}= Create List run query: SELECT - ${result}= Find In Log With Timeout ${centralLog} ${start} ${content} 40 - Should Be True ${result} msg=No SELECT done by broker in the DB + ${result} Check Connections + Should Be True ${result} Broker and Engine are not connected + ${content} Create List run query: SELECT + ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 40 + Should Be True ${result} No SELECT done by broker in the DB FOR ${i} IN 0 5 Disable Eth Connection On Port port=3306 Sleep 10s Reset Eth Connection Sleep 10s END - ${content}= Create List 0 events acknowledged - ${result}= Find In Log With Timeout ${centralLog} ${start} ${content} 60 - Should Be True ${result} msg=There are still events in the queue. + ${content} Create List 0 events acknowledged + ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 60 + Should Be True ${result} There are still events in the queue. Stop Engine Kindly Stop Broker @@ -143,23 +143,23 @@ NetworkDBFailU7 Broker Config Log central sql trace Config Broker rrd Config Broker module - ${start}= Get Current Date + ${start} Get Current Date Start Broker Start Engine - ${result}= Check Connections - Should Be True ${result} msg=Broker and Engine are not connected - ${content}= Create List run query: SELECT - ${result}= Find In Log With Timeout ${centralLog} ${start} ${content} 40 - Should Be True ${result} msg=No SELECT done by broker in the DB + ${result} Check Connections + Should Be True ${result} Broker and Engine are not connected + ${content} Create List run query: SELECT + ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 40 + Should Be True ${result} No SELECT done by broker in the DB FOR ${i} IN 0 5 Disable Eth Connection On Port port=3306 Sleep 10s Reset Eth Connection Sleep 10s END - ${content}= Create List 0 events acknowledged - ${result}= Find In Log With Timeout ${centralLog} ${start} ${content} 60 - Should Be True ${result} msg=There are still events in the queue. + ${content} Create List 0 events acknowledged + ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 60 + Should Be True ${result} There are still events in the queue. Stop Engine Kindly Stop Broker @@ -184,18 +184,18 @@ Network Failure Broker Config Output set central central-broker-master-perfdata connections_count 10 Broker Config Log central sql trace broker_config_source_log central true - ${start}= Get Current Date + ${start} Get Current Date Start Broker Start Engine - ${content}= Create List SQL: performing mysql_ping - ${result}= Find In Log With Timeout ${centralLog} ${start} ${content} 120 - Should Be True ${result} msg=We should have a call to mysql_ping every 30s on inactive connections. + ${content} Create List SQL: performing mysql_ping + ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 120 + Should Be True ${result} We should have a call to mysql_ping every 30s on inactive connections. Disable Sleep Enable ${interval} - ${end}= Get Current Date - ${content}= Create List mysql_connection 0x[0-9,a-f]+ : commit - ${result}= Find Regex In Log With Timeout ${centralLog} ${end} ${content} 80 + ${end} Get Current Date + ${content} Create List mysql_connection 0x[0-9,a-f]+ : commit + ${result} Find Regex In Log With Timeout ${centralLog} ${end} ${content} 80 Should Be True ... ${result[0]} - ... msg=timeout after network to be restablished (network failure duration : ${interval}) + ... timeout after network to be restablished (network failure duration : ${interval}) Kindly Stop Broker Stop Engine diff --git a/tests/broker-engine/acknowledgement.robot b/tests/broker-engine/acknowledgement.robot index feb9d9df232..5087269c04c 100644 --- a/tests/broker-engine/acknowledgement.robot +++ b/tests/broker-engine/acknowledgement.robot @@ -28,36 +28,36 @@ BEACK1 Broker Config Log module0 neb debug Broker Config Log central sql debug - ${start}= Get Current Date + ${start} Get Current Date Start Broker Start Engine - ${content}= Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() + ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} - ... msg=An Initial service state on (host_50,service_1000) should be raised before we can start our external commands. + ... An Initial service state on (host_50,service_1000) should be raised before we can start our external commands. # Time to set the service to CRITICAL HARD. Process Service Check Result host_1 service_1 2 (1;1) is critical - ${result}= Check Service Status With Timeout host_1 service_1 ${2} 60 SOFT - Should Be True ${result} msg=Service (1;1) should be critical + ${result} Check Service Status With Timeout host_1 service_1 ${2} 60 SOFT + Should Be True ${result} Service (1;1) should be critical Repeat Keyword 2 times Process Service Check Result host_1 service_1 2 (1;1) is critical - ${result}= Check Service Status With Timeout host_1 service_1 ${2} 60 HARD - Should Be True ${result} msg=Service (1;1) should be critical HARD - ${d}= Get Current Date result_format=epoch exclude_millis=True + ${result} Check Service Status With Timeout host_1 service_1 ${2} 60 HARD + Should Be True ${result} Service (1;1) should be critical HARD + ${d} Get Current Date result_format=epoch exclude_millis=True Acknowledge Service Problem host_1 service_1 - ${ack_id}= Check Acknowledgement With Timeout host_1 service_1 ${d} 2 60 HARD - Should Be True ${ack_id} > 0 msg=No acknowledgement on service (1, 1). + ${ack_id} Check Acknowledgement With Timeout host_1 service_1 ${d} 2 60 HARD + Should Be True ${ack_id} > 0 No acknowledgement on service (1, 1). # Service_1 is set back to OK. Repeat Keyword 3 times Process Service Check Result host_1 service_1 0 (1;1) is OK - ${result}= Check Service Status With Timeout host_1 service_1 ${0} 60 HARD - Should Be True ${result} msg=Service (1;1) should be OK HARD + ${result} Check Service Status With Timeout host_1 service_1 ${0} 60 HARD + Should Be True ${result} Service (1;1) should be OK HARD # Acknowledgement is deleted but to see this we have to check in the comments table - ${result}= check acknowledgement is deleted with timeout ${ack_id} 30 - Should Be True ${result} msg=Acknowledgement ${ack_id} should be deleted. + ${result} check acknowledgement is deleted with timeout ${ack_id} 30 + Should Be True ${result} Acknowledgement ${ack_id} should be deleted. BEACK2 [Documentation] Configuration is made with BBDO3. Engine has a critical service. An external command is sent to acknowledge it. The centreon_storage.acknowledgements table is then updated with this acknowledgement. The service is newly set to OK. And the acknowledgement in database is deleted. @@ -70,35 +70,35 @@ BEACK2 Broker Config Log module0 neb debug Broker Config Log central sql debug - ${start}= Get Current Date + ${start} Get Current Date Start Broker Start Engine # Let's wait for the external command check start - ${content}= Create List check_for_external_commands() - ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 - Should Be True ${result} msg=A message telling check_for_external_commands() should be available. + ${content} Create List check_for_external_commands() + ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + Should Be True ${result} A message telling check_for_external_commands() should be available. # Time to set the service to CRITICAL HARD. Process Service Check Result host_1 service_1 ${2} (1;1) is critical - ${result}= Check Service Resource Status With Timeout host_1 service_1 ${2} 600 SOFT - Should Be True ${result} msg=Service (1;1) should be critical + ${result} Check Service Resource Status With Timeout host_1 service_1 ${2} 600 SOFT + Should Be True ${result} Service (1;1) should be critical Repeat Keyword 2 times Process Service Check Result host_1 service_1 2 (1;1) is critical - ${result}= Check Service Resource Status With Timeout host_1 service_1 ${2} 600 HARD - Should Be True ${result} msg=Service (1;1) should be critical HARD - ${d}= Get Current Date result_format=epoch exclude_millis=True + ${result} Check Service Resource Status With Timeout host_1 service_1 ${2} 600 HARD + Should Be True ${result} Service (1;1) should be critical HARD + ${d} Get Current Date result_format=epoch exclude_millis=True Acknowledge Service Problem host_1 service_1 - ${ack_id}= Check Acknowledgement With Timeout host_1 service_1 ${d} 2 600 HARD - Should Be True ${ack_id} > 0 msg=No acknowledgement on service (1, 1). + ${ack_id} Check Acknowledgement With Timeout host_1 service_1 ${d} 2 600 HARD + Should Be True ${ack_id} > 0 No acknowledgement on service (1, 1). # Service_1 is set back to OK. Repeat Keyword 3 times Process Service Check Result host_1 service_1 0 (1;1) is OK - ${result}= Check Service Resource Status With Timeout host_1 service_1 ${0} 60 HARD - Should Be True ${result} msg=Service (1;1) should be OK HARD + ${result} Check Service Resource Status With Timeout host_1 service_1 ${0} 60 HARD + Should Be True ${result} Service (1;1) should be OK HARD # Acknowledgement is deleted but to see this we have to check in the comments table - ${result}= check acknowledgement is deleted with timeout ${ack_id} 30 - Should Be True ${result} msg=Acknowledgement ${ack_id} should be deleted. + ${result} check acknowledgement is deleted with timeout ${ack_id} 30 + Should Be True ${result} Acknowledgement ${ack_id} should be deleted. BEACK3 [Documentation] Engine has a critical service. An external command is sent to acknowledge it. The centreon_storage.acknowledgements table is then updated with this acknowledgement. The acknowledgement is removed and the comment in the comments table has its deletion_time column updated. @@ -110,33 +110,33 @@ BEACK3 Broker Config Log module0 neb debug Broker Config Log central sql debug - ${start}= Get Current Date + ${start} Get Current Date Start Broker Start Engine - ${content}= Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() + ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} - ... msg=An Initial service state on (host_50,service_1000) should be raised before we can start our external commands. + ... An Initial service state on (host_50,service_1000) should be raised before we can start our external commands. # Time to set the service to CRITICAL HARD. Process Service Check Result host_1 service_1 2 (1;1) is critical - ${result}= Check Service Status With Timeout host_1 service_1 ${2} 60 SOFT - Should Be True ${result} msg=Service (1;1) should be critical + ${result} Check Service Status With Timeout host_1 service_1 ${2} 60 SOFT + Should Be True ${result} Service (1;1) should be critical Repeat Keyword 2 times Process Service Check Result host_1 service_1 2 (1;1) is critical - ${result}= Check Service Status With Timeout host_1 service_1 ${2} 60 HARD - Should Be True ${result} msg=Service (1;1) should be critical HARD - ${d}= Get Current Date result_format=epoch exclude_millis=True + ${result} Check Service Status With Timeout host_1 service_1 ${2} 60 HARD + Should Be True ${result} Service (1;1) should be critical HARD + ${d} Get Current Date result_format=epoch exclude_millis=True Acknowledge Service Problem host_1 service_1 - ${ack_id}= Check Acknowledgement With Timeout host_1 service_1 ${d} 2 60 HARD - Should Be True ${ack_id} > 0 msg=No acknowledgement on service (1, 1). + ${ack_id} Check Acknowledgement With Timeout host_1 service_1 ${d} 2 60 HARD + Should Be True ${ack_id} > 0 No acknowledgement on service (1, 1). Remove Service Acknowledgement host_1 service_1 # Acknowledgement is deleted but this time, both of comments and acknowledgements tables have the deletion_time column filled - ${result}= check acknowledgement is deleted with timeout ${ack_id} 30 BOTH - Should Be True ${result} msg=Acknowledgement ${ack_id} should be deleted. + ${result} check acknowledgement is deleted with timeout ${ack_id} 30 BOTH + Should Be True ${result} Acknowledgement ${ack_id} should be deleted. BEACK4 [Documentation] Configuration is made with BBDO3. Engine has a critical service. An external command is sent to acknowledge it. The centreon_storage.acknowledgements table is then updated with this acknowledgement. The acknowledgement is removed and the comment in the comments table has its deletion_time column updated. @@ -149,33 +149,33 @@ BEACK4 Broker Config Log module0 neb debug Broker Config Log central sql debug - ${start}= Get Current Date + ${start} Get Current Date Start Broker Start Engine - ${content}= Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() + ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} - ... msg=An Initial service state on (host_50,service_1000) should be raised before we can start our external commands. + ... An Initial service state on (host_50,service_1000) should be raised before we can start our external commands. # Time to set the service to CRITICAL HARD. Process Service Check Result host_1 service_1 ${2} (1;1) is critical - ${result}= Check Service Resource Status With Timeout host_1 service_1 ${2} 600 SOFT - Should Be True ${result} msg=Service (1;1) should be critical + ${result} Check Service Resource Status With Timeout host_1 service_1 ${2} 600 SOFT + Should Be True ${result} Service (1;1) should be critical Repeat Keyword 2 times Process Service Check Result host_1 service_1 2 (1;1) is critical - ${result}= Check Service Resource Status With Timeout host_1 service_1 ${2} 600 HARD - Should Be True ${result} msg=Service (1;1) should be critical HARD - ${d}= Get Current Date result_format=epoch exclude_millis=True + ${result} Check Service Resource Status With Timeout host_1 service_1 ${2} 600 HARD + Should Be True ${result} Service (1;1) should be critical HARD + ${d} Get Current Date result_format=epoch exclude_millis=True Acknowledge Service Problem host_1 service_1 - ${ack_id}= Check Acknowledgement With Timeout host_1 service_1 ${d} 2 600 HARD - Should Be True ${ack_id} > 0 msg=No acknowledgement on service (1, 1). + ${ack_id} Check Acknowledgement With Timeout host_1 service_1 ${d} 2 600 HARD + Should Be True ${ack_id} > 0 No acknowledgement on service (1, 1). Remove Service Acknowledgement host_1 service_1 # Acknowledgement is deleted but this time, both of comments and acknowledgements tables have the deletion_time column filled - ${result}= check acknowledgement is deleted with timeout ${ack_id} 30 BOTH - Should Be True ${result} msg=Acknowledgement ${ack_id} should be deleted. + ${result} check acknowledgement is deleted with timeout ${ack_id} 30 BOTH + Should Be True ${result} Acknowledgement ${ack_id} should be deleted. BEACK5 [Documentation] Engine has a critical service. An external command is sent to acknowledge it ; the acknowledgement is sticky. The centreon_storage.acknowledgements table is then updated with this acknowledgement. The service is newly set to WARNING. And the acknowledgement in database is still there. @@ -190,42 +190,42 @@ BEACK5 Engine Config Set Value ${0} log_level_external_command trace Engine Config Set Value ${0} log_flush_period 0 True - ${start}= Get Current Date + ${start} Get Current Date Start Broker Start Engine - ${content}= Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() + ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} - ... msg=An Initial service state on (host_50,service_1000) should be raised before we can start our external commands. + ... An Initial service state on (host_50,service_1000) should be raised before we can start our external commands. # Time to set the service to CRITICAL HARD. Process Service Check Result host_1 service_1 2 (1;1) is critical - ${result}= Check Service Status With Timeout host_1 service_1 ${2} 60 SOFT - Should Be True ${result} msg=Service (1;1) should be critical + ${result} Check Service Status With Timeout host_1 service_1 ${2} 60 SOFT + Should Be True ${result} Service (1;1) should be critical Repeat Keyword 2 times Process Service Check Result host_1 service_1 2 (1;1) is critical - ${result}= Check Service Status With Timeout host_1 service_1 ${2} 60 HARD - Should Be True ${result} msg=Service (1;1) should be critical HARD - ${d}= Get Current Date result_format=epoch exclude_millis=True + ${result} Check Service Status With Timeout host_1 service_1 ${2} 60 HARD + Should Be True ${result} Service (1;1) should be critical HARD + ${d} Get Current Date result_format=epoch exclude_millis=True Acknowledge Service Problem host_1 service_1 STICKY - ${ack_id}= Check Acknowledgement With Timeout host_1 service_1 ${d} 2 60 HARD - Should Be True ${ack_id} > 0 msg=No acknowledgement on service (1, 1). + ${ack_id} Check Acknowledgement With Timeout host_1 service_1 ${d} 2 60 HARD + Should Be True ${ack_id} > 0 No acknowledgement on service (1, 1). # Service_1 is set to WARNING. Repeat Keyword 3 times Process Service Check Result host_1 service_1 1 (1;1) is WARNING - ${result}= Check Service Status With Timeout host_1 service_1 ${1} 60 HARD - Should Be True ${result} msg=Service (1;1) should be WARNING HARD + ${result} Check Service Status With Timeout host_1 service_1 ${1} 60 HARD + Should Be True ${result} Service (1;1) should be WARNING HARD # Acknowledgement is not deleted. - ${result}= check acknowledgement is deleted with timeout ${ack_id} 10 - Should Be True ${result}==${False} msg=Acknowledgement ${ack_id} should not be deleted. + ${result} check acknowledgement is deleted with timeout ${ack_id} 10 + Should Be True ${result}==${False} Acknowledgement ${ack_id} should not be deleted. Remove Service Acknowledgement host_1 service_1 # Acknowledgement is deleted but this time, both of comments and acknowledgements tables have the deletion_time column filled - ${result}= check acknowledgement is deleted with timeout ${ack_id} 30 BOTH - Should Be True ${result} msg=Acknowledgement ${ack_id} should be deleted. + ${result} check acknowledgement is deleted with timeout ${ack_id} 30 BOTH + Should Be True ${result} Acknowledgement ${ack_id} should be deleted. BEACK6 [Documentation] Configuration is made with BBDO3. Engine has a critical service. An external command is sent to acknowledge it ; the acknowledgement is sticky. The centreon_storage.acknowledgements table is then updated with this acknowledgement. The service is newly set to WARNING. And the acknowledgement in database is still there. @@ -238,39 +238,39 @@ BEACK6 Broker Config Log module0 neb debug Broker Config Log central sql debug - ${start}= Get Current Date + ${start} Get Current Date Start Broker Start Engine - ${content}= Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() + ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} - ... msg=An Initial service state on (host_50,service_1000) should be raised before we can start our external commands. + ... An Initial service state on (host_50,service_1000) should be raised before we can start our external commands. # Time to set the service to CRITICAL HARD. Process Service Check Result host_1 service_1 ${2} (1;1) is critical - ${result}= Check Service Resource Status With Timeout host_1 service_1 ${2} 600 SOFT - Should Be True ${result} msg=Service (1;1) should be critical + ${result} Check Service Resource Status With Timeout host_1 service_1 ${2} 600 SOFT + Should Be True ${result} Service (1;1) should be critical Repeat Keyword 2 times Process Service Check Result host_1 service_1 2 (1;1) is critical - ${result}= Check Service Resource Status With Timeout host_1 service_1 ${2} 600 HARD - Should Be True ${result} msg=Service (1;1) should be critical HARD - ${d}= Get Current Date result_format=epoch exclude_millis=True + ${result} Check Service Resource Status With Timeout host_1 service_1 ${2} 600 HARD + Should Be True ${result} Service (1;1) should be critical HARD + ${d} Get Current Date result_format=epoch exclude_millis=True Acknowledge Service Problem host_1 service_1 STICKY - ${ack_id}= Check Acknowledgement With Timeout host_1 service_1 ${d} 2 600 HARD - Should Be True ${ack_id} > 0 msg=No acknowledgement on service (1, 1). + ${ack_id} Check Acknowledgement With Timeout host_1 service_1 ${d} 2 600 HARD + Should Be True ${ack_id} > 0 No acknowledgement on service (1, 1). # Service_1 is set to WARNING. Repeat Keyword 3 times Process Service Check Result host_1 service_1 1 (1;1) is WARNING - ${result}= Check Service Status With Timeout host_1 service_1 ${1} 60 HARD - Should Be True ${result} msg=Service (1;1) should be WARNING HARD + ${result} Check Service Status With Timeout host_1 service_1 ${1} 60 HARD + Should Be True ${result} Service (1;1) should be WARNING HARD # Acknowledgement is not deleted. - ${result}= check acknowledgement is deleted with timeout ${ack_id} 10 - Should Be True ${result}==${False} msg=Acknowledgement ${ack_id} should not be deleted. + ${result} check acknowledgement is deleted with timeout ${ack_id} 10 + Should Be True ${result}==${False} Acknowledgement ${ack_id} should not be deleted. Remove Service Acknowledgement host_1 service_1 # Acknowledgement is deleted but this time, both of comments and acknowledgements tables have the deletion_time column filled - ${result}= check acknowledgement is deleted with timeout ${ack_id} 30 BOTH - Should Be True ${result} msg=Acknowledgement ${ack_id} should be deleted. + ${result} check acknowledgement is deleted with timeout ${ack_id} 30 BOTH + Should Be True ${result} Acknowledgement ${ack_id} should be deleted. diff --git a/tests/broker-engine/anomaly-detection.robot b/tests/broker-engine/anomaly-detection.robot index 7407bdddd40..117a0e2dd24 100644 --- a/tests/broker-engine/anomaly-detection.robot +++ b/tests/broker-engine/anomaly-detection.robot @@ -24,7 +24,7 @@ ANO_NOFILE Config Broker module ${1} Broker Config Log central sql debug Config Broker Sql Output central unified_sql - ${serv_id}= Create Anomaly Detection ${0} ${1} ${1} metric + ${serv_id} Create Anomaly Detection ${0} ${1} ${1} metric Remove File /tmp/anomaly_threshold.json Clear Retention Clear Db services @@ -43,8 +43,8 @@ ANO_TOO_OLD_FILE Config Broker module ${1} Broker Config Log central sql debug Config Broker Sql Output central unified_sql - ${serv_id}= Create Anomaly Detection ${0} ${1} ${1} metric - ${predict_data}= Evaluate [[0,0,2],[1648812678,0,3]] + ${serv_id} Create Anomaly Detection ${0} ${1} ${1} metric + ${predict_data} Evaluate [[0,0,2],[1648812678,0,3]] Create Anomaly Threshold File /tmp/anomaly_threshold.json ${1} ${serv_id} metric ${predict_data} Clear Retention Clear Db services @@ -63,8 +63,8 @@ ANO_OUT_LOWER_THAN_LIMIT Config Broker module ${1} Broker Config Log central sql debug Config Broker Sql Output central unified_sql - ${serv_id}= Create Anomaly Detection ${0} ${1} ${1} metric - ${predict_data}= Evaluate [[0,50,52],[2648812678,50,63]] + ${serv_id} Create Anomaly Detection ${0} ${1} ${1} metric + ${predict_data} Evaluate [[0,50,52],[2648812678,50,63]] Create Anomaly Threshold File /tmp/anomaly_threshold.json ${1} ${serv_id} metric ${predict_data} Clear Retention Clear Db services @@ -83,8 +83,8 @@ ANO_OUT_UPPER_THAN_LIMIT Config Broker module ${1} Broker Config Log central sql debug Config Broker Sql Output central unified_sql - ${serv_id}= Create Anomaly Detection ${0} ${1} ${1} metric - ${predict_data}= Evaluate [[0,50,52],[2648812678,50,63]] + ${serv_id} Create Anomaly Detection ${0} ${1} ${1} metric + ${predict_data} Evaluate [[0,50,52],[2648812678,50,63]] Create Anomaly Threshold File /tmp/anomaly_threshold.json ${1} ${serv_id} metric ${predict_data} Clear Retention Clear Db services @@ -99,8 +99,8 @@ ANO_JSON_SENSITIVITY_NOT_SAVED [Documentation] json sensitivity not saved in retention [Tags] engine anomaly retention Config Engine ${1} ${50} ${20} - ${serv_id}= Create Anomaly Detection ${0} ${1} ${1} metric - ${predict_data}= Evaluate [[0,50,2, 10],[2648812678,25,-5,6]] + ${serv_id} Create Anomaly Detection ${0} ${1} ${1} metric + ${predict_data} Evaluate [[0,50,2, 10],[2648812678,25,-5,6]] Create Anomaly Threshold File V2 ... /tmp/anomaly_threshold.json ... ${1} @@ -112,15 +112,15 @@ ANO_JSON_SENSITIVITY_NOT_SAVED Start Engine Sleep 5s Stop Engine - ${retention_sensitivity}= Grep Retention ${0} sensitivity=0.00 + ${retention_sensitivity} Grep Retention ${0} sensitivity=0.00 Should Be Equal As Strings ${retention_sensitivity} sensitivity=0.00 ANO_CFG_SENSITIVITY_SAVED [Documentation] cfg sensitivity saved in retention [Tags] engine anomaly retention Config Engine ${1} ${50} ${20} - ${serv_id}= Create Anomaly Detection ${0} ${1} ${1} metric 4.00 - ${predict_data}= Evaluate [[0,50,2, 10],[2648812678,25,-5,6]] + ${serv_id} Create Anomaly Detection ${0} ${1} ${1} metric 4.00 + ${predict_data} Evaluate [[0,50,2, 10],[2648812678,25,-5,6]] Create Anomaly Threshold File V2 ... /tmp/anomaly_threshold.json ... ${1} @@ -132,7 +132,7 @@ ANO_CFG_SENSITIVITY_SAVED Start Engine Sleep 5s Stop Engine - ${retention_sensitivity}= Grep Retention ${0} sensitivity=4.00 + ${retention_sensitivity} Grep Retention ${0} sensitivity=4.00 Should Be Equal As Strings ${retention_sensitivity} sensitivity=4.00 ANO_EXTCMD_SENSITIVITY_SAVED @@ -140,8 +140,8 @@ ANO_EXTCMD_SENSITIVITY_SAVED [Tags] engine anomaly retention extcmd FOR ${use_grpc} IN RANGE 1 2 Config Engine ${1} ${50} ${20} - ${serv_id}= Create Anomaly Detection ${0} ${1} ${1} metric - ${predict_data}= Evaluate [[0,50,2, 10],[2648812678,25,-5,6]] + ${serv_id} Create Anomaly Detection ${0} ${1} ${1} metric + ${predict_data} Evaluate [[0,50,2, 10],[2648812678,25,-5,6]] Create Anomaly Threshold File V2 ... /tmp/anomaly_threshold.json ... ${1} @@ -155,7 +155,7 @@ ANO_EXTCMD_SENSITIVITY_SAVED Update Ano Sensitivity ${use_grpc} host_1 anomaly_1001 4.55 Sleep 1s Stop Engine - ${retention_sensitivity}= Grep Retention ${0} sensitivity=4.55 + ${retention_sensitivity} Grep Retention ${0} sensitivity=4.55 Should Be Equal As Strings ${retention_sensitivity} sensitivity=4.55 END @@ -171,28 +171,28 @@ AOUTLU1 Broker Config Add Item module0 bbdo_version 3.0.1 Broker Config Add Item rrd bbdo_version 3.0.1 Broker Config Add Item central bbdo_version 3.0.1 - ${serv_id}= Create Anomaly Detection ${0} ${1} ${1} metric - ${predict_data}= Evaluate [[0,50,52],[2648812678,50,63]] + ${serv_id} Create Anomaly Detection ${0} ${1} ${1} metric + ${predict_data} Evaluate [[0,50,52],[2648812678,50,63]] Create Anomaly Threshold File /tmp/anomaly_threshold.json ${1} ${serv_id} metric ${predict_data} Clear Retention Clear Db services Start Broker - ${start}= Get Current Date + ${start} Get Current Date Start Engine # Let's wait for the check of external commands - ${content}= Create List check_for_external_commands - ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 - Should Be True ${result} msg=No check for external commands executed for 1mn. + ${content} Create List check_for_external_commands + ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + Should Be True ${result} No check for external commands executed for 1mn. Process Service Check result host_1 anomaly_${serv_id} 2 taratata|metric=80%;50;75 Check Service Status With Timeout host_1 anomaly_${serv_id} 2 30 Stop Engine Kindly Stop Broker - ${lst}= Create List 1 0 4 - ${result}= Check Types in resources ${lst} + ${lst} Create List 1 0 4 + ${result} Check Types in resources ${lst} Should Be True ... ${result} - ... msg=The table 'resources' should contain rows of types SERVICE, HOST and ANOMALY_DETECTION. + ... The table 'resources' should contain rows of types SERVICE, HOST and ANOMALY_DETECTION. ANO_DT1 [Documentation] downtime on dependent service is inherited by ano @@ -206,27 +206,27 @@ ANO_DT1 Broker Config Add Item module0 bbdo_version 3.0.1 Broker Config Add Item rrd bbdo_version 3.0.1 Broker Config Add Item central bbdo_version 3.0.1 - ${serv_id}= Create Anomaly Detection ${0} ${1} ${1} metric - ${predict_data}= Evaluate [[0,50,52],[2648812678,50,63]] + ${serv_id} Create Anomaly Detection ${0} ${1} ${1} metric + ${predict_data} Evaluate [[0,50,52],[2648812678,50,63]] Create Anomaly Threshold File /tmp/anomaly_threshold.json ${1} ${serv_id} metric ${predict_data} Clear Retention Clear Db services Clear Db downtimes Start Broker - ${start}= Get Current Date + ${start} Get Current Date Start Engine # Let's wait for the check of external commands - ${content}= Create List check_for_external_commands - ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 - Should Be True ${result} msg=No check for external commands executed for 1mn. + ${content} Create List check_for_external_commands + ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + Should Be True ${result} No check for external commands executed for 1mn. #create dependent service downtime schedule_service_fixed_downtime host_1 service_1 3600 - ${result}= Check Service Downtime With Timeout host_1 service_1 1 60 - Should Be True ${result} msg=dependent service must be in downtime - ${result}= Check Service Downtime With Timeout host_1 anomaly_${serv_id} 1 60 - Should Be True ${result} msg=anomaly service must be in downtime + ${result} Check Service Downtime With Timeout host_1 service_1 1 60 + Should Be True ${result} dependent service must be in downtime + ${result} Check Service Downtime With Timeout host_1 anomaly_${serv_id} 1 60 + Should Be True ${result} anomaly service must be in downtime Stop Engine Kindly Stop Broker @@ -243,31 +243,31 @@ ANO_DT2 Broker Config Add Item module0 bbdo_version 3.0.1 Broker Config Add Item rrd bbdo_version 3.0.1 Broker Config Add Item central bbdo_version 3.0.1 - ${serv_id}= Create Anomaly Detection ${0} ${1} ${1} metric - ${predict_data}= Evaluate [[0,50,52],[2648812678,50,63]] + ${serv_id} Create Anomaly Detection ${0} ${1} ${1} metric + ${predict_data} Evaluate [[0,50,52],[2648812678,50,63]] Create Anomaly Threshold File /tmp/anomaly_threshold.json ${1} ${serv_id} metric ${predict_data} Clear Retention Clear Db services Clear Db downtimes Start Broker - ${start}= Get Current Date + ${start} Get Current Date Start Engine # Let's wait for the check of external commands - ${content}= Create List check_for_external_commands - ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 - Should Be True ${result} msg=No check for external commands executed for 1mn. + ${content} Create List check_for_external_commands + ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + Should Be True ${result} No check for external commands executed for 1mn. #create dependent service downtime schedule_service_fixed_downtime host_1 service_1 3600 - ${result}= Check Service Downtime With Timeout host_1 anomaly_${serv_id} 1 60 - Should Be True ${result} msg=anomaly service must be in downtime + ${result} Check Service Downtime With Timeout host_1 anomaly_${serv_id} 1 60 + Should Be True ${result} anomaly service must be in downtime DELETE SERVICE DOWNTIME host_1 service_1 - ${result}= Check Service Downtime With Timeout host_1 service_1 0 60 - Should Be True ${result} msg=dependent service must be in downtime - ${result}= Check Service Downtime With Timeout host_1 anomaly_${serv_id} 0 60 - Should Be True ${result} msg=anomaly service must be in downtime + ${result} Check Service Downtime With Timeout host_1 service_1 0 60 + Should Be True ${result} dependent service must be in downtime + ${result} Check Service Downtime With Timeout host_1 anomaly_${serv_id} 0 60 + Should Be True ${result} anomaly service must be in downtime Stop Engine Kindly Stop Broker @@ -284,32 +284,32 @@ ANO_DT3 Broker Config Add Item module0 bbdo_version 3.0.1 Broker Config Add Item rrd bbdo_version 3.0.1 Broker Config Add Item central bbdo_version 3.0.1 - ${serv_id}= Create Anomaly Detection ${0} ${1} ${1} metric - ${predict_data}= Evaluate [[0,50,52],[2648812678,50,63]] + ${serv_id} Create Anomaly Detection ${0} ${1} ${1} metric + ${predict_data} Evaluate [[0,50,52],[2648812678,50,63]] Create Anomaly Threshold File /tmp/anomaly_threshold.json ${1} ${serv_id} metric ${predict_data} Clear Retention Clear Db services Clear Db downtimes Start Broker - ${start}= Get Current Date + ${start} Get Current Date Start Engine # Let's wait for the check of external commands - ${content}= Create List check_for_external_commands - ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 - Should Be True ${result} msg=No check for external commands executed for 1mn. + ${content} Create List check_for_external_commands + ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + Should Be True ${result} No check for external commands executed for 1mn. #create dependent service downtime schedule_service_fixed_downtime host_1 service_1 3600 - ${result}= Check Service Downtime With Timeout host_1 anomaly_${serv_id} 1 60 - Should Be True ${result} msg=anomaly service must be in downtime + ${result} Check Service Downtime With Timeout host_1 anomaly_${serv_id} 1 60 + Should Be True ${result} anomaly service must be in downtime DELETE SERVICE DOWNTIME host_1 anomaly_${serv_id} - ${result}= Check Service Downtime With Timeout host_1 anomaly_${serv_id} 0 60 - Should Be True ${result} msg=anomaly service must be in downtime + ${result} Check Service Downtime With Timeout host_1 anomaly_${serv_id} 0 60 + Should Be True ${result} anomaly service must be in downtime - ${result}= Check Service Downtime With Timeout host_1 service_1 1 60 - Should Be True ${result} msg=dependent service must be in downtime + ${result} Check Service Downtime With Timeout host_1 service_1 1 60 + Should Be True ${result} dependent service must be in downtime Stop Engine Kindly Stop Broker @@ -326,32 +326,32 @@ ANO_DT4 Broker Config Add Item module0 bbdo_version 3.0.1 Broker Config Add Item rrd bbdo_version 3.0.1 Broker Config Add Item central bbdo_version 3.0.1 - ${serv_id}= Create Anomaly Detection ${0} ${1} ${1} metric - ${predict_data}= Evaluate [[0,50,52],[2648812678,50,63]] + ${serv_id} Create Anomaly Detection ${0} ${1} ${1} metric + ${predict_data} Evaluate [[0,50,52],[2648812678,50,63]] Create Anomaly Threshold File /tmp/anomaly_threshold.json ${1} ${serv_id} metric ${predict_data} Clear Retention Clear Db services Clear Db downtimes Start Broker - ${start}= Get Current Date + ${start} Get Current Date Start Engine # Let's wait for the check of external commands - ${content}= Create List check_for_external_commands - ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 - Should Be True ${result} msg=No check for external commands executed for 1mn. + ${content} Create List check_for_external_commands + ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + Should Be True ${result} No check for external commands executed for 1mn. #create dependent service downtime schedule_service_fixed_downtime host_1 service_1 3600 schedule_service_fixed_downtime host_1 anomaly_${serv_id} 3600 - ${result}= Check Service Downtime With Timeout host_1 anomaly_${serv_id} 2 60 - Should Be True ${result} msg=anomaly service must be in double downtime + ${result} Check Service Downtime With Timeout host_1 anomaly_${serv_id} 2 60 + Should Be True ${result} anomaly service must be in double downtime DELETE SERVICE DOWNTIME host_1 service_1 - ${result}= Check Service Downtime With Timeout host_1 service_1 0 60 - Should Be True ${result} msg=dependent service mustn t be in downtime - ${result}= Check Service Downtime With Timeout host_1 anomaly_${serv_id} 1 60 - Should Be True ${result} msg=anomaly service must be in simple downtime + ${result} Check Service Downtime With Timeout host_1 service_1 0 60 + Should Be True ${result} dependent service mustn t be in downtime + ${result} Check Service Downtime With Timeout host_1 anomaly_${serv_id} 1 60 + Should Be True ${result} anomaly service must be in simple downtime Stop Engine Kindly Stop Broker diff --git a/tests/broker-engine/bbdo-protobuf.robot b/tests/broker-engine/bbdo-protobuf.robot index 3626cb458d2..00d485a0d9f 100644 --- a/tests/broker-engine/bbdo-protobuf.robot +++ b/tests/broker-engine/bbdo-protobuf.robot @@ -30,12 +30,12 @@ BEPBBEE1 Broker Config Log module0 bbdo debug Broker Config Log central bbdo debug Clear Retention - ${start}= Get Current Date + ${start} Get Current Date Start Broker Start Engine - ${content}= Create List BBDO: peer is using protocol version 3.0.0 whereas we're using protocol version 2.0.0 - ${result}= Find In Log with timeout ${centralLog} ${start} ${content} 30 - Should Be True ${result} msg=Message about not matching bbdo versions not available + ${content} Create List BBDO: peer is using protocol version 3.0.0 whereas we're using protocol version 2.0.0 + ${result} Find In Log with timeout ${centralLog} ${start} ${content} 30 + Should Be True ${result} Message about not matching bbdo versions not available Stop Engine Kindly Stop Broker @@ -52,13 +52,13 @@ BEPBBEE2 Broker Config Log central sql debug Broker Config Flush Log central 0 Clear Retention - ${start}= Get Current Date + ${start} Get Current Date Start Broker Start Engine - ${content}= Create List + ${content} Create List ... Configuration check error: bbdo versions >= 3.0.0 need the unified_sql module to be configured. - ${result}= Find In Log with timeout ${centralLog} ${start} ${content} 30 - Should Be True ${result} msg=Message about a missing config of unified_sql not available. + ${result} Find In Log with timeout ${centralLog} ${start} ${content} 30 + Should Be True ${result} Message about a missing config of unified_sql not available. Stop Engine BEPBBEE3 @@ -76,7 +76,7 @@ BEPBBEE3 Config Broker Sql Output central unified_sql Broker Config Add Lua Output central test-protobuf ${SCRIPTS}test-pbservicestatus.lua Clear Retention - ${start}= Get Current Date + ${start} Get Current Date Start Broker Start Engine Wait Until Created /tmp/pbservicestatus.log 1m @@ -98,7 +98,7 @@ BEPBBEE4 Config Broker Sql Output central unified_sql Broker Config Add Lua Output central test-protobuf ${SCRIPTS}test-pbhoststatus.lua Clear Retention - ${start}= Get Current Date + ${start} Get Current Date Start Broker Start Engine Wait Until Created /tmp/pbhoststatus.log 1m @@ -120,7 +120,7 @@ BEPBBEE5 Config Broker Sql Output central unified_sql Broker Config Add Lua Output central test-protobuf ${SCRIPTS}test-pbservice.lua Clear Retention - ${start}= Get Current Date + ${start} Get Current Date Start Broker Start Engine Wait Until Created /tmp/pbservice.log 1m @@ -145,22 +145,22 @@ BEPBRI1 Clear Retention Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} Execute SQL String DELETE FROM instances - ${start}= Get Current Date + ${start} Get Current Date Start Broker True Start Engine Wait Until Created /tmp/pbresponsiveinstance.log 30s - ${grep_res}= Grep File /tmp/pbresponsiveinstance.log "_type":65582, "category":1, "element":46, - ${grep_res}= Get Lines Containing String ${grep_res} "poller_id":1, "responsive":true - Should Not Be Empty ${grep_res} msg="responsive":true not found + ${grep_res} Grep File /tmp/pbresponsiveinstance.log "_type":65582, "category":1, "element":46, + ${grep_res} Get Lines Containing String ${grep_res} "poller_id":1, "responsive":true + Should Not Be Empty ${grep_res} "responsive":true not found Stop Engine FOR ${index} IN RANGE 60 Sleep 1s - ${grep_res}= Grep File /tmp/pbresponsiveinstance.log "_type":65582, "category":1, "element":46, - ${grep_res}= Get Lines Containing String ${grep_res} "poller_id":1, "responsive":false + ${grep_res} Grep File /tmp/pbresponsiveinstance.log "_type":65582, "category":1, "element":46, + ${grep_res} Get Lines Containing String ${grep_res} "poller_id":1, "responsive":false IF len('${grep_res}') > 0 BREAK END - Should Not Be Empty ${grep_res} msg="responsive":false not found + Should Not Be Empty ${grep_res} "responsive":false not found Kindly Stop Broker True BEPBCVS @@ -172,16 +172,16 @@ BEPBCVS Broker Config Log central sql trace Config Broker Sql Output central unified_sql Clear Retention - ${start}= Get Current Date + ${start} Get Current Date Start Broker True Start Engine - ${content}= Create List check_for_external_commands - ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 - Should Be True ${result} msg=No check for external commands executed for 1mn. + ${content} Create List check_for_external_commands + ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + Should Be True ${result} No check for external commands executed for 1mn. Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} FOR ${index} IN RANGE 300 - ${output}= Query + ${output} Query ... SELECT c.value FROM customvariables c LEFT JOIN hosts h ON c.host_id=h.host_id WHERE h.name='host_1' && c.name in ('KEY1','KEY_SERV1_1') ORDER BY service_id Log To Console ${output} Sleep 1s diff --git a/tests/broker-engine/compression.robot b/tests/broker-engine/compression.robot index d592af36d9a..a5bf780599c 100644 --- a/tests/broker-engine/compression.robot +++ b/tests/broker-engine/compression.robot @@ -36,15 +36,15 @@ BECC1 Broker Config Output set module0 central-module-master-output compression ${comp2} Broker Config Log central bbdo info Broker Config Log module0 bbdo info - ${start}= Get Current Date + ${start} Get Current Date Start Broker Start Engine - ${result}= Check Connections - Should Be True ${result} msg=Engine and Broker not connected + ${result} Check Connections + Should Be True ${result} Engine and Broker not connected Kindly Stop Broker Stop Engine - ${content1}= Create List we have extensions '${ext["${comp1}"]}' and peer has '${ext["${comp2}"]}' - ${content2}= Create List we have extensions '${ext["${comp2}"]}' and peer has '${ext["${comp1}"]}' + ${content1} Create List we have extensions '${ext["${comp1}"]}' and peer has '${ext["${comp2}"]}' + ${content2} Create List we have extensions '${ext["${comp2}"]}' and peer has '${ext["${comp1}"]}' IF "${comp1}" == "yes" and "${comp2}" == "no" Insert Into List ... ${content1} @@ -56,11 +56,11 @@ BECC1 ... ${-1} ... extension 'COMPRESSION' is set to 'yes' in the configuration but cannot be activated because of peer configuration END - ${log}= Catenate SEPARATOR= ${BROKER_LOG} /central-broker-master.log - ${result}= Find In Log ${log} ${start} ${content1} + ${log} Catenate SEPARATOR= ${BROKER_LOG} /central-broker-master.log + ${result} Find In Log ${log} ${start} ${content1} Should Be True ${result} - ${log}= Catenate SEPARATOR= ${BROKER_LOG} /central-module-master0.log - ${result}= Find In Log ${log} ${start} ${content2} + ${log} Catenate SEPARATOR= ${BROKER_LOG} /central-module-master0.log + ${result} Find In Log ${log} ${start} ${content2} Should Be True ${result} END END diff --git a/tests/broker-engine/delete-poller.robot b/tests/broker-engine/delete-poller.robot index 1c84555d13e..21b56561dd9 100644 --- a/tests/broker-engine/delete-poller.robot +++ b/tests/broker-engine/delete-poller.robot @@ -34,7 +34,7 @@ EBDP1 # Let's wait until engine listens to external_commands. ${content} Create List check_for_external_commands() ${result} Find In Log with Timeout ${engineLog3} ${start} ${content} 60 - Should Be True ${result} msg=check_for_external_commands is missing. + Should Be True ${result} check_for_external_commands is missing. Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} FOR ${index} IN RANGE 60 @@ -55,7 +55,7 @@ EBDP1 # Let's wait for the initial service states. ${content} Create List check_for_external_commands() ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 - Should Be True ${result} msg=check_for_external_commands is missing. + Should Be True ${result} check_for_external_commands is missing. Remove Poller 51001 Poller3 Sleep 6s @@ -87,7 +87,7 @@ EBDP2 # Let's wait until engine listens to external_commands. ${content} Create List check_for_external_commands() ${result} Find In Log with Timeout ${engineLog2} ${start} ${content} 60 - Should Be True ${result} msg=check_for_external_commands is missing. + Should Be True ${result} check_for_external_commands is missing. Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} FOR ${index} IN RANGE 60 @@ -108,7 +108,7 @@ EBDP2 ${content} Create List feeder 'central-broker-master-input-\d', connection closed ${result} Find Regex In Log With Timeout ${centralLog} ${start_remove} ${content} 60 - Should Be True ${result} msg=connection closed not found. + Should Be True ${result} connection closed not found. log to console Reconfiguration of 2 pollers # Poller2 is removed from the engine configuration but still there in centreon_storage DB @@ -122,7 +122,7 @@ EBDP2 # Let's wait until engine listens to external_commands. ${content} Create List check_for_external_commands() ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 - Should Be True ${result} msg=check_for_external_commands is missing. + Should Be True ${result} check_for_external_commands is missing. Remove Poller 51001 Poller2 @@ -159,7 +159,7 @@ EBDP_GRPC2 # Let's wait until engine listens to external_commands. ${content} Create List check_for_external_commands() ${result} Find In Log with Timeout ${engineLog2} ${start} ${content} 60 - Should Be True ${result} msg=check_for_external_commands is missing. + Should Be True ${result} check_for_external_commands is missing. Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} FOR ${index} IN RANGE 60 @@ -181,7 +181,7 @@ EBDP_GRPC2 ${content} Create List feeder 'central-broker-master-input-\d', connection closed ${result} Find Regex In Log With Timeout ${centralLog} ${start_remove} ${content} 60 - Should Be True ${result} msg=connection closed not found. + Should Be True ${result} connection closed not found. log to console Reconfiguration of 2 pollers # Poller2 is removed from the engine configuration but still there in centreon_storage DB @@ -195,7 +195,7 @@ EBDP_GRPC2 # Let's wait until engine listens to external_commands. ${content} Create List check_for_external_commands() ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 - Should Be True ${result} msg=check_for_external_commands is missing. + Should Be True ${result} check_for_external_commands is missing. Remove Poller 51001 Poller2 @@ -226,7 +226,7 @@ EBDP3 # Let's wait until engine listens to external_commands. ${content} Create List check_for_external_commands() ${result} Find In Log with Timeout ${engineLog2} ${start} ${content} 60 - Should Be True ${result} msg=check_for_external_commands is missing. + Should Be True ${result} check_for_external_commands is missing. Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} FOR ${index} IN RANGE 60 @@ -255,7 +255,7 @@ EBDP3 # Let's wait until engine listens to external_commands. ${content} Create List check_for_external_commands() ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 - Should Be True ${result} msg=check_for_external_commands is missing. + Should Be True ${result} check_for_external_commands is missing. Remove Poller 51001 Poller2 @@ -289,7 +289,7 @@ EBDP4 # Let's wait until engine listens to external_commands. ${content} Create List check_for_external_commands() ${result} Find In Log with Timeout ${engineLog3} ${start} ${content} 60 - Should Be True ${result} msg=check_for_external_commands is missing. + Should Be True ${result} check_for_external_commands is missing. Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} FOR ${index} IN RANGE 60 @@ -302,7 +302,7 @@ EBDP4 # Let's brutally kill the poller ${content} Create List processing poller event (id: 4, name: Poller3, running: ${result} Find In log with timeout ${centralLog} ${start} ${content} 60 - Should Be True ${result} msg=We want the poller 4 event before stopping broker + Should Be True ${result} We want the poller 4 event before stopping broker Kindly Stop Broker Remove Files ${centralLog} ${rrdLog} @@ -315,11 +315,11 @@ EBDP4 ... SERVICE ALERT: host_40;service_781;CRITICAL ... SERVICE ALERT: host_40;service_782;WARNING ${result} Find In log with timeout ${engineLog3} ${start} ${content} 60 - Should Be True ${result} msg=Service alerts about service 781 and 782 should be raised + Should Be True ${result} Service alerts about service 781 and 782 should be raised ${content} Create List callbacks: service (40, 781) has no perfdata service (40, 782) has no perfdata ${result} Find In log with timeout ${moduleLog3} ${start} ${content} 60 - Should Be True ${result} msg=pb service status on services (40, 781) and (40, 782) should be generated + Should Be True ${result} pb service status on services (40, 781) and (40, 782) should be generated Stop Engine # Because poller3 is going to be removed, we move its memory file to poller0, 1 and 2. @@ -336,7 +336,7 @@ EBDP4 # Let's wait until engine listens to external_commands. ${content} Create List check_for_external_commands() ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 - Should Be True ${result} msg=check_for_external_commands is missing. + Should Be True ${result} check_for_external_commands is missing. Remove Poller 51001 Poller3 FOR ${index} IN RANGE 60 @@ -350,12 +350,12 @@ EBDP4 # Let's wait until engine listens to external_commands. ${content} Create List check_for_external_commands() ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 - Should Be True ${result} msg=check_for_external_commands is missing. + Should Be True ${result} check_for_external_commands is missing. ${content} Create List service status (40, 781) thrown away because host 40 is not known by any poller log to console date ${start} ${result} Find in Log With Timeout ${centralLog} ${start} ${content} 60 - Should be True ${result} msg=No message about these two wrong service status. + Should be True ${result} No message about these two wrong service status. Stop Engine Kindly Stop Broker @@ -375,7 +375,7 @@ EBDP5 # Let's wait until engine listens to external_commands ${content} Create List check_for_external_commands ${result} Find In Log with Timeout ${engineLog3} ${start} ${content} 60 - Should Be True ${result} msg=check_for_external_commands is missing. + Should Be True ${result} check_for_external_commands is missing. Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} FOR ${index} IN RANGE 60 @@ -396,7 +396,7 @@ EBDP5 # Let's wait until engine listens to external_commands ${content} Create List check_for_external_commands ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 - Should Be True ${result} msg=check_for_external_commands is missing. + Should Be True ${result} check_for_external_commands is missing. ${remove_time} Get Current Date Remove Poller by id 51001 ${4} @@ -404,7 +404,7 @@ EBDP5 # wait unified receive instance event ${content} Create List central-broker-unified-sql read neb:Instance ${result} Find In Log with Timeout ${centralLog} ${remove_time} ${content} 60 - Should Be True ${result} msg=central-broker-unified-sql read neb:Instance is missing + Should Be True ${result} central-broker-unified-sql read neb:Instance is missing Stop Engine Kindly Stop Broker @@ -432,7 +432,7 @@ EBDP6 # Let's wait until engine listens to external_commands. ${content} Create List check_for_external_commands() ${result} Find In Log with Timeout ${engineLog2} ${start} ${content} 60 - Should Be True ${result} msg=check_for_external_commands is missing. + Should Be True ${result} check_for_external_commands is missing. Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} FOR ${index} IN RANGE 60 @@ -463,7 +463,7 @@ EBDP6 # Let's wait until engine listens to external_commands. ${content} Create List check_for_external_commands() ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 - Should Be True ${result} msg=check_for_external_commands is missing. + Should Be True ${result} check_for_external_commands is missing. ${remove_time} Get Current Date Remove Poller by id 51001 ${3} @@ -471,7 +471,7 @@ EBDP6 # wait unified receive instance event ${content} Create List central-broker-unified-sql read neb:Instance ${result} Find In Log with Timeout ${centralLog} ${remove_time} ${content} 60 - Should Be True ${result} msg=central-broker-unified-sql read neb:Instance is missing + Should Be True ${result} central-broker-unified-sql read neb:Instance is missing Stop Engine Kindly Stop Broker @@ -500,7 +500,7 @@ EBDP7 # Let's wait until engine listens to external_commands. ${content} Create List check_for_external_commands() ${result} Find In Log with Timeout ${engineLog2} ${start} ${content} 60 - Should Be True ${result} msg=check_for_external_commands is missing. + Should Be True ${result} check_for_external_commands is missing. Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} FOR ${index} IN RANGE 60 @@ -529,7 +529,7 @@ EBDP7 # Let's wait until engine listens to external_commands. ${content} Create List check_for_external_commands() ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 - Should Be True ${result} msg=check_for_external_commands is missing. + Should Be True ${result} check_for_external_commands is missing. ${remove_time} Get Current Date Remove Poller by id 51001 ${3} @@ -537,7 +537,7 @@ EBDP7 # wait unified receive instance event ${content} Create List central-broker-unified-sql read neb:Instance ${result} Find In Log with Timeout ${centralLog} ${remove_time} ${content} 60 - Should Be True ${result} msg=central-broker-unified-sql read neb:Instance is missing + Should Be True ${result} central-broker-unified-sql read neb:Instance is missing Stop Engine Kindly Stop Broker @@ -569,7 +569,7 @@ EBDP8 # Let's wait until engine listens to external_commands. ${content} Create List check_for_external_commands() ${result} Find In Log with Timeout ${engineLog3} ${start} ${content} 60 - Should Be True ${result} msg=check_for_external_commands is missing. + Should Be True ${result} check_for_external_commands is missing. Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} FOR ${index} IN RANGE 60 @@ -582,7 +582,7 @@ EBDP8 # Let's brutally kill the poller ${content} Create List processing poller event (id: 4, name: Poller3, running: ${result} Find In log with timeout ${centralLog} ${start} ${content} 60 - Should Be True ${result} msg=We want the poller 4 event before stopping broker + Should Be True ${result} We want the poller 4 event before stopping broker Kindly Stop Broker Remove Files ${centralLog} ${rrdLog} @@ -595,11 +595,11 @@ EBDP8 ... SERVICE ALERT: host_40;service_781;CRITICAL ... SERVICE ALERT: host_40;service_782;WARNING ${result} Find In log with timeout ${engineLog3} ${start} ${content} 60 - Should Be True ${result} msg=Service alerts about service 781 and 782 should be raised + Should Be True ${result} Service alerts about service 781 and 782 should be raised ${content} Create List callbacks: service (40, 781) has no perfdata service (40, 782) has no perfdata ${result} Find In log with timeout ${moduleLog3} ${start} ${content} 60 - Should Be True ${result} msg=pb service status on services (40, 781) and (40, 782) should be generated + Should Be True ${result} pb service status on services (40, 781) and (40, 782) should be generated Stop Engine # Because poller3 is going to be removed, we move its memory file to poller0, 1 and 2. @@ -624,11 +624,11 @@ EBDP8 # Let's wait until engine listens to external_commands. ${content} Create List check_for_external_commands() ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 - Should Be True ${result} msg=check_for_external_commands is missing. + Should Be True ${result} check_for_external_commands is missing. ${content} Create List service status (40, 781) thrown away because host 40 is not known by any poller log to console date ${start} ${result} Find in Log With Timeout ${centralLog} ${start} ${content} 60 - Should be True ${result} msg=No message about these two wrong service status. + Should be True ${result} No message about these two wrong service status. Stop Engine Kindly Stop Broker diff --git a/tests/broker-engine/downtimes.robot b/tests/broker-engine/downtimes.robot index f02be747595..439b6c68f1f 100644 --- a/tests/broker-engine/downtimes.robot +++ b/tests/broker-engine/downtimes.robot @@ -41,41 +41,41 @@ BEDTMASS1 Broker Config Log central sql debug Config Broker Sql Output central unified_sql Clear Retention - ${start}= Get Current Date + ${start} Get Current Date Start Broker Start Engine # Let's wait for the initial service states. - ${content}= Create List INITIAL SERVICE STATE: host_50;service_1000; - ${result}= Find In Log with Timeout ${engineLog2} ${start} ${content} 60 + ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; + ${result} Find In Log with Timeout ${engineLog2} ${start} ${content} 60 Should Be True ... ${result} - ... msg=An Initial service state on service (50, 1000) should be raised before we can start external commands. + ... An Initial service state on service (50, 1000) should be raised before we can start external commands. # It's time to schedule downtimes FOR ${i} IN RANGE ${17} - ${host0}= Catenate SEPARATOR= host_ ${i + 1} - ${host1}= Catenate SEPARATOR= host_ ${i + 18} - ${host2}= Catenate SEPARATOR= host_ ${i + 35} + ${host0} Catenate SEPARATOR= host_ ${i + 1} + ${host1} Catenate SEPARATOR= host_ ${i + 18} + ${host2} Catenate SEPARATOR= host_ ${i + 35} Schedule host downtime ${0} ${host0} ${3600} Schedule host downtime ${1} ${host1} ${3600} Schedule host downtime ${2} ${host2} ${3600} END - ${result}= check number of downtimes ${1050} ${start} ${60} - Should be true ${result} msg=We should have 1050 downtimes enabled. + ${result} check number of downtimes ${1050} ${start} ${60} + Should be true ${result} We should have 1050 downtimes enabled. # It's time to delete downtimes FOR ${i} IN RANGE ${17} - ${host0}= Catenate SEPARATOR= host_ ${i + 1} - ${host1}= Catenate SEPARATOR= host_ ${i + 18} - ${host2}= Catenate SEPARATOR= host_ ${i + 35} + ${host0} Catenate SEPARATOR= host_ ${i + 1} + ${host1} Catenate SEPARATOR= host_ ${i + 18} + ${host2} Catenate SEPARATOR= host_ ${i + 35} Delete host downtimes ${0} ${host0} Delete host downtimes ${1} ${host1} Delete host downtimes ${2} ${host2} END - ${result}= check number of downtimes ${0} ${start} ${60} - Should be true ${result} msg=We should have no downtime enabled. + ${result} check number of downtimes ${0} ${start} ${60} + Should be true ${result} We should have no downtime enabled. Stop Engine Kindly Stop Broker @@ -97,41 +97,41 @@ BEDTMASS2 Broker Config Log central sql debug Clear Retention - ${start}= Get Current Date + ${start} Get Current Date Start Broker Start Engine # Let's wait for the initial service states. - ${content}= Create List INITIAL SERVICE STATE: host_50;service_1000; - ${result}= Find In Log with Timeout ${engineLog2} ${start} ${content} 60 + ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; + ${result} Find In Log with Timeout ${engineLog2} ${start} ${content} 60 Should Be True ... ${result} - ... msg=An Initial service state on service (50, 1000) should be raised before we can start external commands. + ... An Initial service state on service (50, 1000) should be raised before we can start external commands. # It's time to schedule downtimes FOR ${i} IN RANGE ${17} - ${host0}= Catenate SEPARATOR= host_ ${i + 1} - ${host1}= Catenate SEPARATOR= host_ ${i + 18} - ${host2}= Catenate SEPARATOR= host_ ${i + 35} + ${host0} Catenate SEPARATOR= host_ ${i + 1} + ${host1} Catenate SEPARATOR= host_ ${i + 18} + ${host2} Catenate SEPARATOR= host_ ${i + 35} Schedule host downtime ${0} ${host0} ${3600} Schedule host downtime ${1} ${host1} ${3600} Schedule host downtime ${2} ${host2} ${3600} END - ${result}= check number of downtimes ${1050} ${start} ${60} - Should be true ${result} msg=We should have 1050 downtimes enabled. + ${result} check number of downtimes ${1050} ${start} ${60} + Should be true ${result} We should have 1050 downtimes enabled. # It's time to delete downtimes FOR ${i} IN RANGE ${17} - ${host0}= Catenate SEPARATOR= host_ ${i + 1} - ${host1}= Catenate SEPARATOR= host_ ${i + 18} - ${host2}= Catenate SEPARATOR= host_ ${i + 35} + ${host0} Catenate SEPARATOR= host_ ${i + 1} + ${host1} Catenate SEPARATOR= host_ ${i + 18} + ${host2} Catenate SEPARATOR= host_ ${i + 35} Delete host downtimes ${0} ${host0} Delete host downtimes ${1} ${host1} Delete host downtimes ${2} ${host2} END - ${result}= check number of downtimes ${0} ${start} ${60} - Should be true ${result} msg=We should have no downtime enabled. + ${result} check number of downtimes ${0} ${start} ${60} + Should be true ${result} We should have no downtime enabled. Stop Engine Kindly Stop Broker @@ -148,33 +148,33 @@ BEDTSVCREN1 Broker Config Log module0 neb debug Clear Retention - ${start}= Get Current Date + ${start} Get Current Date Start Broker Start Engine # Let's wait for the check of external commands - ${content}= Create List check_for_external_commands - ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 - Should Be True ${result} msg=No check for external commands executed for 1mn. + ${content} Create List check_for_external_commands + ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + Should Be True ${result} No check for external commands executed for 1mn. # It's time to schedule a downtime Schedule service downtime host_1 service_1 ${3600} - ${result}= check number of downtimes ${1} ${start} ${60} - Should be true ${result} msg=We should have 1 downtime enabled. + ${result} check number of downtimes ${1} ${start} ${60} + Should be true ${result} We should have 1 downtime enabled. # Let's rename the service service_1 Rename Service ${0} host_1 service_1 toto_1 Reload Engine # Let's wait for the check of external commands - ${content}= Create List check_for_external_commands - ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 - Should Be True ${result} msg=No check for external commands executed for 1mn. + ${content} Create List check_for_external_commands + ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + Should Be True ${result} No check for external commands executed for 1mn. Delete service downtime full ${0} host_1 toto_1 - ${result}= check number of downtimes ${0} ${start} ${60} - Should be true ${result} msg=We should have no downtime enabled. + ${result} check number of downtimes ${0} ${start} ${60} + Should be true ${result} We should have no downtime enabled. Stop Engine Kindly Stop Broker @@ -191,24 +191,24 @@ BEDTSVCFIXED Broker Config Log module0 neb debug Clear Retention - ${start}= Get Current Date + ${start} Get Current Date Start Broker Start Engine # Let's wait for the check of external commands - ${content}= Create List check_for_external_commands - ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 - Should Be True ${result} msg=No check for external commands executed for 1mn. + ${content} Create List check_for_external_commands + ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + Should Be True ${result} No check for external commands executed for 1mn. # It's time to schedule a downtime Schedule service downtime host_1 service_1 ${3600} - ${result}= check number of downtimes ${1} ${start} ${60} - Should be true ${result} msg=We should have 1 downtime enabled. + ${result} check number of downtimes ${1} ${start} ${60} + Should be true ${result} We should have 1 downtime enabled. Delete service downtime full ${0} host_1 service_1 - ${result}= check number of downtimes ${0} ${start} ${60} - Should be true ${result} msg=We should have no downtime enabled. + ${result} check number of downtimes ${0} ${start} ${60} + Should be true ${result} We should have no downtime enabled. Stop Engine Kindly Stop Broker @@ -226,25 +226,25 @@ BEDTHOSTFIXED Config Broker Sql Output central unified_sql Clear Retention - ${start}= Get Current Date + ${start} Get Current Date Start Broker Start Engine # Let's wait for the check of external commands - ${content}= Create List check_for_external_commands - ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 - Should Be True ${result} msg=No check for external commands executed for 1mn. + ${content} Create List check_for_external_commands + ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + Should Be True ${result} No check for external commands executed for 1mn. # It's time to schedule downtimes Schedule host fixed downtime ${0} host_1 ${3600} - ${result}= check number of downtimes ${21} ${start} ${60} - Should be true ${result} msg=We should have 21 downtimes (1 host + 20 services) enabled. + ${result} check number of downtimes ${21} ${start} ${60} + Should be true ${result} We should have 21 downtimes (1 host + 20 services) enabled. # It's time to delete downtimes Delete host downtimes ${0} host_1 - ${result}= check number of downtimes ${0} ${start} ${60} - Should be true ${result} msg=We should have no downtime enabled. + ${result} check number of downtimes ${0} ${start} ${60} + Should be true ${result} We should have no downtime enabled. Stop Engine Kindly Stop Broker @@ -255,4 +255,4 @@ Clean Downtimes Before Suite Clean Before Suite Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} - ${output}= Execute SQL String DELETE FROM downtimes WHERE deletion_time IS NULL + ${output} Execute SQL String DELETE FROM downtimes WHERE deletion_time IS NULL diff --git a/tests/broker-engine/external-commands.robot b/tests/broker-engine/external-commands.robot index 018742b17bf..7f0f8166d4a 100644 --- a/tests/broker-engine/external-commands.robot +++ b/tests/broker-engine/external-commands.robot @@ -33,14 +33,14 @@ BEEXTCMD1 FOR ${use_grpc} IN RANGE 0 2 Log To Console external command CHANGE_NORMAL_SVC_CHECK_INTERVAL on bbdo3.0 use_grpc=${use_grpc} Clear Retention - ${start}= Get Current Date + ${start} Get Current Date Start Broker Start Engine - ${content}= Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() + ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} - ... msg=An Initial host state on host_1 should be raised before we can start our external commands. + ... An Initial host state on host_1 should be raised before we can start our external commands. Change Normal Svc Check Interval ${use_grpc} host_1 service_1 10 Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} @@ -48,7 +48,7 @@ BEEXTCMD1 FOR ${index} IN RANGE 300 Log To Console ... SELECT s.check_interval FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE h.name='host_1' AND s.description='service_1' - ${output}= Query + ${output} Query ... SELECT s.check_interval FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE h.name='host_1' AND s.description='service_1' Log To Console ${output} Sleep 1s @@ -70,14 +70,14 @@ BEEXTCMD2 FOR ${use_grpc} IN RANGE 0 2 Log To Console external command CHANGE_NORMAL_SVC_CHECK_INTERVAL on bbdo2.0 use_grpc=${use_grpc} Clear Retention - ${start}= Get Current Date + ${start} Get Current Date Start Broker Start Engine - ${content}= Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() + ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} - ... msg=An Initial host state on host_1 should be raised before we can start our external commands. + ... An Initial host state on host_1 should be raised before we can start our external commands. Change Normal Svc Check Interval ${use_grpc} host_1 service_1 15 Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} @@ -85,7 +85,7 @@ BEEXTCMD2 FOR ${index} IN RANGE 30 Log To Console ... SELECT s.check_interval FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE h.name='host_1' AND s.description='service_1' - ${output}= Query + ${output} Query ... SELECT s.check_interval FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE h.name='host_1' AND s.description='service_1' Log To Console ${output} Sleep 1s @@ -113,21 +113,21 @@ BEEXTCMD3 FOR ${use_grpc} IN RANGE 0 2 Log To Console external command CHANGE_NORMAL_HOST_CHECK_INTERVAL on bbdo3.0 use_grpc=${use_grpc} Clear Retention - ${start}= Get Current Date + ${start} Get Current Date Start Broker Start Engine - ${content}= Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() + ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} - ... msg=An Initial host state on host_1 should be raised before we can start our external commands. + ... An Initial host state on host_1 should be raised before we can start our external commands. Change Normal Host Check Interval ${use_grpc} host_1 10 Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} FOR ${index} IN RANGE 30 Log To Console SELECT check_interval FROM hosts WHERE name='host_1' - ${output}= Query SELECT check_interval FROM hosts WHERE name='host_1' + ${output} Query SELECT check_interval FROM hosts WHERE name='host_1' Log To Console ${output} Sleep 1s IF "${output}" == "((10.0,),)" BREAK @@ -149,21 +149,21 @@ BEEXTCMD4 FOR ${use_grpc} IN RANGE 0 2 Log To Console external command CHANGE_NORMAL_HOST_CHECK_INTERVAL on bbdo2.0 use_grpc=${use_grpc} Clear Retention - ${start}= Get Current Date + ${start} Get Current Date Start Broker Start Engine - ${content}= Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() + ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} - ... msg=An Initial host state on host_1 should be raised before we can start our external commands. + ... An Initial host state on host_1 should be raised before we can start our external commands. Change Normal Host Check Interval ${use_grpc} host_1 15 Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} FOR ${index} IN RANGE 30 Log To Console SELECT check_interval FROM hosts WHERE name='host_1' - ${output}= Query SELECT check_interval FROM hosts WHERE name='host_1' + ${output} Query SELECT check_interval FROM hosts WHERE name='host_1' Log To Console ${output} Sleep 1s IF "${output}" == "((15.0,),)" BREAK @@ -188,14 +188,14 @@ BEEXTCMD5 FOR ${use_grpc} IN RANGE 0 2 Log To Console external command CHANGE_RETRY_SVC_CHECK_INTERVAL on bbdo3.0 use_grpc=${use_grpc} Clear Retention - ${start}= Get Current Date + ${start} Get Current Date Start Broker Start Engine - ${content}= Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() + ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} - ... msg=An Initial host state on host_1 should be raised before we can start our external commands. + ... An Initial host state on host_1 should be raised before we can start our external commands. Change Retry Svc Check Interval ${use_grpc} host_1 service_1 15 Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} @@ -203,7 +203,7 @@ BEEXTCMD5 FOR ${index} IN RANGE 30 Log To Console ... SELECT s.retry_interval FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE h.name='host_1' AND s.description='service_1' - ${output}= Query + ${output} Query ... SELECT s.retry_interval FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE h.name='host_1' AND s.description='service_1' Log To Console ${output} Sleep 1s @@ -225,14 +225,14 @@ BEEXTCMD6 FOR ${use_grpc} IN RANGE 0 2 Log To Console external command CHANGE_RETRY_SVC_CHECK_INTERVAL on bbdo2.0 use_grpc=${use_grpc} Clear Retention - ${start}= Get Current Date + ${start} Get Current Date Start Broker Start Engine - ${content}= Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() + ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} - ... msg=An Initial host state on host_1 should be raised before we can start our external commands. + ... An Initial host state on host_1 should be raised before we can start our external commands. Change Retry Svc Check Interval ${use_grpc} host_1 service_1 10 Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} @@ -240,7 +240,7 @@ BEEXTCMD6 FOR ${index} IN RANGE 30 Log To Console ... SELECT s.retry_interval FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE h.name='host_1' AND s.description='service_1' - ${output}= Query + ${output} Query ... SELECT s.retry_interval FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE h.name='host_1' AND s.description='service_1' Log To Console ${output} Sleep 1s @@ -268,21 +268,21 @@ BEEXTCMD7 FOR ${use_grpc} IN RANGE 0 2 Log To Console external command CHANGE_RETRY_HOST_CHECK_INTERVAL on bbdo3.0 use_grpc=${use_grpc} Clear Retention - ${start}= Get Current Date + ${start} Get Current Date Start Broker Start Engine - ${content}= Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() + ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} - ... msg=An Initial host state on host_1 should be raised before we can start our external commands. + ... An Initial host state on host_1 should be raised before we can start our external commands. Change Retry Host Check Interval ${use_grpc} host_1 15 Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} FOR ${index} IN RANGE 30 Log To Console SELECT retry_interval FROM hosts WHERE name='host_1' - ${output}= Query SELECT retry_interval FROM hosts WHERE name='host_1' + ${output} Query SELECT retry_interval FROM hosts WHERE name='host_1' Log To Console ${output} Sleep 1s IF "${output}" == "((15.0,),)" BREAK @@ -304,21 +304,21 @@ BEEXTCMD8 FOR ${use_grpc} IN RANGE 0 2 Log To Console external command CHANGE_RETRY_HOST_CHECK_INTERVAL on bbdo2.0 use_grpc=${use_grpc} Clear Retention - ${start}= Get Current Date + ${start} Get Current Date Start Broker Start Engine - ${content}= Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() + ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} - ... msg=An Initial host state on host_1 should be raised before we can start our external commands. + ... An Initial host state on host_1 should be raised before we can start our external commands. Change Retry Host Check Interval ${use_grpc} host_1 10 Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} FOR ${index} IN RANGE 30 Log To Console SELECT retry_interval FROM hosts WHERE name='host_1' - ${output}= Query SELECT retry_interval FROM hosts WHERE name='host_1' + ${output} Query SELECT retry_interval FROM hosts WHERE name='host_1' Log To Console ${output} Sleep 1s IF "${output}" == "((10.0,),)" BREAK @@ -343,14 +343,14 @@ BEEXTCMD9 FOR ${use_grpc} IN RANGE 0 2 Log To Console external command CHANGE_MAX_SVC_CHECK_ATTEMPTS on bbdo3.0 use_grpc=${use_grpc} Clear Retention - ${start}= Get Current Date + ${start} Get Current Date Start Broker Start Engine - ${content}= Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() + ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} - ... msg=An Initial host state on host_1 should be raised before we can start our external commands. + ... An Initial host state on host_1 should be raised before we can start our external commands. Change Max Svc Check Attempts ${use_grpc} host_1 service_1 15 Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} @@ -358,7 +358,7 @@ BEEXTCMD9 FOR ${index} IN RANGE 30 Log To Console ... SELECT s.max_check_attempts FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE h.name='host_1' AND s.description='service_1' - ${output}= Query + ${output} Query ... SELECT s.max_check_attempts FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE h.name='host_1' AND s.description='service_1' Log To Console ${output} Sleep 1s @@ -368,7 +368,7 @@ BEEXTCMD9 FOR ${index} IN RANGE 30 Log To Console SELECT max_check_attempts FROM resources WHERE name='service_1' AND parent_name='host_1' - ${output}= Query + ${output} Query ... SELECT max_check_attempts FROM resources WHERE name='service_1' AND parent_name='host_1' Log To Console ${output} Sleep 1s @@ -390,14 +390,14 @@ BEEXTCMD10 FOR ${use_grpc} IN RANGE 0 2 Log To Console external command CHANGE_MAX_SVC_CHECK_ATTEMPTS on bbdo2.0 use_grpc=${use_grpc} Clear Retention - ${start}= Get Current Date + ${start} Get Current Date Start Broker Start Engine - ${content}= Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() + ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} - ... msg=An Initial host state on host_1 should be raised before we can start our external commands. + ... An Initial host state on host_1 should be raised before we can start our external commands. Change Max Svc Check Attempts ${use_grpc} host_1 service_1 10 Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} @@ -405,7 +405,7 @@ BEEXTCMD10 FOR ${index} IN RANGE 30 Log To Console ... SELECT s.max_check_attempts FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE h.name='host_1' AND s.description='service_1' - ${output}= Query + ${output} Query ... SELECT s.max_check_attempts FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE h.name='host_1' AND s.description='service_1' Log To Console ${output} Sleep 1s @@ -433,21 +433,21 @@ BEEXTCMD11 FOR ${use_grpc} IN RANGE 0 2 Log To Console external command CHANGE_MAX_HOST_CHECK_ATTEMPTS on bbdo3.0 use_grpc=${use_grpc} Clear Retention - ${start}= Get Current Date + ${start} Get Current Date Start Broker Start Engine - ${content}= Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() + ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} - ... msg=An Initial host state on host_1 should be raised before we can start our external commands. + ... An Initial host state on host_1 should be raised before we can start our external commands. Change Max Host Check Attempts ${use_grpc} host_1 15 Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} FOR ${index} IN RANGE 30 Log To Console SELECT max_check_attempts FROM hosts WHERE name='host_1' - ${output}= Query SELECT max_check_attempts FROM hosts WHERE name='host_1' + ${output} Query SELECT max_check_attempts FROM hosts WHERE name='host_1' Log To Console ${output} Sleep 1s IF "${output}" == "((15,),)" BREAK @@ -456,7 +456,7 @@ BEEXTCMD11 FOR ${index} IN RANGE 30 Log To Console SELECT max_check_attempts FROM resources WHERE name='host_1' - ${output}= Query SELECT max_check_attempts FROM resources WHERE name='host_1' + ${output} Query SELECT max_check_attempts FROM resources WHERE name='host_1' Log To Console ${output} Sleep 1s IF "${output}" == "((15,),)" BREAK @@ -478,21 +478,21 @@ BEEXTCMD12 FOR ${use_grpc} IN RANGE 0 2 Log To Console external command CHANGE_MAX_HOST_CHECK_ATTEMPTS on bbdo2.0 use_grpc=${use_grpc} Clear Retention - ${start}= Get Current Date + ${start} Get Current Date Start Broker Start Engine - ${content}= Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() + ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} - ... msg=An Initial host state on host_1 should be raised before we can start our external commands. + ... An Initial host state on host_1 should be raised before we can start our external commands. Change Max Host Check Attempts ${use_grpc} host_1 10 Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} FOR ${index} IN RANGE 30 Log To Console SELECT max_check_attempts FROM hosts WHERE name='host_1' - ${output}= Query SELECT max_check_attempts FROM hosts WHERE name='host_1' + ${output} Query SELECT max_check_attempts FROM hosts WHERE name='host_1' Log To Console ${output} Sleep 1s IF "${output}" == "((10,),)" BREAK @@ -520,21 +520,21 @@ BEEXTCMD13 FOR ${use_grpc} IN RANGE 0 2 Log To Console external command CHANGE_HOST_CHECK_TIMEPERIOD on bbdo3.0 use_grpc=${use_grpc} Clear Retention - ${start}= Get Current Date + ${start} Get Current Date Start Broker Start Engine - ${content}= Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() + ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} - ... msg=An Initial host state on host_1 should be raised before we can start our external commands. + ... An Initial host state on host_1 should be raised before we can start our external commands. Change Host Check Timeperiod ${use_grpc} host_1 24x6 Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} FOR ${index} IN RANGE 30 Log To Console SELECT check_period FROM hosts WHERE name='host_1' - ${output}= Query SELECT check_period FROM hosts WHERE name='host_1' + ${output} Query SELECT check_period FROM hosts WHERE name='host_1' Log To Console ${output} Sleep 1s IF "${output}" == "(('24x6',),)" BREAK @@ -557,21 +557,21 @@ BEEXTCMD14 FOR ${use_grpc} IN RANGE 0 2 Log To Console external command CHANGE_HOST_CHECK_TIMEPERIOD on bbdo2.0 use_grpc=${use_grpc} Clear Retention - ${start}= Get Current Date + ${start} Get Current Date Start Broker Start Engine - ${content}= Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() + ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} - ... msg=An Initial host state on host_1 should be raised before we can start our external commands. + ... An Initial host state on host_1 should be raised before we can start our external commands. Change Host Check Timeperiod ${use_grpc} host_1 24x6 Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} FOR ${index} IN RANGE 30 Log To Console SELECT check_period FROM hosts WHERE name='host_1' - ${output}= Query SELECT check_period FROM hosts WHERE name='host_1' + ${output} Query SELECT check_period FROM hosts WHERE name='host_1' Log To Console ${output} Sleep 1s IF "${output}" == "(('24x6',),)" BREAK @@ -599,21 +599,21 @@ BEEXTCMD15 FOR ${use_grpc} IN RANGE 0 2 Log To Console external command CHANGE_HOST_NOTIFICATION_TIMEPERIOD on bbdo3.0 use_grpc=${use_grpc} Clear Retention - ${start}= Get Current Date + ${start} Get Current Date Start Broker Start Engine - ${content}= Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() + ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} - ... msg=An Initial host state on host_1 should be raised before we can start our external commands. + ... An Initial host state on host_1 should be raised before we can start our external commands. Change Host Notification Timeperiod ${use_grpc} host_1 24x7 Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} FOR ${index} IN RANGE 30 Log To Console SELECT notification_period FROM hosts WHERE name='host_1' - ${output}= Query SELECT notification_period FROM hosts WHERE name='host_1' + ${output} Query SELECT notification_period FROM hosts WHERE name='host_1' Log To Console ${output} Sleep 1s IF "${output}" == "(('24x7',),)" BREAK @@ -636,21 +636,21 @@ BEEXTCMD16 FOR ${use_grpc} IN RANGE 0 2 Log To Console external command CHANGE_HOST_NOTIFICATION_TIMEPERIOD on bbdo2.0 use_grpc=${use_grpc} Clear Retention - ${start}= Get Current Date + ${start} Get Current Date Start Broker Start Engine - ${content}= Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() + ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} - ... msg=An Initial host state on host_1 should be raised before we can start our external commands. + ... An Initial host state on host_1 should be raised before we can start our external commands. Change Host Notification Timeperiod ${use_grpc} host_1 24x6 Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} FOR ${index} IN RANGE 30 Log To Console SELECT notification_period FROM hosts WHERE name='host_1' - ${output}= Query SELECT notification_period FROM hosts WHERE name='host_1' + ${output} Query SELECT notification_period FROM hosts WHERE name='host_1' Log To Console ${output} Sleep 1s IF "${output}" == "(('24x6',),)" BREAK @@ -678,14 +678,14 @@ BEEXTCMD17 FOR ${use_grpc} IN RANGE 0 2 Log To Console external command CHANGE_SVC_CHECK_TIMEPERIOD on bbdo3.0 use_grpc=${use_grpc} Clear Retention - ${start}= Get Current Date + ${start} Get Current Date Start Broker Start Engine - ${content}= Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() + ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} - ... msg=An Initial host state on host_1 should be raised before we can start our external commands. + ... An Initial host state on host_1 should be raised before we can start our external commands. Change Svc Check Timeperiod ${use_grpc} host_1 service_1 24x6 Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} @@ -693,7 +693,7 @@ BEEXTCMD17 FOR ${index} IN RANGE 30 Log To Console ... SELECT s.check_period FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE s.description='service_1' AND h.name='host_1' - ${output}= Query + ${output} Query ... SELECT s.check_period FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE s.description='service_1' AND h.name='host_1' Log To Console ${output} Sleep 1s @@ -717,14 +717,14 @@ BEEXTCMD18 FOR ${use_grpc} IN RANGE 0 2 Log To Console external command CHANGE_SVC_CHECK_TIMEPERIOD on bbdo2.0 use_grpc=${use_grpc} Clear Retention - ${start}= Get Current Date + ${start} Get Current Date Start Broker Start Engine - ${content}= Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() + ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} - ... msg=An Initial host state on host_1 should be raised before we can start our external commands. + ... An Initial host state on host_1 should be raised before we can start our external commands. Change Svc Check Timeperiod ${use_grpc} host_1 service_1 24x7 Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} @@ -732,7 +732,7 @@ BEEXTCMD18 FOR ${index} IN RANGE 30 Log To Console ... SELECT s.check_period FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE s.description='service_1' AND h.name='host_1' - ${output}= Query + ${output} Query ... SELECT s.check_period FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE s.description='service_1' AND h.name='host_1' Log To Console ${output} Sleep 1s @@ -761,14 +761,14 @@ BEEXTCMD19 FOR ${use_grpc} IN RANGE 0 2 Log To Console external command CHANGE_SVC_NOTIFICATION_TIMEPERIOD on bbdo3.0 use_grpc=${use_grpc} Clear Retention - ${start}= Get Current Date + ${start} Get Current Date Start Broker Start Engine - ${content}= Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() + ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} - ... msg=An Initial host state on host_1 should be raised before we can start our external commands. + ... An Initial host state on host_1 should be raised before we can start our external commands. Change Svc Notification Timeperiod ${use_grpc} host_1 service_1 24x7 Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} @@ -776,7 +776,7 @@ BEEXTCMD19 FOR ${index} IN RANGE 30 Log To Console ... SELECT s.notification_period FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE s.description='service_1' AND h.name='host_1' - ${output}= Query + ${output} Query ... SELECT s.notification_period FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE s.description='service_1' AND h.name='host_1' Log To Console ${output} Sleep 1s @@ -800,14 +800,14 @@ BEEXTCMD20 FOR ${use_grpc} IN RANGE 0 2 Log To Console external command CHANGE_SVC_NOTIFICATION_TIMEPERIOD on bbdo2.0 use_grpc=${use_grpc} Clear Retention - ${start}= Get Current Date + ${start} Get Current Date Start Broker Start Engine - ${content}= Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() + ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} - ... msg=An Initial host state on host_1 should be raised before we can start our external commands. + ... An Initial host state on host_1 should be raised before we can start our external commands. Change Svc Notification Timeperiod ${use_grpc} host_1 service_1 24x6 Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} @@ -815,7 +815,7 @@ BEEXTCMD20 FOR ${index} IN RANGE 30 Log To Console ... SELECT s.notification_period FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE s.description='service_1' AND h.name='host_1' - ${output}= Query + ${output} Query ... SELECT s.notification_period FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE s.description='service_1' AND h.name='host_1' Log To Console ${output} Sleep 1s @@ -845,21 +845,21 @@ BEEXTCMD21 FOR ${use_grpc} IN RANGE 0 2 Log To Console ... external command DISABLE_HOST_AND_CHILD_NOTIFICATIONS and ENABLE_HOST_AND_CHILD_NOTIFICATIONS on bbdo3.0 use_grpc=${use_grpc} - ${start}= Get Current Date + ${start} Get Current Date Start Broker Start Engine - ${content}= Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() + ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} - ... msg=An Initial host state on host_1 should be raised before we can start our external commands. + ... An Initial host state on host_1 should be raised before we can start our external commands. Disable Host And child Notifications ${use_grpc} host_1 Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} FOR ${index} IN RANGE 30 Log To Console SELECT notify FROM hosts WHERE name='host_1' - ${output}= Query SELECT notify FROM hosts WHERE name='host_1' + ${output} Query SELECT notify FROM hosts WHERE name='host_1' Log To Console ${output} Sleep 1s IF "${output}" == "((0,),)" BREAK @@ -868,7 +868,7 @@ BEEXTCMD21 FOR ${index} IN RANGE 30 Log To Console SELECT notifications_enabled FROM resources WHERE name='host_1' - ${output}= Query SELECT notifications_enabled FROM resources WHERE name='host_1' + ${output} Query SELECT notifications_enabled FROM resources WHERE name='host_1' Log To Console ${output} Sleep 1s IF "${output}" == "((0,),)" BREAK @@ -879,7 +879,7 @@ BEEXTCMD21 FOR ${index} IN RANGE 30 Log To Console SELECT notify FROM hosts WHERE name='host_1' - ${output}= Query SELECT notify FROM hosts WHERE name='host_1' + ${output} Query SELECT notify FROM hosts WHERE name='host_1' Log To Console ${output} Sleep 1s IF "${output}" == "((1,),)" BREAK @@ -888,7 +888,7 @@ BEEXTCMD21 FOR ${index} IN RANGE 30 Log To Console SELECT notifications_enabled FROM resources WHERE name='host_1' - ${output}= Query SELECT notifications_enabled FROM resources WHERE name='host_1' + ${output} Query SELECT notifications_enabled FROM resources WHERE name='host_1' Log To Console ${output} Sleep 1s IF "${output}" == "((1,),)" BREAK @@ -912,21 +912,21 @@ BEEXTCMD22 FOR ${use_grpc} IN RANGE 0 2 Log To Console ... external command DISABLE_HOST_AND_CHILD_NOTIFICATIONS and ENABLE_HOST_AND_CHILD_NOTIFICATIONS on bbdo2.0 use_grpc=${use_grpc} - ${start}= Get Current Date + ${start} Get Current Date Start Broker Start Engine - ${content}= Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() + ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} - ... msg=An Initial host state on host_1 should be raised before we can start our external commands. + ... An Initial host state on host_1 should be raised before we can start our external commands. Disable Host And child Notifications ${use_grpc} host_1 Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} FOR ${index} IN RANGE 30 Log To Console SELECT notify FROM hosts WHERE name='host_1' - ${output}= Query SELECT notify FROM hosts WHERE name='host_1' + ${output} Query SELECT notify FROM hosts WHERE name='host_1' Log To Console ${output} Sleep 1s IF "${output}" == "((0,),)" BREAK @@ -937,7 +937,7 @@ BEEXTCMD22 FOR ${index} IN RANGE 30 Log To Console SELECT notify FROM hosts WHERE name='host_1' - ${output}= Query SELECT notify FROM hosts WHERE name='host_1' + ${output} Query SELECT notify FROM hosts WHERE name='host_1' Log To Console ${output} Sleep 1s IF "${output}" == "((1,),)" BREAK @@ -964,21 +964,21 @@ BEEXTCMD23 Config Broker Sql Output central unified_sql Clear Retention FOR ${use_grpc} IN RANGE 0 1 - ${start}= Get Current Date + ${start} Get Current Date Start Broker Start Engine - ${content}= Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() + ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} - ... msg=An Initial host state on host_1 should be raised before we can start our external commands. + ... An Initial host state on host_1 should be raised before we can start our external commands. Disable Host Check ${use_grpc} host_1 Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} FOR ${index} IN RANGE 30 Log To Console SELECT active_checks FROM hosts WHERE name='host_1' - ${output}= Query SELECT active_checks FROM hosts WHERE name='host_1' + ${output} Query SELECT active_checks FROM hosts WHERE name='host_1' Log To Console ${output} Sleep 1s IF "${output}" == "((0,),)" BREAK @@ -987,7 +987,7 @@ BEEXTCMD23 FOR ${index} IN RANGE 30 Log To Console SELECT active_checks_enabled FROM resources WHERE name='host_1' - ${output}= Query SELECT active_checks_enabled FROM resources WHERE name='host_1' + ${output} Query SELECT active_checks_enabled FROM resources WHERE name='host_1' Log To Console ${output} Sleep 1s IF "${output}" == "((0,),)" BREAK @@ -996,7 +996,7 @@ BEEXTCMD23 FOR ${index} IN RANGE 30 Log To Console SELECT should_be_scheduled FROM hosts WHERE name='host_1' - ${output}= Query SELECT should_be_scheduled FROM hosts WHERE name='host_1' + ${output} Query SELECT should_be_scheduled FROM hosts WHERE name='host_1' Log To Console ${output} Sleep 1s IF "${output}" == "((0,),)" BREAK @@ -1007,7 +1007,7 @@ BEEXTCMD23 FOR ${index} IN RANGE 30 Log To Console SELECT active_checks FROM hosts WHERE name='host_1' - ${output}= Query SELECT active_checks FROM hosts WHERE name='host_1' + ${output} Query SELECT active_checks FROM hosts WHERE name='host_1' Log To Console ${output} Sleep 1s IF "${output}" == "((1,),)" BREAK @@ -1016,7 +1016,7 @@ BEEXTCMD23 FOR ${index} IN RANGE 30 Log To Console SELECT active_checks_enabled FROM resources WHERE name='host_1' - ${output}= Query SELECT active_checks_enabled FROM resources WHERE name='host_1' + ${output} Query SELECT active_checks_enabled FROM resources WHERE name='host_1' Log To Console ${output} Sleep 1s IF "${output}" == "((1,),)" BREAK @@ -1025,7 +1025,7 @@ BEEXTCMD23 FOR ${index} IN RANGE 30 Log To Console SELECT should_be_scheduled FROM hosts WHERE name='host_1' - ${output}= Query SELECT should_be_scheduled FROM hosts WHERE name='host_1' + ${output} Query SELECT should_be_scheduled FROM hosts WHERE name='host_1' Log To Console ${output} Sleep 1s IF "${output}" == "((1,),)" BREAK @@ -1046,21 +1046,21 @@ BEEXTCMD24 Broker Config Log central sql debug Clear Retention FOR ${use_grpc} IN RANGE 0 1 - ${start}= Get Current Date + ${start} Get Current Date Start Broker Start Engine - ${content}= Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() + ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} - ... msg=An Initial host state on host_1 should be raised before we can start our external commands. + ... An Initial host state on host_1 should be raised before we can start our external commands. Disable Host Check ${use_grpc} host_1 Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} FOR ${index} IN RANGE 30 Log To Console SELECT active_checks FROM hosts WHERE name='host_1' - ${output}= Query SELECT active_checks FROM hosts WHERE name='host_1' + ${output} Query SELECT active_checks FROM hosts WHERE name='host_1' Log To Console ${output} Sleep 1s IF "${output}" == "((0,),)" BREAK @@ -1069,7 +1069,7 @@ BEEXTCMD24 FOR ${index} IN RANGE 30 Log To Console SELECT should_be_scheduled FROM hosts WHERE name='host_1' - ${output}= Query SELECT should_be_scheduled FROM hosts WHERE name='host_1' + ${output} Query SELECT should_be_scheduled FROM hosts WHERE name='host_1' Log To Console ${output} Sleep 1s IF "${output}" == "((0,),)" BREAK @@ -1080,7 +1080,7 @@ BEEXTCMD24 FOR ${index} IN RANGE 30 Log To Console SELECT active_checks FROM hosts WHERE name='host_1' - ${output}= Query SELECT active_checks FROM hosts WHERE name='host_1' + ${output} Query SELECT active_checks FROM hosts WHERE name='host_1' Log To Console ${output} Sleep 1s IF "${output}" == "((1,),)" BREAK @@ -1089,7 +1089,7 @@ BEEXTCMD24 FOR ${index} IN RANGE 30 Log To Console SELECT should_be_scheduled FROM hosts WHERE name='host_1' - ${output}= Query SELECT should_be_scheduled FROM hosts WHERE name='host_1' + ${output} Query SELECT should_be_scheduled FROM hosts WHERE name='host_1' Log To Console ${output} Sleep 1s IF "${output}" == "((1,),)" BREAK @@ -1116,21 +1116,21 @@ BEEXTCMD25 Config Broker Sql Output central unified_sql FOR ${use_grpc} IN RANGE 0 1 Clear Retention - ${start}= Get Current Date + ${start} Get Current Date Start Broker Start Engine - ${content}= Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() + ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} - ... msg=An Initial host state on host_1 should be raised before we can start our external commands. + ... An Initial host state on host_1 should be raised before we can start our external commands. Disable Host Event Handler ${use_grpc} host_1 Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} FOR ${index} IN RANGE 30 Log To Console SELECT event_handler_enabled FROM hosts WHERE name='host_1' - ${output}= Query SELECT event_handler_enabled FROM hosts WHERE name='host_1' + ${output} Query SELECT event_handler_enabled FROM hosts WHERE name='host_1' Log To Console ${output} Sleep 1s IF "${output}" == "((0,),)" BREAK @@ -1141,7 +1141,7 @@ BEEXTCMD25 FOR ${index} IN RANGE 30 Log To Console SELECT event_handler_enabled FROM hosts WHERE name='host_1' - ${output}= Query SELECT event_handler_enabled FROM hosts WHERE name='host_1' + ${output} Query SELECT event_handler_enabled FROM hosts WHERE name='host_1' Log To Console ${output} Sleep 1s IF "${output}" == "((1,),)" BREAK @@ -1163,21 +1163,21 @@ BEEXTCMD26 Broker Config Log central sql debug Clear Retention FOR ${use_grpc} IN RANGE 0 1 - ${start}= Get Current Date + ${start} Get Current Date Start Broker Start Engine - ${content}= Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() + ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} - ... msg=An Initial host state on host_1 should be raised before we can start our external commands. + ... An Initial host state on host_1 should be raised before we can start our external commands. Disable Host Event Handler ${use_grpc} host_1 Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} FOR ${index} IN RANGE 30 Log To Console SELECT event_handler_enabled FROM hosts WHERE name='host_1' - ${output}= Query SELECT event_handler_enabled FROM hosts WHERE name='host_1' + ${output} Query SELECT event_handler_enabled FROM hosts WHERE name='host_1' Log To Console ${output} Sleep 1s IF "${output}" == "((0,),)" BREAK @@ -1188,7 +1188,7 @@ BEEXTCMD26 FOR ${index} IN RANGE 30 Log To Console SELECT event_handler_enabled FROM hosts WHERE name='host_1' - ${output}= Query SELECT event_handler_enabled FROM hosts WHERE name='host_1' + ${output} Query SELECT event_handler_enabled FROM hosts WHERE name='host_1' Log To Console ${output} Sleep 1s IF "${output}" == "((1,),)" BREAK @@ -1215,21 +1215,21 @@ BEEXTCMD27 Config Broker Sql Output central unified_sql Clear Retention FOR ${use_grpc} IN RANGE 0 1 - ${start}= Get Current Date + ${start} Get Current Date Start Broker Start Engine - ${content}= Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() + ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} - ... msg=An Initial host state on host_1 should be raised before we can start our external commands. + ... An Initial host state on host_1 should be raised before we can start our external commands. Disable Host Flap Detection ${use_grpc} host_1 Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} FOR ${index} IN RANGE 30 Log To Console SELECT flap_detection FROM hosts WHERE name='host_1' - ${output}= Query SELECT flap_detection FROM hosts WHERE name='host_1' + ${output} Query SELECT flap_detection FROM hosts WHERE name='host_1' Log To Console ${output} Sleep 1s IF "${output}" == "((0,),)" BREAK @@ -1240,7 +1240,7 @@ BEEXTCMD27 FOR ${index} IN RANGE 30 Log To Console SELECT flap_detection FROM hosts WHERE name='host_1' - ${output}= Query SELECT flap_detection FROM hosts WHERE name='host_1' + ${output} Query SELECT flap_detection FROM hosts WHERE name='host_1' Log To Console ${output} Sleep 1s IF "${output}" == "((1,),)" BREAK @@ -1262,21 +1262,21 @@ BEEXTCMD28 Broker Config Log central sql debug Clear Retention FOR ${use_grpc} IN RANGE 0 1 - ${start}= Get Current Date + ${start} Get Current Date Start Broker Start Engine - ${content}= Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() + ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} - ... msg=An Initial host state on host_1 should be raised before we can start our external commands. + ... An Initial host state on host_1 should be raised before we can start our external commands. Disable Host Flap detection ${use_grpc} host_1 Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} FOR ${index} IN RANGE 30 Log To Console SELECT flap_detection FROM hosts WHERE name='host_1' - ${output}= Query SELECT flap_detection FROM hosts WHERE name='host_1' + ${output} Query SELECT flap_detection FROM hosts WHERE name='host_1' Log To Console ${output} Sleep 1s IF "${output}" == "((0,),)" BREAK @@ -1287,7 +1287,7 @@ BEEXTCMD28 FOR ${index} IN RANGE 30 Log To Console SELECT flap_detection FROM hosts WHERE name='host_1' - ${output}= Query SELECT flap_detection FROM hosts WHERE name='host_1' + ${output} Query SELECT flap_detection FROM hosts WHERE name='host_1' Log To Console ${output} Sleep 1s IF "${output}" == "((1,),)" BREAK @@ -1316,21 +1316,21 @@ BEEXTCMD29 Log To Console ... external command DISABLE_HOST_NOTIFICATIONS and ENABLE_HOST_NOTIFICATIONS on bbdo3.0 use_grpc=${use_grpc} Clear Retention - ${start}= Get Current Date + ${start} Get Current Date Start Broker Start Engine - ${content}= Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() + ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} - ... msg=An Initial host state on host_1 should be raised before we can start our external commands. + ... An Initial host state on host_1 should be raised before we can start our external commands. Disable Host Notifications ${use_grpc} host_1 Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} FOR ${index} IN RANGE 30 Log To Console SELECT notify FROM hosts WHERE name='host_1' - ${output}= Query SELECT notify FROM hosts WHERE name='host_1' + ${output} Query SELECT notify FROM hosts WHERE name='host_1' Log To Console ${output} Sleep 1s IF "${output}" == "((0,),)" BREAK @@ -1339,7 +1339,7 @@ BEEXTCMD29 FOR ${index} IN RANGE 30 Log To Console SELECT notifications_enabled FROM resources WHERE name='host_1' - ${output}= Query SELECT notifications_enabled FROM resources WHERE name='host_1' + ${output} Query SELECT notifications_enabled FROM resources WHERE name='host_1' Log To Console ${output} Sleep 1s IF "${output}" == "((0,),)" BREAK @@ -1350,7 +1350,7 @@ BEEXTCMD29 FOR ${index} IN RANGE 30 Log To Console SELECT notify FROM hosts WHERE name='host_1' - ${output}= Query SELECT notify FROM hosts WHERE name='host_1' + ${output} Query SELECT notify FROM hosts WHERE name='host_1' Log To Console ${output} Sleep 1s IF "${output}" == "((1,),)" BREAK @@ -1359,7 +1359,7 @@ BEEXTCMD29 FOR ${index} IN RANGE 30 Log To Console SELECT notifications_enabled FROM resources WHERE name='host_1' - ${output}= Query SELECT notifications_enabled FROM resources WHERE name='host_1' + ${output} Query SELECT notifications_enabled FROM resources WHERE name='host_1' Log To Console ${output} Sleep 1s IF "${output}" == "((1,),)" BREAK diff --git a/tests/broker-engine/external-commands2.robot b/tests/broker-engine/external-commands2.robot index be020c39bea..c3540496dd3 100644 --- a/tests/broker-engine/external-commands2.robot +++ b/tests/broker-engine/external-commands2.robot @@ -31,11 +31,11 @@ BEEXTCMD30 Log To Console ... external command DISABLE_HOST_NOTIFICATIONS and ENABLE_HOST_NOTIFICATIONS on bbdo2.0 use_grpc=${use_grpc} Clear Retention - ${start}= Get Current Date + ${start} Get Current Date Start Broker Start Engine - ${content}= Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() + ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. @@ -45,7 +45,7 @@ BEEXTCMD30 FOR ${index} IN RANGE 30 Log To Console SELECT notify FROM hosts WHERE name='host_1' - ${output}= Query SELECT notify FROM hosts WHERE name='host_1' + ${output} Query SELECT notify FROM hosts WHERE name='host_1' Log To Console ${output} Sleep 1s IF "${output}" == "((0,),)" BREAK @@ -56,7 +56,7 @@ BEEXTCMD30 FOR ${index} IN RANGE 30 Log To Console SELECT notify FROM hosts WHERE name='host_1' - ${output}= Query SELECT notify FROM hosts WHERE name='host_1' + ${output} Query SELECT notify FROM hosts WHERE name='host_1' Log To Console ${output} Sleep 1s IF "${output}" == "((1,),)" BREAK @@ -83,11 +83,11 @@ BEEXTCMD31 Config Broker Sql Output central unified_sql Clear Retention FOR ${use_grpc} IN RANGE 0 1 - ${start}= Get Current Date + ${start} Get Current Date Start Broker Start Engine - ${content}= Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() + ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. @@ -98,7 +98,7 @@ BEEXTCMD31 FOR ${index} IN RANGE 30 Log To Console ... SELECT s.active_checks FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE s.description='service_1' AND h.name='host_1' - ${output}= Query + ${output} Query ... SELECT s.active_checks FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE s.description='service_1' AND h.name='host_1' Log To Console ${output} Sleep 1s @@ -108,7 +108,7 @@ BEEXTCMD31 FOR ${index} IN RANGE 30 Log To Console SELECT active_checks_enabled FROM resources WHERE name='service_1' - ${output}= Query SELECT active_checks_enabled FROM resources WHERE name='service_1' + ${output} Query SELECT active_checks_enabled FROM resources WHERE name='service_1' Log To Console ${output} Sleep 1s IF "${output}" == "((0,),)" BREAK @@ -118,7 +118,7 @@ BEEXTCMD31 FOR ${index} IN RANGE 30 Log To Console ... SELECT s.should_be_scheduled FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE s.description='service_1' AND h.name='host_1' - ${output}= Query + ${output} Query ... SELECT s.should_be_scheduled FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE s.description='service_1' AND h.name='host_1' Log To Console ${output} Sleep 1s @@ -131,7 +131,7 @@ BEEXTCMD31 FOR ${index} IN RANGE 30 Log To Console ... SELECT s.active_checks FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE s.description='service_1' AND h.name='host_1' - ${output}= Query + ${output} Query ... SELECT s.active_checks FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE s.description='service_1' AND h.name='host_1' Log To Console ${output} Sleep 1s @@ -141,7 +141,7 @@ BEEXTCMD31 FOR ${index} IN RANGE 30 Log To Console SELECT active_checks_enabled FROM resources WHERE name='service_1' - ${output}= Query SELECT active_checks_enabled FROM resources WHERE name='service_1' + ${output} Query SELECT active_checks_enabled FROM resources WHERE name='service_1' Log To Console ${output} Sleep 1s IF "${output}" == "((1,),)" BREAK @@ -151,7 +151,7 @@ BEEXTCMD31 FOR ${index} IN RANGE 30 Log To Console ... SELECT s.should_be_scheduled FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE s.description='service_1' AND h.name='host_1' - ${output}= Query + ${output} Query ... SELECT s.should_be_scheduled FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE s.description='service_1' AND h.name='host_1' Log To Console ${output} Sleep 1s @@ -173,11 +173,11 @@ BEEXTCMD32 Broker Config Log central sql debug Clear Retention FOR ${use_grpc} IN RANGE 0 1 - ${start}= Get Current Date + ${start} Get Current Date Start Broker Start Engine - ${content}= Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() + ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. @@ -188,7 +188,7 @@ BEEXTCMD32 FOR ${index} IN RANGE 30 Log To Console ... SELECT s.s.active_checks FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE s.description='service_1' AND h.name='host_1' - ${output}= Query + ${output} Query ... SELECT s.active_checks FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE s.description='service_1' AND h.name='host_1' Log To Console ${output} Sleep 1s @@ -199,7 +199,7 @@ BEEXTCMD32 FOR ${index} IN RANGE 30 Log To Console ... SELECT s.should_be_scheduled FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE s.description='service_1' AND h.name='host_1' - ${output}= Query + ${output} Query ... SELECT s.should_be_scheduled FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE s.description='service_1' AND h.name='host_1' Log To Console ${output} Sleep 1s @@ -212,7 +212,7 @@ BEEXTCMD32 FOR ${index} IN RANGE 30 Log To Console ... SELECT s.active_checks FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE s.description='service_1' AND h.name='host_1' - ${output}= Query + ${output} Query ... SELECT s.active_checks FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE s.description='service_1' AND h.name='host_1' Log To Console ${output} Sleep 1s @@ -223,7 +223,7 @@ BEEXTCMD32 FOR ${index} IN RANGE 30 Log To Console ... SELECT s.should_be_scheduled FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE s.description='service_1' AND h.name='host_1' - ${output}= Query + ${output} Query ... SELECT s.should_be_scheduled FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE s.description='service_1' AND h.name='host_1' Log To Console ${output} Sleep 1s @@ -251,11 +251,11 @@ BEEXTCMD33 Config Broker Sql Output central unified_sql Clear Retention FOR ${use_grpc} IN RANGE 0 1 - ${start}= Get Current Date + ${start} Get Current Date Start Broker Start Engine - ${content}= Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() + ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. @@ -266,7 +266,7 @@ BEEXTCMD33 FOR ${index} IN RANGE 30 Log To Console ... SELECT s.notify FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE s.description='service_1' AND h.name='host_1' - ${output}= Query + ${output} Query ... SELECT s.notify FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE s.description='service_1' AND h.name='host_1' Log To Console ${output} Sleep 1s @@ -279,7 +279,7 @@ BEEXTCMD33 FOR ${index} IN RANGE 30 Log To Console ... SELECT s.notify FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE s.description='service_1' AND h.name='host_1' - ${output}= Query + ${output} Query ... SELECT s.notify FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE s.description='service_1' AND h.name='host_1' Log To Console ${output} Sleep 1s @@ -302,11 +302,11 @@ BEEXTCMD34 Broker Config Log central sql debug Clear Retention FOR ${use_grpc} IN RANGE 0 1 - ${start}= Get Current Date + ${start} Get Current Date Start Broker Start Engine - ${content}= Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() + ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. @@ -317,7 +317,7 @@ BEEXTCMD34 FOR ${index} IN RANGE 30 Log To Console ... SELECT s.notify FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE s.description='service_1' AND h.name='host_1' - ${output}= Query + ${output} Query ... SELECT s.notify FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE s.description='service_1' AND h.name='host_1' Log To Console ${output} Sleep 1s @@ -330,7 +330,7 @@ BEEXTCMD34 FOR ${index} IN RANGE 30 Log To Console ... SELECT s.notify FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE s.description='service_1' AND h.name='host_1' - ${output}= Query + ${output} Query ... SELECT s.notify FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE s.description='service_1' AND h.name='host_1' Log To Console ${output} Sleep 1s @@ -358,11 +358,11 @@ BEEXTCMD35 Config Broker Sql Output central unified_sql Clear Retention FOR ${use_grpc} IN RANGE 0 1 - ${start}= Get Current Date + ${start} Get Current Date Start Broker Start Engine - ${content}= Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() + ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. @@ -372,7 +372,7 @@ BEEXTCMD35 FOR ${index} IN RANGE 30 Log To Console SELECT passive_checks FROM hosts WHERE name='host_1' - ${output}= Query SELECT passive_checks FROM hosts WHERE name='host_1' + ${output} Query SELECT passive_checks FROM hosts WHERE name='host_1' Log To Console ${output} Sleep 1s IF "${output}" == "((0,),)" BREAK @@ -381,7 +381,7 @@ BEEXTCMD35 FOR ${index} IN RANGE 30 Log To Console SELECT passive_checks_enabled FROM resources WHERE name='host_1' - ${output}= Query SELECT passive_checks_enabled FROM resources WHERE name='host_1' + ${output} Query SELECT passive_checks_enabled FROM resources WHERE name='host_1' Log To Console ${output} Sleep 1s IF "${output}" == "((0,),)" BREAK @@ -392,7 +392,7 @@ BEEXTCMD35 FOR ${index} IN RANGE 30 Log To Console SELECT passive_checks FROM hosts WHERE name='host_1' - ${output}= Query SELECT passive_checks FROM hosts WHERE name='host_1' + ${output} Query SELECT passive_checks FROM hosts WHERE name='host_1' Log To Console ${output} Sleep 1s IF "${output}" == "((1,),)" BREAK @@ -401,7 +401,7 @@ BEEXTCMD35 FOR ${index} IN RANGE 30 Log To Console SELECT passive_checks_enabled FROM resources WHERE name='host_1' - ${output}= Query SELECT passive_checks_enabled FROM resources WHERE name='host_1' + ${output} Query SELECT passive_checks_enabled FROM resources WHERE name='host_1' Log To Console ${output} Sleep 1s IF "${output}" == "((1,),)" BREAK @@ -423,11 +423,11 @@ BEEXTCMD36 Broker Config Log central sql debug Clear Retention FOR ${use_grpc} IN RANGE 0 1 - ${start}= Get Current Date + ${start} Get Current Date Start Broker Start Engine - ${content}= Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() + ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. @@ -437,7 +437,7 @@ BEEXTCMD36 FOR ${index} IN RANGE 30 Log To Console SELECT passive_checks FROM hosts WHERE name='host_1' - ${output}= Query SELECT passive_checks FROM hosts WHERE name='host_1' + ${output} Query SELECT passive_checks FROM hosts WHERE name='host_1' Log To Console ${output} Sleep 1s IF "${output}" == "((0,),)" BREAK @@ -448,7 +448,7 @@ BEEXTCMD36 FOR ${index} IN RANGE 30 Log To Console SELECT passive_checks FROM hosts WHERE name='host_1' - ${output}= Query SELECT passive_checks FROM hosts WHERE name='host_1' + ${output} Query SELECT passive_checks FROM hosts WHERE name='host_1' Log To Console ${output} Sleep 1s IF "${output}" == "((1,),)" BREAK @@ -475,11 +475,11 @@ BEEXTCMD37 Config Broker Sql Output central unified_sql Clear Retention FOR ${use_grpc} IN RANGE 0 1 - ${start}= Get Current Date + ${start} Get Current Date Start Broker Start Engine - ${content}= Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() + ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. @@ -490,7 +490,7 @@ BEEXTCMD37 FOR ${index} IN RANGE 30 Log To Console ... SELECT s.passive_checks FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE s.description='service_1' AND h.name='host_1' - ${output}= Query + ${output} Query ... SELECT s.passive_checks FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE s.description='service_1' AND h.name='host_1' Log To Console ${output} Sleep 1s @@ -500,7 +500,7 @@ BEEXTCMD37 FOR ${index} IN RANGE 30 Log To Console SELECT passive_checks_enabled FROM resources WHERE name='service_1' - ${output}= Query SELECT passive_checks_enabled FROM resources WHERE name='service_1' + ${output} Query SELECT passive_checks_enabled FROM resources WHERE name='service_1' Log To Console ${output} Sleep 1s IF "${output}" == "((0,),)" BREAK @@ -512,7 +512,7 @@ BEEXTCMD37 FOR ${index} IN RANGE 30 Log To Console ... SELECT s.passive_checks FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE s.description='service_1' AND h.name='host_1' - ${output}= Query + ${output} Query ... SELECT s.passive_checks FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE s.description='service_1' AND h.name='host_1' Log To Console ${output} Sleep 1s @@ -522,7 +522,7 @@ BEEXTCMD37 FOR ${index} IN RANGE 30 Log To Console SELECT passive_checks_enabled FROM resources WHERE name='service_1' - ${output}= Query SELECT passive_checks_enabled FROM resources WHERE name='service_1' + ${output} Query SELECT passive_checks_enabled FROM resources WHERE name='service_1' Log To Console ${output} Sleep 1s IF "${output}" == "((1,),)" BREAK @@ -544,11 +544,11 @@ BEEXTCMD38 Broker Config Log central sql debug Clear Retention FOR ${use_grpc} IN RANGE 0 1 - ${start}= Get Current Date + ${start} Get Current Date Start Broker Start Engine - ${content}= Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() + ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. @@ -559,7 +559,7 @@ BEEXTCMD38 FOR ${index} IN RANGE 30 Log To Console ... SELECT s.passive_checks FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE s.description='service_1' AND h.name='host_1' - ${output}= Query + ${output} Query ... SELECT s.passive_checks FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE s.description='service_1' AND h.name='host_1' Log To Console ${output} Sleep 1s @@ -572,7 +572,7 @@ BEEXTCMD38 FOR ${index} IN RANGE 30 Log To Console ... SELECT s.passive_checks FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE s.description='service_1' AND h.name='host_1' - ${output}= Query + ${output} Query ... SELECT s.passive_checks FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE s.description='service_1' AND h.name='host_1' Log To Console ${output} Sleep 1s @@ -600,11 +600,11 @@ BEEXTCMD39 Config Broker Sql Output central unified_sql Clear Retention FOR ${use_grpc} IN RANGE 0 1 - ${start}= Get Current Date + ${start} Get Current Date Start Broker Start Engine - ${content}= Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() + ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. @@ -614,7 +614,7 @@ BEEXTCMD39 FOR ${index} IN RANGE 30 Log To Console SELECT obsess_over_host FROM hosts WHERE name='host_1' - ${output}= Query SELECT obsess_over_host FROM hosts WHERE name='host_1' + ${output} Query SELECT obsess_over_host FROM hosts WHERE name='host_1' Log To Console ${output} Sleep 1s IF "${output}" == "((0,),)" BREAK @@ -625,7 +625,7 @@ BEEXTCMD39 FOR ${index} IN RANGE 30 Log To Console SELECT obsess_over_host FROM hosts WHERE name='host_1' - ${output}= Query SELECT obsess_over_host FROM hosts WHERE name='host_1' + ${output} Query SELECT obsess_over_host FROM hosts WHERE name='host_1' Log To Console ${output} Sleep 1s IF "${output}" == "((1,),)" BREAK @@ -647,11 +647,11 @@ BEEXTCMD40 Broker Config Log central sql debug Clear Retention FOR ${use_grpc} IN RANGE 0 1 - ${start}= Get Current Date + ${start} Get Current Date Start Broker Start Engine - ${content}= Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() + ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. @@ -661,7 +661,7 @@ BEEXTCMD40 FOR ${index} IN RANGE 30 Log To Console SELECT obsess_over_host FROM hosts WHERE name='host_1' - ${output}= Query SELECT obsess_over_host FROM hosts WHERE name='host_1' + ${output} Query SELECT obsess_over_host FROM hosts WHERE name='host_1' Log To Console ${output} Sleep 1s IF "${output}" == "((0,),)" BREAK @@ -672,7 +672,7 @@ BEEXTCMD40 FOR ${index} IN RANGE 30 Log To Console SELECT obsess_over_host FROM hosts WHERE name='host_1' - ${output}= Query SELECT obsess_over_host FROM hosts WHERE name='host_1' + ${output} Query SELECT obsess_over_host FROM hosts WHERE name='host_1' Log To Console ${output} Sleep 1s IF "${output}" == "((1,),)" BREAK @@ -699,11 +699,11 @@ BEEXTCMD41 Config Broker Sql Output central unified_sql Clear Retention FOR ${use_grpc} IN RANGE 0 1 - ${start}= Get Current Date + ${start} Get Current Date Start Broker Start Engine - ${content}= Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() + ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. @@ -714,7 +714,7 @@ BEEXTCMD41 FOR ${index} IN RANGE 30 Log To Console ... SELECT s.obsess_over_service FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE s.description='service_1' AND h.name='host_1' - ${output}= Query + ${output} Query ... SELECT s.obsess_over_service FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE s.description='service_1' AND h.name='host_1' Log To Console ${output} Sleep 1s @@ -727,7 +727,7 @@ BEEXTCMD41 FOR ${index} IN RANGE 30 Log To Console ... SELECT s.obsess_over_service FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE s.description='service_1' AND h.name='host_1' - ${output}= Query + ${output} Query ... SELECT s.obsess_over_service FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE s.description='service_1' AND h.name='host_1' Log To Console ${output} Sleep 1s @@ -750,11 +750,11 @@ BEEXTCMD42 Broker Config Log central sql debug Clear Retention FOR ${use_grpc} IN RANGE 0 1 - ${start}= Get Current Date + ${start} Get Current Date Start Broker Start Engine - ${content}= Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() + ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. @@ -765,7 +765,7 @@ BEEXTCMD42 FOR ${index} IN RANGE 30 Log To Console ... SELECT s.obsess_over_service FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE s.description='service_1' AND h.name='host_1' - ${output}= Query + ${output} Query ... SELECT s.obsess_over_service FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE s.description='service_1' AND h.name='host_1' Log To Console ${output} Sleep 1s @@ -778,7 +778,7 @@ BEEXTCMD42 FOR ${index} IN RANGE 30 Log To Console ... SELECT s.obsess_over_service FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE s.description='service_1' AND h.name='host_1' - ${output}= Query + ${output} Query ... SELECT s.obsess_over_service FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE s.description='service_1' AND h.name='host_1' Log To Console ${output} Sleep 1s @@ -807,11 +807,11 @@ BEEXTCMD_GRPC1 FOR ${use_grpc} IN RANGE 0 2 Log To Console external command CHANGE_NORMAL_SVC_CHECK_INTERVAL on bbdo3.0 use_grpc=${use_grpc} Clear Retention - ${start}= Get Current Date + ${start} Get Current Date Start Broker Start Engine - ${content}= Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() + ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. @@ -822,7 +822,7 @@ BEEXTCMD_GRPC1 FOR ${index} IN RANGE 300 Log To Console ... SELECT s.check_interval FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE s.description='service_1' AND h.name='host_1' - ${output}= Query + ${output} Query ... SELECT s.check_interval FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE s.description='service_1' AND h.name='host_1' Log To Console ${output} Sleep 1s @@ -846,11 +846,11 @@ BEEXTCMD_GRPC2 FOR ${use_grpc} IN RANGE 0 2 Log To Console external command CHANGE_NORMAL_SVC_CHECK_INTERVAL on bbdo2.0 use_grpc=${use_grpc} Clear Retention - ${start}= Get Current Date + ${start} Get Current Date Start Broker Start Engine - ${content}= Create List INITIAL SERVICE STATE: host_50;service_1000; - ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; + ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. @@ -861,7 +861,7 @@ BEEXTCMD_GRPC2 FOR ${index} IN RANGE 30 Log To Console ... SELECT s.check_interval FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE s.description='service_1' AND h.name='host_1' - ${output}= Query + ${output} Query ... SELECT s.check_interval FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE s.description='service_1' AND h.name='host_1' Log To Console ${output} Sleep 1s @@ -891,11 +891,11 @@ BEEXTCMD_GRPC3 FOR ${use_grpc} IN RANGE 0 2 Log To Console external command CHANGE_NORMAL_HOST_CHECK_INTERVAL on bbdo3.0 use_grpc=${use_grpc} Clear Retention - ${start}= Get Current Date + ${start} Get Current Date Start Broker Start Engine - ${content}= Create List INITIAL SERVICE STATE: host_50;service_1000; - ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; + ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. @@ -905,7 +905,7 @@ BEEXTCMD_GRPC3 FOR ${index} IN RANGE 30 Log To Console SELECT check_interval FROM hosts WHERE name='host_1' - ${output}= Query SELECT check_interval FROM hosts WHERE name='host_1' + ${output} Query SELECT check_interval FROM hosts WHERE name='host_1' Log To Console ${output} Sleep 1s IF "${output}" == "((10.0,),)" BREAK @@ -929,11 +929,11 @@ BEEXTCMD_GRPC4 FOR ${use_grpc} IN RANGE 0 2 Log To Console external command CHANGE_NORMAL_HOST_CHECK_INTERVAL on bbdo2.0 use_grpc=${use_grpc} Clear Retention - ${start}= Get Current Date + ${start} Get Current Date Start Broker Start Engine - ${content}= Create List INITIAL SERVICE STATE: host_50;service_1000; - ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; + ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. @@ -943,7 +943,7 @@ BEEXTCMD_GRPC4 FOR ${index} IN RANGE 30 Log To Console SELECT check_interval FROM hosts WHERE name='host_1' - ${output}= Query SELECT check_interval FROM hosts WHERE name='host_1' + ${output} Query SELECT check_interval FROM hosts WHERE name='host_1' Log To Console ${output} Sleep 1s IF "${output}" == "((15.0,),)" BREAK @@ -974,15 +974,15 @@ BEEXTCMD_REVERSE_GRPC1 FOR ${use_grpc} IN RANGE 0 2 Log To Console external command CHANGE_NORMAL_SVC_CHECK_INTERVAL on bbdo3.0 use_grpc=${use_grpc} Clear Retention - ${start}= Get Current Date + ${start} Get Current Date Sleep 1s Start Broker Start Engine - ${content}= Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() + ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} - ... msg=An Initial host state on host_1 should be raised before we can start our external commands. + ... An Initial host state on host_1 should be raised before we can start our external commands. Change Normal Svc Check Interval ${use_grpc} host_1 service_1 10 Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} @@ -990,7 +990,7 @@ BEEXTCMD_REVERSE_GRPC1 FOR ${index} IN RANGE 300 Log To Console ... SELECT s.check_interval FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE h.name='host_1' AND s.description='service_1' - ${output}= Query + ${output} Query ... SELECT s.check_interval FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE h.name='host_1' AND s.description='service_1' Log To Console ${output} Sleep 1s @@ -1018,11 +1018,11 @@ BEEXTCMD_REVERSE_GRPC2 FOR ${use_grpc} IN RANGE 0 2 Log To Console external command CHANGE_NORMAL_SVC_CHECK_INTERVAL on bbdo2.0 use_grpc=${use_grpc} reversed Clear Retention - ${start}= Get Current Date + ${start} Get Current Date Start Broker Start Engine - ${content}= Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() + ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. @@ -1033,7 +1033,7 @@ BEEXTCMD_REVERSE_GRPC2 FOR ${index} IN RANGE 30 Log To Console ... SELECT s.check_interval FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE h.name='host_1' AND s.description='service_1' - ${output}= Query + ${output} Query ... SELECT s.check_interval FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE h.name='host_1' AND s.description='service_1' Log To Console ${output} Sleep 1s @@ -1067,11 +1067,11 @@ BEEXTCMD_REVERSE_GRPC3 FOR ${use_grpc} IN RANGE 0 2 Log To Console external command CHANGE_NORMAL_HOST_CHECK_INTERVAL on bbdo3.0 use_grpc=${use_grpc} reversed Clear Retention - ${start}= Get Current Date + ${start} Get Current Date Start Broker Start Engine - ${content}= Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() + ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. @@ -1081,7 +1081,7 @@ BEEXTCMD_REVERSE_GRPC3 FOR ${index} IN RANGE 30 Log To Console SELECT check_interval FROM hosts WHERE name='host_1' - ${output}= Query SELECT check_interval FROM hosts WHERE name='host_1' + ${output} Query SELECT check_interval FROM hosts WHERE name='host_1' Log To Console ${output} Sleep 1s IF "${output}" == "((10.0,),)" BREAK @@ -1109,11 +1109,11 @@ BEEXTCMD_REVERSE_GRPC4 FOR ${use_grpc} IN RANGE 0 2 Log To Console external command CHANGE_NORMAL_HOST_CHECK_INTERVAL on bbdo2.0 use_grpc=${use_grpc} reversed Clear Retention - ${start}= Get Current Date + ${start} Get Current Date Start Broker Start Engine - ${content}= Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() + ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. @@ -1124,7 +1124,7 @@ BEEXTCMD_REVERSE_GRPC4 FOR ${index} IN RANGE 30 Log To Console SELECT check_interval FROM hosts WHERE name='host_1' - ${output}= Query SELECT check_interval FROM hosts WHERE name='host_1' + ${output} Query SELECT check_interval FROM hosts WHERE name='host_1' Log To Console ${output} Sleep 1s IF "${output}" == "((15.0,),)" BREAK @@ -1153,11 +1153,11 @@ BEEXTCMD_COMPRESS_GRPC1 FOR ${use_grpc} IN RANGE 0 2 Log To Console external command CHANGE_NORMAL_SVC_CHECK_INTERVAL on bbdo3.0 use_grpc=${use_grpc} Clear Retention - ${start}= Get Current Date + ${start} Get Current Date Start Broker Start Engine - ${content}= Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() + ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. @@ -1168,7 +1168,7 @@ BEEXTCMD_COMPRESS_GRPC1 FOR ${index} IN RANGE 300 Log To Console ... SELECT s.check_interval FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE s.description='service_1' AND h.name='host_1' - ${output}= Query + ${output} Query ... SELECT s.check_interval FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE s.description='service_1' AND h.name='host_1' Log To Console ${output} Sleep 1s @@ -1188,15 +1188,15 @@ BEATOI11 Config Broker module ${1} Broker Config Log central core error Broker Config Log central sql debug - ${start}= Get Current Date + ${start} Get Current Date Start Broker Start Engine - ${content}= Create List check_for_external_commands - ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${content} Create List check_for_external_commands + ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} No check for external commands executed for 1mn. SEND CUSTOM HOST NOTIFICATION host_1 1 admin foobar - ${content}= Create List EXTERNAL COMMAND: SEND_CUSTOM_HOST_NOTIFICATION;host_1;1;admin;foobar - ${result}= Find In Log With Timeout ${engineLog0} ${start} ${content} 60 + ${content} Create List EXTERNAL COMMAND: SEND_CUSTOM_HOST_NOTIFICATION;host_1;1;admin;foobar + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} command argument notification_option must be an integer between 0 and 7. Stop Engine Kindly Stop Broker @@ -1210,16 +1210,16 @@ BEATOI12 Config Broker module ${1} Broker Config Log central core error Broker Config Log central sql debug - ${start}= Get Current Date + ${start} Get Current Date Start Broker Start Engine - ${content}= Create List check_for_external_commands - ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${content} Create List check_for_external_commands + ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} No check for external commands executed for 1mn. SEND CUSTOM HOST NOTIFICATION host_1 8 admin foobar - ${content}= Create List + ${content} Create List ... Error: could not send custom host notification: '8' must be an integer between 0 and 7 - ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} command argument notification_option must be an integer between 0 and 7. Stop Engine Kindly Stop Broker @@ -1233,16 +1233,16 @@ BEATOI13 Config Broker module ${1} Broker Config Log central core error Broker Config Log central sql debug - ${start}= Get Current Date + ${start} Get Current Date Start Broker Start Engine - ${content}= Create List check_for_external_commands - ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${content} Create List check_for_external_commands + ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} No check for external commands executed for 1mn. - ${date}= Get Current Date result_format=epoch + ${date} Get Current Date result_format=epoch SCHEDULE SERVICE DOWNTIME host_1 service_1 -1 - ${content}= Create List Error: could not schedule downtime : duration - ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${content} Create List Error: could not schedule downtime : duration + ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} command argument duration must be an integer >= 0. Stop Engine Kindly Stop Broker @@ -1256,20 +1256,20 @@ BEATOI21 Config Broker module ${1} Broker Config Log central core error Broker Config Log central sql debug - ${start}= Get Current Date exclude_millis=True + ${start} Get Current Date exclude_millis=True Start Broker Start Engine - ${content}= Create List check_for_external_commands - ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${content} Create List check_for_external_commands + ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} No check for external commands executed for 1mn. ADD HOST COMMENT host_1 1 user comment - ${content}= Create List ADD_HOST_COMMENT - ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${content} Create List ADD_HOST_COMMENT + ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} the comment with id:1 was not added. - ${com_id}= Find Internal Id ${start} True 30 + ${com_id} Find Internal Id ${start} True 30 Should Be True ${com_id}>0 Comment id should be a positive integer. DEL HOST COMMENT ${com_id} - ${result}= Find Internal Id ${start} False 30 + ${result} Find Internal Id ${start} False 30 Should Be True ${result} the comment with id:${com_id} was not deleted. Stop Engine Kindly Stop Broker @@ -1283,23 +1283,23 @@ BEATOI22 Config Broker module ${1} Broker Config Log central core error Broker Config Log central sql debug - ${start}= Get Current Date + ${start} Get Current Date Sleep 1s Start Broker Start Engine - ${content}= Create List check_for_external_commands - ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${content} Create List check_for_external_commands + ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} No check for external commands executed for 1mn. ADD HOST COMMENT host_1 1 user comment - ${content}= Create List ADD_HOST_COMMENT - ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${content} Create List ADD_HOST_COMMENT + ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} the comment with id:1 was not added. - ${com_id}= Find Internal Id ${start} True 30 + ${com_id} Find Internal Id ${start} True 30 DEL HOST COMMENT -1 - ${content}= Create List Error: could not delete comment : comment_id - ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${content} Create List Error: could not delete comment : comment_id + ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} comment_id must be an unsigned integer. - ${result}= Find Internal Id ${start} True 30 + ${result} Find Internal Id ${start} True 30 Should Be True ${result} comment with id:-1 was deleted. Stop Engine Kindly Stop Broker @@ -1313,16 +1313,16 @@ BEATOI23 Config Broker module ${1} Broker Config Log central core error Broker Config Log central sql error - ${start}= Get Current Date + ${start} Get Current Date Start Broker Start Engine - ${content}= Create List check_for_external_commands - ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${content} Create List check_for_external_commands + ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} No check for external commands executed for 1mn. - ${date}= Get Current Date result_format=epoch + ${date} Get Current Date result_format=epoch ADD SVC COMMENT host_1 service_1 0 user comment - ${content}= Create List ADD_SVC_COMMENT - ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${content} Create List ADD_SVC_COMMENT + ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} command argument persistent_flag must be 0 or 1. Stop Engine Kindly Stop Broker @@ -1337,13 +1337,13 @@ BECUSTOMHOSTVAR Broker Config Add Item module0 bbdo_version 3.0.0 Broker Config Add Item central bbdo_version 3.0.0 Config Broker Sql Output central unified_sql - ${start}= Get Current Date + ${start} Get Current Date Start Broker Start Engine - ${content}= Create List check_for_external_commands - ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${content} Create List check_for_external_commands + ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} No check for external commands executed for 1mn. - ${date}= Get Current Date result_format=epoch + ${date} Get Current Date result_format=epoch CHANGE CUSTOM HOST VAR COMMAND host_1 SNMPVERSION 789456 Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} @@ -1351,7 +1351,7 @@ BECUSTOMHOSTVAR FOR ${index} IN RANGE 300 Log To Console ... SELECT c.value FROM customvariables c LEFT JOIN hosts h ON c.host_id=h.host_id WHERE h.name='host_1' && c.name='SNMPVERSION' - ${output}= Query + ${output} Query ... SELECT c.value FROM customvariables c LEFT JOIN hosts h ON c.host_id=h.host_id WHERE h.name='host_1' && c.name='SNMPVERSION' Log To Console ${output} Sleep 1s @@ -1372,13 +1372,13 @@ BECUSTOMSVCVAR Broker Config Add Item module0 bbdo_version 3.0.0 Broker Config Add Item central bbdo_version 3.0.0 Config Broker Sql Output central unified_sql - ${start}= Get Current Date + ${start} Get Current Date Start Broker Start Engine - ${content}= Create List check_for_external_commands - ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${content} Create List check_for_external_commands + ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} No check for external commands executed for 1mn. - ${date}= Get Current Date result_format=epoch + ${date} Get Current Date result_format=epoch CHANGE CUSTOM SVC VAR COMMAND host_1 service_1 CRITICAL 456123 Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} @@ -1386,7 +1386,7 @@ BECUSTOMSVCVAR FOR ${index} IN RANGE 300 Log To Console ... SELECT c.value FROM customvariables c JOIN hosts h ON c.host_id=h.host_id JOIN services s ON c.service_id = s.service_id and h.host_id = s.service_id WHERE h.name='host_1' && s.description = 'service_1' && c.name='CRITICAL' - ${output}= Query + ${output} Query ... SELECT c.value FROM customvariables c JOIN hosts h ON c.host_id=h.host_id JOIN services s ON c.service_id = s.service_id and h.host_id = s.service_id WHERE h.name='host_1' && s.description = 'service_1' && c.name='CRITICAL' Log To Console ${output} Sleep 1s @@ -1407,17 +1407,17 @@ BESERVCHECK Broker Config Add Item module0 bbdo_version 3.0.0 Broker Config Add Item central bbdo_version 3.0.0 Config Broker Sql Output central unified_sql - ${start}= Get Current Date + ${start} Get Current Date Start Broker Start Engine - ${content}= Create List check_for_external_commands - ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${content} Create List check_for_external_commands + ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} No check for external commands executed for 1mn. Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} Execute SQL String UPDATE services set command_line='toto', next_check=0 where service_id=1 and host_id=1 schedule_forced_svc_check host_1 service_1 - ${command_param}= get_command_service_param 1 - ${result}= check_service_check_with_timeout + ${command_param} get_command_service_param 1 + ${result} check_service_check_with_timeout ... host_1 ... service_1 ... 30 diff --git a/tests/broker-engine/hostgroups.robot b/tests/broker-engine/hostgroups.robot index 251e74a8143..53fe8d5fd2e 100644 --- a/tests/broker-engine/hostgroups.robot +++ b/tests/broker-engine/hostgroups.robot @@ -29,7 +29,7 @@ EBNHG1 Broker Config Log central sql info Broker Config Output Set central central-broker-master-sql connections_count 5 Broker Config Output Set central central-broker-master-perfdata connections_count 5 - ${start}= Get Current Date + ${start} Get Current Date Start Broker Start Engine Add Host Group ${0} ${1} ["host_1", "host_2", "host_3"] @@ -38,13 +38,13 @@ EBNHG1 Reload Broker Reload Engine - ${content}= Create List + ${content} Create List ... enabling membership of host 3 to host group 1 on instance 1 ... enabling membership of host 2 to host group 1 on instance 1 ... enabling membership of host 1 to host group 1 on instance 1 - ${result}= Find In Log With Timeout ${centralLog} ${start} ${content} 45 - Should Be True ${result} msg=One of the new host groups not found in logs. + ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 45 + Should Be True ${result} One of the new host groups not found in logs. Stop Engine Kindly Stop Broker @@ -59,7 +59,7 @@ EBNHGU1 Broker Config Log central sql info Config Broker Sql Output central unified_sql Broker Config Output Set central central-broker-unified-sql connections_count 5 - ${start}= Get Current Date + ${start} Get Current Date Start Broker Start Engine Add Host Group ${0} ${1} ["host_1", "host_2", "host_3"] @@ -68,13 +68,13 @@ EBNHGU1 Reload Broker Reload Engine - ${content}= Create List + ${content} Create List ... enabling membership of host 3 to host group 1 on instance 1 ... enabling membership of host 2 to host group 1 on instance 1 ... enabling membership of host 1 to host group 1 on instance 1 - ${result}= Find In Log With Timeout ${centralLog} ${start} ${content} 45 - Should Be True ${result} msg=One of the new host groups not found in logs. + ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 45 + Should Be True ${result} One of the new host groups not found in logs. Stop Engine Kindly Stop Broker @@ -94,7 +94,7 @@ EBNHGU2 Broker Config Add Item module2 bbdo_version 3.0.0 Broker Config Add Item central bbdo_version 3.0.0 Broker Config Add Item rrd bbdo_version 3.0.0 - ${start}= Get Current Date + ${start} Get Current Date Start Broker Start Engine Add Host Group ${0} ${1} ["host_1", "host_2", "host_3"] @@ -103,12 +103,12 @@ EBNHGU2 Reload Broker Reload Engine - ${content}= Create List + ${content} Create List ... enabling membership of host 3 to host group 1 on instance 1 ... enabling membership of host 2 to host group 1 on instance 1 - ${result}= Find In Log With Timeout ${centralLog} ${start} ${content} 45 - Should Be True ${result} msg=One of the new host groups not found in logs. + ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 45 + Should Be True ${result} One of the new host groups not found in logs. Stop Engine Kindly stop Broker @@ -131,7 +131,7 @@ EBNHGU3 Broker Config Add Item rrd bbdo_version 3.0.0 Broker Config Log central sql debug - ${start}= Get Current Date + ${start} Get Current Date Start Broker Start Engine Add Host Group ${0} ${1} ["host_1", "host_2", "host_3"] @@ -143,16 +143,16 @@ EBNHGU3 Reload Broker Reload Engine - ${result}= Check Number of relations between hostgroup and hosts 1 12 30 - Should Be True ${result} msg=We should have 12 hosts members of host 1. + ${result} Check Number of relations between hostgroup and hosts 1 12 30 + Should Be True ${result} We should have 12 hosts members of host 1. Config Engine Remove Cfg File ${0} hostgroups.cfg Sleep 3s Reload Broker Reload Engine - ${result}= Check Number of relations between hostgroup and hosts 1 9 30 - Should Be True ${result} msg=We should have 12 hosts members of host 1. + ${result} Check Number of relations between hostgroup and hosts 1 9 30 + Should Be True ${result} We should have 12 hosts members of host 1. Stop Engine Kindly Stop Broker @@ -168,7 +168,7 @@ EBNHG4 Broker Config Log central sql info Broker Config Output Set central central-broker-master-sql connections_count 5 Broker Config Output Set central central-broker-master-perfdata connections_count 5 - ${start}= Get Current Date + ${start} Get Current Date Start Broker Start Engine Sleep 3s @@ -177,17 +177,17 @@ EBNHG4 Reload Broker Reload Engine - ${content}= Create List + ${content} Create List ... enabling membership of host 3 to host group 1 on instance 1 ... enabling membership of host 2 to host group 1 - ${result}= Find In Log With Timeout ${centralLog} ${start} ${content} 45 - Should Be True ${result} msg=One of the new host groups not found in logs. + ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 45 + Should Be True ${result} One of the new host groups not found in logs. Rename Host Group ${0} ${1} test ["host_1", "host_2", "host_3"] Sleep 10s - ${start}= Get Current Date + ${start} Get Current Date Log to Console Step-1 Reload Broker Log to Console Step0 @@ -198,7 +198,7 @@ EBNHG4 Log to Console Step1 FOR ${index} IN RANGE 60 Log To Console SELECT name FROM hostgroups WHERE hostgroup_id = ${1} - ${output}= Query SELECT name FROM hostgroups WHERE hostgroup_id = ${1} + ${output} Query SELECT name FROM hostgroups WHERE hostgroup_id = ${1} Log To Console ${output} Sleep 1s IF "${output}" == "(('hostgroup_test',),)" BREAK @@ -219,7 +219,7 @@ EBNHGU4 Broker Config Log central sql info Config Broker Sql Output central unified_sql Broker Config Output Set central central-broker-unified-sql connections_count 5 - ${start}= Get Current Date + ${start} Get Current Date Start Broker Start Engine Sleep 3s @@ -228,17 +228,17 @@ EBNHGU4 Reload Broker Reload Engine - ${content}= Create List + ${content} Create List ... enabling membership of host 3 to host group 1 on instance 1 ... enabling membership of host 2 to host group 1 - ${result}= Find In Log With Timeout ${centralLog} ${start} ${content} 45 - Should Be True ${result} msg=One of the new host groups not found in logs. + ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 45 + Should Be True ${result} One of the new host groups not found in logs. Rename Host Group ${0} ${1} test ["host_1", "host_2", "host_3"] Sleep 10s - ${start}= Get Current Date + ${start} Get Current Date Log to Console Step-1 Reload Broker Log to Console Step0 @@ -249,7 +249,7 @@ EBNHGU4 Log to Console Step1 FOR ${index} IN RANGE 60 Log To Console SELECT name FROM hostgroups WHERE hostgroup_id = ${1} - ${output}= Query SELECT name FROM hostgroups WHERE hostgroup_id = ${1} + ${output} Query SELECT name FROM hostgroups WHERE hostgroup_id = ${1} Log To Console ${output} Sleep 1s IF "${output}" == "(('hostgroup_test',),)" BREAK diff --git a/tests/broker-engine/hosts-with-notes-and-actions.robot b/tests/broker-engine/hosts-with-notes-and-actions.robot index 02b4417912a..ec6d0f0876d 100644 --- a/tests/broker-engine/hosts-with-notes-and-actions.robot +++ b/tests/broker-engine/hosts-with-notes-and-actions.robot @@ -30,7 +30,7 @@ EBSNU1 Broker Config Add Item rrd bbdo_version 3.0.0 Broker Config Log central sql debug Config Broker Sql Output central unified_sql - ${nu}= Evaluate 2000*"X" + ${nu} Evaluate 2000*"X" Engine Config set value in hosts 0 host_1 notes_url ${nu} Clear Retention Start Broker @@ -38,13 +38,13 @@ EBSNU1 Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} FOR ${index} IN RANGE 60 - ${output}= Query SELECT notes_url FROM hosts WHERE name='host_1' + ${output} Query SELECT notes_url FROM hosts WHERE name='host_1' Sleep 1s IF "${output}" == "(('${nu}',),)" BREAK END Should Be Equal As Strings ${output} (('${nu}',),) FOR ${index} IN RANGE 60 - ${output}= Query SELECT notes_url FROM resources WHERE name='host_1' + ${output} Query SELECT notes_url FROM resources WHERE name='host_1' Sleep 1s IF "${output}" == "(('${nu}',),)" BREAK END @@ -64,7 +64,7 @@ EBSAU2 Broker Config Add Item rrd bbdo_version 3.0.0 Broker Config Log central sql debug Config Broker Sql Output central unified_sql - ${au}= Evaluate 2000*"Y" + ${au} Evaluate 2000*"Y" Engine Config set value in hosts 0 host_2 action_url ${au} Clear Retention Start Broker @@ -72,13 +72,13 @@ EBSAU2 Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} FOR ${index} IN RANGE 60 - ${output}= Query SELECT action_url FROM hosts WHERE name='host_2' + ${output} Query SELECT action_url FROM hosts WHERE name='host_2' Sleep 1s IF "${output}" == "(('${au}',),)" BREAK END Should Be Equal As Strings ${output} (('${au}',),) FOR ${index} IN RANGE 60 - ${output}= Query SELECT action_url FROM resources WHERE name='host_2' + ${output} Query SELECT action_url FROM resources WHERE name='host_2' Sleep 1s IF "${output}" == "(('${au}',),)" BREAK END @@ -98,7 +98,7 @@ EBSN3 Broker Config Add Item rrd bbdo_version 3.0.0 Broker Config Log central sql debug Config Broker Sql Output central unified_sql - ${n}= Evaluate 500*"Z" + ${n} Evaluate 500*"Z" Engine Config set value in hosts 0 host_3 notes ${n} Clear Retention Start Broker @@ -106,13 +106,13 @@ EBSN3 Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} FOR ${index} IN RANGE 60 - ${output}= Query SELECT notes FROM hosts WHERE name='host_3' + ${output} Query SELECT notes FROM hosts WHERE name='host_3' Sleep 1s IF "${output}" == "(('${n}',),)" BREAK END Should Be Equal As Strings ${output} (('${n}',),) FOR ${index} IN RANGE 60 - ${output}= Query SELECT notes FROM resources WHERE name='host_3' + ${output} Query SELECT notes FROM resources WHERE name='host_3' Sleep 1s IF "${output}" == "(('${n}',),)" BREAK END diff --git a/tests/broker-engine/log-v2_engine.robot b/tests/broker-engine/log-v2_engine.robot index f425972f44a..2609d628be3 100644 --- a/tests/broker-engine/log-v2_engine.robot +++ b/tests/broker-engine/log-v2_engine.robot @@ -31,28 +31,28 @@ LOGV2EB1 Engine Config Set Value ${0} log_level_config trace Engine Config Set Value ${0} log_flush_period 0 True - ${start}= Get Current Date exclude_millis=yes - ${time_stamp}= Convert Date ${start} epoch exclude_millis=yes - ${time_stamp2}= evaluate int(${time_stamp}) + ${start} Get Current Date exclude_millis=yes + ${time_stamp} Convert Date ${start} epoch exclude_millis=yes + ${time_stamp2} evaluate int(${time_stamp}) Sleep 1s Start Broker Start Engine - ${result}= Check Connections - Should Be True ${result} msg=Engine and Broker not connected + ${result} Check Connections + Should Be True ${result} Engine and Broker not connected - ${pid}= Get Process Id e0 - ${content}= Create List [process] [info] [${pid}] Configuration loaded, main loop starting. + ${pid} Get Process Id e0 + ${content} Create List [process] [info] [${pid}] Configuration loaded, main loop starting. - ${result1}= Find In Log With Timeout ${engineLog0} ${start} ${content} 30 - Should Be True ${result1} msg=No message telling configuration loaded. + ${result1} Find In Log With Timeout ${engineLog0} ${start} ${content} 30 + Should Be True ${result1} No message telling configuration loaded. Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} Log To Console after connection FOR ${index} IN RANGE 60 Log To Console ... SELECT COUNT(*) FROM logs WHERE output="Configuration loaded, main loop starting." AND ctime>=${time_stamp2} - ${output}= Query + ${output} Query ... SELECT COUNT(*) FROM logs WHERE output="Configuration loaded, main loop starting." AND ctime>=${time_stamp2} Log To Console ${output} Sleep 1s @@ -78,28 +78,28 @@ LOGV2EBU1 Engine Config Set Value ${0} log_level_config trace Engine Config Set Value ${0} log_flush_period 0 True - ${start}= Get Current Date exclude_millis=yes - ${time_stamp}= Convert Date ${start} epoch exclude_millis=yes - ${time_stamp2}= evaluate int(${time_stamp}) + ${start} Get Current Date exclude_millis=yes + ${time_stamp} Convert Date ${start} epoch exclude_millis=yes + ${time_stamp2} evaluate int(${time_stamp}) Sleep 1s Start Broker Start Engine - ${result}= Check Connections - Should Be True ${result} msg=Engine and Broker not connected + ${result} Check Connections + Should Be True ${result} Engine and Broker not connected - ${pid}= Get Process Id e0 - ${content}= Create List [process] [info] [${pid}] Configuration loaded, main loop starting. + ${pid} Get Process Id e0 + ${content} Create List [process] [info] [${pid}] Configuration loaded, main loop starting. - ${result1}= Find In Log With Timeout ${engineLog0} ${start} ${content} 30 - Should Be True ${result1} msg=No message telling configuration loaded. + ${result1} Find In Log With Timeout ${engineLog0} ${start} ${content} 30 + Should Be True ${result1} No message telling configuration loaded. Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} Log To Console after connection FOR ${index} IN RANGE 60 Log To Console ... SELECT COUNT(*) FROM logs WHERE output="Configuration loaded, main loop starting." AND ctime>=${time_stamp2} - ${output}= Query + ${output} Query ... SELECT COUNT(*) FROM logs WHERE output="Configuration loaded, main loop starting." AND ctime>=${time_stamp2} Log To Console ${output} Sleep 1s @@ -122,31 +122,31 @@ LOGV2DB1 Engine Config Set Value ${0} log_v2_enabled ${0} Engine Config Set Value ${0} log_flush_period 0 True - ${start}= Get Current Date exclude_millis=yes - ${time_stamp}= Convert Date ${start} epoch exclude_millis=yes - ${time_stamp2}= evaluate int(${time_stamp}) + ${start} Get Current Date exclude_millis=yes + ${time_stamp} Convert Date ${start} epoch exclude_millis=yes + ${time_stamp2} evaluate int(${time_stamp}) Sleep 1s Start Broker Start Engine - ${result}= Check Connections - Should Be True ${result} msg=Engine and Broker not connected + ${result} Check Connections + Should Be True ${result} Engine and Broker not connected - ${pid}= Get Process Id e0 - ${content_v2}= Create List [process] [info] [${pid}] Configuration loaded, main loop starting. - ${content_old}= Create List [${pid}] Configuration loaded, main loop starting. + ${pid} Get Process Id e0 + ${content_v2} Create List [process] [info] [${pid}] Configuration loaded, main loop starting. + ${content_old} Create List [${pid}] Configuration loaded, main loop starting. - ${result1}= Find In Log With Timeout ${engineLog0} ${start} ${content_v2} 15 - ${result2}= Find In Log With Timeout ${engineLog0} ${start} ${content_old} 15 + ${result1} Find In Log With Timeout ${engineLog0} ${start} ${content_v2} 15 + ${result2} Find In Log With Timeout ${engineLog0} ${start} ${content_old} 15 Should Not Be True ${result1} - Should Be True ${result2} msg=Old logs should be enabled. + Should Be True ${result2} Old logs should be enabled. Log To Console after connection Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} FOR ${index} IN RANGE 60 Log To Console ... SELECT COUNT(*) FROM logs WHERE output="Configuration loaded, main loop starting." AND ctime>=${time_stamp2} - ${output}= Query + ${output} Query ... SELECT COUNT(*) FROM logs WHERE output="Configuration loaded, main loop starting." AND ctime>=${time_stamp2}; Log To Console ${output} Sleep 1s @@ -168,21 +168,21 @@ LOGV2DB2 Engine Config Set Value ${0} log_v2_enabled ${0} Engine Config Set Value ${0} log_flush_period 0 True - ${start}= Get Current Date exclude_millis=yes - ${time_stamp}= Convert Date ${start} epoch exclude_millis=yes - ${time_stamp2}= evaluate int(${time_stamp}) + ${start} Get Current Date exclude_millis=yes + ${time_stamp} Convert Date ${start} epoch exclude_millis=yes + ${time_stamp2} evaluate int(${time_stamp}) Sleep 1s Start Broker Start Engine - ${result}= Check Connections - Should Be True ${result} msg=Engine and Broker not connected + ${result} Check Connections + Should Be True ${result} Engine and Broker not connected - ${pid}= Get Process Id e0 - ${content_v2}= Create List [process] [info] [${pid}] Configuration loaded, main loop starting. - ${content_hold}= Create List [${pid}] Configuration loaded, main loop starting. + ${pid} Get Process Id e0 + ${content_v2} Create List [process] [info] [${pid}] Configuration loaded, main loop starting. + ${content_hold} Create List [${pid}] Configuration loaded, main loop starting. - ${result1}= Find In Log With Timeout ${engineLog0} ${start} ${content_v2} 30 - ${result2}= Find In Log With Timeout ${engineLog0} ${start} ${content_hold} 30 + ${result1} Find In Log With Timeout ${engineLog0} ${start} ${content_v2} 30 + ${result2} Find In Log With Timeout ${engineLog0} ${start} ${content_hold} 30 Should Not Be True ${result1} Should Not Be True ${result2} @@ -191,7 +191,7 @@ LOGV2DB2 FOR ${index} IN RANGE 60 Log To Console ... SELECT COUNT(*) FROM logs WHERE output="Configuration loaded, main loop starting." AND ctime>=${time_stamp2} - ${output}= Query + ${output} Query ... SELECT COUNT(*) FROM logs WHERE output="Configuration loaded, main loop starting." AND ctime>=${time_stamp2}; Log To Console ${output} Sleep 1s @@ -213,22 +213,22 @@ LOGV2EB2 Engine Config Set Value ${0} log_v2_enabled ${1} Engine Config Set Value ${0} log_flush_period 0 True - ${start}= Get Current Date exclude_millis=yes - ${time_stamp}= Convert Date ${start} epoch exclude_millis=yes - ${time_stamp2}= evaluate int(${time_stamp}) + ${start} Get Current Date exclude_millis=yes + ${time_stamp} Convert Date ${start} epoch exclude_millis=yes + ${time_stamp2} evaluate int(${time_stamp}) Sleep 1s Start Broker Start Engine - ${result}= Check Connections - Should Be True ${result} msg=Engine and Broker not connected + ${result} Check Connections + Should Be True ${result} Engine and Broker not connected - ${pid}= Get Process Id e0 - ${content_v2}= Create List [process] [info] [${pid}] Configuration loaded, main loop starting. - ${content_hold}= Create List [${pid}] Configuration loaded, main loop starting. + ${pid} Get Process Id e0 + ${content_v2} Create List [process] [info] [${pid}] Configuration loaded, main loop starting. + ${content_hold} Create List [${pid}] Configuration loaded, main loop starting. - ${result1}= Find In Log With Timeout ${engineLog0} ${start} ${content_v2} 30 - ${result2}= Find In Log With Timeout ${engineLog0} ${start} ${content_hold} 30 + ${result1} Find In Log With Timeout ${engineLog0} ${start} ${content_v2} 30 + ${result2} Find In Log With Timeout ${engineLog0} ${start} ${content_hold} 30 Should Be True ${result1} Should Be True ${result2} @@ -237,7 +237,7 @@ LOGV2EB2 FOR ${index} IN RANGE 60 Log To Console ... SELECT COUNT(*) FROM logs WHERE output="Configuration loaded, main loop starting." AND ctime>=${time_stamp2} - ${output}= Query + ${output} Query ... SELECT COUNT(*) FROM logs WHERE output="Configuration loaded, main loop starting." AND ctime>=${time_stamp2}; Log To Console ${output} Sleep 1s @@ -261,22 +261,22 @@ LOGV2EBU2 Engine Config Set Value ${0} log_v2_enabled ${1} Engine Config Set Value ${0} log_flush_period 0 True - ${start}= Get Current Date exclude_millis=yes - ${time_stamp}= Convert Date ${start} epoch exclude_millis=yes - ${time_stamp2}= evaluate int(${time_stamp}) + ${start} Get Current Date exclude_millis=yes + ${time_stamp} Convert Date ${start} epoch exclude_millis=yes + ${time_stamp2} evaluate int(${time_stamp}) Sleep 1s Start Broker Start Engine - ${result}= Check Connections - Should Be True ${result} msg=Engine and Broker not connected + ${result} Check Connections + Should Be True ${result} Engine and Broker not connected - ${pid}= Get Process Id e0 - ${content_v2}= Create List [process] [info] [${pid}] Configuration loaded, main loop starting. - ${content_hold}= Create List [${pid}] Configuration loaded, main loop starting. + ${pid} Get Process Id e0 + ${content_v2} Create List [process] [info] [${pid}] Configuration loaded, main loop starting. + ${content_hold} Create List [${pid}] Configuration loaded, main loop starting. - ${result1}= Find In Log With Timeout ${engineLog0} ${start} ${content_v2} 30 - ${result2}= Find In Log With Timeout ${engineLog0} ${start} ${content_hold} 30 + ${result1} Find In Log With Timeout ${engineLog0} ${start} ${content_v2} 30 + ${result2} Find In Log With Timeout ${engineLog0} ${start} ${content_hold} 30 Should Be True ${result1} Should Be True ${result2} @@ -285,7 +285,7 @@ LOGV2EBU2 FOR ${index} IN RANGE 60 Log To Console ... SELECT COUNT(*) FROM logs WHERE output="Configuration loaded, main loop starting." AND ctime>=${time_stamp2} - ${output}= Query + ${output} Query ... SELECT COUNT(*) FROM logs WHERE output="Configuration loaded, main loop starting." AND ctime>=${time_stamp2}; Log To Console ${output} Sleep 1s @@ -308,15 +308,15 @@ LOGV2EF1 Engine Config Set Value ${0} log_v2_enabled ${1} Engine Config Set Value ${0} log_flush_period 0 True - ${start}= Get Current Date + ${start} Get Current Date Start Broker Start Engine - ${result}= Check Connections - Should Be True ${result} msg=Engine and Broker not connected - ${pid}= Get Process Id e0 - ${content_v2}= Create List [process] [info] [${pid}] Configuration loaded, main loop starting. + ${result} Check Connections + Should Be True ${result} Engine and Broker not connected + ${pid} Get Process Id e0 + ${content_v2} Create List [process] [info] [${pid}] Configuration loaded, main loop starting. - ${result1}= Find In Log With Timeout ${engineLog0} ${start} ${content_v2} 30 + ${result1} Find In Log With Timeout ${engineLog0} ${start} ${content_v2} 30 Should Be True ${result1} Stop Engine Kindly Stop Broker @@ -333,17 +333,17 @@ LOGV2DF1 Engine Config Set Value ${0} log_v2_enabled ${0} Engine Config Set Value ${0} log_flush_period 0 True - ${start}= Get Current Date + ${start} Get Current Date Start Broker Start Engine - ${result}= Check Connections - Should Be True ${result} msg=Engine and Broker not connected - ${pid}= Get Process Id e0 - ${content_hold}= Create List [${pid}] Configuration loaded, main loop starting. - ${content_v2}= Create List [process] [info] [${pid}] Configuration loaded, main loop starting. - - ${result1}= Find In Log With Timeout ${engineLog0} ${start} ${content_hold} 30 - ${result2}= Find In Log With Timeout ${engineLog0} ${start} ${content_v2} 30 + ${result} Check Connections + Should Be True ${result} Engine and Broker not connected + ${pid} Get Process Id e0 + ${content_hold} Create List [${pid}] Configuration loaded, main loop starting. + ${content_v2} Create List [process] [info] [${pid}] Configuration loaded, main loop starting. + + ${result1} Find In Log With Timeout ${engineLog0} ${start} ${content_hold} 30 + ${result2} Find In Log With Timeout ${engineLog0} ${start} ${content_v2} 30 Should Be True ${result1} Should Not Be True ${result2} Stop Engine @@ -361,17 +361,17 @@ LOGV2DF2 Engine Config Set Value ${0} log_v2_enabled ${0} Engine Config Set Value ${0} log_flush_period 0 True - ${start}= Get Current Date + ${start} Get Current Date Start Broker Start Engine - ${result}= Check Connections - Should Be True ${result} msg=Engine and Broker not connected - ${pid}= Get Process Id e0 - ${content_v2}= Create List [process] [info] [${pid}] Configuration loaded, main loop starting. - ${content_hold}= Create List [${pid}] Configuration loaded, main loop starting. - - ${result1}= Find In Log With Timeout ${engineLog0} ${start} ${content_v2} 15 - ${result2}= Find In Log With Timeout ${engineLog0} ${start} ${content_hold} 15 + ${result} Check Connections + Should Be True ${result} Engine and Broker not connected + ${pid} Get Process Id e0 + ${content_v2} Create List [process] [info] [${pid}] Configuration loaded, main loop starting. + ${content_hold} Create List [${pid}] Configuration loaded, main loop starting. + + ${result1} Find In Log With Timeout ${engineLog0} ${start} ${content_v2} 15 + ${result2} Find In Log With Timeout ${engineLog0} ${start} ${content_hold} 15 Should Not Be True ${result1} Should Not Be True ${result2} Stop Engine @@ -389,17 +389,17 @@ LOGV2EF2 Engine Config Set Value ${0} log_v2_enabled ${1} Engine Config Set Value ${0} log_flush_period 0 True - ${start}= Get Current Date + ${start} Get Current Date Start Broker Start Engine - ${result}= Check Connections - Should Be True ${result} msg=Engine and Broker not connected - ${pid}= Get Process Id e0 - ${content_v2}= Create List [process] [info] [${pid}] Configuration loaded, main loop starting. - ${content_hold}= Create List [${pid}] Configuration loaded, main loop starting. - - ${result1}= Find In Log With Timeout ${engineLog0} ${start} ${content_v2} 15 - ${result2}= Find In Log With Timeout ${engineLog0} ${start} ${content_hold} 15 + ${result} Check Connections + Should Be True ${result} Engine and Broker not connected + ${pid} Get Process Id e0 + ${content_v2} Create List [process] [info] [${pid}] Configuration loaded, main loop starting. + ${content_hold} Create List [${pid}] Configuration loaded, main loop starting. + + ${result1} Find In Log With Timeout ${engineLog0} ${start} ${content_v2} 15 + ${result2} Find In Log With Timeout ${engineLog0} ${start} ${content_hold} 15 Should Be True ${result1} Should Be True ${result2} Stop Engine @@ -419,18 +419,18 @@ LOGV2FE2 Clear Engine Logs - ${start}= Get Current Date + ${start} Get Current Date Start Broker Start Engine - ${result}= Check Connections - Should Be True ${result} msg=Engine and Broker not connected - ${pid}= Get Process Id e0 - ${content_v2}= Create List [process] [info] [${pid}] Configuration loaded, main loop starting. - ${content_hold}= Create List [${pid}] Configuration loaded, main loop starting. + ${result} Check Connections + Should Be True ${result} Engine and Broker not connected + ${pid} Get Process Id e0 + ${content_v2} Create List [process] [info] [${pid}] Configuration loaded, main loop starting. + ${content_hold} Create List [${pid}] Configuration loaded, main loop starting. Sleep 2m - ${res}= check engine logs are duplicated ${engineLog0} ${start} - Should Be True ${res} msg=one or other log are not duplicate in logsfile + ${res} check engine logs are duplicated ${engineLog0} ${start} + Should Be True ${res} one or other log are not duplicate in logsfile Stop Engine Kindly Stop Broker diff --git a/tests/broker-engine/muxer_filter.robot b/tests/broker-engine/muxer_filter.robot index 4a76914a3af..c11a6d6054f 100644 --- a/tests/broker-engine/muxer_filter.robot +++ b/tests/broker-engine/muxer_filter.robot @@ -36,7 +36,7 @@ STUPID_FILTER ${content} Create List ... The configured write filters for the endpoint 'central-broker-unified-sql' are too restrictive and will be ignored. neb,bbdo,extcmd categories are mandatory. ${result} Find In Log with Timeout ${centralLog} ${start} ${content} 60 - Should Be True ${result} msg=A message telling bad filter should be available. + Should Be True ${result} A message telling bad filter should be available. Stop Engine Kindly Stop Broker True @@ -61,12 +61,12 @@ STORAGE_ON_LUA Wait Until Created /tmp/all_lua_event.log FOR ${index} IN RANGE 30 - ${res}= Get File Size /tmp/all_lua_event.log + ${res} Get File Size /tmp/all_lua_event.log Sleep 1s IF ${res} > 100 BREAK END - ${grep_res}= Grep File /tmp/all_lua_event.log "category":[^3] regexp=True - Should Be Empty ${grep_res} msg=Events of category different than 'storage' found. + ${grep_res} Grep File /tmp/all_lua_event.log "category":[^3] regexp=True + Should Be Empty ${grep_res} Events of category different than 'storage' found. Stop Engine Kindly Stop Broker True @@ -101,17 +101,17 @@ FILTER_ON_LUA_EVENT Wait Until Created /tmp/all_lua_event.log FOR ${index} IN RANGE 30 # search for pb_metric_mapping - ${res}= Get File Size /tmp/all_lua_event.log + ${res} Get File Size /tmp/all_lua_event.log Sleep 1s IF ${res} > 100 BREAK END ${content} Get File /tmp/all_lua_event.log - @{lines}= Split To lines ${content} + @{lines} Split To lines ${content} FOR ${line} IN @{lines} Should Contain ... ${line} ... "_type":196620 - ... msg=All the lines in all_lua_event.log should contain "_type":196620 + ... All the lines in all_lua_event.log should contain "_type":196620 END Stop Engine @@ -132,11 +132,11 @@ BAM_STREAM_FILTER Clone Engine Config To DB Add Bam Config To Engine - @{svc}= Set Variable ${{ [("host_16", "service_314")] }} + @{svc} Set Variable ${{ [("host_16", "service_314")] }} Create BA With Services test worst ${svc} Add Bam Config To Broker central # Command of service_314 is set to critical - ${cmd_1}= Get Command Id 314 + ${cmd_1} Get Command Id 314 Log To Console service_314 has command id ${cmd_1} Set Command Status ${cmd_1} 2 Start Broker True @@ -145,35 +145,35 @@ BAM_STREAM_FILTER # Let's wait for the external command check start ${content} Create List check_for_external_commands() ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 - Should Be True ${result} msg=A message telling check_for_external_commands() should be available. + Should Be True ${result} A message telling check_for_external_commands() should be available. # KPI set to critical Repeat Keyword 3 times Process Service Check Result host_16 service_314 2 output critical for 314 ${result} Check Service Status With Timeout host_16 service_314 2 60 HARD - Should Be True ${result} msg=The service (host_16,service_314) is not CRITICAL as expected + Should Be True ${result} The service (host_16,service_314) is not CRITICAL as expected # The BA should become critical ${result} Check Ba Status With Timeout test 2 60 - Should Be True ${result} msg=The BA ba_1 is not CRITICAL as expected + Should Be True ${result} The BA ba_1 is not CRITICAL as expected # monitoring FOR ${cpt} IN RANGE 30 # pb_service - ${grep_res1}= Grep File ${centralLog} centreon-bam-monitoring event of type 1001b written + ${grep_res1} Grep File ${centralLog} centreon-bam-monitoring event of type 1001b written # pb_service_status - ${grep_res2}= Grep File ${centralLog} centreon-bam-monitoring event of type 1001d written + ${grep_res2} Grep File ${centralLog} centreon-bam-monitoring event of type 1001d written # pb_ba_status - ${grep_res3}= Grep File ${centralLog} centreon-bam-monitoring event of type 60013 written + ${grep_res3} Grep File ${centralLog} centreon-bam-monitoring event of type 60013 written # pb_kpi_status - ${grep_res4}= Grep File ${centralLog} centreon-bam-monitoring event of type 6001b written + ${grep_res4} Grep File ${centralLog} centreon-bam-monitoring event of type 6001b written # reject KpiEvent - ${grep_res5}= Grep File + ${grep_res5} Grep File ... ${centralLog} ... muxer centreon-bam-monitoring event of type 60015 rejected by write filter # reject storage - ${grep_res6}= Grep File + ${grep_res6} Grep File ... ${centralLog} ... muxer centreon-bam-monitoring event of type 3[0-9a-f]{4} rejected by write filter regexp=True @@ -182,30 +182,30 @@ BAM_STREAM_FILTER END END - Should Not Be Empty ${grep_res1} msg=no pb_service event - Should Not Be Empty ${grep_res2} msg=no pb_service_status event - Should Not Be Empty ${grep_res3} msg=no pb_ba_status event - Should Not Be Empty ${grep_res4} msg=no pb_kpi_status event - Should Not Be Empty ${grep_res5} msg=no KpiEvent event - Should Not Be Empty ${grep_res6} msg=no storage event rejected + Should Not Be Empty ${grep_res1} no pb_service event + Should Not Be Empty ${grep_res2} no pb_service_status event + Should Not Be Empty ${grep_res3} no pb_ba_status event + Should Not Be Empty ${grep_res4} no pb_kpi_status event + Should Not Be Empty ${grep_res5} no KpiEvent event + Should Not Be Empty ${grep_res6} no storage event rejected # reporting # pb_ba_event - ${grep_res}= Grep File ${centralLog} centreon-bam-reporting event of type 60014 written - Should Not Be Empty ${grep_res} msg=no pb_ba_event + ${grep_res} Grep File ${centralLog} centreon-bam-reporting event of type 60014 written + Should Not Be Empty ${grep_res} no pb_ba_event # pb_kpi_event - ${grep_res}= Grep File ${centralLog} centreon-bam-reporting event of type 60015 written - Should Not Be Empty ${grep_res} msg=no pb_kpi_event + ${grep_res} Grep File ${centralLog} centreon-bam-reporting event of type 60015 written + Should Not Be Empty ${grep_res} no pb_kpi_event # reject storage - ${grep_res}= Grep File + ${grep_res} Grep File ... ${centralLog} ... centreon-bam-reporting event of type 3[0-9a-f]{4} rejected by write filter regexp=True - Should Not Be Empty ${grep_res} msg=no rejected storage event + Should Not Be Empty ${grep_res} no rejected storage event # reject neb - ${grep_res}= Grep File + ${grep_res} Grep File ... ${centralLog} ... centreon-bam-reporting event of type 1[0-9a-f]{4} rejected by write filter regexp=True - Should Not Be Empty ${grep_res} msg=no rejected neb event + Should Not Be Empty ${grep_res} no rejected neb event Stop Engine Kindly Stop Broker True @@ -228,18 +228,18 @@ UNIFIED_SQL_FILTER # Let's wait for the external command check start ${content} Create List check_for_external_commands() ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 - Should Be True ${result} msg=A message telling check_for_external_commands() should be available. + Should Be True ${result} A message telling check_for_external_commands() should be available. # one service set to critical in order to have some events Repeat Keyword 3 times Process Service Check Result host_16 service_314 2 output critical for 314 ${result} Check Service Status With Timeout host_16 service_314 2 60 HARD - Should Be True ${result} msg=The service (host_16,service_314) is not CRITICAL as expected + Should Be True ${result} The service (host_16,service_314) is not CRITICAL as expected # de_pb_service de_pb_service_status de_pb_host de_pb_custom_variable de_pb_log_entry de_pb_host_check FOR ${event} IN 1001b 1001d 1001e 10025 10029 10027 - ${to_search}= Catenate central-broker-unified-sql event of type ${event} written - ${grep_res}= Grep File ${centralLog} ${to_search} + ${to_search} Catenate central-broker-unified-sql event of type ${event} written + ${grep_res} Grep File ${centralLog} ${to_search} Should Not Be Empty ${grep_res} END @@ -267,18 +267,18 @@ CBD_RELOAD_AND_FILTERS # Let's wait for the external command check start ${content} Create List check_for_external_commands() ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 - Should Be True ${result} msg=A message telling check_for_external_commands() should be available. + Should Be True ${result} A message telling check_for_external_commands() should be available. # Let's wait for storage data written into rrd files ${content} Create List RRD: new pb status data for index ${result} Find In Log with Timeout ${rrdLog} ${start} ${content} 60 - Should Be True ${result} msg=No status from central broker for 1mn. + Should Be True ${result} No status from central broker for 1mn. # We check that output filters to rrd are set to "all" ${content} Create List ... endpoint applier: filters for endpoint 'centreon-broker-master-rrd' reduced to the needed ones: all ${result} Find In Log with Timeout ${centralLog} ${start} ${content} 60 - Should Be True ${result} msg=No message about the output filters to rrd broker. + Should Be True ${result} No message about the output filters to rrd broker. # New configuration Broker Config Output Set Json central centreon-broker-master-rrd filters {"category": [ "storage"]} @@ -290,8 +290,8 @@ CBD_RELOAD_AND_FILTERS #wait broker reload ${content} Create List creating endpoint centreon-broker-master-rrd ${result} Find In Log with Timeout ${centralLog} ${start} ${content} 60 - Should Be True ${result} msg=No creating endpoint centreon-broker-master-rrd. - ${start2}= Get Current Date + Should Be True ${result} No creating endpoint centreon-broker-master-rrd. + ${start2} Get Current Date # We check that output filters to rrd are set to "storage" ${content} Create List @@ -299,17 +299,17 @@ CBD_RELOAD_AND_FILTERS ... endpoint applier: filters ... storage for endpoint 'centreon-broker-master-rrd' applied. ${result} Find In Log with Timeout ${centralLog} ${start} ${content} 60 - Should Be True ${result} msg=No message about the output filters to rrd broker. + Should Be True ${result} No message about the output filters to rrd broker. # Let's wait for storage data written into rrd files ${content} Create List RRD: new pb status data for index ${result} Find In Log with Timeout ${rrdLog} ${start2} ${content} 60 - Should Be True ${result} msg=No status from central broker for 1mn. + Should Be True ${result} No status from central broker for 1mn. # We check that output filters to rrd are set to "storage" ${content} Create List rrd event of type .* rejected by write filter ${result} Find Regex In Log with Timeout ${centralLog} ${start2} ${content} 120 - Should Be True ${result} msg=No event rejected by the rrd output whereas only storage category is enabled. + Should Be True ${result} No event rejected by the rrd output whereas only storage category is enabled. Log To Console Third configuration: all events are sent. # New configuration @@ -320,20 +320,20 @@ CBD_RELOAD_AND_FILTERS # wait broker reload ${content} Create List creating endpoint centreon-broker-master-rrd ${result} Find In Log with Timeout ${centralLog} ${start} ${content} 60 - Should Be True ${result} msg=No creating endpoint centreon-broker-master-rrd. - ${start2}= Get Current Date + Should Be True ${result} No creating endpoint centreon-broker-master-rrd. + ${start2} Get Current Date # We check that output filters to rrd are set to "all" ${content} Create List ... endpoint applier: filters for endpoint 'centreon-broker-master-rrd' reduced to the needed ones: all ${result} Find In Log with Timeout ${centralLog} ${start} ${content} 60 - Should Be True ${result} msg=No message about the output filters to rrd broker. + Should Be True ${result} No message about the output filters to rrd broker. ${start} Get Current Date # Let's wait for storage data written into rrd files ${content} Create List RRD: new pb status data for index ${result} Find In Log with Timeout ${rrdLog} ${start2} ${content} 60 - Should Be True ${result} msg=No status from central broker for 1mn. + Should Be True ${result} No status from central broker for 1mn. # We check that output filters to rrd doesn't filter anything ${content} Create List rrd event of type .* rejected by write filter @@ -341,7 +341,7 @@ CBD_RELOAD_AND_FILTERS Should Be Equal As Strings ... ${result[0]} ... False - ... msg=Some events are rejected by the rrd output whereas all categories are enabled. + ... Some events are rejected by the rrd output whereas all categories are enabled. Stop Engine Kindly Stop Broker True @@ -370,18 +370,18 @@ CBD_RELOAD_AND_FILTERS_WITH_OPR # Let's wait for the external command check start ${content} Create List check_for_external_commands() ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 - Should Be True ${result} msg=A message telling check_for_external_commands() should be available. + Should Be True ${result} A message telling check_for_external_commands() should be available. # Let's wait for storage data written into rrd files ${content} Create List RRD: new pb status data for index ${result} Find In Log with Timeout ${rrdLog} ${start} ${content} 60 - Should Be True ${result} msg=No status from central broker for 1mn. + Should Be True ${result} No status from central broker for 1mn. # We check that output filters to rrd are set to "all" ${content} Create List ... endpoint applier: filters for endpoint 'centreon-broker-master-rrd' reduced to the needed ones: all ${result} Find In Log with Timeout ${centralLog} ${start} ${content} 60 - Should Be True ${result} msg=No message about the output filters to rrd broker. + Should Be True ${result} No message about the output filters to rrd broker. # New configuration Broker Config Output Set Json central centreon-broker-master-rrd filters {"category": [ "storage"]} @@ -393,8 +393,8 @@ CBD_RELOAD_AND_FILTERS_WITH_OPR #wait broker reload ${content} Create List creating endpoint centreon-broker-master-rrd ${result} Find In Log with Timeout ${centralLog} ${start} ${content} 60 - Should Be True ${result} msg=No creating endpoint centreon-broker-master-rrd. - ${start2}= Get Current Date + Should Be True ${result} No creating endpoint centreon-broker-master-rrd. + ${start2} Get Current Date # We check that output filters to rrd are set to "storage" ${content} Create List @@ -402,17 +402,17 @@ CBD_RELOAD_AND_FILTERS_WITH_OPR ... endpoint applier: filters ... storage for endpoint 'centreon-broker-master-rrd' applied. ${result} Find In Log with Timeout ${centralLog} ${start} ${content} 60 - Should Be True ${result} msg=No message about the output filters to rrd broker. + Should Be True ${result} No message about the output filters to rrd broker. # Let's wait for storage data written into rrd files ${content} Create List RRD: new pb status data for index ${result} Find In Log with Timeout ${rrdLog} ${start2} ${content} 60 - Should Be True ${result} msg=No status from central broker for 1mn. + Should Be True ${result} No status from central broker for 1mn. # We check that output filters to rrd are set to "storage" ${content} Create List rrd event of type .* rejected by write filter ${result} Find Regex In Log with Timeout ${centralLog} ${start2} ${content} 120 - Should Be True ${result} msg=No event rejected by the rrd output whereas only storage category is enabled. + Should Be True ${result} No event rejected by the rrd output whereas only storage category is enabled. Log To Console Third configuration: all events are sent. # New configuration @@ -423,19 +423,19 @@ CBD_RELOAD_AND_FILTERS_WITH_OPR #wait broker reload ${content} Create List creating endpoint centreon-broker-master-rrd ${result} Find In Log with Timeout ${centralLog} ${start} ${content} 60 - Should Be True ${result} msg=No creating endpoint centreon-broker-master-rrd. - ${start2}= Get Current Date + Should Be True ${result} No creating endpoint centreon-broker-master-rrd. + ${start2} Get Current Date # We check that output filters to rrd are set to "all" ${content} Create List ... endpoint applier: filters for endpoint 'centreon-broker-master-rrd' reduced to the needed ones: all ${result} Find In Log with Timeout ${centralLog} ${start} ${content} 60 - Should Be True ${result} msg=No message about the output filters to rrd broker. + Should Be True ${result} No message about the output filters to rrd broker. # Let's wait for storage data written into rrd files ${content} Create List RRD: new pb status data for index ${result} Find In Log with Timeout ${rrdLog} ${start2} ${content} 60 - Should Be True ${result} msg=No status from central broker for 1mn. + Should Be True ${result} No status from central broker for 1mn. # We check that output filters to rrd doesn't filter anything ${content} Create List rrd event of type .* rejected by write filter @@ -443,7 +443,7 @@ CBD_RELOAD_AND_FILTERS_WITH_OPR Should Be Equal As Strings ... ${result[0]} ... False - ... msg=Some events are rejected by the rrd output whereas all categories are enabled. + ... Some events are rejected by the rrd output whereas all categories are enabled. Stop Engine Kindly Stop Broker True @@ -489,33 +489,33 @@ SEVERAL_FILTERS_ON_LUA_EVENT Wait Until Created /tmp/all_lua_event.log FOR ${index} IN RANGE 30 # search for pb_metric_mapping - ${res}= Get File Size /tmp/all_lua_event.log + ${res} Get File Size /tmp/all_lua_event.log Sleep 1s IF ${res} > 100 BREAK END ${content} Get File /tmp/all_lua_event.log - @{lines}= Split To lines ${content} + @{lines} Split To lines ${content} FOR ${line} IN @{lines} Should Contain ... ${line} ... "_type":196620 - ... msg=All the lines in all_lua_event.log should contain "_type":196620 + ... All the lines in all_lua_event.log should contain "_type":196620 END Wait Until Created /tmp/all_lua_event-bis.log FOR ${index} IN RANGE 30 # search for pb_metric_mapping - ${res}= Get File Size /tmp/all_lua_event-bis.log + ${res} Get File Size /tmp/all_lua_event-bis.log Sleep 1s IF ${res} > 100 BREAK END ${content} Get File /tmp/all_lua_event-bis.log - @{lines}= Split To lines ${content} + @{lines} Split To lines ${content} FOR ${line} IN @{lines} Should Contain ... ${line} ... "_type":65565 - ... msg=All the lines in all_lua_event-bis.log should contain "_type":65565 + ... All the lines in all_lua_event-bis.log should contain "_type":65565 END Stop Engine Kindly Stop Broker True diff --git a/tests/broker-engine/output-tables.robot b/tests/broker-engine/output-tables.robot index 7369f80a516..e373f3264b5 100644 --- a/tests/broker-engine/output-tables.robot +++ b/tests/broker-engine/output-tables.robot @@ -34,21 +34,21 @@ BERES1 Broker Config Output Set central central-broker-unified-sql store_in_resources yes Broker Config Output Set central central-broker-unified-sql store_in_hosts_services no Clear Retention - ${start}= Get Current Date + ${start} Get Current Date Sleep 1s Start Broker Start Engine - ${content_not_present}= Create List + ${content_not_present} Create List ... processing host status event (host: ... UPDATE hosts SET checked=i ... processing service status event (host: ... UPDATE services SET checked= - ${content_present}= Create List UPDATE resources SET status= - ${result}= Find In log With Timeout ${centralLog} ${start} ${content_present} 60 - Should Be True ${result} msg=no updates concerning resources available. + ${content_present} Create List UPDATE resources SET status= + ${result} Find In log With Timeout ${centralLog} ${start} ${content_present} 60 + Should Be True ${result} no updates concerning resources available. FOR ${l} IN ${content_not_present} - ${result}= Find In Log ${centralLog} ${start} ${content_not_present} - Should Not Be True ${result[0]} msg=There are updates of hosts/services table(s). + ${result} Find In Log ${centralLog} ${start} ${content_not_present} + Should Not Be True ${result[0]} There are updates of hosts/services table(s). END Stop Engine Kindly Stop Broker @@ -68,22 +68,22 @@ BEHS1 Broker Config Output Set central central-broker-unified-sql store_in_resources no Broker Config Output Set central central-broker-unified-sql store_in_hosts_services yes Clear Retention - ${start}= Get Current Date + ${start} Get Current Date Start Broker Start Engine - ${content_present}= Create List UPDATE hosts SET checked= UPDATE services SET checked= - ${content_not_present}= Create List + ${content_present} Create List UPDATE hosts SET checked= UPDATE services SET checked= + ${content_not_present} Create List ... INSERT INTO resources ... UPDATE resources SET ... UPDATE tags ... INSERT INTO tags ... UPDATE severities ... INSERT INTO severities - ${result}= Find In log With Timeout ${centralLog} ${start} ${content_present} 60 - Should Be True ${result} msg=no updates concerning hosts/services available. + ${result} Find In log With Timeout ${centralLog} ${start} ${content_present} 60 + Should Be True ${result} no updates concerning hosts/services available. FOR ${l} IN ${content_not_present} - ${result}= Find In Log ${centralLog} ${start} ${content_not_present} - Should Not Be True ${result[0]} msg=There are updates of the resources table. + ${result} Find In Log ${centralLog} ${start} ${content_not_present} + Should Not Be True ${result[0]} There are updates of the resources table. END Stop Engine Kindly Stop Broker @@ -110,45 +110,45 @@ BEINSTANCESTATUS Broker Config Add Item module0 bbdo_version 3.0.0 Broker Config Add Item central bbdo_version 3.0.0 Config Broker Sql Output central unified_sql - ${start}= Get Current Date + ${start} Get Current Date Start Broker Start Engine - ${content}= Create List check_for_external_commands - ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 - Should Be True ${result} msg=No check for external commands executed for 1mn. - ${result}= check_field_db_value + ${content} Create List check_for_external_commands + ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + Should Be True ${result} No check for external commands executed for 1mn. + ${result} check_field_db_value ... SELECT global_host_event_handler FROM instances WHERE instance_id=1 ... command_1 ... 30 - Should Be True ${result} msg=global_host_event_handler not updated. - ${result}= check_field_db_value + Should Be True ${result} global_host_event_handler not updated. + ${result} check_field_db_value ... SELECT global_service_event_handler FROM instances WHERE instance_id=1 ... command_2 ... 2 - Should Be True ${result} msg=global_service_event_handler not updated. - ${result}= check_field_db_value SELECT flap_detection FROM instances WHERE instance_id=1 ${1} 3 - Should Be True ${result} msg=flap_detection not updated. - ${result}= check_field_db_value SELECT notifications FROM instances WHERE instance_id=1 ${0} 3 - Should Be True ${result} msg=notifications not updated. - ${result}= check_field_db_value SELECT active_host_checks FROM instances WHERE instance_id=1 ${0} 3 - Should Be True ${result} msg=active_host_checks not updated. - ${result}= check_field_db_value SELECT active_service_checks FROM instances WHERE instance_id=1 ${0} 3 - Should Be True ${result} msg=active_service_checks not updated. - ${result}= check_field_db_value SELECT check_hosts_freshness FROM instances WHERE instance_id=1 ${0} 3 - Should Be True ${result} msg=check_hosts_freshness not updated. - ${result}= check_field_db_value + Should Be True ${result} global_service_event_handler not updated. + ${result} check_field_db_value SELECT flap_detection FROM instances WHERE instance_id=1 ${1} 3 + Should Be True ${result} flap_detection not updated. + ${result} check_field_db_value SELECT notifications FROM instances WHERE instance_id=1 ${0} 3 + Should Be True ${result} notifications not updated. + ${result} check_field_db_value SELECT active_host_checks FROM instances WHERE instance_id=1 ${0} 3 + Should Be True ${result} active_host_checks not updated. + ${result} check_field_db_value SELECT active_service_checks FROM instances WHERE instance_id=1 ${0} 3 + Should Be True ${result} active_service_checks not updated. + ${result} check_field_db_value SELECT check_hosts_freshness FROM instances WHERE instance_id=1 ${0} 3 + Should Be True ${result} check_hosts_freshness not updated. + ${result} check_field_db_value ... SELECT check_services_freshness FROM instances WHERE instance_id=1 ... ${1} ... 3 - Should Be True ${result} msg=check_services_freshness not updated. - ${result}= check_field_db_value SELECT obsess_over_hosts FROM instances WHERE instance_id=1 ${1} 3 - Should Be True ${result} msg=obsess_over_hosts not updated. - ${result}= check_field_db_value SELECT obsess_over_services FROM instances WHERE instance_id=1 ${1} 3 - Should Be True ${result} msg=obsess_over_services not updated. - ${result}= check_field_db_value SELECT passive_host_checks FROM instances WHERE instance_id=1 ${0} 3 - Should Be True ${result} msg=passive_host_checks not updated. - ${result}= check_field_db_value SELECT passive_service_checks FROM instances WHERE instance_id=1 ${0} 3 - Should Be True ${result} msg=passive_service_checks not updated. + Should Be True ${result} check_services_freshness not updated. + ${result} check_field_db_value SELECT obsess_over_hosts FROM instances WHERE instance_id=1 ${1} 3 + Should Be True ${result} obsess_over_hosts not updated. + ${result} check_field_db_value SELECT obsess_over_services FROM instances WHERE instance_id=1 ${1} 3 + Should Be True ${result} obsess_over_services not updated. + ${result} check_field_db_value SELECT passive_host_checks FROM instances WHERE instance_id=1 ${0} 3 + Should Be True ${result} passive_host_checks not updated. + ${result} check_field_db_value SELECT passive_service_checks FROM instances WHERE instance_id=1 ${0} 3 + Should Be True ${result} passive_service_checks not updated. Stop Engine Kindly Stop Broker @@ -167,22 +167,22 @@ BEINSTANCE Execute SQL String DELETE FROM instances #as GetCurrent Date floor milliseconds to upper or lower integer, we substract 1s - ${start}= get_round_current_date + ${start} get_round_current_date Start Broker Start Engine - ${engine_pid}= Get Engine Pid e0 - ${result}= check_field_db_value SELECT pid FROM instances WHERE instance_id=1 ${engine_pid} 30 - Should Be True ${result} msg=no correct engine pid in instances table. - ${result}= check_field_db_value SELECT engine FROM instances WHERE instance_id=1 Centreon Engine 3 - Should Be True ${result} msg=no correct engine in instances table. - ${result}= check_field_db_value SELECT running FROM instances WHERE instance_id=1 ${1} 3 - Should Be True ${result} msg=no correct running in instances table. - ${result}= check_field_db_value SELECT name FROM instances WHERE instance_id=1 Poller0 3 - Should Be True ${result} msg=no correct name in instances table. - ${result}= check_field_db_value SELECT end_time FROM instances WHERE instance_id=1 ${0} 3 - Should Be True ${result} msg=no correct end_time in instances table. - @{bdd_start_time}= Query SELECT start_time FROM instances WHERE instance_id=1 - ${now}= get_round_current_date + ${engine_pid} Get Engine Pid e0 + ${result} check_field_db_value SELECT pid FROM instances WHERE instance_id=1 ${engine_pid} 30 + Should Be True ${result} no correct engine pid in instances table. + ${result} check_field_db_value SELECT engine FROM instances WHERE instance_id=1 Centreon Engine 3 + Should Be True ${result} no correct engine in instances table. + ${result} check_field_db_value SELECT running FROM instances WHERE instance_id=1 ${1} 3 + Should Be True ${result} no correct running in instances table. + ${result} check_field_db_value SELECT name FROM instances WHERE instance_id=1 Poller0 3 + Should Be True ${result} no correct name in instances table. + ${result} check_field_db_value SELECT end_time FROM instances WHERE instance_id=1 ${0} 3 + Should Be True ${result} no correct end_time in instances table. + @{bdd_start_time} Query SELECT start_time FROM instances WHERE instance_id=1 + ${now} get_round_current_date Should Be True ... ${start} <= ${bdd_start_time[0][0]} and ${bdd_start_time[0][0]} <= ${now} ... sg=no correct start_time in instances table. @@ -204,22 +204,22 @@ BE_NOTIF_OVERFLOW Start Broker Start Engine - ${start}= Get Current Date - ${content}= Create List INITIAL SERVICE STATE: host_16;service_314; - ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 30 + ${start} Get Current Date + ${content} Create List INITIAL SERVICE STATE: host_16;service_314; + ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 30 Should Be True ... ${result} - ... msg=An Initial host state on host_16 should be raised before we can start our external commands. + ... An Initial host state on host_16 should be raised before we can start our external commands. set_svc_notification_number host_16 service_314 40000 Repeat Keyword 3 times Process Service Check Result host_16 service_314 2 output critical for 314 - ${result}= Check Service Status With Timeout host_16 service_314 2 30 - Should Be True ${result} msg=The service (host_16,service_314) is not CRITICAL as expected + ${result} Check Service Status With Timeout host_16 service_314 2 30 + Should Be True ${result} The service (host_16,service_314) is not CRITICAL as expected Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} - ${output}= Query + ${output} Query ... SELECT s.notification_number FROM services s LEFT JOIN hosts h ON s.host_id=h.host_id WHERE h.name='host_16' AND s.description='service_314' - Should Be True ${output[0][0]} == None msg=notification_number is not null + Should Be True ${output[0][0]} == None notification_number is not null Stop Engine Kindly Stop Broker @@ -244,7 +244,7 @@ BE_TIME_NULL_SERVICE_RESOURCE Start Engine FOR ${index} IN RANGE 300 - ${output}= Query + ${output} Query ... SELECT r.last_status_change, s.last_hard_state_change, s.last_notification, s.next_notification , s.last_state_change, s.last_time_critical, s.last_time_ok, s.last_time_unknown, s.last_time_warning, h.last_hard_state_change, h.last_notification, h.next_host_notification, h.last_state_change, h.last_time_down, h.last_time_unreachable, h.last_time_up FROM services s, resources r, hosts h WHERE h.host_id=1 AND s.service_id=1 AND r.id=1 AND r.parent_id=1 Log To Console ${output} Sleep 1s @@ -278,7 +278,7 @@ BE_DEFAULT_NOTIFCATION_INTERVAL_IS_ZERO_SERVICE_RESOURCE Start Engine FOR ${index} IN RANGE 300 - ${output}= Query + ${output} Query ... SELECT s.notification_interval, h.notification_interval FROM services s, hosts h WHERE h.host_id=1 AND s.service_id=1 Log To Console ${output} Sleep 1s diff --git a/tests/broker-engine/reverse-connection.robot b/tests/broker-engine/reverse-connection.robot index f9d87c922bb..58644d7f370 100644 --- a/tests/broker-engine/reverse-connection.robot +++ b/tests/broker-engine/reverse-connection.robot @@ -29,27 +29,27 @@ BRGC1 Log To Console Compression set to Broker Config Log central bbdo info Broker Config Log module0 bbdo info - ${start}= Get Current Date + ${start} Get Current Date Start Broker Start Engine # Let's wait for the external command check start - ${content}= Create List check_for_external_commands() - ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 - Should Be True ${result} msg=A message telling check_for_external_commands() should be available. + ${content} Create List check_for_external_commands() + ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + Should Be True ${result} A message telling check_for_external_commands() should be available. Run Reverse Bam ${50} ${0.2} Kindly Stop Broker Stop Engine - ${content}= Create List + ${content} Create List ... New incoming connection 'centreon-broker-master-map-2' ... file: end of file '${VarRoot}/lib/centreon-broker//central-broker-master.queue.centreon-broker-master-map-2' reached, erasing it - ${log}= Catenate SEPARATOR= ${BROKER_LOG} /central-broker-master.log - ${result}= Find In Log With Timeout ${log} ${start} ${content} 40 - Should Be True ${result} msg=Connection to map has failed. + ${log} Catenate SEPARATOR= ${BROKER_LOG} /central-broker-master.log + ${result} Find In Log With Timeout ${log} ${start} ${content} 40 + Should Be True ${result} Connection to map has failed. File Should Not Exist ... ${VarRoot}/lib/centreon-broker/central-broker-master.queue.centreon-broker-master-map* - ... msg=There should not exist que map files. + ... There should not exist que map files. BRCTS1 [Documentation] Broker reverse connection too slow @@ -61,27 +61,27 @@ BRCTS1 Broker Config Log central bbdo info Broker Config Log module0 bbdo info - ${start}= Get Current Date + ${start} Get Current Date Start Broker Start Engine # Let's wait for the external command check start - ${content}= Create List check_for_external_commands() - ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 - Should Be True ${result} msg=A message telling check_for_external_commands() should be available. + ${content} Create List check_for_external_commands() + ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + Should Be True ${result} A message telling check_for_external_commands() should be available. Run Reverse Bam ${150} ${10} Kindly Stop Broker Stop Engine - ${content}= Create List + ${content} Create List ... New incoming connection 'centreon-broker-master-map-2' ... file: end of file '${VarRoot}/lib/centreon-broker//central-broker-master.queue.centreon-broker-master-map-2' reached, erasing it - ${log}= Catenate SEPARATOR= ${BROKER_LOG} /central-broker-master.log - ${result}= Find In Log With Timeout ${log} ${start} ${content} 40 - Should Be True ${result} msg=Connection to map has failed + ${log} Catenate SEPARATOR= ${BROKER_LOG} /central-broker-master.log + ${result} Find In Log With Timeout ${log} ${start} ${content} 40 + Should Be True ${result} Connection to map has failed File Should Not Exist ... ${VarRoot}/lib/centreon-broker/central-broker-master.queue.centreon-broker-master-map* - ... msg=There should not exist queue map files. + ... There should not exist queue map files. BRCS1 [Documentation] Broker reverse connection stopped @@ -93,25 +93,25 @@ BRCS1 Broker Config Log central bbdo info Broker Config Log module0 bbdo info - ${start}= Get Current Date + ${start} Get Current Date Start Broker Start Engine # Let's wait for the external command check start - ${content}= Create List check_for_external_commands() - ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 - Should Be True ${result} msg=A message telling check_for_external_commands() should be available. + ${content} Create List check_for_external_commands() + ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + Should Be True ${result} A message telling check_for_external_commands() should be available. Kindly Stop Broker Stop Engine - ${content}= Create List + ${content} Create List ... New incoming connection 'centreon-broker-master-map-2' ... file: end of file '${VarRoot}/lib/centreon-broker//central-broker-master.queue.centreon-broker-master-map-2' reached, erasing it - ${log}= Catenate SEPARATOR= ${BROKER_LOG} /central-broker-master.log - ${result}= Find In Log With Timeout ${log} ${start} ${content} 40 - Should Not Be True ${result} msg=Connection to map has failed + ${log} Catenate SEPARATOR= ${BROKER_LOG} /central-broker-master.log + ${result} Find In Log With Timeout ${log} ${start} ${content} 40 + Should Not Be True ${result} Connection to map has failed File Should Not Exist ... ${VarRoot}/lib/centreon-broker/central-broker-master.queue.centreon-broker-master-map-2 - ... msg=There should not exist queue map files. + ... There should not exist queue map files. BRCTSMN [Documentation] Broker connected to map with neb filter @@ -127,32 +127,32 @@ BRCTSMN Broker Config Log central core trace Broker Config Log central processing trace Broker Config Log module0 bbdo info - ${start}= Get Round Current Date + ${start} Get Round Current Date Start Broker Start Map Sleep 5s Start Engine # Let's wait for the external command check start - ${content}= Create List check_for_external_commands() - ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 - Should Be True ${result} msg=A message telling check_for_external_commands() should be available. + ${content} Create List check_for_external_commands() + ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + Should Be True ${result} A message telling check_for_external_commands() should be available. # pb_service pb_host pb_service_status pb_host_status - ${expected_events}= Create List 65563 65566 65565 65568 - ${categories}= Create List 1 - ${output}= Check Map Output ${categories} ${expected_events} 120 + ${expected_events} Create List 65563 65566 65565 65568 + ${categories} Create List 1 + ${output} Check Map Output ${categories} ${expected_events} 120 Kindly Stop Broker Stop Map - Should Be True ${output} msg=Filters badly applied in Broker + Should Be True ${output} Filters badly applied in Broker # We should have exactly 1000 pb_service - ${ret}= Grep File /tmp/map-output.log 65563 - ${ret}= Get Line Count ${ret} + ${ret} Grep File /tmp/map-output.log 65563 + ${ret} Get Line Count ${ret} Should Be True ${ret} >= 1000 # We should have exactly 50 pb_host - ${ret}= Grep File /tmp/map-output.log 65566 - ${ret}= Get Line Count ${ret} + ${ret} Grep File /tmp/map-output.log 65566 + ${ret} Get Line Count ${ret} Should Be True ${ret} >= 50 Stop Engine @@ -175,30 +175,30 @@ BRCTSMNS Broker Config Log central core trace Broker Config Log central processing trace Broker Config Log module0 bbdo info - ${start}= Get Round Current Date + ${start} Get Round Current Date Start Broker Start Map Sleep 5s Start Engine # Let's wait for the external command check start - ${content}= Create List check_for_external_commands() - ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 - Should Be True ${result} msg=A message telling check_for_external_commands() should be available. + ${content} Create List check_for_external_commands() + ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + Should Be True ${result} A message telling check_for_external_commands() should be available. # pb_service pb_host pb_service_status pb_host_status pb_metric pb_status pb_index_mapping - ${expected_events}= Create List 65563 65566 65565 65568 196617 196618 196619 - ${categories}= Create List 1 3 - ${output}= Check Map Output ${categories} ${expected_events} 120 - Should Be True ${output} msg=Filters badly applied in Broker + ${expected_events} Create List 65563 65566 65565 65568 196617 196618 196619 + ${categories} Create List 1 3 + ${output} Check Map Output ${categories} ${expected_events} 120 + Should Be True ${output} Filters badly applied in Broker # We should have 1000 pb_service with maybe some BAs - ${ret}= Grep File /tmp/map-output.log 65563 - ${ret}= Get Line Count ${ret} + ${ret} Grep File /tmp/map-output.log 65563 + ${ret} Get Line Count ${ret} Should Be True ${ret} >= 1000 # We should have exactly 50 pb_host with maybe some meta hosts - ${ret}= Grep File /tmp/map-output.log 65566 - ${ret}= Get Line Count ${ret} + ${ret} Grep File /tmp/map-output.log 65566 + ${ret} Get Line Count ${ret} Should Be True ${ret} >= 50 # The output file of the map script is cleared. @@ -211,10 +211,10 @@ BRCTSMNS Reload Broker # pb_service we changed services 50 added and others moved... - ${expected_events}= Create List 65563 - ${categories}= Create List 1 3 - ${output}= Check Map Output ${categories} ${expected_events} 120 - Should Be True ${output} msg=Filters badly applied in Broker + ${expected_events} Create List 65563 + ${categories} Create List 1 3 + ${output} Check Map Output ${categories} ${expected_events} 120 + Should Be True ${output} Filters badly applied in Broker Kindly Stop Broker Stop Map diff --git a/tests/broker-engine/rrd-from-db.robot b/tests/broker-engine/rrd-from-db.robot index d84ce0f6a6e..7112151f6f3 100644 --- a/tests/broker-engine/rrd-from-db.robot +++ b/tests/broker-engine/rrd-from-db.robot @@ -34,24 +34,24 @@ BRRDDMDB1 Broker Config Flush Log central 0 Broker Config Flush Log rrd 0 Create Metrics 3 - ${start}= Get Current Date exclude_millis=True + ${start} Get Current Date exclude_millis=True Start Broker Start Engine - ${result}= Check Connections - Should Be True ${result} msg=Engine and Broker not connected + ${result} Check Connections + Should Be True ${result} Engine and Broker not connected # We choose 3 metrics to remove. - ${metrics}= Get Metrics To Delete 3 + ${metrics} Get Metrics To Delete 3 Log To Console Metrics to delete ${metrics} - ${empty}= Create List + ${empty} Create List Remove Graphs from DB ${empty} ${metrics} Reload Broker - ${metrics_str}= Catenate SEPARATOR=, @{metrics} - ${content}= Create List metrics ${metrics_str} erased from database + ${metrics_str} Catenate SEPARATOR=, @{metrics} + ${content} Create List metrics ${metrics_str} erased from database - ${result}= Find In Log With Timeout ${centralLog} ${start} ${content} 30 - Should Be True ${result} msg=No log message telling about metrics ${metrics_str} deletion. + ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 30 + Should Be True ${result} No log message telling about metrics ${metrics_str} deletion. FOR ${m} IN @{metrics} Log to Console Waiting for ${VarRoot}/lib/centreon/metrics/${m}.rrd to be deleted Wait Until Removed ${VarRoot}/lib/centreon/metrics/${m}.rrd 20s @@ -72,28 +72,28 @@ BRRDDIDDB1 Broker Config Flush Log rrd 0 Create Metrics 3 - ${start}= Get Current Date + ${start} Get Current Date Sleep 1s Start Broker Start Engine - ${result}= Check Connections - Should Be True ${result} msg=Engine and Broker not connected + ${result} Check Connections + Should Be True ${result} Engine and Broker not connected log to console STEP1 - ${indexes}= Get Indexes To Delete 2 + ${indexes} Get Indexes To Delete 2 log to console STEP2 - ${metrics}= Get Metrics Matching Indexes ${indexes} + ${metrics} Get Metrics Matching Indexes ${indexes} log to console STEP3 Log To Console indexes ${indexes} to delete with their metrics - ${empty}= Create List + ${empty} Create List Remove Graphs from DB ${indexes} ${empty} Reload Broker - ${indexes_str}= Catenate SEPARATOR=, @{indexes} - ${content}= Create List indexes ${indexes_str} erased from database + ${indexes_str} Catenate SEPARATOR=, @{indexes} + ${content} Create List indexes ${indexes_str} erased from database - ${result}= Find In Log With Timeout ${centralLog} ${start} ${content} 30 - Should Be True ${result} msg=No log message telling about indexes ${indexes_str} deletion. + ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 30 + Should Be True ${result} No log message telling about indexes ${indexes_str} deletion. FOR ${i} IN @{indexes} log to console Wait for ${VarRoot}/lib/centreon/status/${i}.rrd to be deleted Wait Until Removed ${VarRoot}/lib/centreon/status/${i}.rrd 20s @@ -117,37 +117,37 @@ BRRDRBDB1 Broker Config Flush Log rrd 0 Create Metrics 3 - ${start}= Get Current Date + ${start} Get Current Date Start Broker Start Engine - ${result}= Check Connections - Should Be True ${result} msg=Engine and Broker not connected + ${result} Check Connections + Should Be True ${result} Engine and Broker not connected # We get 3 indexes to rebuild - ${index}= Get Indexes To Rebuild 3 + ${index} Get Indexes To Rebuild 3 Rebuild Rrd Graphs from DB ${index} Log To Console Indexes to rebuild: ${index} - ${metrics}= Get Metrics Matching Indexes ${index} + ${metrics} Get Metrics Matching Indexes ${index} Log To Console Metrics to rebuild: ${metrics} Reload Broker - ${content1}= Create List RRD: Starting to rebuild metrics - ${result}= Find In Log With Timeout ${rrdLog} ${start} ${content1} 45 - Should Be True ${result} msg=RRD cbd did not receive metrics to rebuild START + ${content1} Create List RRD: Starting to rebuild metrics + ${result} Find In Log With Timeout ${rrdLog} ${start} ${content1} 45 + Should Be True ${result} RRD cbd did not receive metrics to rebuild START - ${content1}= Create List RRD: Rebuilding metric - ${result}= Find In Log With Timeout ${rrdLog} ${start} ${content1} 45 - Should Be True ${result} msg=RRD cbd did not receive metrics to rebuild DATA + ${content1} Create List RRD: Rebuilding metric + ${result} Find In Log With Timeout ${rrdLog} ${start} ${content1} 45 + Should Be True ${result} RRD cbd did not receive metrics to rebuild DATA - ${content1}= Create List RRD: Finishing to rebuild metrics - ${result}= Find In Log With Timeout ${rrdLog} ${start} ${content1} 500 - Should Be True ${result} msg=RRD cbd did not receive metrics to rebuild END + ${content1} Create List RRD: Finishing to rebuild metrics + ${result} Find In Log With Timeout ${rrdLog} ${start} ${content1} 500 + Should Be True ${result} RRD cbd did not receive metrics to rebuild END FOR ${m} IN @{metrics} - ${value}= Evaluate ${m} / 2 - ${result}= Compare RRD Average Value ${m} ${value} + ${value} Evaluate ${m} / 2 + ${result} Compare RRD Average Value ${m} ${value} Should Be True ... ${result} - ... msg=Data before RRD rebuild contain alternatively the metric ID and 0. The expected average is metric_id / 2. + ... Data before RRD rebuild contain alternatively the metric ID and 0. The expected average is metric_id / 2. END BRRDRBUDB1 @@ -167,36 +167,36 @@ BRRDRBUDB1 Broker Config Add Item central bbdo_version 3.0.1 Create Metrics 3 - ${start}= Get Current Date exclude_millis=True + ${start} Get Current Date exclude_millis=True Start Broker Start Engine - ${result}= Check Connections - Should Be True ${result} msg=Engine and Broker not connected + ${result} Check Connections + Should Be True ${result} Engine and Broker not connected # We get 3 indexes to rebuild - ${index}= Get Indexes To Rebuild 3 + ${index} Get Indexes To Rebuild 3 Rebuild Rrd Graphs from DB ${index} Reload Broker Log To Console Indexes to rebuild: ${index} - ${metrics}= Get Metrics Matching Indexes ${index} + ${metrics} Get Metrics Matching Indexes ${index} - ${content1}= Create List RRD: Starting to rebuild metrics - ${result}= Find In Log With Timeout ${rrdLog} ${start} ${content1} 30 - Should Be True ${result} msg=RRD cbd did not receive metrics to rebuild START + ${content1} Create List RRD: Starting to rebuild metrics + ${result} Find In Log With Timeout ${rrdLog} ${start} ${content1} 30 + Should Be True ${result} RRD cbd did not receive metrics to rebuild START - ${content1}= Create List RRD: Rebuilding metric - ${result}= Find In Log With Timeout ${rrdLog} ${start} ${content1} 30 - Should Be True ${result} msg=RRD cbd did not receive metrics to rebuild DATA + ${content1} Create List RRD: Rebuilding metric + ${result} Find In Log With Timeout ${rrdLog} ${start} ${content1} 30 + Should Be True ${result} RRD cbd did not receive metrics to rebuild DATA - ${content1}= Create List RRD: Finishing to rebuild metrics - ${result}= Find In Log With Timeout ${rrdLog} ${start} ${content1} 500 - Should Be True ${result} msg=RRD cbd did not receive metrics to rebuild END + ${content1} Create List RRD: Finishing to rebuild metrics + ${result} Find In Log With Timeout ${rrdLog} ${start} ${content1} 500 + Should Be True ${result} RRD cbd did not receive metrics to rebuild END FOR ${m} IN @{metrics} - ${value}= Evaluate ${m} / 2 - ${result}= Compare RRD Average Value ${m} ${value} + ${value} Evaluate ${m} / 2 + ${result} Compare RRD Average Value ${m} ${value} Should Be True ... ${result} - ... msg=Data before RRD rebuild contain alternatively the metric ID and 0. The expected average is metric_id / 2. + ... Data before RRD rebuild contain alternatively the metric ID and 0. The expected average is metric_id / 2. END BRRDUPLICATE @@ -214,32 +214,32 @@ BRRDUPLICATE Clear Db data_bin Create Metrics 3 - ${start}= Get Current Date + ${start} Get Current Date Start Broker Start Engine - ${result}= Check Connections - Should Be True ${result} msg=Engine and Broker not connected + ${result} Check Connections + Should Be True ${result} Engine and Broker not connected # We get 3 indexes to rebuild - ${index}= Get Indexes To Rebuild 3 2 - ${duplicates}= add_duplicate_metrics + ${index} Get Indexes To Rebuild 3 2 + ${duplicates} add_duplicate_metrics Rebuild Rrd Graphs from DB ${index} Log To Console Indexes to rebuild: ${index} - ${metrics}= Get Metrics Matching Indexes ${index} + ${metrics} Get Metrics Matching Indexes ${index} Log To Console Metrics to rebuild: ${metrics} Reload Broker - ${content1}= Create List RRD: Starting to rebuild metrics - ${result}= Find In Log With Timeout ${rrdLog} ${start} ${content1} 45 - Should Be True ${result} msg=RRD cbd did not receive metrics to rebuild START + ${content1} Create List RRD: Starting to rebuild metrics + ${result} Find In Log With Timeout ${rrdLog} ${start} ${content1} 45 + Should Be True ${result} RRD cbd did not receive metrics to rebuild START - ${content1}= Create List RRD: Rebuilding metric - ${result}= Find In Log With Timeout ${rrdLog} ${start} ${content1} 45 - Should Be True ${result} msg=RRD cbd did not receive metrics to rebuild DATA + ${content1} Create List RRD: Rebuilding metric + ${result} Find In Log With Timeout ${rrdLog} ${start} ${content1} 45 + Should Be True ${result} RRD cbd did not receive metrics to rebuild DATA - ${content1}= Create List RRD: Finishing to rebuild metrics - ${result}= Find In Log With Timeout ${rrdLog} ${start} ${content1} 500 - Should Be True ${result} msg=RRD cbd did not receive metrics to rebuild END + ${content1} Create List RRD: Finishing to rebuild metrics + ${result} Find In Log With Timeout ${rrdLog} ${start} ${content1} 500 + Should Be True ${result} RRD cbd did not receive metrics to rebuild END - ${result}= check_for_NaN_metric ${duplicates} - Should Be True ${result} msg=at least one metric contains NaN value + ${result} check_for_NaN_metric ${duplicates} + Should Be True ${result} at least one metric contains NaN value diff --git a/tests/broker-engine/rrdcached-from-db.robot b/tests/broker-engine/rrdcached-from-db.robot index 43c64a17e6c..ffc69ae7e24 100644 --- a/tests/broker-engine/rrdcached-from-db.robot +++ b/tests/broker-engine/rrdcached-from-db.robot @@ -35,24 +35,24 @@ BRRDCDDMDB1 Broker Config Flush Log central 0 Broker Config Flush Log rrd 0 Create Metrics 3 - ${start}= Get Current Date exclude_millis=True + ${start} Get Current Date exclude_millis=True Start Broker Start Engine - ${result}= Check Connections - Should Be True ${result} msg=Engine and Broker not connected + ${result} Check Connections + Should Be True ${result} Engine and Broker not connected # We choose 3 metrics to remove. - ${metrics}= Get Metrics To Delete 3 + ${metrics} Get Metrics To Delete 3 Log To Console Metrics to delete ${metrics} - ${empty}= Create List + ${empty} Create List Remove Graphs from DB ${empty} ${metrics} Reload Broker - ${metrics_str}= Catenate SEPARATOR=, @{metrics} - ${content}= Create List metrics ${metrics_str} erased from database + ${metrics_str} Catenate SEPARATOR=, @{metrics} + ${content} Create List metrics ${metrics_str} erased from database - ${result}= Find In Log With Timeout ${centralLog} ${start} ${content} 30 - Should Be True ${result} msg=No log message telling about metrics ${metrics_str} deletion. + ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 30 + Should Be True ${result} No log message telling about metrics ${metrics_str} deletion. FOR ${m} IN @{metrics} Log to Console Waiting for ${VarRoot}/lib/centreon/metrics/${m}.rrd to be deleted Wait Until Removed ${VarRoot}/lib/centreon/metrics/${m}.rrd 20s @@ -74,28 +74,28 @@ BRRDCDDIDDB1 Broker Config Flush Log rrd 0 Create Metrics 3 - ${start}= Get Current Date + ${start} Get Current Date Sleep 1s Start Broker Start Engine - ${result}= Check Connections - Should Be True ${result} msg=Engine and Broker not connected + ${result} Check Connections + Should Be True ${result} Engine and Broker not connected log to console STEP1 - ${indexes}= Get Indexes To Delete 2 + ${indexes} Get Indexes To Delete 2 log to console STEP2 - ${metrics}= Get Metrics Matching Indexes ${indexes} + ${metrics} Get Metrics Matching Indexes ${indexes} log to console STEP3 Log To Console indexes ${indexes} to delete with their metrics - ${empty}= Create List + ${empty} Create List Remove Graphs from DB ${indexes} ${empty} Reload Broker - ${indexes_str}= Catenate SEPARATOR=, @{indexes} - ${content}= Create List indexes ${indexes_str} erased from database + ${indexes_str} Catenate SEPARATOR=, @{indexes} + ${content} Create List indexes ${indexes_str} erased from database - ${result}= Find In Log With Timeout ${centralLog} ${start} ${content} 30 - Should Be True ${result} msg=No log message telling about indexes ${indexes_str} deletion. + ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 30 + Should Be True ${result} No log message telling about indexes ${indexes_str} deletion. FOR ${i} IN @{indexes} log to console Wait for ${VarRoot}/lib/centreon/status/${i}.rrd to be deleted Wait Until Removed ${VarRoot}/lib/centreon/status/${i}.rrd 20s @@ -120,37 +120,37 @@ BRRDCDRBDB1 Broker Config Flush Log rrd 0 Create Metrics 3 - ${start}= Get Current Date + ${start} Get Current Date Start Broker Start Engine - ${result}= Check Connections - Should Be True ${result} msg=Engine and Broker not connected + ${result} Check Connections + Should Be True ${result} Engine and Broker not connected # We get 3 indexes to rebuild - ${index}= Get Indexes To Rebuild 3 + ${index} Get Indexes To Rebuild 3 Rebuild Rrd Graphs from DB ${index} Log To Console Indexes to rebuild: ${index} - ${metrics}= Get Metrics Matching Indexes ${index} + ${metrics} Get Metrics Matching Indexes ${index} Log To Console Metrics to rebuild: ${metrics} Reload Broker - ${content1}= Create List RRD: Starting to rebuild metrics - ${result}= Find In Log With Timeout ${rrdLog} ${start} ${content1} 45 - Should Be True ${result} msg=RRD cbd did not receive metrics to rebuild START + ${content1} Create List RRD: Starting to rebuild metrics + ${result} Find In Log With Timeout ${rrdLog} ${start} ${content1} 45 + Should Be True ${result} RRD cbd did not receive metrics to rebuild START - ${content1}= Create List RRD: Rebuilding metric - ${result}= Find In Log With Timeout ${rrdLog} ${start} ${content1} 45 - Should Be True ${result} msg=RRD cbd did not receive metrics to rebuild DATA + ${content1} Create List RRD: Rebuilding metric + ${result} Find In Log With Timeout ${rrdLog} ${start} ${content1} 45 + Should Be True ${result} RRD cbd did not receive metrics to rebuild DATA - ${content1}= Create List RRD: Finishing to rebuild metrics - ${result}= Find In Log With Timeout ${rrdLog} ${start} ${content1} 500 - Should Be True ${result} msg=RRD cbd did not receive metrics to rebuild END + ${content1} Create List RRD: Finishing to rebuild metrics + ${result} Find In Log With Timeout ${rrdLog} ${start} ${content1} 500 + Should Be True ${result} RRD cbd did not receive metrics to rebuild END FOR ${m} IN @{metrics} - ${value}= Evaluate ${m} / 2 - ${result}= Compare RRD Average Value ${m} ${value} + ${value} Evaluate ${m} / 2 + ${result} Compare RRD Average Value ${m} ${value} Should Be True ... ${result} - ... msg=Data before RRD rebuild contain alternatively the metric ID and 0. The expected average is metric_id / 2. + ... Data before RRD rebuild contain alternatively the metric ID and 0. The expected average is metric_id / 2. END BRRDCDRBUDB1 @@ -171,34 +171,34 @@ BRRDCDRBUDB1 Broker Config Add Item central bbdo_version 3.0.1 Create Metrics 3 - ${start}= Get Current Date exclude_millis=True + ${start} Get Current Date exclude_millis=True Start Broker Start Engine - ${result}= Check Connections - Should Be True ${result} msg=Engine and Broker not connected + ${result} Check Connections + Should Be True ${result} Engine and Broker not connected # We get 3 indexes to rebuild - ${index}= Get Indexes To Rebuild 3 + ${index} Get Indexes To Rebuild 3 Rebuild Rrd Graphs from DB ${index} Reload Broker Log To Console Indexes to rebuild: ${index} - ${metrics}= Get Metrics Matching Indexes ${index} + ${metrics} Get Metrics Matching Indexes ${index} - ${content1}= Create List RRD: Starting to rebuild metrics - ${result}= Find In Log With Timeout ${rrdLog} ${start} ${content1} 30 - Should Be True ${result} msg=RRD cbd did not receive metrics to rebuild START + ${content1} Create List RRD: Starting to rebuild metrics + ${result} Find In Log With Timeout ${rrdLog} ${start} ${content1} 30 + Should Be True ${result} RRD cbd did not receive metrics to rebuild START - ${content1}= Create List RRD: Rebuilding metric - ${result}= Find In Log With Timeout ${rrdLog} ${start} ${content1} 30 - Should Be True ${result} msg=RRD cbd did not receive metrics to rebuild DATA + ${content1} Create List RRD: Rebuilding metric + ${result} Find In Log With Timeout ${rrdLog} ${start} ${content1} 30 + Should Be True ${result} RRD cbd did not receive metrics to rebuild DATA - ${content1}= Create List RRD: Finishing to rebuild metrics - ${result}= Find In Log With Timeout ${rrdLog} ${start} ${content1} 500 - Should Be True ${result} msg=RRD cbd did not receive metrics to rebuild END + ${content1} Create List RRD: Finishing to rebuild metrics + ${result} Find In Log With Timeout ${rrdLog} ${start} ${content1} 500 + Should Be True ${result} RRD cbd did not receive metrics to rebuild END FOR ${m} IN @{metrics} - ${value}= Evaluate ${m} / 2 - ${result}= Compare RRD Average Value ${m} ${value} + ${value} Evaluate ${m} / 2 + ${result} Compare RRD Average Value ${m} ${value} Should Be True ... ${result} - ... msg=Data before RRD rebuild contain alternatively the metric ID and 0. The expected average is metric_id / 2. + ... Data before RRD rebuild contain alternatively the metric ID and 0. The expected average is metric_id / 2. END diff --git a/tests/broker-engine/rrdcached.robot b/tests/broker-engine/rrdcached.robot index 0c7a12a19d4..aac2cf27d57 100644 --- a/tests/broker-engine/rrdcached.robot +++ b/tests/broker-engine/rrdcached.robot @@ -36,7 +36,7 @@ BRRDCDDM1 Start Broker Start Engine ${result} Check Connections - Should Be True ${result} msg=Engine and Broker not connected + Should Be True ${result} Engine and Broker not connected # We choose 3 metrics to remove. ${metrics} Get Metrics To Delete 3 @@ -48,7 +48,7 @@ BRRDCDDM1 ${content} Create List metrics ${metrics_str} erased from database ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 30 - Should Be True ${result} msg=No log message telling about metrics ${metrics_str} deletion. + Should Be True ${result} No log message telling about metrics ${metrics_str} deletion. FOR ${m} IN @{metrics} Log to Console Waiting for ${VarRoot}/lib/centreon/metrics/${m}.rrd to be deleted Wait Until Removed ${VarRoot}/lib/centreon/metrics/${m}.rrd 20s @@ -72,7 +72,7 @@ BRRDCDDID1 Start Broker Start Engine ${result} Check Connections - Should Be True ${result} msg=Engine and Broker not connected + Should Be True ${result} Engine and Broker not connected ${indexes} Get Indexes To Delete 2 ${metrics} Get Metrics Matching Indexes ${indexes} @@ -84,7 +84,7 @@ BRRDCDDID1 ${content} Create List indexes ${indexes_str} erased from database ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 30 - Should Be True ${result} msg=No log message telling about indexes ${indexes_str} deletion. + Should Be True ${result} No log message telling about indexes ${indexes_str} deletion. FOR ${i} IN @{indexes} log to console Wait for ${VarRoot}/lib/centreon/status/${i}.rrd to be deleted Wait Until Removed ${VarRoot}/lib/centreon/status/${i}.rrd 20s @@ -112,7 +112,7 @@ BRRDCDDMID1 Start Broker Start Engine ${result} Check Connections - Should Be True ${result} msg=Engine and Broker not connected + Should Be True ${result} Engine and Broker not connected ${indexes} Get Not Existing Indexes 2 ${metrics} Get Not Existing Metrics 2 @@ -123,7 +123,7 @@ BRRDCDDMID1 ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 30 Should Be True ... ${result} - ... msg=A message telling indexes nor metrics appear in the storage database should appear. + ... A message telling indexes nor metrics appear in the storage database should appear. BRRDCDDMU1 [Documentation] RRD metric deletion on table metric with unified sql output with rrdcached @@ -145,7 +145,7 @@ BRRDCDDMU1 Start Broker Start Engine ${result} Check Connections - Should Be True ${result} msg=Engine and Broker not connected + Should Be True ${result} Engine and Broker not connected # We choose 3 metrics to remove. ${metrics} Get Metrics To Delete 3 @@ -157,7 +157,7 @@ BRRDCDDMU1 ${content} Create List metrics ${metrics_str} erased from database ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 50 - Should Be True ${result} msg=No log message telling about metrics ${metrics_str} deletion. + Should Be True ${result} No log message telling about metrics ${metrics_str} deletion. FOR ${m} IN @{metrics} Wait Until Removed ${VarRoot}/lib/centreon/metrics/${m}.rrd 20s END @@ -182,7 +182,7 @@ BRRDCDDIDU1 Start Broker Start Engine ${result} Check Connections - Should Be True ${result} msg=Engine and Broker not connected + Should Be True ${result} Engine and Broker not connected ${indexes} Get Indexes To Delete 2 ${metrics} Get Metrics Matching Indexes ${indexes} @@ -194,7 +194,7 @@ BRRDCDDIDU1 ${content} Create List indexes ${indexes_str} erased from database ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 30 - Should Be True ${result} msg=No log message telling about indexes ${indexes_str} deletion. + Should Be True ${result} No log message telling about indexes ${indexes_str} deletion. FOR ${i} IN @{indexes} Wait Until Removed ${VarRoot}/lib/centreon/status/${i}.rrd 20s END @@ -221,7 +221,7 @@ BRRDCDDMIDU1 Start Broker Start Engine ${result} Check Connections - Should Be True ${result} msg=Engine and Broker not connected + Should Be True ${result} Engine and Broker not connected ${indexes} Get Not Existing Indexes 2 ${metrics} Get Not Existing Metrics 2 @@ -232,7 +232,7 @@ BRRDCDDMIDU1 ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 30 Should Be True ... ${result} - ... msg=A message telling indexes nor metrics appear in the storage database should appear. + ... A message telling indexes nor metrics appear in the storage database should appear. BRRDCDRB1 [Documentation] RRD metric rebuild with gRPC API. 3 indexes are selected then a message to rebuild them is sent. This is done with storage/sql sql output and rrdcached. @@ -252,7 +252,7 @@ BRRDCDRB1 Start Broker Start Engine ${result} Check Connections - Should Be True ${result} msg=Engine and Broker not connected + Should Be True ${result} Engine and Broker not connected # We get 3 indexes to rebuild ${index} Get Indexes To Rebuild 3 @@ -262,25 +262,25 @@ BRRDCDRB1 Log To Console Metrics to rebuild: ${metrics} ${content} Create List Metric rebuild: metric is sent to rebuild ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 30 - Should Be True ${result} msg=Central did not send metrics to rebuild + Should Be True ${result} Central did not send metrics to rebuild ${content1} Create List RRD: Starting to rebuild metrics ${result} Find In Log With Timeout ${rrdLog} ${start} ${content1} 45 - Should Be True ${result} msg=RRD cbd did not receive metrics to rebuild START + Should Be True ${result} RRD cbd did not receive metrics to rebuild START ${content1} Create List RRD: Rebuilding metric ${result} Find In Log With Timeout ${rrdLog} ${start} ${content1} 45 - Should Be True ${result} msg=RRD cbd did not receive metrics to rebuild DATA + Should Be True ${result} RRD cbd did not receive metrics to rebuild DATA ${content1} Create List RRD: Finishing to rebuild metrics ${result} Find In Log With Timeout ${rrdLog} ${start} ${content1} 500 - Should Be True ${result} msg=RRD cbd did not receive metrics to rebuild END + Should Be True ${result} RRD cbd did not receive metrics to rebuild END FOR ${m} IN @{metrics} ${value} Evaluate ${m} / 2 ${result} Compare RRD Average Value ${m} ${value} Should Be True ... ${result} - ... msg=Data before RRD rebuild contain alternatively the metric ID and 0. The expected average is metric_id / 2. + ... Data before RRD rebuild contain alternatively the metric ID and 0. The expected average is metric_id / 2. END FOR ${index_id} IN @{index} @@ -288,7 +288,7 @@ BRRDCDRB1 ${result} Compare RRD Status Average Value ${index_id} ${value} Should Be True ... ${result} - ... msg=Data before RRD rebuild contain index_id % 3. The expected average is 100 if modulo==0, 75 if modulo==1, 50 if modulo==2 . + ... Data before RRD rebuild contain index_id % 3. The expected average is 100 if modulo==0, 75 if modulo==1, 50 if modulo==2 . END BRRDCDRBU1 @@ -312,7 +312,7 @@ BRRDCDRBU1 Start Broker Start Engine ${result} Check Connections - Should Be True ${result} msg=Engine and Broker not connected + Should Be True ${result} Engine and Broker not connected # We get 3 indexes to rebuild ${index} Get Indexes To Rebuild 3 @@ -322,25 +322,25 @@ BRRDCDRBU1 Log To Console Metrics to rebuild: ${metrics} ${content} Create List Metric rebuild: metric is sent to rebuild ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 30 - Should Be True ${result} msg=Central did not send metrics to rebuild + Should Be True ${result} Central did not send metrics to rebuild ${content1} Create List RRD: Starting to rebuild metrics ${result} Find In Log With Timeout ${rrdLog} ${start} ${content1} 45 - Should Be True ${result} msg=RRD cbd did not receive metrics to rebuild START + Should Be True ${result} RRD cbd did not receive metrics to rebuild START ${content1} Create List RRD: Rebuilding metric ${result} Find In Log With Timeout ${rrdLog} ${start} ${content1} 45 - Should Be True ${result} msg=RRD cbd did not receive metrics to rebuild DATA + Should Be True ${result} RRD cbd did not receive metrics to rebuild DATA ${content1} Create List RRD: Finishing to rebuild metrics ${result} Find In Log With Timeout ${rrdLog} ${start} ${content1} 500 - Should Be True ${result} msg=RRD cbd did not receive metrics to rebuild END + Should Be True ${result} RRD cbd did not receive metrics to rebuild END FOR ${m} IN @{metrics} ${value} Evaluate ${m} / 2 ${result} Compare RRD Average Value ${m} ${value} Should Be True ... ${result} - ... msg=Data before RRD rebuild contain alternatively the metric ID and 0. The expected average is metric_id / 2. + ... Data before RRD rebuild contain alternatively the metric ID and 0. The expected average is metric_id / 2. END FOR ${index_id} IN @{index} @@ -348,5 +348,5 @@ BRRDCDRBU1 ${result} Compare RRD Status Average Value ${index_id} ${value} Should Be True ... ${result} - ... msg=Data before RRD rebuild contain index_id % 3. The expected average is 100 if modulo==0, 75 if modulo==1, 50 if modulo==2 . + ... Data before RRD rebuild contain index_id % 3. The expected average is 100 if modulo==0, 75 if modulo==1, 50 if modulo==2 . END diff --git a/tests/broker-engine/servicegroups.robot b/tests/broker-engine/servicegroups.robot index fa348def7cd..15ff55c74a7 100644 --- a/tests/broker-engine/servicegroups.robot +++ b/tests/broker-engine/servicegroups.robot @@ -30,7 +30,7 @@ EBNSG1 Broker Config Output Set central central-broker-master-perfdata connections_count 5 Clear Retention - ${start}= Get Current Date + ${start} Get Current Date Start Broker Start Engine Add service Group ${0} ${1} ["host_1","service_1", "host_1","service_2","host_1", "service_3"] @@ -40,13 +40,13 @@ EBNSG1 Reload Broker Reload Engine - ${content}= Create List + ${content} Create List ... enabling membership of service (1, 3) to service group 1 on instance 1 ... enabling membership of service (1, 2) to service group 1 on instance 1 ... enabling membership of service (1, 1) to service group 1 on instance 1 - ${result}= Find In Log With Timeout ${centralLog} ${start} ${content} 45 - Should Be True ${result} msg=One of the new service groups not found in logs. + ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 45 + Should Be True ${result} One of the new service groups not found in logs. EBNSGU1 [Documentation] New service group with several pollers and connections to DB with broker configured with unified_sql @@ -61,7 +61,7 @@ EBNSGU1 Broker Config Output Set central central-broker-unified-sql connections_count 5 Clear Retention - ${start}= Get Current Date + ${start} Get Current Date Start Broker Start Engine Add service Group ${0} ${1} ["host_1","service_1", "host_1","service_2","host_1", "service_3"] @@ -71,13 +71,13 @@ EBNSGU1 Reload Broker Reload Engine - ${content}= Create List + ${content} Create List ... enabling membership of service (1, 3) to service group 1 on instance 1 ... enabling membership of service (1, 2) to service group 1 on instance 1 ... enabling membership of service (1, 1) to service group 1 on instance 1 - ${result}= Find In Log With Timeout ${centralLog} ${start} ${content} 45 - Should Be True ${result} msg=One of the new service groups not found in logs. + ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 45 + Should Be True ${result} One of the new service groups not found in logs. EBNSGU2 [Documentation] New service group with several pollers and connections to DB with broker configured with unified_sql @@ -114,14 +114,14 @@ EBNSGU2 Reload Engine Sleep 3s - ${result}= Check Number of relations between servicegroup and services 1 12 30 - Should Be True ${result} msg=We should get 12 relations between the servicegroup 1 and services. + ${result} Check Number of relations between servicegroup and services 1 12 30 + Should Be True ${result} We should get 12 relations between the servicegroup 1 and services. Config Engine Remove Cfg File ${0} servicegroups.cfg Reload Broker Reload Engine - ${result}= Check Number of relations between servicegroup and services 1 9 30 - Should Be True ${result} msg=We should get 9 relations between the servicegroup 1 and services. + ${result} Check Number of relations between servicegroup and services 1 9 30 + Should Be True ${result} We should get 9 relations between the servicegroup 1 and services. *** Keywords *** Test End diff --git a/tests/broker-engine/services-with-notes-and-actions.robot b/tests/broker-engine/services-with-notes-and-actions.robot index 5fbab5c7edc..48dc53c5507 100644 --- a/tests/broker-engine/services-with-notes-and-actions.robot +++ b/tests/broker-engine/services-with-notes-and-actions.robot @@ -31,7 +31,7 @@ EBSNU1 Broker Config Log central sql debug Broker Config Log central bbdo debug Config Broker Sql Output central unified_sql - ${nu}= Evaluate 2000*"X" + ${nu} Evaluate 2000*"X" Engine Config set value in services 0 service_1 notes_url ${nu} Clear Retention Start Broker @@ -39,13 +39,13 @@ EBSNU1 Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} FOR ${index} IN RANGE 60 - ${output}= Query SELECT notes_url FROM services WHERE description='service_1' + ${output} Query SELECT notes_url FROM services WHERE description='service_1' Sleep 1s IF "${output}" == "(('${nu}',),)" BREAK END Should Be Equal As Strings ${output} (('${nu}',),) FOR ${index} IN RANGE 60 - ${output}= Query SELECT notes_url FROM resources WHERE name='service_1' + ${output} Query SELECT notes_url FROM resources WHERE name='service_1' Sleep 1s IF "${output}" == "(('${nu}',),)" BREAK END @@ -66,7 +66,7 @@ EBSAU2 Broker Config Log central sql debug Broker Config Log central bbdo debug Config Broker Sql Output central unified_sql - ${au}= Evaluate 2000*"Y" + ${au} Evaluate 2000*"Y" Engine Config set value in services 0 service_2 action_url ${au} Clear Retention Start Broker @@ -74,13 +74,13 @@ EBSAU2 Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} FOR ${index} IN RANGE 60 - ${output}= Query SELECT action_url FROM services WHERE description='service_2' + ${output} Query SELECT action_url FROM services WHERE description='service_2' Sleep 1s IF "${output}" == "(('${au}',),)" BREAK END Should Be Equal As Strings ${output} (('${au}',),) FOR ${index} IN RANGE 60 - ${output}= Query SELECT action_url FROM resources WHERE name='service_2' + ${output} Query SELECT action_url FROM resources WHERE name='service_2' Sleep 1s IF "${output}" == "(('${au}',),)" BREAK END @@ -101,7 +101,7 @@ EBSN3 Broker Config Log central sql debug Broker Config Log central bbdo debug Config Broker Sql Output central unified_sql - ${n}= Evaluate 500*"Z" + ${n} Evaluate 500*"Z" Engine Config set value in services 0 service_3 notes ${n} Clear Retention Start Broker @@ -109,13 +109,13 @@ EBSN3 Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} FOR ${index} IN RANGE 60 - ${output}= Query SELECT notes FROM services WHERE description='service_3' + ${output} Query SELECT notes FROM services WHERE description='service_3' Sleep 1s IF "${output}" == "(('${n}',),)" BREAK END Should Be Equal As Strings ${output} (('${n}',),) FOR ${index} IN RANGE 60 - ${output}= Query SELECT notes FROM resources WHERE name='service_3' + ${output} Query SELECT notes FROM resources WHERE name='service_3' Sleep 1s IF "${output}" == "(('${n}',),)" BREAK END diff --git a/tests/broker-engine/services.robot b/tests/broker-engine/services.robot index 46b0698389d..ecd243428b7 100644 --- a/tests/broker-engine/services.robot +++ b/tests/broker-engine/services.robot @@ -31,14 +31,14 @@ SDER Broker Config Log central sql debug Broker Config Log module0 neb trace Config Broker Sql Output central unified_sql - ${start}= Get Current Date + ${start} Get Current Date Start Broker Start Engine # Let's wait for the external command check start - ${content}= Create List check_for_external_commands() - ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 - Should Be True ${result} msg=A message telling check_for_external_commands() should be available. + ${content} Create List check_for_external_commands() + ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + Should Be True ${result} A message telling check_for_external_commands() should be available. Stop Engine @@ -55,7 +55,7 @@ SDER FOR ${index} IN RANGE 30 Log To Console SELECT check_attempt from services WHERE description='service_1' - ${output}= Query SELECT check_attempt from services WHERE description='service_1' + ${output} Query SELECT check_attempt from services WHERE description='service_1' Log To Console ${output} IF "${output}" == "((280,),)" BREAK Sleep 1s diff --git a/tests/broker-engine/tags.robot b/tests/broker-engine/tags.robot index 4707a4d03b7..009b1bbfc5d 100644 --- a/tests/broker-engine/tags.robot +++ b/tests/broker-engine/tags.robot @@ -30,18 +30,18 @@ BETAG1 Broker Config Log central sql debug Clear Retention Start Broker - ${start}= Get Current Date + ${start} Get Current Date Start Engine # Let's wait for the external command check start - ${content}= Create List check_for_external_commands() - ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 - Should Be True ${result} msg=A message telling check_for_external_commands() should be available. - - ${result}= check tag With Timeout tag20 3 30 - Should Be True ${result} msg=tag20 should be of type 3 - ${result}= check tag With Timeout tag1 0 30 - Should Be True ${result} msg=tag1 should be of type 0 + ${content} Create List check_for_external_commands() + ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + Should Be True ${result} A message telling check_for_external_commands() should be available. + + ${result} check tag With Timeout tag20 3 30 + Should Be True ${result} tag20 should be of type 3 + ${result} check tag With Timeout tag1 0 30 + Should Be True ${result} tag1 should be of type 0 Stop Engine Kindly Stop Broker @@ -58,19 +58,19 @@ BETAG2 Broker Config Log central sql debug Clear Retention Sleep 1s - ${start}= Get Current Date + ${start} Get Current Date Start Engine Start Broker # Let's wait for the external command check start - ${content}= Create List check_for_external_commands() - ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 - Should Be True ${result} msg=A message telling check_for_external_commands() should be available. - - ${result}= check tag With Timeout tag20 3 30 - Should Be True ${result} msg=tag20 should be of type 3 - ${result}= check tag With Timeout tag1 0 30 - Should Be True ${result} msg=tag1 should be of type 0 + ${content} Create List check_for_external_commands() + ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + Should Be True ${result} A message telling check_for_external_commands() should be available. + + ${result} check tag With Timeout tag20 3 30 + Should Be True ${result} tag20 should be of type 3 + ${result} check tag With Timeout tag1 0 30 + Should Be True ${result} tag1 should be of type 0 Stop Engine Kindly Stop Broker @@ -91,18 +91,18 @@ BEUTAG1 Broker Config Log central sql debug Clear Retention Start Broker - ${start}= Get Current Date + ${start} Get Current Date Start Engine # Let's wait for the external command check start - ${content}= Create List check_for_external_commands() - ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 - Should Be True ${result} msg=A message telling check_for_external_commands() should be available. - - ${result}= check tag With Timeout tag20 3 30 - Should Be True ${result} msg=tag20 should be of type 3 - ${result}= check tag With Timeout tag1 0 30 - Should Be True ${result} msg=tag1 should be of type 0 + ${content} Create List check_for_external_commands() + ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + Should Be True ${result} A message telling check_for_external_commands() should be available. + + ${result} check tag With Timeout tag20 3 30 + Should Be True ${result} tag20 should be of type 3 + ${result} check tag With Timeout tag1 0 30 + Should Be True ${result} tag1 should be of type 0 Stop Engine Kindly Stop Broker @@ -127,29 +127,29 @@ BEUTAG2 Broker Config Log central sql error Clear Retention Start Broker - ${start}= Get Current Date + ${start} Get Current Date Start Engine # Let's wait for the external command check start - ${content}= Create List check_for_external_commands() - ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 - Should Be True ${result} msg=A message telling check_for_external_commands() should be available. + ${content} Create List check_for_external_commands() + ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + Should Be True ${result} A message telling check_for_external_commands() should be available. - ${svc}= Create Service ${0} 1 1 + ${svc} Create Service ${0} 1 1 Add Tags To Services ${0} group_tags 4 [${svc}] Stop Engine - ${start}= Get Current Date + ${start} Get Current Date Start Engine Reload Broker # Let's wait for the external command check start - ${content}= Create List check_for_external_commands() - ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 - Should Be True ${result} msg=A message telling check_for_external_commands() should be available. + ${content} Create List check_for_external_commands() + ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + Should Be True ${result} A message telling check_for_external_commands() should be available. - ${result}= check resources tags With Timeout 1 ${svc} servicegroup [4] 60 - Should Be True ${result} msg=New service should have a service group tag of id 4. + ${result} check resources tags With Timeout 1 ${svc} servicegroup [4] 60 + Should Be True ${result} New service should have a service group tag of id 4. Stop Engine Kindly Stop Broker @@ -170,19 +170,19 @@ BEUTAG3 Broker Config Log central sql debug Clear Retention Sleep 1s - ${start}= Get Current Date + ${start} Get Current Date Start Engine Start Broker # Let's wait for the external command check start - ${content}= Create List check_for_external_commands() - ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 - Should Be True ${result} msg=A message telling check_for_external_commands() should be available. - - ${result}= check tag With Timeout tag20 3 30 - Should Be True ${result} msg=tag20 should be of type 3 - ${result}= check tag With Timeout tag1 0 30 - Should Be True ${result} msg=tag1 should be of type 0 + ${content} Create List check_for_external_commands() + ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + Should Be True ${result} A message telling check_for_external_commands() should be available. + + ${result} check tag With Timeout tag20 3 30 + Should Be True ${result} tag20 should be of type 3 + ${result} check tag With Timeout tag1 0 30 + Should Be True ${result} tag1 should be of type 0 Stop Engine Kindly Stop Broker @@ -205,24 +205,24 @@ BEUTAG4 Broker Config Log module0 neb debug Broker Config Log central sql debug Clear Retention - ${start}= Get Current Date + ${start} Get Current Date Start Engine Sleep 1s Start Broker # Let's wait for the external command check start - ${content}= Create List check_for_external_commands() - ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 - Should Be True ${result} msg=A message telling check_for_external_commands() should be available. - - ${result}= check resources tags With Timeout 1 1 servicegroup [4, 5] 60 - Should Be True ${result} msg=Service (1, 1) should have servicegroup tag ids 4 and 5 - ${result}= check resources tags With Timeout 1 3 servicegroup [4, 5] 60 - Should Be True ${result} msg=Service (1, 3) should have servicegroup tag ids 4, 5 - ${result}= check resources tags With Timeout 1 3 servicecategory [2, 4] 60 - Should Be True ${result} msg=Service (1, 3) should have servicecategory tag ids 2, 4 - ${result}= check resources tags With Timeout 1 5 servicecategory [2, 4] 60 - Should Be True ${result} msg=Service (1, 5) should have servicecategory tag ids 2, 4 + ${content} Create List check_for_external_commands() + ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + Should Be True ${result} A message telling check_for_external_commands() should be available. + + ${result} check resources tags With Timeout 1 1 servicegroup [4, 5] 60 + Should Be True ${result} Service (1, 1) should have servicegroup tag ids 4 and 5 + ${result} check resources tags With Timeout 1 3 servicegroup [4, 5] 60 + Should Be True ${result} Service (1, 3) should have servicegroup tag ids 4, 5 + ${result} check resources tags With Timeout 1 3 servicecategory [2, 4] 60 + Should Be True ${result} Service (1, 3) should have servicecategory tag ids 2, 4 + ${result} check resources tags With Timeout 1 5 servicecategory [2, 4] 60 + Should Be True ${result} Service (1, 5) should have servicecategory tag ids 2, 4 Stop Engine Kindly Stop Broker @@ -246,23 +246,23 @@ BEUTAG5 Broker Config Log central sql debug Clear Retention Sleep 1s - ${start}= Get Current Date + ${start} Get Current Date Start Engine Start Broker # Let's wait for the external command check start - ${content}= Create List check_for_external_commands() - ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 - Should Be True ${result} msg=A message telling check_for_external_commands() should be available. - - ${result}= check resources tags With Timeout 0 1 hostgroup [2,3] 60 - Should Be True ${result} msg=Host 1 should have hostgroup tags 2 and 3 - ${result}= check resources tags With Timeout 0 2 hostgroup [2,3] 60 - Should Be True ${result} msg=Host 2 should have hostgroup tags 2 and 3 - ${result}= check resources tags With Timeout 0 2 hostcategory [2, 3] 60 - Should Be True ${result} msg=Host 2 should have hostcategory tags 2 and 3 - ${result}= check resources tags With Timeout 0 3 hostcategory [2, 3] 60 - Should Be True ${result} msg=Host 3 should have hostcategory tags 2 and 3 + ${content} Create List check_for_external_commands() + ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + Should Be True ${result} A message telling check_for_external_commands() should be available. + + ${result} check resources tags With Timeout 0 1 hostgroup [2,3] 60 + Should Be True ${result} Host 1 should have hostgroup tags 2 and 3 + ${result} check resources tags With Timeout 0 2 hostgroup [2,3] 60 + Should Be True ${result} Host 2 should have hostgroup tags 2 and 3 + ${result} check resources tags With Timeout 0 2 hostcategory [2, 3] 60 + Should Be True ${result} Host 2 should have hostcategory tags 2 and 3 + ${result} check resources tags With Timeout 0 3 hostcategory [2, 3] 60 + Should Be True ${result} Host 3 should have hostcategory tags 2 and 3 Stop Engine Kindly Stop Broker @@ -288,23 +288,23 @@ BEUTAG6 Broker Config Log central sql debug Clear Retention Sleep 1s - ${start}= Get Current Date + ${start} Get Current Date Start Engine Start Broker # Let's wait for the external command check start - ${content}= Create List check_for_external_commands() - ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 - Should Be True ${result} msg=A message telling check_for_external_commands() should be available. - - ${result}= check resources tags With Timeout 0 1 hostgroup [2,4] 60 - Should Be True ${result} msg=Host 1 should have hostgroup tag_id 2 and 4 - ${result}= check resources tags With Timeout 0 1 hostcategory [1,5] 60 - Should Be True ${result} msg=Host 1 should have hostcategory tag_id 1 and 5 - ${result}= check resources tags With Timeout 1 1 servicegroup [2,4] 60 - Should Be True ${result} msg=Service (1, 1) should have servicegroup tag_id 2 and 4. - ${result}= check resources tags With Timeout 1 1 servicecategory [3,5] 60 - Should Be True ${result} msg=Service (1, 1) should have servicecategory tag_id 3 and 5. + ${content} Create List check_for_external_commands() + ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + Should Be True ${result} A message telling check_for_external_commands() should be available. + + ${result} check resources tags With Timeout 0 1 hostgroup [2,4] 60 + Should Be True ${result} Host 1 should have hostgroup tag_id 2 and 4 + ${result} check resources tags With Timeout 0 1 hostcategory [1,5] 60 + Should Be True ${result} Host 1 should have hostcategory tag_id 1 and 5 + ${result} check resources tags With Timeout 1 1 servicegroup [2,4] 60 + Should Be True ${result} Service (1, 1) should have servicegroup tag_id 2 and 4. + ${result} check resources tags With Timeout 1 1 servicecategory [3,5] 60 + Should Be True ${result} Service (1, 1) should have servicecategory tag_id 3 and 5. Stop Engine Kindly Stop Broker @@ -334,23 +334,23 @@ BEUTAG7 Broker Config Log module1 neb debug Broker Config Log central sql trace Clear Retention - ${start}= Get Current Date + ${start} Get Current Date Start Engine Start Broker # Let's wait for the external command check start - ${content}= Create List check_for_external_commands() - ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 - Should Be True ${result} msg=A message telling check_for_external_commands() should be available. + ${content} Create List check_for_external_commands() + ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + Should Be True ${result} A message telling check_for_external_commands() should be available. # We need to wait a little before reloading Engine - ${result}= check resources tags With Timeout 1 1 servicegroup [2,4] 60 - Should Be True ${result} msg=First step: Service (1, 1) should have servicegroup tags 2 and 4 + ${result} check resources tags With Timeout 1 1 servicegroup [2,4] 60 + Should Be True ${result} First step: Service (1, 1) should have servicegroup tags 2 and 4 - ${result}= check resources tags With Timeout 26 502 servicecategory [2,4] 60 - Should Be True ${result} msg=First step: Service (26, 502) should have servicecategory tags 13, 9, 3 and 11. - ${result}= check resources tags With Timeout 26 502 servicegroup [3,5] 60 - Should Be True ${result} msg=First step: Service (26, 502) should have servicegroup tags 3 and 5. + ${result} check resources tags With Timeout 26 502 servicecategory [2,4] 60 + Should Be True ${result} First step: Service (26, 502) should have servicecategory tags 13, 9, 3 and 11. + ${result} check resources tags With Timeout 26 502 servicegroup [3,5] 60 + Should Be True ${result} First step: Service (26, 502) should have servicegroup tags 3 and 5. Remove Tags From Services ${0} group_tags Remove Tags From Services ${0} category_tags @@ -362,11 +362,11 @@ BEUTAG7 Reload Engine Reload Broker Sleep 3s - ${result}= check resources tags With Timeout 26 507 servicegroup [3,5] 60 - Should Be True ${result} msg=Second step: Service (26, 507) should have servicegroup tags 3 and 5 + ${result} check resources tags With Timeout 26 507 servicegroup [3,5] 60 + Should Be True ${result} Second step: Service (26, 507) should have servicegroup tags 3 and 5 - ${result}= check resources tags With Timeout 26 508 servicegroup [3,5] 60 - Should Be True ${result} msg=Second step: Service (26, 508) should have servicegroup tags 3 and 5 + ${result} check resources tags With Timeout 26 508 servicegroup [3,5] 60 + Should Be True ${result} Second step: Service (26, 508) should have servicegroup tags 3 and 5 Stop Engine Kindly Stop Broker @@ -406,29 +406,29 @@ BEUTAG8 Broker Config Log module1 neb debug Broker Config Log central sql trace Clear Retention - ${start}= Get Current Date + ${start} Get Current Date Start Engine Start Broker # Let's wait for the external command check start - ${content}= Create List check_for_external_commands() - ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 - Should Be True ${result} msg=A message telling check_for_external_commands() should be available. + ${content} Create List check_for_external_commands() + ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + Should Be True ${result} A message telling check_for_external_commands() should be available. # We need to wait a little before reloading Engine - ${result}= check resources tags With Timeout 1 2 servicecategory [3,5] 60 - Should Be True ${result} msg=First step: Service (1, 2) should have servicecategory tags 3 and 5. - ${result}= check resources tags With Timeout 1 2 servicegroup [1] 60 - Should Be True ${result} msg=First step: Service (1, 2) should have servicegroup tag 1. + ${result} check resources tags With Timeout 1 2 servicecategory [3,5] 60 + Should Be True ${result} First step: Service (1, 2) should have servicecategory tags 3 and 5. + ${result} check resources tags With Timeout 1 2 servicegroup [1] 60 + Should Be True ${result} First step: Service (1, 2) should have servicegroup tag 1. - ${result}= check resources tags With Timeout 1 5 servicegroup [9] 60 - Should Be True ${result} msg=First step: Service (1, 5) should have servicegroup tag 9 + ${result} check resources tags With Timeout 1 5 servicegroup [9] 60 + Should Be True ${result} First step: Service (1, 5) should have servicegroup tag 9 - ${result}= check resources tags With Timeout 26 502 servicegroup [1,4,5] 60 - Should Be True ${result} msg=First step: Service (26, 502) should have tags 1, 4 and 5 + ${result} check resources tags With Timeout 26 502 servicegroup [1,4,5] 60 + Should Be True ${result} First step: Service (26, 502) should have tags 1, 4 and 5 - ${result}= check resources tags With Timeout 26 503 servicegroup [7] 60 - Should Be True ${result} msg=First step: Service (26, 503) should have servicegroup tag 7 + ${result} check resources tags With Timeout 26 503 servicegroup [7] 60 + Should Be True ${result} First step: Service (26, 503) should have servicegroup tag 7 Stop Engine Kindly Stop Broker @@ -465,39 +465,39 @@ BEUTAG9 Broker Config Log central sql trace Clear Retention Sleep 1s - ${start}= Get Current Date + ${start} Get Current Date Start Engine Start Broker # Let's wait for the external command check start - ${content}= Create List check_for_external_commands() - ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 - Should Be True ${result} msg=A message telling check_for_external_commands() should be available. + ${content} Create List check_for_external_commands() + ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + Should Be True ${result} A message telling check_for_external_commands() should be available. # We need to wait a little before reloading Engine - ${result}= check resources tags With Timeout 0 9 hostgroup [2] 60 - Should Be True ${result} msg=First step: resource 9 should have hostgroup tag with id=2 + ${result} check resources tags With Timeout 0 9 hostgroup [2] 60 + Should Be True ${result} First step: resource 9 should have hostgroup tag with id=2 - ${result}= check resources tags With Timeout 0 10 hostgroup [2] 60 - Should Be True ${result} msg=First step: resource 10 should have hostgroup tag with id=2 + ${result} check resources tags With Timeout 0 10 hostgroup [2] 60 + Should Be True ${result} First step: resource 10 should have hostgroup tag with id=2 - ${result}= check resources tags With Timeout 0 11 hostgroup [6] 60 - Should Be True ${result} msg=First step: resource 11 should have hostgroup tag with id=6 + ${result} check resources tags With Timeout 0 11 hostgroup [6] 60 + Should Be True ${result} First step: resource 11 should have hostgroup tag with id=6 - ${result}= check resources tags With Timeout 0 12 hostgroup [6] 60 - Should Be True ${result} msg=First step: resource 12 should have hostgroup tag with id=6 + ${result} check resources tags With Timeout 0 12 hostgroup [6] 60 + Should Be True ${result} First step: resource 12 should have hostgroup tag with id=6 - ${result}= check resources tags With Timeout 0 30 hostgroup [8] 60 - Should Be True ${result} msg=First step: resource 30 should have hostgroup tag with id=10 + ${result} check resources tags With Timeout 0 30 hostgroup [8] 60 + Should Be True ${result} First step: resource 30 should have hostgroup tag with id=10 - ${result}= check resources tags With Timeout 0 31 hostgroup [8] 60 - Should Be True ${result} msg=First step: resource 31 should have hostgroup tag with id=10 + ${result} check resources tags With Timeout 0 31 hostgroup [8] 60 + Should Be True ${result} First step: resource 31 should have hostgroup tag with id=10 - ${result}= check resources tags With Timeout 0 32 hostgroup [9] 60 - Should Be True ${result} msg=First step: resource 32 should have hostgroup tag with id=14 + ${result} check resources tags With Timeout 0 32 hostgroup [9] 60 + Should Be True ${result} First step: resource 32 should have hostgroup tag with id=14 - ${result}= check resources tags With Timeout 0 33 hostgroup [9] 60 - Should Be True ${result} msg=First step: host 33 should have hostgroup tag with id=14 + ${result} check resources tags With Timeout 0 33 hostgroup [9] 60 + Should Be True ${result} First step: host 33 should have hostgroup tag with id=14 Stop Engine Kindly Stop Broker @@ -528,24 +528,24 @@ BEUTAG10 Broker Config Log module1 neb debug Broker Config Log central sql trace Clear Retention - ${start}= Get Current Date + ${start} Get Current Date Start Engine Start Broker # Let's wait for the external command check start - ${content}= Create List check_for_external_commands() - ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 - Should Be True ${result} msg=A message telling check_for_external_commands() should be available. + ${content} Create List check_for_external_commands() + ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + Should Be True ${result} A message telling check_for_external_commands() should be available. - ${result}= check resources tags With Timeout 1 4 servicegroup [2,4] 60 - Should Be True ${result} msg=First step: Service (1, 4) should have servicegroup tags 2 and 4 - ${result}= check resources tags With Timeout 1 3 servicecategory [3,5] 60 - Should Be True ${result} msg=First step: Service (1, 3) should have servicecategory tags 3 and 5 + ${result} check resources tags With Timeout 1 4 servicegroup [2,4] 60 + Should Be True ${result} First step: Service (1, 4) should have servicegroup tags 2 and 4 + ${result} check resources tags With Timeout 1 3 servicecategory [3,5] 60 + Should Be True ${result} First step: Service (1, 3) should have servicecategory tags 3 and 5 - ${result}= check resources tags With Timeout 26 504 servicegroup [3,5] 60 - Should Be True ${result} msg=First step: Service (26, 504) should have servicegroup tags 3 and 5. - ${result}= check resources tags With Timeout 26 503 servicecategory [2,4] 60 - Should Be True ${result} msg=First step: Service (26, 503) should have servicecategory tags 2 and 4. + ${result} check resources tags With Timeout 26 504 servicegroup [3,5] 60 + Should Be True ${result} First step: Service (26, 504) should have servicegroup tags 3 and 5. + ${result} check resources tags With Timeout 26 503 servicecategory [2,4] 60 + Should Be True ${result} First step: Service (26, 503) should have servicecategory tags 2 and 4. Remove Tags From Services ${0} group_tags Remove Tags From Services ${0} category_tags @@ -559,17 +559,17 @@ BEUTAG10 Add Tags To Services ${1} category_tags 2,4 [501, 502, 504] Reload Engine Reload Broker - ${result}= check resources tags With Timeout 1 4 servicegroup [2,4] 60 False - Should Be True ${result} msg=Second step: Service (1, 4) should not have servicegroup tags 2 and 4 + ${result} check resources tags With Timeout 1 4 servicegroup [2,4] 60 False + Should Be True ${result} Second step: Service (1, 4) should not have servicegroup tags 2 and 4 - ${result}= check resources tags With Timeout 1 3 servicecategory [3,5] 60 False - Should Be True ${result} msg=Second step: Service (1, 3) should not have servicecategory tags 3 and 5 + ${result} check resources tags With Timeout 1 3 servicecategory [3,5] 60 False + Should Be True ${result} Second step: Service (1, 3) should not have servicecategory tags 3 and 5 - ${result}= check resources tags With Timeout 26 504 servicegroup [3,5] 60 False - Should Be True ${result} msg=Second step: Service (26, 504) should not have servicegroup tags 3 and 5 + ${result} check resources tags With Timeout 26 504 servicegroup [3,5] 60 False + Should Be True ${result} Second step: Service (26, 504) should not have servicegroup tags 3 and 5 - ${result}= check resources tags With Timeout 26 503 servicecategory [3,5] 60 False - Should Be True ${result} msg=Second step: Service (26, 503) should not have servicecategory tags 3 and 5 + ${result} check resources tags With Timeout 26 503 servicecategory [3,5] 60 False + Should Be True ${result} Second step: Service (26, 503) should not have servicecategory tags 3 and 5 Stop Engine Kindly Stop Broker @@ -600,24 +600,24 @@ BEUTAG11 Broker Config Log module1 neb debug Broker Config Log central sql trace Clear Retention - ${start}= Get Current Date + ${start} Get Current Date Start Engine Start Broker # Let's wait for the external command check start - ${content}= Create List check_for_external_commands() - ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 - Should Be True ${result} msg=A message telling check_for_external_commands() should be available. + ${content} Create List check_for_external_commands() + ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + Should Be True ${result} A message telling check_for_external_commands() should be available. - ${result}= check resources tags With Timeout 1 4 servicegroup [2,4] 60 - Should Be True ${result} msg=First step: Service (1, 4) should have servicegroup tags 2 and 4 - ${result}= check resources tags With Timeout 1 3 servicecategory [3,5] 60 - Should Be True ${result} msg=First step: Service (1, 3) should have servicecategory tags 3 and 5 + ${result} check resources tags With Timeout 1 4 servicegroup [2,4] 60 + Should Be True ${result} First step: Service (1, 4) should have servicegroup tags 2 and 4 + ${result} check resources tags With Timeout 1 3 servicecategory [3,5] 60 + Should Be True ${result} First step: Service (1, 3) should have servicecategory tags 3 and 5 - ${result}= check resources tags With Timeout 26 504 servicegroup [3,5] 60 - Should Be True ${result} msg=First step: Service (26, 504) should have servicegroup tags 3 and 5. - ${result}= check resources tags With Timeout 26 503 servicecategory [2,4] 60 - Should Be True ${result} msg=First step: Service (26, 503) should have servicecategory tags 2 and 4. + ${result} check resources tags With Timeout 26 504 servicegroup [3,5] 60 + Should Be True ${result} First step: Service (26, 504) should have servicegroup tags 3 and 5. + ${result} check resources tags With Timeout 26 503 servicecategory [2,4] 60 + Should Be True ${result} First step: Service (26, 503) should have servicecategory tags 2 and 4. Remove Tags From Services ${0} group_tags Remove Tags From Services ${0} category_tags @@ -631,17 +631,17 @@ BEUTAG11 Add Tags To Services ${1} category_tags 2,4 [501, 502, 504] Reload Engine Reload Broker - ${result}= check resources tags With Timeout 1 4 servicegroup [2,4] 60 - Should Be True ${result} msg=Second step: Service (1, 4) should not have servicegroup tags 2 and 4 + ${result} check resources tags With Timeout 1 4 servicegroup [2,4] 60 + Should Be True ${result} Second step: Service (1, 4) should not have servicegroup tags 2 and 4 - ${result}= check resources tags With Timeout 1 3 servicecategory [5] 60 False - Should Be True ${result} msg=Second step: Service (1, 3) should not have servicecategory tags 5 + ${result} check resources tags With Timeout 1 3 servicecategory [5] 60 False + Should Be True ${result} Second step: Service (1, 3) should not have servicecategory tags 5 - ${result}= check resources tags With Timeout 26 504 servicegroup [3,5] 60 False - Should Be True ${result} msg=Second step: Service (26, 504) should not have servicegroup tags 3 and 5 + ${result} check resources tags With Timeout 26 504 servicegroup [3,5] 60 False + Should Be True ${result} Second step: Service (26, 504) should not have servicegroup tags 3 and 5 - ${result}= check resources tags With Timeout 26 503 servicecategory [3,5] 60 - Should Be True ${result} msg=Second step: Service (26, 503) should not have servicecategory tags 3 and 5 + ${result} check resources tags With Timeout 26 503 servicecategory [3,5] 60 + Should Be True ${result} Second step: Service (26, 503) should not have servicecategory tags 3 and 5 Stop Engine Kindly Stop Broker @@ -666,23 +666,23 @@ BEUTAG12 Broker Config Log central sql debug Clear Retention Sleep 1s - ${start}= Get Current Date + ${start} Get Current Date Start Engine Start Broker # Let's wait for the external command check start - ${content}= Create List check_for_external_commands() - ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 - Should Be True ${result} msg=A message telling check_for_external_commands() should be available. - - ${result}= check resources tags With Timeout 0 1 hostgroup [2,3] 60 - Should Be True ${result} msg=Host 1 should have hostgroup tags 2 and 3 - ${result}= check resources tags With Timeout 0 2 hostgroup [2,3] 60 - Should Be True ${result} msg=Host 2 should have hostgroup tags 2 and 3 - ${result}= check resources tags With Timeout 0 2 hostcategory [2, 3] 60 - Should Be True ${result} msg=Host 2 should have hostcategory tags 2 and 3 - ${result}= check resources tags With Timeout 0 3 hostcategory [2, 3] 60 - Should Be True ${result} msg=Host 3 should have hostcategory tags 2 and 3 + ${content} Create List check_for_external_commands() + ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + Should Be True ${result} A message telling check_for_external_commands() should be available. + + ${result} check resources tags With Timeout 0 1 hostgroup [2,3] 60 + Should Be True ${result} Host 1 should have hostgroup tags 2 and 3 + ${result} check resources tags With Timeout 0 2 hostgroup [2,3] 60 + Should Be True ${result} Host 2 should have hostgroup tags 2 and 3 + ${result} check resources tags With Timeout 0 2 hostcategory [2, 3] 60 + Should Be True ${result} Host 2 should have hostcategory tags 2 and 3 + ${result} check resources tags With Timeout 0 3 hostcategory [2, 3] 60 + Should Be True ${result} Host 3 should have hostcategory tags 2 and 3 Remove Tags From Hosts ${0} group_tags Remove Tags From Hosts ${0} category_tags @@ -692,16 +692,16 @@ BEUTAG12 Reload Engine Reload Broker - ${result}= check resources tags With Timeout 0 1 hostgroup [2,3] 60 False - Should Be True ${result} msg=Host 1 should not have hostgroup tags 2 nor 3 - ${result}= check resources tags With Timeout 0 2 hostgroup [2,3] 60 False - Should Be True ${result} msg=Host 2 should not have hostgroup tags 2 nor 3 - ${result}= check resources tags With Timeout 0 2 hostcategory [2,3] 60 False - Should Be True ${result} msg=Host 2 should not have hostgroup tags 2 nor 3 - ${result}= check resources tags With Timeout 0 3 hostcategory [2,3] 60 False - Should Be True ${result} msg=Host 3 should not have hostgroup tags 2 nor 3 - ${result}= check resources tags With Timeout 0 4 hostcategory [2,3] 60 False - Should Be True ${result} msg=Host 4 should not have hostgroup tags 2 nor 3 + ${result} check resources tags With Timeout 0 1 hostgroup [2,3] 60 False + Should Be True ${result} Host 1 should not have hostgroup tags 2 nor 3 + ${result} check resources tags With Timeout 0 2 hostgroup [2,3] 60 False + Should Be True ${result} Host 2 should not have hostgroup tags 2 nor 3 + ${result} check resources tags With Timeout 0 2 hostcategory [2,3] 60 False + Should Be True ${result} Host 2 should not have hostgroup tags 2 nor 3 + ${result} check resources tags With Timeout 0 3 hostcategory [2,3] 60 False + Should Be True ${result} Host 3 should not have hostgroup tags 2 nor 3 + ${result} check resources tags With Timeout 0 4 hostcategory [2,3] 60 False + Should Be True ${result} Host 4 should not have hostgroup tags 2 nor 3 Stop Engine Kindly Stop Broker diff --git a/tests/broker-engine/tls.robot b/tests/broker-engine/tls.robot index ff4b5ba129f..18586ff887c 100644 --- a/tests/broker-engine/tls.robot +++ b/tests/broker-engine/tls.robot @@ -37,15 +37,15 @@ BECT1 Broker Config Output set module0 central-module-master-output tls ${comp2} Broker Config Log central bbdo info Broker Config Log module0 bbdo info - ${start}= Get Current Date + ${start} Get Current Date Start Broker Start Engine - ${result}= Check Connections - Should Be True ${result} msg=Engine and Broker not connected + ${result} Check Connections + Should Be True ${result} Engine and Broker not connected Kindly Stop Broker Stop Engine - ${content1}= Create List we have extensions '${ext["${comp1}"]}' and peer has '${ext["${comp2}"]}' - ${content2}= Create List we have extensions '${ext["${comp2}"]}' and peer has '${ext["${comp1}"]}' + ${content1} Create List we have extensions '${ext["${comp1}"]}' and peer has '${ext["${comp2}"]}' + ${content2} Create List we have extensions '${ext["${comp2}"]}' and peer has '${ext["${comp1}"]}' IF "${comp1}" == "yes" and "${comp2}" == "no" Insert Into List ... ${content1} @@ -57,9 +57,9 @@ BECT1 ... ${-1} ... extension 'TLS' is set to 'yes' in the configuration but cannot be activated because of peer configuration END - ${result}= Find In Log ${centralLog} ${start} ${content1} + ${result} Find In Log ${centralLog} ${start} ${content1} Should Be True ${result} - ${result}= Find In Log ${moduleLog0} ${start} ${content2} + ${result} Find In Log ${moduleLog0} ${start} ${content2} Should Be True ${result} END END @@ -72,7 +72,7 @@ BECT2 Config Broker central Config Broker module - ${hostname}= Get Hostname + ${hostname} Get Hostname Create Key And Certificate ... localhost ... ${EtcRoot}/centreon-broker/server.key @@ -118,20 +118,20 @@ BECT2 Broker Config Log module0 bbdo info Broker Config Input set central central-broker-master-input tls yes Broker Config Output set module0 central-module-master-output tls yes - ${start}= Get Current Date + ${start} Get Current Date Start Broker Start Engine - ${result}= Check Connections - Should Be True ${result} msg=Engine and Broker not connected + ${result} Check Connections + Should Be True ${result} Engine and Broker not connected Kindly Stop Broker Stop Engine - ${content1}= Create List we have extensions 'TLS' and peer has 'TLS' using certificates as credentials - ${content2}= Create List we have extensions 'TLS' and peer has 'TLS' using certificates as credentials - ${content1}= Combine Lists ${content1} ${LIST_HANDSHAKE} - ${content2}= Combine Lists ${content2} ${LIST_HANDSHAKE} - ${result}= Find In Log ${centralLog} ${start} ${content1} + ${content1} Create List we have extensions 'TLS' and peer has 'TLS' using certificates as credentials + ${content2} Create List we have extensions 'TLS' and peer has 'TLS' using certificates as credentials + ${content1} Combine Lists ${content1} ${LIST_HANDSHAKE} + ${content2} Combine Lists ${content2} ${LIST_HANDSHAKE} + ${result} Find In Log ${centralLog} ${start} ${content1} Should Be True ${result} - ${result}= Find In Log ${moduleLog0} ${start} ${content2} + ${result} Find In Log ${moduleLog0} ${start} ${content2} Should Be True ${result} BECT3 @@ -142,7 +142,7 @@ BECT3 Config Broker central Config Broker module - ${hostname}= Get Hostname + ${hostname} Get Hostname Create Certificate ${hostname} ${EtcRoot}/centreon-broker/server.crt Create Certificate ${hostname} ${EtcRoot}/centreon-broker/client.crt @@ -163,22 +163,22 @@ BECT3 Broker Config Input set central central-broker-master-input tls yes Broker Config Output set module0 central-module-master-output tls yes # We get the current date just before starting broker - ${start}= Get Current Date + ${start} Get Current Date Start Broker Start Engine - ${result}= Check Connections - Should Be True ${result} msg=Engine and Broker not connected + ${result} Check Connections + Should Be True ${result} Engine and Broker not connected Kindly Stop Broker Stop Engine - ${content1}= Create List we have extensions 'TLS' and peer has 'TLS' using anonymous server credentials - ${content2}= Create List we have extensions 'TLS' and peer has 'TLS' using anonymous client credentials - ${content1}= Combine Lists ${content1} ${LIST_HANDSHAKE} - ${content2}= Combine Lists ${content2} ${LIST_HANDSHAKE} - ${log}= Catenate SEPARATOR= ${BROKER_LOG} /central-broker-master.log - ${result}= Find In Log ${log} ${start} ${content1} + ${content1} Create List we have extensions 'TLS' and peer has 'TLS' using anonymous server credentials + ${content2} Create List we have extensions 'TLS' and peer has 'TLS' using anonymous client credentials + ${content1} Combine Lists ${content1} ${LIST_HANDSHAKE} + ${content2} Combine Lists ${content2} ${LIST_HANDSHAKE} + ${log} Catenate SEPARATOR= ${BROKER_LOG} /central-broker-master.log + ${result} Find In Log ${log} ${start} ${content1} Should Be True ${result} - ${log}= Catenate SEPARATOR= ${BROKER_LOG} /central-module-master0.log - ${result}= Find In Log ${log} ${start} ${content2} + ${log} Catenate SEPARATOR= ${BROKER_LOG} /central-module-master0.log + ${result} Find In Log ${log} ${start} ${content2} Should Be True ${result} BECT4 @@ -247,22 +247,22 @@ BECT4 ... ca_certificate ... ${EtcRoot}/centreon-broker/client.crt # We get the current date just before starting broker - ${start}= Get Current Date + ${start} Get Current Date Start Broker Start Engine - ${result}= Check Connections - Should Be True ${result} msg=Engine and Broker not connected + ${result} Check Connections + Should Be True ${result} Engine and Broker not connected Kindly Stop Broker Stop Engine - ${content1}= Create List we have extensions 'TLS' and peer has 'TLS' using certificates as credentials - ${content2}= Create List we have extensions 'TLS' and peer has 'TLS' using certificates as credentials - ${content1}= Combine Lists ${content1} ${LIST_HANDSHAKE} - ${content2}= Combine Lists ${content2} ${LIST_HANDSHAKE} - ${log}= Catenate SEPARATOR= ${BROKER_LOG} /central-broker-master.log - ${result}= Find In Log ${log} ${start} ${content1} + ${content1} Create List we have extensions 'TLS' and peer has 'TLS' using certificates as credentials + ${content2} Create List we have extensions 'TLS' and peer has 'TLS' using certificates as credentials + ${content1} Combine Lists ${content1} ${LIST_HANDSHAKE} + ${content2} Combine Lists ${content2} ${LIST_HANDSHAKE} + ${log} Catenate SEPARATOR= ${BROKER_LOG} /central-broker-master.log + ${result} Find In Log ${log} ${start} ${content1} Should Be True ${result} - ${log}= Catenate SEPARATOR= ${BROKER_LOG} /central-module-master0.log - ${result}= Find In Log ${log} ${start} ${content2} + ${log} Catenate SEPARATOR= ${BROKER_LOG} /central-module-master0.log + ${result} Find In Log ${log} ${start} ${content2} Should Be True ${result} BECT_GRPC1 @@ -283,15 +283,15 @@ BECT_GRPC1 Broker Config Log module0 grpc debug Change Broker tcp output to grpc module0 Change Broker tcp input to grpc central - ${start}= Get Current Date + ${start} Get Current Date Start Broker Start Engine - ${result}= Check Connections - Should Be True ${result} msg=Engine and Broker not connected + ${result} Check Connections + Should Be True ${result} Engine and Broker not connected Kindly Stop Broker Stop Engine - ${content1}= Create List we have extensions '${ext["${comp1}"]}' and peer has '${ext["${comp2}"]}' - ${content2}= Create List we have extensions '${ext["${comp2}"]}' and peer has '${ext["${comp1}"]}' + ${content1} Create List we have extensions '${ext["${comp1}"]}' and peer has '${ext["${comp2}"]}' + ${content2} Create List we have extensions '${ext["${comp2}"]}' and peer has '${ext["${comp1}"]}' IF "${comp1}" == "yes" and "${comp2}" == "no" Insert Into List ... ${content1} @@ -303,9 +303,9 @@ BECT_GRPC1 ... ${-1} ... extension 'TLS' is set to 'yes' in the configuration but cannot be activated because of peer configuration END - ${result}= Find In Log ${centralLog} ${start} ${content1} + ${result} Find In Log ${centralLog} ${start} ${content1} Should Be True ${result} - ${result}= Find In Log ${moduleLog0} ${start} ${content2} + ${result} Find In Log ${moduleLog0} ${start} ${content2} Should Be True ${result} END END @@ -365,22 +365,22 @@ BECT_GRPC2 Broker Config Output set module0 central-module-master-output tls yes Change Broker tcp output to grpc module0 Change Broker tcp input to grpc central - ${start}= Get Current Date + ${start} Get Current Date Start Broker Start Engine - ${result}= Check Connections - Should Be True ${result} msg=Engine and Broker not connected + ${result} Check Connections + Should Be True ${result} Engine and Broker not connected Kindly Stop Broker Stop Engine - ${content1}= Create List we have extensions 'TLS' and peer has 'TLS' using certificates as credentials - ${content2}= Create List we have extensions 'TLS' and peer has 'TLS' using certificates as credentials - ${content1}= Combine Lists ${content1} ${LIST_HANDSHAKE} - ${content2}= Combine Lists ${content2} ${LIST_HANDSHAKE} - ${log}= Catenate SEPARATOR= ${BROKER_LOG} /central-broker-master.log - ${result}= Find In Log ${log} ${start} ${content1} + ${content1} Create List we have extensions 'TLS' and peer has 'TLS' using certificates as credentials + ${content2} Create List we have extensions 'TLS' and peer has 'TLS' using certificates as credentials + ${content1} Combine Lists ${content1} ${LIST_HANDSHAKE} + ${content2} Combine Lists ${content2} ${LIST_HANDSHAKE} + ${log} Catenate SEPARATOR= ${BROKER_LOG} /central-broker-master.log + ${result} Find In Log ${log} ${start} ${content1} Should Be True ${result} - ${log}= Catenate SEPARATOR= ${BROKER_LOG} /central-module-master0.log - ${result}= Find In Log ${log} ${start} ${content2} + ${log} Catenate SEPARATOR= ${BROKER_LOG} /central-module-master0.log + ${result} Find In Log ${log} ${start} ${content2} Should Be True ${result} BECT_GRPC3 @@ -391,7 +391,7 @@ BECT_GRPC3 Config Broker central Config Broker module - ${hostname}= Get Hostname + ${hostname} Get Hostname Create Certificate ${hostname} ${EtcRoot}/centreon-broker/server.crt Create Certificate ${hostname} ${EtcRoot}/centreon-broker/client.crt @@ -414,22 +414,22 @@ BECT_GRPC3 Broker Config Input set central central-broker-master-input tls yes Broker Config Output set module0 central-module-master-output tls yes # We get the current date just before starting broker - ${start}= Get Current Date + ${start} Get Current Date Start Broker Start Engine - ${result}= Check Connections - Should Be True ${result} msg=Engine and Broker not connected + ${result} Check Connections + Should Be True ${result} Engine and Broker not connected Kindly Stop Broker Stop Engine - ${content1}= Create List we have extensions 'TLS' and peer has 'TLS' using anonymous server credentials - ${content2}= Create List we have extensions 'TLS' and peer has 'TLS' using anonymous client credentials - ${content1}= Combine Lists ${content1} ${LIST_HANDSHAKE} - ${content2}= Combine Lists ${content2} ${LIST_HANDSHAKE} - ${log}= Catenate SEPARATOR= ${BROKER_LOG} /central-broker-master.log - ${result}= Find In Log ${log} ${start} ${content1} + ${content1} Create List we have extensions 'TLS' and peer has 'TLS' using anonymous server credentials + ${content2} Create List we have extensions 'TLS' and peer has 'TLS' using anonymous client credentials + ${content1} Combine Lists ${content1} ${LIST_HANDSHAKE} + ${content2} Combine Lists ${content2} ${LIST_HANDSHAKE} + ${log} Catenate SEPARATOR= ${BROKER_LOG} /central-broker-master.log + ${result} Find In Log ${log} ${start} ${content1} Should Be True ${result} - ${log}= Catenate SEPARATOR= ${BROKER_LOG} /central-module-master0.log - ${result}= Find In Log ${log} ${start} ${content2} + ${log} Catenate SEPARATOR= ${BROKER_LOG} /central-module-master0.log + ${result} Find In Log ${log} ${start} ${content2} Should Be True ${result} BECT_GRPC4 @@ -500,20 +500,20 @@ BECT_GRPC4 ... ca_certificate ... ${EtcRoot}/centreon-broker/client.crt # We get the current date just before starting broker - ${start}= Get Current Date + ${start} Get Current Date Start Broker Start Engine - ${result}= Check Connections - Should Be True ${result} msg=Engine and Broker not connected + ${result} Check Connections + Should Be True ${result} Engine and Broker not connected Kindly Stop Broker Stop Engine - ${content1}= Create List we have extensions 'TLS' and peer has 'TLS' using certificates as credentials - ${content2}= Create List we have extensions 'TLS' and peer has 'TLS' using certificates as credentials - ${content1}= Combine Lists ${content1} ${LIST_HANDSHAKE} - ${content2}= Combine Lists ${content2} ${LIST_HANDSHAKE} - ${log}= Catenate SEPARATOR= ${BROKER_LOG} /central-broker-master.log - ${result}= Find In Log ${log} ${start} ${content1} + ${content1} Create List we have extensions 'TLS' and peer has 'TLS' using certificates as credentials + ${content2} Create List we have extensions 'TLS' and peer has 'TLS' using certificates as credentials + ${content1} Combine Lists ${content1} ${LIST_HANDSHAKE} + ${content2} Combine Lists ${content2} ${LIST_HANDSHAKE} + ${log} Catenate SEPARATOR= ${BROKER_LOG} /central-broker-master.log + ${result} Find In Log ${log} ${start} ${content1} Should Be True ${result} - ${log}= Catenate SEPARATOR= ${BROKER_LOG} /central-module-master0.log - ${result}= Find In Log ${log} ${start} ${content2} + ${log} Catenate SEPARATOR= ${BROKER_LOG} /central-module-master0.log + ${result} Find In Log ${log} ${start} ${content2} Should Be True ${result} diff --git a/tests/broker-engine/victoria.robot b/tests/broker-engine/victoria.robot index a5d64d366ac..9508d3d31f9 100644 --- a/tests/broker-engine/victoria.robot +++ b/tests/broker-engine/victoria.robot @@ -41,7 +41,7 @@ VICT_ONE_CHECK_METRIC ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} - ... msg=An Initial host state on host_1 should be raised before we can start our external commands. + ... An Initial host state on host_1 should be raised before we can start our external commands. Process Service Check Result host_16 service_314 0 taratata|metric_taratata=80%;50;75;5;99 @@ -100,7 +100,7 @@ VICT_ONE_CHECK_STATUS ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} - ... msg=An Initial host state on host_1 should be raised before we can start our external commands. + ... An Initial host state on host_1 should be raised before we can start our external commands. # service ok ${start} Get Round Current Date @@ -226,14 +226,14 @@ VICT_ONE_CHECK_METRIC_AFTER_FAILURE ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} - ... msg=An Initial host state on host_1 should be raised before we can start our external commands. + ... An Initial host state on host_1 should be raised before we can start our external commands. Process Service Check Result host_16 service_314 0 taratata|metric_taratata=80%;50;75;5;99 ${start} Get Round Current Date ${content} Create List [victoria_metrics] name: "metric_taratata" ${result} Find In Log with Timeout ${centralLog} ${start} ${content} 60 - Should Be True ${result} msg=victoria should add metric in a request + Should Be True ${result} victoria should add metric in a request Start Server 127.0.0.1 8000 ${timeout} Get Current Date result_format=epoch increment=00:01:00 diff --git a/tests/broker/bbdo-server-client-ko.robot b/tests/broker/bbdo-server-client-ko.robot index 31ef4c1b2a9..29a42824adf 100644 --- a/tests/broker/bbdo-server-client-ko.robot +++ b/tests/broker/bbdo-server-client-ko.robot @@ -27,14 +27,14 @@ BSCSSK1 Broker Config Log rrd tcp debug Broker Config Log central core error Broker Config Log rrd core error - ${start}= Get Current Date exclude_millis=True + ${start} Get Current Date exclude_millis=True Sleep 1s Start Broker # Client cannot connect. It returns an error - ${content}= Create List peer tcp://localhost:5670 is sending corrupted data - ${result}= Find In Log With Timeout ${centralLog} ${start} ${content} 30 - Should Be True ${result} msg=No message about the bad connection. + ${content} Create List peer tcp://localhost:5670 is sending corrupted data + ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 30 + Should Be True ${result} No message about the bad connection. Kindly Stop Broker @@ -52,15 +52,15 @@ BSCSSK2 Broker Config Log rrd tcp debug Broker Config Log central core error Broker Config Log rrd core error - ${start}= Get Current Date exclude_millis=True + ${start} Get Current Date exclude_millis=True Sleep 1s Start Broker # Client cannot connect. It returns an error - ${content}= Create List + ${content} Create List ... BBDO: invalid protocol header, aborting connection: waiting for message of type 'version_response' but nothing received - ${result}= Find In Log With Timeout ${centralLog} ${start} ${content} 30 - Should Be True ${result} msg=No message about the bad connection. + ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 30 + Should Be True ${result} No message about the bad connection. Kindly Stop Broker @@ -71,22 +71,22 @@ Start Stop Service Start Process /usr/sbin/cbd ${EtcRoot}/centreon-broker/central-broker.json alias=b1 Start Process /usr/sbin/cbd ${EtcRoot}/centreon-broker/central-rrd.json alias=b2 Sleep ${interval} - ${pid1}= Get Process Id b1 - ${pid2}= Get Process Id b2 - ${result}= check connection 5670 ${pid1} ${pid2} - Should Be True ${result} msg=The connection between cbd central and rrd is not established. + ${pid1} Get Process Id b1 + ${pid2} Get Process Id b2 + ${result} check connection 5670 ${pid1} ${pid2} + Should Be True ${result} The connection between cbd central and rrd is not established. Send Signal To Process SIGTERM b1 - ${result}= Wait Or Dump And Kill Process b1 60s - Should Be True ${result.rc} == -15 or ${result.rc} == 0 msg=Broker service badly stopped + ${result} Wait Or Dump And Kill Process b1 60s + Should Be True ${result.rc} == -15 or ${result.rc} == 0 Broker service badly stopped Send Signal To Process SIGTERM b2 - ${result}= Wait Or Dump And Kill Process b2 60s - Should Be True ${result.rc} == -15 or ${result.rc} == 0 msg=Broker service badly stopped + ${result} Wait Or Dump And Kill Process b2 60s + Should Be True ${result.rc} == -15 or ${result.rc} == 0 Broker service badly stopped Start Stop Instance [Arguments] ${interval} Start Process /usr/sbin/cbd ${EtcRoot}/centreon-broker/central-broker.json alias=b1 Sleep ${interval} Send Signal To Process SIGTERM b1 - ${result}= Wait Or Dump And Kill Process b1 60s - Should Be True ${result.rc} == -15 or ${result.rc} == 0 msg=Broker instance badly stopped + ${result} Wait Or Dump And Kill Process b1 60s + Should Be True ${result.rc} == -15 or ${result.rc} == 0 Broker instance badly stopped diff --git a/tests/broker/bbdo-server-client-reversed.robot b/tests/broker/bbdo-server-client-reversed.robot index d08c0e8d3d1..3d81bbc3892 100644 --- a/tests/broker/bbdo-server-client-reversed.robot +++ b/tests/broker/bbdo-server-client-reversed.robot @@ -35,11 +35,11 @@ BSCSSRR1 Broker Config Output set central central-broker-master-output retention yes Config Broker BBDO Input rrd bbdo_client 5670 tcp localhost Broker Config Log central config debug - ${start}= Get Round Current Date + ${start} Get Round Current Date Repeat Keyword 5 times Start Stop Service 0 - ${content}= Create List failover 'central-broker-master-output' construction. - ${result}= Find In Log With Timeout ${centralLog} ${start} ${content} 30 - Should Be True ${result} msg=No information about TLS activation. + ${content} Create List failover 'central-broker-master-output' construction. + ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 30 + Should Be True ${result} No information about TLS activation. BSCSSPRR1 [Documentation] Start-Stop two instances of broker and no coredump. The server contains a listen address, reversed and retention. central-broker-master-output is then a failover. @@ -72,13 +72,13 @@ BSCSSGRR1 Broker Config Output set central central-broker-master-output retention yes Config Broker BBDO Input rrd bbdo_client 5670 grpc localhost Broker Config Log central config info - ${start}= Get Round Current Date + ${start} Get Round Current Date Repeat Keyword 5 times Start Stop Service 0 - ${content}= Create List + ${content} Create List ... endpoint applier: creating new failover 'central-broker-master-output' ... failover 'central-broker-master-output' construction. - ${result}= Find In Log With Timeout ${centralLog} ${start} ${content} 30 - Should Be True ${result} msg=No information about TLS activation. + ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 30 + Should Be True ${result} No information about TLS activation. BSCSSTRR1 [Documentation] Start-Stop two instances of broker and no coredump. Encryption is enabled. transport protocol is tcp, reversed and retention. @@ -93,11 +93,11 @@ BSCSSTRR1 Broker Config Log central config off Broker Config Log central core off Broker Config Log central tls debug - ${start}= Get Round Current Date + ${start} Get Round Current Date Repeat Keyword 5 times Start Stop Service 0 - ${content}= Create List TLS: successful handshake - ${result}= Find In Log With Timeout ${centralLog} ${start} ${content} 30 - Should Be True ${result} msg=No information about TLS activation. + ${content} Create List TLS: successful handshake + ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 30 + Should Be True ${result} No information about TLS activation. BSCSSTRR2 [Documentation] Start-Stop two instances of broker and no coredump. Encryption is enabled. @@ -129,11 +129,11 @@ BSCSSTRR2 ... ${EtcRoot}/centreon-broker/client.crt Broker Config Input set rrd rrd-broker-master-input private_key ${EtcRoot}/centreon-broker/client.key Broker Config Input set rrd rrd-broker-master-input certificate ${EtcRoot}/centreon-broker/client.crt - ${start}= Get Round Current Date + ${start} Get Round Current Date Repeat Keyword 5 times Start Stop Service 0 - ${content}= Create List TLS: successful handshake - ${result}= Find In Log With Timeout ${centralLog} ${start} ${content} 30 - Should Be True ${result} msg=No information about TLS activation. + ${content} Create List TLS: successful handshake + ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 30 + Should Be True ${result} No information about TLS activation. BSCSSTGRR2 [Documentation] Start-Stop two instances of broker. The connection is made by bbdo_client/bbdo_server with encryption enabled. It works with good certificates and keys. Reversed grpc connection with retention. @@ -178,11 +178,11 @@ BSCSSTGRR2 ... rrd-broker-master-input ... ca_certificate ... ${EtcRoot}/centreon-broker/server.crt - ${start}= Get Round Current Date + ${start} Get Round Current Date Start Broker - ${content}= Create List write: buff: write done: buff: - ${result}= Find In Log With Timeout ${centralLog} ${start} ${content} 30 - Should Be True ${result} msg=No information about TLS activation. + ${content} Create List write: buff: write done: buff: + ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 30 + Should Be True ${result} No information about TLS activation. Kindly Stop Broker BSCSSCRR1 @@ -198,11 +198,11 @@ BSCSSCRR1 Broker Config Log central core trace Broker Config Log rrd core trace Broker Config Flush Log central 0 - ${start}= Get Round Current Date + ${start} Get Round Current Date Start Broker - ${content}= Create List compression: writing - ${result}= Find In Log With Timeout ${centralLog} ${start} ${content} 30 - Should Be True ${result} msg=No compression enabled + ${content} Create List compression: writing + ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 30 + Should Be True ${result} No compression enabled Kindly Stop Broker BSCSSCRR2 @@ -219,11 +219,11 @@ BSCSSCRR2 Broker Config Log rrd core trace Broker Config Log central bbdo trace Broker Config Flush Log central 0 - ${start}= Get Round Current Date + ${start} Get Round Current Date Start Broker - ${content}= Create List BBDO: we have extensions '' and peer has 'COMPRESSION' - ${result}= Find In Log With Timeout ${centralLog} ${start} ${content} 30 - Should Be True ${result} msg=Compression enabled but should not. + ${content} Create List BBDO: we have extensions '' and peer has 'COMPRESSION' + ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 30 + Should Be True ${result} Compression enabled but should not. Kindly Stop Broker BSCSSCGRR1 @@ -241,11 +241,11 @@ BSCSSCGRR1 Broker Config Log central tls debug Broker Config Log central grpc debug Broker Config Flush Log central 0 - ${start}= Get Round Current Date + ${start} Get Round Current Date Start Broker - ${content}= Create List server default compression deflate - ${result}= Find In Log With Timeout ${centralLog} ${start} ${content} 30 - Should Be True ${result} msg=No compression enabled + ${content} Create List server default compression deflate + ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 30 + Should Be True ${result} No compression enabled Kindly Stop Broker BSCSSCGRR2 @@ -263,11 +263,11 @@ BSCSSCGRR2 Broker Config Log central tls debug Broker Config Log central grpc debug Broker Config Flush Log central 0 - ${start}= Get Round Current Date + ${start} Get Round Current Date Start Broker - ${content}= Create List server default compression deflate - ${result}= Find In Log With Timeout ${centralLog} ${start} ${content} 15 - Should Be True not ${result} msg=No compression enabled + ${content} Create List server default compression deflate + ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 15 + Should Be True not ${result} No compression enabled Kindly Stop Broker @@ -277,25 +277,25 @@ Start Stop Service Start Process /usr/sbin/cbd ${EtcRoot}/centreon-broker/central-broker.json alias=b1 Start Process /usr/sbin/cbd ${EtcRoot}/centreon-broker/central-rrd.json alias=b2 Sleep ${interval} - ${pid1}= Get Process Id b1 - ${pid2}= Get Process Id b2 - ${result}= check connection 5670 ${pid1} ${pid2} - Should Be True ${result} msg=The connection between cbd central and rrd is not established. + ${pid1} Get Process Id b1 + ${pid2} Get Process Id b2 + ${result} check connection 5670 ${pid1} ${pid2} + Should Be True ${result} The connection between cbd central and rrd is not established. Send Signal To Process SIGTERM b1 - ${result}= Wait Or Dump And Kill Process b1 60s - Should Be True ${result.rc} == -15 or ${result.rc} == 0 msg=Broker service badly stopped + ${result} Wait Or Dump And Kill Process b1 60s + Should Be True ${result.rc} == -15 or ${result.rc} == 0 Broker service badly stopped Send Signal To Process SIGTERM b2 - ${result}= Wait Or Dump And Kill Process b2 60s - Should Be True ${result.rc} == -15 or ${result.rc} == 0 msg=Broker service badly stopped + ${result} Wait Or Dump And Kill Process b2 60s + Should Be True ${result.rc} == -15 or ${result.rc} == 0 Broker service badly stopped Start Stop Instance [Arguments] ${interval} Start Process /usr/sbin/cbd ${EtcRoot}/centreon-broker/central-broker.json alias=b1 Sleep ${interval} Send Signal To Process SIGTERM b1 - ${result}= Wait Or Dump And Kill Process b1 60s - Should Be True ${result.rc} == -15 or ${result.rc} == 0 msg=Broker instance badly stopped + ${result} Wait Or Dump And Kill Process b1 60s + Should Be True ${result.rc} == -15 or ${result.rc} == 0 Broker instance badly stopped Prepare Suite Clean Before Suite diff --git a/tests/broker/bbdo-server-client.robot b/tests/broker/bbdo-server-client.robot index 5c4128bfbcb..cb5232526ea 100644 --- a/tests/broker/bbdo-server-client.robot +++ b/tests/broker/bbdo-server-client.robot @@ -107,11 +107,11 @@ BSCSST1 Broker Config Log central config off Broker Config Log central core off Broker Config Log central tls debug - ${start}= Get Current Date + ${start} Get Current Date Repeat Keyword 5 times Start Stop Service 0 - ${content}= Create List TLS: successful handshake - ${result}= Find In Log With Timeout ${centralLog} ${start} ${content} 30 - Should Be True ${result} msg=No information about TLS activation. + ${content} Create List TLS: successful handshake + ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 30 + Should Be True ${result} No information about TLS activation. BSCSST2 [Documentation] Start-Stop two instances of broker and no coredump. Encryption is enabled on client side. @@ -143,11 +143,11 @@ BSCSST2 ... ${EtcRoot}/centreon-broker/client.crt Broker Config Input set rrd rrd-broker-master-input private_key ${EtcRoot}/centreon-broker/client.key Broker Config Input set rrd rrd-broker-master-input certificate ${EtcRoot}/centreon-broker/client.crt - ${start}= Get Current Date + ${start} Get Current Date Repeat Keyword 5 times Start Stop Service 0 - ${content}= Create List TLS: successful handshake - ${result}= Find In Log With Timeout ${centralLog} ${start} ${content} 30 - Should Be True ${result} msg=No information about TLS activation. + ${content} Create List TLS: successful handshake + ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 30 + Should Be True ${result} No information about TLS activation. BSCSSTG1 [Documentation] Start-Stop two instances of broker. The connection is made by bbdo_client/bbdo_server with encryption enabled. This is not sufficient, then an error is raised. @@ -169,11 +169,11 @@ BSCSSTG1 Broker Config Source Log central 1 Broker Config Flush Log rrd 0 Broker Config Source Log rrd 1 - ${start}= Get Current Date + ${start} Get Current Date Start Broker - ${content}= Create List Handshake failed - ${result}= Find In Log With Timeout ${centralLog} ${start} ${content} 30 - Should Be True ${result} msg=No information about TLS activation. + ${content} Create List Handshake failed + ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 30 + Should Be True ${result} No information about TLS activation. BSCSSTG2 [Documentation] Start-Stop two instances of broker. The connection is made by bbdo_client/bbdo_server with encryption enabled. It works with good certificates and keys. @@ -217,11 +217,11 @@ BSCSSTG2 ... ${EtcRoot}/centreon-broker/client.crt Broker Config Input set rrd rrd-broker-master-input private_key ${EtcRoot}/centreon-broker/client.key Broker Config Input set rrd rrd-broker-master-input certificate ${EtcRoot}/centreon-broker/client.crt - ${start}= Get Current Date + ${start} Get Current Date Start Broker - ${content}= Create List encrypted connection write: buff: write done: buff: - ${result}= Find In Log With Timeout ${centralLog} ${start} ${content} 30 - Should Be True ${result} msg=No information about TLS activation. + ${content} Create List encrypted connection write: buff: write done: buff: + ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 30 + Should Be True ${result} No information about TLS activation. Kindly Stop Broker BSCSSTG3 @@ -270,12 +270,12 @@ BSCSSTG3 ... private_key ... ${EtcRoot}/centreon-broker/missing-client.key Broker Config Input set rrd rrd-broker-master-input certificate ${EtcRoot}/centreon-broker/client.crt - ${start}= Get Current Date + ${start} Get Current Date Start Broker - ${content}= Create List + ${content} Create List ... Cannot open file '/tmp/etc/centreon-broker/missing-client.key': No such file or directory - ${result}= Find In Log With Timeout ${rrdLog} ${start} ${content} 30 - Should Be True ${result} msg=No information about the missing private key on server. + ${result} Find In Log With Timeout ${rrdLog} ${start} ${content} 30 + Should Be True ${result} No information about the missing private key on server. BSCSSC1 [Documentation] Start-Stop two instances of broker. The connection is made by bbdo_client/bbdo_server with tcp transport protocol. Compression is enabled on client side. @@ -290,11 +290,11 @@ BSCSSC1 Broker Config Log central core trace Broker Config Log rrd core trace Broker Config Flush Log central 0 - ${start}= Get Current Date + ${start} Get Current Date Start Broker - ${content}= Create List compression: writing - ${result}= Find In Log With Timeout ${centralLog} ${start} ${content} 30 - Should Be True ${result} msg=No compression enabled + ${content} Create List compression: writing + ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 30 + Should Be True ${result} No compression enabled Kindly Stop Broker BSCSSC2 @@ -311,11 +311,11 @@ BSCSSC2 Broker Config Log rrd core trace Broker Config Log central bbdo trace Broker Config Flush Log central 0 - ${start}= Get Current Date + ${start} Get Current Date Start Broker - ${content}= Create List BBDO: we have extensions '' and peer has 'COMPRESSION' - ${result}= Find In Log With Timeout ${centralLog} ${start} ${content} 30 - Should Be True ${result} msg=Compression enabled but should not. + ${content} Create List BBDO: we have extensions '' and peer has 'COMPRESSION' + ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 30 + Should Be True ${result} Compression enabled but should not. Kindly Stop Broker BSCSSCG1 @@ -334,11 +334,11 @@ BSCSSCG1 Broker Config Log rrd grpc debug Broker Config Log central grpc debug Broker Config Flush Log central 0 - ${start}= Get Current Date + ${start} Get Current Date Start Broker - ${content}= Create List activate compression deflate - ${result}= Find In Log With Timeout ${centralLog} ${start} ${content} 30 - Should Be True ${result} msg=No compression enabled + ${content} Create List activate compression deflate + ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 30 + Should Be True ${result} No compression enabled Kindly Stop Broker BSCSSGA1 @@ -357,11 +357,11 @@ BSCSSGA1 Broker Config Log rrd grpc trace Broker Config Flush Log central 0 Broker Config Flush Log rrd 0 - ${start}= Get Current Date + ${start} Get Current Date Start Broker - ${content}= Create List Wrong client authorization token - ${result}= Find In Log With Timeout ${rrdLog} ${start} ${content} 30 - Should Be True ${result} msg=An error message about the authorization token should be raised. + ${content} Create List Wrong client authorization token + ${result} Find In Log With Timeout ${rrdLog} ${start} ${content} 30 + Should Be True ${result} An error message about the authorization token should be raised. Kindly Stop Broker BSCSSGA2 @@ -383,11 +383,11 @@ BSCSSGA2 Broker Config Flush Log central 0 Broker Config Flush Log rrd 0 Broker Config Source Log rrd 1 - ${start}= Get Current Date + ${start} Get Current Date Start Broker - ${content}= Create List receive: buff - ${result}= Find In Log With Timeout ${rrdLog} ${start} ${content} 30 - Should Be True ${result} msg=If the authorization token is the same on both side, no issue + ${content} Create List receive: buff + ${result} Find In Log With Timeout ${rrdLog} ${start} ${content} 30 + Should Be True ${result} If the authorization token is the same on both side, no issue Kindly Stop Broker @@ -397,25 +397,25 @@ Start Stop Service Start Process /usr/sbin/cbd ${EtcRoot}/centreon-broker/central-broker.json alias=b1 Start Process /usr/sbin/cbd ${EtcRoot}/centreon-broker/central-rrd.json alias=b2 Sleep ${interval} - ${pid1}= Get Process Id b1 - ${pid2}= Get Process Id b2 - ${result}= check connection 5670 ${pid1} ${pid2} - Should Be True ${result} msg=The connection between cbd central and rrd is not established. + ${pid1} Get Process Id b1 + ${pid2} Get Process Id b2 + ${result} check connection 5670 ${pid1} ${pid2} + Should Be True ${result} The connection between cbd central and rrd is not established. Send Signal To Process SIGTERM b1 - ${result}= Wait For Process b1 timeout=60s on_timeout=kill - Should Be True ${result.rc} == -15 or ${result.rc} == 0 msg=Broker service badly stopped + ${result} Wait For Process b1 timeout=60s on_timeout=kill + Should Be True ${result.rc} == -15 or ${result.rc} == 0 Broker service badly stopped Send Signal To Process SIGTERM b2 - ${result}= Wait For Process b2 timeout=60s on_timeout=kill - Should Be True ${result.rc} == -15 or ${result.rc} == 0 msg=Broker service badly stopped + ${result} Wait For Process b2 timeout=60s on_timeout=kill + Should Be True ${result.rc} == -15 or ${result.rc} == 0 Broker service badly stopped Start Stop Instance [Arguments] ${interval} Start Process /usr/sbin/cbd ${EtcRoot}/centreon-broker/central-broker.json alias=b1 Sleep ${interval} Send Signal To Process SIGTERM b1 - ${result}= Wait For Process b1 timeout=60s on_timeout=kill - Should Be True ${result.rc} == -15 or ${result.rc} == 0 msg=Broker instance badly stopped + ${result} Wait For Process b1 timeout=60s on_timeout=kill + Should Be True ${result.rc} == -15 or ${result.rc} == 0 Broker instance badly stopped Prepare Suite Clean Before Suite diff --git a/tests/broker/command-line.robot b/tests/broker/command-line.robot index feedd31d9fe..bdb93c02a55 100644 --- a/tests/broker/command-line.robot +++ b/tests/broker/command-line.robot @@ -18,43 +18,43 @@ BCL1 [Tags] broker start-stop Config Broker central Start Broker With Args -s foobar - ${result}= Wait For Broker - ${expected}= Evaluate "The option -s expects a positive integer" in """${result}""" - Should be True ${expected} msg=expected error 'The option -s expects a positive integer' + ${result} Wait For Broker + ${expected} Evaluate "The option -s expects a positive integer" in """${result}""" + Should be True ${expected} expected error 'The option -s expects a positive integer' BCL2 [Documentation] Starting broker with option '-s5' should work [Tags] broker start-stop Config Broker central - ${start}= Get Current Date exclude_millis=True + ${start} Get Current Date exclude_millis=True Sleep 1s Start Broker With Args -s5 ${EtcRoot}/centreon-broker/central-broker.json - ${table}= Create List Starting the TCP thread pool of 5 threads - ${logger_res}= Find in log with timeout ${centralLog} ${start} ${table} 30 + ${table} Create List Starting the TCP thread pool of 5 threads + ${logger_res} Find in log with timeout ${centralLog} ${start} ${table} 30 Should be True ... ${logger_res} - ... msg=Didn't found 5 threads in ${VarRoot}/log/centreon-broker/central-broker-master.log + ... Didn't found 5 threads in ${VarRoot}/log/centreon-broker/central-broker-master.log Stop Broker With Args BCL3 [Documentation] Starting broker with options '-D' should work and activate diagnose mode [Tags] broker start-stop Config Broker central - ${start}= Get Current Date exclude_millis=True + ${start} Get Current Date exclude_millis=True Sleep 1s Start Broker With Args -D ${EtcRoot}/centreon-broker/central-broker.json - ${result}= Wait For Broker - ${expected}= Evaluate "diagnostic:" in """${result}""" - Should be True ${expected} msg=diagnostic mode didn't launch + ${result} Wait For Broker + ${expected} Evaluate "diagnostic:" in """${result}""" + Should be True ${expected} diagnostic mode didn't launch BCL4 [Documentation] Starting broker with options '-s2' and '-D' should work. [Tags] broker start-stop Config Broker central Start Broker With Args -s2 -D ${EtcRoot}/centreon-broker/central-broker.json - ${result}= Wait For Broker - ${expected}= Evaluate "diagnostic:" in """${result}""" - Should be True ${expected} msg=diagnostic mode didn't launch + ${result} Wait For Broker + ${expected} Evaluate "diagnostic:" in """${result}""" + Should be True ${expected} diagnostic mode didn't launch *** Keywords *** @@ -65,11 +65,11 @@ Start Broker With Args Wait For broker Wait For Process b1 - ${result}= Get File /tmp/output.txt + ${result} Get File /tmp/output.txt Remove File /tmp/output.txt RETURN ${result} Stop Broker With Args Send Signal To Process SIGTERM b1 - ${result}= Wait For Process b1 timeout=60s on_timeout=kill + ${result} Wait For Process b1 timeout=60s on_timeout=kill Should Be Equal As Integers ${result.rc} 0 diff --git a/tests/broker/filters.robot b/tests/broker/filters.robot index cb5ffae0a41..5b66bc6aa77 100644 --- a/tests/broker/filters.robot +++ b/tests/broker/filters.robot @@ -26,14 +26,14 @@ BFC1 ... central-broker-master-sql ... filters ... {"category": ["neb", "foo", "bar"]} - ${start}= Get Round Current Date + ${start} Get Round Current Date Start Broker - ${content}= Create List + ${content} Create List ... 'foo' is not a known category: cannot find event category 'foo' ... 'bar' is not a known category: cannot find event category 'bar' ... Filters applied on endpoint:neb - ${result}= Find In Log With Timeout ${centralLog} ${start} ${content} 30 - Should Be True ${result} msg="Only neb filter should be applied on sql output" + ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 30 + Should Be True ${result} "Only neb filter should be applied on sql output" Kindly Stop Broker @@ -50,13 +50,13 @@ BFC2 ... central-broker-master-sql ... filters ... {"category": ["doe", "foo", "bar"]} - ${start}= Get Round Current Date + ${start} Get Round Current Date Start Broker - ${content}= Create List + ${content} Create List ... 'doe' is not a known category: cannot find event category 'doe' ... 'bar' is not a known category: cannot find event category 'bar' ... Filters applied on endpoint:all - ${result}= Find In Log With Timeout ${centralLog} ${start} ${content} 30 - Should Be True ${result} msg="Only neb filter should be applied on sql output" + ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 30 + Should Be True ${result} "Only neb filter should be applied on sql output" Kindly Stop Broker diff --git a/tests/broker/grpc-stream.robot b/tests/broker/grpc-stream.robot index 7c8efd72b38..5dfbaac453e 100644 --- a/tests/broker/grpc-stream.robot +++ b/tests/broker/grpc-stream.robot @@ -111,5 +111,5 @@ Start Stop Instance Sleep ${interval} Kindly Stop Broker True Send Signal To Process SIGTERM b1 - ${result}= Wait For Process b1 timeout=60s on_timeout=kill - Should Be True ${result.rc} == -15 or ${result.rc} == 0 msg=Broker instance badly stopped + ${result} Wait For Process b1 timeout=60s on_timeout=kill + Should Be True ${result.rc} == -15 or ${result.rc} == 0 Broker instance badly stopped diff --git a/tests/broker/log.robot b/tests/broker/log.robot index 0d39636fcf3..8827b8cb48e 100644 --- a/tests/broker/log.robot +++ b/tests/broker/log.robot @@ -20,15 +20,15 @@ BLDIS1 Config Broker central Broker Config Log central core disabled Broker Config Log central sql debug - ${start}= Get Current Date + ${start} Get Current Date Start Broker - ${content}= Create List [sql] - ${result}= Find In Log With Timeout ${centralLog} ${start} ${content} 30 - Should Be True ${result} msg="No sql logs produced" + ${content} Create List [sql] + ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 30 + Should Be True ${result} "No sql logs produced" - ${content}= Create List [core] - ${result}= Find In Log With Timeout ${centralLog} ${start} ${content} 30 - Should Be Equal ${result} ${False} msg="We should not have core logs" + ${content} Create List [core] + ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 30 + Should Be Equal ${result} ${False} "We should not have core logs" Kindly Stop Broker BLEC1 @@ -38,12 +38,12 @@ BLEC1 Config Broker central Broker Config Log central core trace Broker Config Log central sql debug - ${start}= Get Current Date + ${start} Get Current Date Start Broker - ${result}= Get Broker Log Level 51001 central core + ${result} Get Broker Log Level 51001 central core Should Be Equal ${result} trace Set Broker Log Level 51001 central core debug - ${result}= Get Broker Log Level 51001 central core + ${result} Get Broker Log Level 51001 central core Should Be Equal ${result} debug BLEC2 @@ -53,11 +53,11 @@ BLEC2 Config Broker central Broker Config Log central core trace Broker Config Log central sql debug - ${start}= Get Current Date + ${start} Get Current Date Start Broker - ${result}= Get Broker Log Level 51001 central core + ${result} Get Broker Log Level 51001 central core Should Be Equal ${result} trace - ${result}= Set Broker Log Level 51001 central core foo + ${result} Set Broker Log Level 51001 central core foo Should Be Equal ${result} Enum LogLevelEnum has no value defined for name 'FOO' BLEC3 @@ -67,7 +67,7 @@ BLEC3 Config Broker central Broker Config Log central core trace Broker Config Log central sql debug - ${start}= Get Current Date + ${start} Get Current Date Start Broker - ${result}= Set Broker Log Level 51001 central foo trace + ${result} Set Broker Log Level 51001 central foo trace Should Be Equal ${result} The 'foo' logger does not exist diff --git a/tests/ccc/ccc.robot b/tests/ccc/ccc.robot index 51eb314e244..f9f7bd71f96 100644 --- a/tests/ccc/ccc.robot +++ b/tests/ccc/ccc.robot @@ -24,7 +24,7 @@ BECCC1 Config Broker module Config Broker rrd Clear Retention - ${start}= Get Current Date + ${start} Get Current Date Sleep 1s Start Broker Start Engine @@ -32,7 +32,7 @@ BECCC1 Start Process /usr/bin/ccc stderr=/tmp/output.txt FOR ${i} IN RANGE 10 Wait Until Created /tmp/output.txt - ${content}= Get File /tmp/output.txt + ${content} Get File /tmp/output.txt IF len("${content.strip()}") > 0 BREAK Sleep 1s END @@ -56,7 +56,7 @@ BECCC2 Broker Config Output Set central central-broker-unified-sql store_in_resources yes Broker Config Output Set central central-broker-unified-sql store_in_hosts_services no Clear Retention - ${start}= Get Current Date + ${start} Get Current Date Sleep 1s Start Broker Start Engine @@ -64,13 +64,13 @@ BECCC2 Start Process /usr/bin/ccc -p 51001 stderr=/tmp/output.txt FOR ${i} IN RANGE 10 Wait Until Created /tmp/output.txt - ${content}= Get File /tmp/output.txt + ${content} Get File /tmp/output.txt IF len("${content.strip()}") > 0 BREAK Sleep 1s END - ${version}= Get Version - ${expected}= Catenate Connected to a Centreon Broker ${version} gRPC server + ${version} Get Version + ${expected} Catenate Connected to a Centreon Broker ${version} gRPC server Should Be Equal As Strings ${content.strip()} ${expected} Stop Engine Kindly Stop Broker @@ -91,7 +91,7 @@ BECCC3 Broker Config Output Set central central-broker-unified-sql store_in_resources yes Broker Config Output Set central central-broker-unified-sql store_in_hosts_services no Clear Retention - ${start}= Get Current Date + ${start} Get Current Date Sleep 1s Start Broker Start Engine @@ -99,12 +99,12 @@ BECCC3 Start Process /usr/bin/ccc -p 50001 stderr=/tmp/output.txt FOR ${i} IN RANGE 10 Wait Until Created /tmp/output.txt - ${content}= Get File /tmp/output.txt + ${content} Get File /tmp/output.txt IF len("${content.strip()}") > 0 BREAK Sleep 1s END - ${version}= Get Version - ${expected}= Catenate Connected to a Centreon Engine ${version} gRPC server + ${version} Get Version + ${expected} Catenate Connected to a Centreon Engine ${version} gRPC server Should Be Equal As Strings ${content.strip()} ${expected} Stop Engine Kindly Stop Broker @@ -125,7 +125,7 @@ BECCC4 Broker Config Output Set central central-broker-unified-sql store_in_resources yes Broker Config Output Set central central-broker-unified-sql store_in_hosts_services no Clear Retention - ${start}= Get Current Date + ${start} Get Current Date Sleep 1s Start Broker Start Engine @@ -133,12 +133,12 @@ BECCC4 Start Process /usr/bin/ccc -p 51001 -l stdout=/tmp/output.txt FOR ${i} IN RANGE 10 Wait Until Created /tmp/output.txt - ${content}= Get File /tmp/output.txt + ${content} Get File /tmp/output.txt IF len("""${content.strip()}""") > 0 BREAK Sleep 1s END - ${contains}= Evaluate "GetVersion" in """${content}""" and "RemovePoller" in """${content}""" - Should Be True ${contains} msg=The list of methods should contain GetVersion(Empty) + ${contains} Evaluate "GetVersion" in """${content}""" and "RemovePoller" in """${content}""" + Should Be True ${contains} The list of methods should contain GetVersion(Empty) Stop Engine Kindly Stop Broker Remove File /tmp/output.txt @@ -158,7 +158,7 @@ BECCC5 Broker Config Output Set central central-broker-unified-sql store_in_resources yes Broker Config Output Set central central-broker-unified-sql store_in_hosts_services no Clear Retention - ${start}= Get Current Date + ${start} Get Current Date Sleep 1s Start Broker Start Engine @@ -166,12 +166,12 @@ BECCC5 Start Process /usr/bin/ccc -p 51001 -l GetVersion stderr=/tmp/output.txt FOR ${i} IN RANGE 10 Wait Until Created /tmp/output.txt - ${content}= Get File /tmp/output.txt + ${content} Get File /tmp/output.txt IF len("""${content.strip()}""") > 0 BREAK Sleep 1s END - ${contains}= Evaluate "The list argument expects no command" in """${content}""" - Should Be True ${contains} msg=When -l option is applied, we can't call a command. + ${contains} Evaluate "The list argument expects no command" in """${content}""" + Should Be True ${contains} When -l option is applied, we can't call a command. Stop Engine Kindly Stop Broker Remove File /tmp/output.txt @@ -191,7 +191,7 @@ BECCC6 Broker Config Output Set central central-broker-unified-sql store_in_resources yes Broker Config Output Set central central-broker-unified-sql store_in_hosts_services no Clear Retention - ${start}= Get Current Date + ${start} Get Current Date Sleep 1s Start Broker Start Engine @@ -199,25 +199,25 @@ BECCC6 Start Process /usr/bin/ccc -p 51001 GetVersion{} stdout=/tmp/output.txt FOR ${i} IN RANGE 10 Wait Until Created /tmp/output.txt - ${content}= Get File /tmp/output.txt + ${content} Get File /tmp/output.txt IF len("""${content.strip().split()}""") > 50 BREAK Sleep 1s END - ${version}= Get Version - ${vers}= Split String ${version} . - ${mm}= Evaluate """${vers}[0]""".lstrip("0") - ${m}= Evaluate """${vers}[1]""".lstrip("0") - ${p}= Evaluate """${vers}[2]""".lstrip("0") + ${version} Get Version + ${vers} Split String ${version} . + ${mm} Evaluate """${vers}[0]""".lstrip("0") + ${m} Evaluate """${vers}[1]""".lstrip("0") + ${p} Evaluate """${vers}[2]""".lstrip("0") IF "${p}" == 0 or "${p}" == "" Should Contain ... ${content} ... {\n \"major\": ${mm},\n \"minor\": ${m}\n} - ... msg=A version as json string should be returned + ... A version as json string should be returned ELSE Should Contain ... ${content} ... {\n \"major\": ${mm},\n \"minor\": ${m},\n \"patch\": ${p}\n} - ... msg=A version as json string should be returned + ... A version as json string should be returned END Stop Engine Kindly Stop Broker @@ -238,7 +238,7 @@ BECCC7 Broker Config Output Set central central-broker-unified-sql store_in_resources yes Broker Config Output Set central central-broker-unified-sql store_in_hosts_services no Clear Retention - ${start}= Get Current Date + ${start} Get Current Date Sleep 1s Start Broker Start Engine @@ -246,14 +246,14 @@ BECCC7 Start Process /usr/bin/ccc -p 51001 GetVersion{"idx":1} stderr=/tmp/output.txt FOR ${i} IN RANGE 10 Wait Until Created /tmp/output.txt - ${content}= Get File /tmp/output.txt + ${content} Get File /tmp/output.txt IF len("""${content.strip().split()}""") > 10 BREAK Sleep 1s END Should Contain ... ${content} ... Error during the execution of '/com.centreon.broker.Broker/GetVersion' method: - ... msg=GetVersion{"idx":1} should return an error because the input message is incompatible with the expected one. + ... GetVersion{"idx":1} should return an error because the input message is incompatible with the expected one. Stop Engine Kindly Stop Broker Remove File /tmp/output.txt @@ -273,7 +273,7 @@ BECCC8 Broker Config Output Set central central-broker-unified-sql store_in_resources yes Broker Config Output Set central central-broker-unified-sql store_in_hosts_services no Clear Retention - ${start}= Get Current Date + ${start} Get Current Date Sleep 1s Start Broker Start Engine @@ -285,7 +285,7 @@ BECCC8 ... stdout=/tmp/output.txt FOR ${i} IN RANGE 10 Wait Until Created /tmp/output.txt - ${content}= Get File /tmp/output.txt + ${content} Get File /tmp/output.txt IF len("""${content.strip().split()}""") > 2 BREAK Sleep 1s END diff --git a/tests/connector_perl/connector_perl.robot b/tests/connector_perl/connector_perl.robot index b38a7743ac1..b83864b77c2 100644 --- a/tests/connector_perl/connector_perl.robot +++ b/tests/connector_perl/connector_perl.robot @@ -16,32 +16,32 @@ test use connector perl exist script [Tags] connector engine schedule forced host check local_host_test_machine /tmp/test_connector_perl/rw/centengine.cmd Sleep 5 seconds we wait engine forced checks - ${search_result}= check search /tmp/test_connector_perl/log/centengine.debug test.pl - Should Contain ${search_result} a dummy check msg=check not found + ${search_result} check search /tmp/test_connector_perl/log/centengine.debug test.pl + Should Contain ${search_result} a dummy check check not found test use connector perl unknown script [Documentation] test unknown script [Tags] connector engine schedule forced host check local_host_test_machine_bad_test /tmp/test_connector_perl/rw/centengine.cmd Sleep 5 seconds we wait engine forced checks - ${search_result}= check search /tmp/test_connector_perl/log/centengine.debug test_titi.pl + ${search_result} check search /tmp/test_connector_perl/log/centengine.debug test_titi.pl Should Contain ... ${search_result} ... Embedded Perl error: failed to open Perl file '/tmp/test_connector_perl/test_titi.pl' - ... msg=check not found + ... check not found test use connector perl multiple script [Documentation] test script multiple [Tags] connector engine FOR ${idx} IN RANGE 2 12 - ${host}= Catenate SEPARATOR= local_host_test_machine. ${idx} + ${host} Catenate SEPARATOR= local_host_test_machine. ${idx} schedule forced host check ${host} /tmp/test_connector_perl/rw/centengine.cmd END Sleep 10 seconds we wait engine forced checks FOR ${idx} IN RANGE 2 12 - ${search_str}= Catenate SEPARATOR= test.pl -H 127.0.0. ${idx} - ${search_result}= check search /tmp/test_connector_perl/log/centengine.debug ${search_str} - Should Contain ${search_result} a dummy check msg=check not found + ${search_str} Catenate SEPARATOR= test.pl -H 127.0.0. ${idx} + ${search_result} check search /tmp/test_connector_perl/log/centengine.debug ${search_str} + Should Contain ${search_result} a dummy check check not found END diff --git a/tests/connector_ssh/connector_ssh.robot b/tests/connector_ssh/connector_ssh.robot index 62fd0e4b64a..9a2a1819177 100644 --- a/tests/connector_ssh/connector_ssh.robot +++ b/tests/connector_ssh/connector_ssh.robot @@ -32,18 +32,18 @@ TestBadUser Start Engine ${start}= Get Current Date - ${content}= Create List INITIAL SERVICE STATE: host_1;service_1; check_for_external_commands() - ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${content} Create List INITIAL SERVICE STATE: host_1;service_1; check_for_external_commands() + ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} - ... msg=An Initial host state on host_1 should be raised before we can start our external commands. + ... An Initial host state on host_1 should be raised before we can start our external commands. ${start}= Get Current Date schedule forced host check host_1 ${VarRoot}/lib/centreon-engine/config0/rw/centengine.cmd - ${content}= Create List fail to connect to toto@127.0.0.10 - ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 - Should Be True ${result} msg=A message fail to connect to toto@127.0.0.10 should be available. + ${content} Create List fail to connect to toto@127.0.0.10 + ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + Should Be True ${result} A message fail to connect to toto@127.0.0.10 should be available. Stop Engine TestBadPwd @@ -61,18 +61,18 @@ TestBadPwd Start Engine ${start}= Get Current Date - ${content}= Create List INITIAL SERVICE STATE: host_1;service_1; check_for_external_commands() - ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${content} Create List INITIAL SERVICE STATE: host_1;service_1; check_for_external_commands() + ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} - ... msg=An Initial host state on host_1 should be raised before we can start our external commands. + ... An Initial host state on host_1 should be raised before we can start our external commands. ${start}= Get Current Date schedule forced host check host_1 ${VarRoot}/lib/centreon-engine/config0/rw/centengine.cmd - ${content}= Create List fail to connect to testconnssh@127.0.0.11 - ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 - Should Be True ${result} msg=A message fail to connect to testconnssh@127.0.0.11 should be available. + ${content} Create List fail to connect to testconnssh@127.0.0.11 + ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + Should Be True ${result} A message fail to connect to testconnssh@127.0.0.11 should be available. Stop Engine Test6Hosts @@ -87,7 +87,7 @@ Test6Hosts Config Engine ${1} Engine Config Set Value ${0} log_level_commands trace Engine Config Add Command ${0} ssh_linux_snmp $USER1$/check_by_ssh -H $HOSTADDRESS$ -l $_HOSTUSER$ -a $_HOSTPASSWORD$ -C "echo -n toto=$HOSTADDRESS$" SSH Connector - ${run_env}= Run Env + ${run_env} Run Env Engine Config Set Value In Hosts ${0} host_1 _USER testconnssh Engine Config Replace Value In Hosts ${0} host_1 check_command ssh_linux_snmp Engine Config Set Value In Hosts ${0} host_1 _IDENTITYFILE /home/testconnssh/.ssh/id_rsa @@ -107,11 +107,11 @@ Test6Hosts Start Engine ${start}= Get Current Date - ${content}= Create List INITIAL SERVICE STATE: host_1;service_1; check_for_external_commands() - ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${content} Create List INITIAL SERVICE STATE: host_1;service_1; check_for_external_commands() + ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} - ... msg=An Initial host state on host_1 should be raised before we can start our external commands. + ... An Initial host state on host_1 should be raised before we can start our external commands. ${start}= Get Current Date FOR ${idx} IN RANGE 1 7 @@ -119,19 +119,19 @@ Test6Hosts END IF "${run_env}" == "docker" - ${content}= Create List output='toto=127.0.0.1' - ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 - Should Be True ${result} msg=A message output='toto=127.0.0.1' should be available. + ${content} Create List output='toto=127.0.0.1' + ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + Should Be True ${result} A message output='toto=127.0.0.1' should be available. ELSE - ${content}= Create List output='toto=::1' - ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 - Should Be True ${result} msg=A message output='toto=::1' should be available. + ${content} Create List output='toto=::1' + ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + Should Be True ${result} A message output='toto=::1' should be available. END FOR ${idx} IN RANGE 2 7 - ${content}= Create List output='toto=127.0.0.${idx} - ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 - Should Be True ${result} msg=A message output='toto=127.0.0.${idx}' should be available. + ${content} Create List output='toto=127.0.0.${idx} + ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + Should Be True ${result} A message output='toto=127.0.0.${idx}' should be available. END Stop Engine @@ -156,5 +156,5 @@ Save SSH Logs If Failed Save SSH Logs Save Logs - ${failDir}= Catenate SEPARATOR= failed/ ${Test Name} + ${failDir} Catenate SEPARATOR= failed/ ${Test Name} Copy File ${ENGINE_LOG}/config0/connector_ssh.log ${failDir} diff --git a/tests/engine/forced_checks.robot b/tests/engine/forced_checks.robot index 8a19aa2704f..df3399b8861 100644 --- a/tests/engine/forced_checks.robot +++ b/tests/engine/forced_checks.robot @@ -76,11 +76,11 @@ EFHC2 Engine Config Set Value ${0} log_v2_enabled ${1} Clear Retention - ${start}= Get Current Date + ${start} Get Current Date Start Engine Start Broker - ${content}= Create List INITIAL HOST STATE: host_1; - ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${content} Create List INITIAL HOST STATE: host_1; + ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. @@ -89,7 +89,7 @@ EFHC2 Schedule Forced HOST CHECK host_1 ${VarRoot}/lib/centreon-engine/config0/rw/centengine.cmd Sleep 5s END - ${content}= Create List + ${content} Create List ... EXTERNAL COMMAND: SCHEDULE_FORCED_HOST_CHECK;host_1; ... HOST ALERT: host_1;DOWN;SOFT;1; ... EXTERNAL COMMAND: SCHEDULE_FORCED_HOST_CHECK;host_1; @@ -97,10 +97,10 @@ EFHC2 ... EXTERNAL COMMAND: SCHEDULE_FORCED_HOST_CHECK;host_1; ... HOST ALERT: host_1;DOWN;HARD;3; - ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} Message about SCHEDULE FORCED CHECK and HOST ALERT should be available in log. - ${result}= Check host status host_1 1 1 False + ${result} Check host status host_1 1 1 False Should be true ${result} host_1 should be down/hard Stop Engine Kindly Stop Broker @@ -126,13 +126,13 @@ EFHCU1 Clear Retention Clear db resources - ${start}= Get Current Date + ${start} Get Current Date Start Engine Start Broker - ${result}= Check host status host_1 4 1 True + ${result} Check host status host_1 4 1 True Should be true ${result} host_1 should be pending - ${content}= Create List INITIAL HOST STATE: host_1; - ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${content} Create List INITIAL HOST STATE: host_1; + ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. @@ -141,7 +141,7 @@ EFHCU1 Schedule Forced HOST CHECK host_1 ${VarRoot}/lib/centreon-engine/config0/rw/centengine.cmd Sleep 5s END - ${content}= Create List + ${content} Create List ... EXTERNAL COMMAND: SCHEDULE_FORCED_HOST_CHECK;host_1; ... HOST ALERT: host_1;DOWN;SOFT;1; ... EXTERNAL COMMAND: SCHEDULE_FORCED_HOST_CHECK;host_1; @@ -149,10 +149,10 @@ EFHCU1 ... EXTERNAL COMMAND: SCHEDULE_FORCED_HOST_CHECK;host_1; ... HOST ALERT: host_1;DOWN;HARD;3; - ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} Message about SCHEDULE FORCED CHECK and HOST ALERT should be available in log. - ${result}= Check host status host_1 1 1 True + ${result} Check host status host_1 1 1 True Should be true ${result} host_1 should be down/hard Stop Engine Kindly Stop Broker @@ -177,13 +177,13 @@ EFHCU2 Broker Config Add Item rrd bbdo_version 3.0.0 Clear Retention - ${start}= Get Current Date + ${start} Get Current Date Start Engine Start Broker - ${result}= Check host status host_1 4 1 True + ${result} Check host status host_1 4 1 True Should be true ${result} host_1 should be pending - ${content}= Create List INITIAL HOST STATE: host_1; - ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${content} Create List INITIAL HOST STATE: host_1; + ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. @@ -192,7 +192,7 @@ EFHCU2 Schedule Forced HOST CHECK host_1 ${VarRoot}/lib/centreon-engine/config0/rw/centengine.cmd Sleep 5s END - ${content}= Create List + ${content} Create List ... EXTERNAL COMMAND: SCHEDULE_FORCED_HOST_CHECK;host_1; ... HOST ALERT: host_1;DOWN;SOFT;1; ... EXTERNAL COMMAND: SCHEDULE_FORCED_HOST_CHECK;host_1; @@ -200,10 +200,10 @@ EFHCU2 ... EXTERNAL COMMAND: SCHEDULE_FORCED_HOST_CHECK;host_1; ... HOST ALERT: host_1;DOWN;HARD;3; - ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} Message about SCHEDULE FORCED CHECK and HOST ALERT should be available in log. - ${result}= Check host status host_1 1 1 True + ${result} Check host status host_1 1 1 True Should be true ${result} host_1 should be down/hard Stop Engine Kindly Stop Broker @@ -223,21 +223,21 @@ EMACROS ... \\d+ ... /bin/echo "ResourceFile: $RESOURCEFILE$ - LogFile: $LOGFILE$ - AdminEmail: $ADMINEMAIL$ - AdminPager: $ADMINPAGER$" Clear Retention - ${start}= Get Current Date + ${start} Get Current Date Start Engine Start Broker - ${content}= Create List INITIAL HOST STATE: host_1; - ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${content} Create List INITIAL HOST STATE: host_1; + ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. schedule_forced_svc_check host_1 service_1 Sleep 5s - ${content}= Create List + ${content} Create List ... ResourceFile: /tmp/etc/centreon-engine/config0/resource.cfg - LogFile: /tmp/var/log/centreon-engine/config0/centengine.log - AdminEmail: titus@bidibule.com - AdminPager: admin - ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} AdminEmail: titus@bidibule.com - AdminPager: admin not found in log. Stop Engine @@ -266,12 +266,12 @@ EMACROS_NOTIF Remove File /tmp/notif_toto.txt Clear Retention - ${start}= Get Current Date + ${start} Get Current Date Start Engine Start Broker - ${content}= Create List INITIAL HOST STATE: host_1; - ${result}= Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${content} Create List INITIAL HOST STATE: host_1; + ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. @@ -282,7 +282,7 @@ EMACROS_NOTIF Wait Until Created /tmp/notif_toto.txt 30s - ${grep_res}= Grep File + ${grep_res} Grep File ... /tmp/notif_toto.txt ... ResourceFile: /tmp/etc/centreon-engine/resource.cfg - LogFile: /tmp/var/log/centreon-engine/centengine.log - AdminEmail: titus@bidibule.com - AdminPager: admin diff --git a/tests/engine/perl-connectors.robot b/tests/engine/perl-connectors.robot index 179489b9ee2..12323e12667 100644 --- a/tests/engine/perl-connectors.robot +++ b/tests/engine/perl-connectors.robot @@ -21,15 +21,15 @@ EPC1 Config Engine ${1} Config Broker module Engine Config Set Value ${0} log_level_commands trace - ${start}= Get Current Date + ${start} Get Current Date Start Engine - ${content}= Create List connector::run: connector='Perl Connector' - ${result}= Find In Log with timeout ${engineLog0} ${start} ${content} 60 - Should Be True ${result} msg=Missing a message talking about 'Perl Connector' + ${content} Create List connector::run: connector='Perl Connector' + ${result} Find In Log with timeout ${engineLog0} ${start} ${content} 60 + Should Be True ${result} Missing a message talking about 'Perl Connector' - ${content}= Create List connector::data_is_available - ${result}= Find In Log with timeout ${engineLog0} ${start} ${content} 20 - Should Be True ${result} msg=Missing a message telling data is available from the Perl connector + ${content} Create List connector::data_is_available + ${result} Find In Log with timeout ${engineLog0} ${start} ${content} 20 + Should Be True ${result} Missing a message telling data is available from the Perl connector Stop Engine diff --git a/tests/resources/db_variables.robot b/tests/resources/db_variables.robot index f63d15a4d72..5badb0a6a95 100644 --- a/tests/resources/db_variables.robot +++ b/tests/resources/db_variables.robot @@ -7,5 +7,5 @@ ${DBHost} localhost ${DBUser} centreon ${DBPass} centreon ${DBPort} 3306 -${DBUserRoot} root_centreon +${DBUserRoot} root ${DBPassRoot} centreon diff --git a/tests/resources/resources.robot b/tests/resources/resources.robot index bd056087c60..fb3db68b44d 100644 --- a/tests/resources/resources.robot +++ b/tests/resources/resources.robot @@ -95,7 +95,7 @@ Kindly Stop Broker IF ${result.rc} != 0 Copy Coredump In Failed Dir b1 /usr/sbin/cbd broker_central Coredump Info b1 /usr/sbin/cbd broker_central - Should Be Equal As Integers ${result.rc} 0 msg=Central Broker not correctly stopped + Should Be Equal As Integers ${result.rc} 0 Central Broker not correctly stopped END END @@ -110,7 +110,7 @@ Kindly Stop Broker IF ${result.rc} != 0 Copy Coredump In Failed Dir b2 /usr/sbin/cbd broker_rrd Coredump info b2 /usr/sbin/cbd broker_rrd - Should Be Equal As Integers ${result.rc} 0 msg=RRD Broker not correctly stopped + Should Be Equal As Integers ${result.rc} 0 RRD Broker not correctly stopped END END END @@ -159,7 +159,7 @@ Stop Custom Engine ${result} Terminate Process ${process_alias} Should Be True ... ${result.rc} == -15 or ${result.rc} == 0 - ... msg=Engine badly stopped alias = ${process_alias} - code returned ${result.rc}. + ... Engine badly stopped alias = ${process_alias} - code returned ${result.rc}. Stop Engine ${count} Get Engines Count @@ -182,7 +182,7 @@ Stop Engine END Should Be True ... ${result.rc} == -15 or ${result.rc} == 0 - ... msg=Engine badly stopped with ${count} instances - code returned ${result.rc}. + ... Engine badly stopped with ${count} instances - code returned ${result.rc}. END END diff --git a/tests/severities/hosts.robot b/tests/severities/hosts.robot index 1275dea06b9..b27981a1c1d 100644 --- a/tests/severities/hosts.robot +++ b/tests/severities/hosts.robot @@ -34,23 +34,23 @@ BEUHSEV1 Broker Config Log module0 neb debug Broker Config Log central sql trace Clear Retention - ${start}= Get Current Date + ${start} Get Current Date Start Engine Start Broker Sleep 2s - ${result}= check host severity With Timeout 1 10 60 - Should Be True ${result} msg=Host 1 should have severity_id=10 + ${result} check host severity With Timeout 1 10 60 + Should Be True ${result} Host 1 should have severity_id=10 Remove Severities From Hosts ${0} Add Severity To Hosts 0 10 [2, 4] Add Severity To Hosts 0 8 [3] Reload Engine Reload Broker - ${result}= check host severity With Timeout 3 8 60 - Should Be True ${result} msg=Host 3 should have severity_id=8 - ${result}= check host severity With Timeout 1 None 60 - Should Be True ${result} msg=Host 1 should have no severity + ${result} check host severity With Timeout 3 8 60 + Should Be True ${result} Host 3 should have severity_id=8 + ${result} check host severity With Timeout 1 None 60 + Should Be True ${result} Host 1 should have no severity Stop Engine Kindly Stop Broker @@ -81,31 +81,31 @@ BEUHSEV2 Broker Config Log module1 neb debug Broker Config Log central sql trace Clear Retention - ${start}= Get Current Date + ${start} Get Current Date Start Engine Start Broker Sleep 5s # We need to wait a little before reloading Engine - ${result}= check host severity With Timeout 2 18 60 - Should Be True ${result} msg=First step: Host 2 should have severity_id=18 + ${result} check host severity With Timeout 2 18 60 + Should Be True ${result} First step: Host 2 should have severity_id=18 - ${result}= check host severity With Timeout 4 18 60 - Should Be True ${result} msg=First step: Host 4 should have severity_id=18 + ${result} check host severity With Timeout 4 18 60 + Should Be True ${result} First step: Host 4 should have severity_id=18 - ${result}= check host severity With Timeout 26 18 60 - Should Be True ${result} msg=First step: Host 26 should have severity_id=18 + ${result} check host severity With Timeout 26 18 60 + Should Be True ${result} First step: Host 26 should have severity_id=18 - ${result}= check host severity With Timeout 27 18 60 - Should Be True ${result} msg=First step: Host 27 should have severity_id=18 + ${result} check host severity With Timeout 27 18 60 + Should Be True ${result} First step: Host 27 should have severity_id=18 - ${result}= check host severity With Timeout 3 16 60 - Should Be True ${result} msg=First step: Host 3 should have severity_id=16 + ${result} check host severity With Timeout 3 16 60 + Should Be True ${result} First step: Host 3 should have severity_id=16 - ${result}= check host severity With Timeout 5 16 60 - Should Be True ${result} msg=First step: Host 5 should have severity_id=16 + ${result} check host severity With Timeout 5 16 60 + Should Be True ${result} First step: Host 5 should have severity_id=16 - ${result}= check host severity With Timeout 28 16 60 - Should Be True ${result} msg=First step: Host 28 should have severity_id=16 + ${result} check host severity With Timeout 28 16 60 + Should Be True ${result} First step: Host 28 should have severity_id=16 Remove Severities From Hosts ${0} Create Severities File ${0} ${18} @@ -114,17 +114,17 @@ BEUHSEV2 Reload Engine Reload Broker Sleep 3s - ${result}= check host severity With Timeout 28 16 60 - Should Be True ${result} msg=Second step: Host 28 should have severity_id=16 + ${result} check host severity With Timeout 28 16 60 + Should Be True ${result} Second step: Host 28 should have severity_id=16 - ${result}= check host severity With Timeout 4 None 60 - Should Be True ${result} msg=Second step: Host 4 should have severity_id=None + ${result} check host severity With Timeout 4 None 60 + Should Be True ${result} Second step: Host 4 should have severity_id=None - ${result}= check host severity With Timeout 3 None 60 - Should Be True ${result} msg=Second step: Host 3 should have severity_id=17 + ${result} check host severity With Timeout 3 None 60 + Should Be True ${result} Second step: Host 3 should have severity_id=17 - ${result}= check host severity With Timeout 5 None 60 - Should Be True ${result} msg=Second step: Host 5 should have severity_id=17 + ${result} check host severity With Timeout 5 None 60 + Should Be True ${result} Second step: Host 5 should have severity_id=17 Stop Engine Kindly Stop Broker @@ -160,25 +160,25 @@ BETUHSEV1 Broker Config Log module1 neb debug Broker Config Log central sql trace Clear Retention - ${start}= Get Current Date + ${start} Get Current Date Start Engine Start Broker Sleep 5s # We need to wait a little before reloading Engine - ${result}= check host severity With Timeout 2 2 60 - Should Be True ${result} msg=First step: Host 2 should have severity_id=2 + ${result} check host severity With Timeout 2 2 60 + Should Be True ${result} First step: Host 2 should have severity_id=2 - ${result}= check host severity With Timeout 4 2 60 - Should Be True ${result} msg=First step: Host 4 should have severity_id=2 + ${result} check host severity With Timeout 4 2 60 + Should Be True ${result} First step: Host 4 should have severity_id=2 - ${result}= check host severity With Timeout 5 4 60 - Should Be True ${result} msg=First step: Host 5 should have severity_id=4 + ${result} check host severity With Timeout 5 4 60 + Should Be True ${result} First step: Host 5 should have severity_id=4 - ${result}= check host severity With Timeout 31 6 60 - Should Be True ${result} msg=First step: Host 31 should have severity_id=6 + ${result} check host severity With Timeout 31 6 60 + Should Be True ${result} First step: Host 31 should have severity_id=6 - ${result}= check host severity With Timeout 33 10 60 - Should Be True ${result} msg=First step: Host 33 should have severity_id=10 + ${result} check host severity With Timeout 33 10 60 + Should Be True ${result} First step: Host 33 should have severity_id=10 Stop Engine Kindly Stop Broker diff --git a/tests/severities/severities.robot b/tests/severities/severities.robot index 2ee1d92871e..f57a513443d 100644 --- a/tests/severities/severities.robot +++ b/tests/severities/severities.robot @@ -30,13 +30,13 @@ BESEV1 Broker Config Log module0 neb debug Broker Config Log central sql debug Clear Retention - ${start}= Get Current Date + ${start} Get Current Date Start Broker Start Engine - ${result}= check severity With Timeout severity20 5 1 30 - Should Be True ${result} msg=severity20 should be of level 5 with icon_id 1 - ${result}= check severity With Timeout severity1 1 5 30 - Should Be True ${result} msg=severity1 should be of level 1 with icon_id 5 + ${result} check severity With Timeout severity20 5 1 30 + Should Be True ${result} severity20 should be of level 5 with icon_id 1 + ${result} check severity With Timeout severity1 1 5 30 + Should Be True ${result} severity1 should be of level 1 with icon_id 5 Stop Engine Kindly Stop Broker @@ -53,14 +53,14 @@ BESEV2 Broker Config Log module0 neb debug Broker Config Log central sql debug Clear Retention - ${start}= Get Current Date + ${start} Get Current Date Start Engine Sleep 1s Start Broker - ${result}= check severity With Timeout severity20 5 1 30 - Should Be True ${result} msg=severity20 should be of level 5 with icon_id 1 - ${result}= check severity With Timeout severity1 1 5 30 - Should Be True ${result} msg=severity1 should be of level 1 with icon_id 5 + ${result} check severity With Timeout severity20 5 1 30 + Should Be True ${result} severity20 should be of level 5 with icon_id 1 + ${result} check severity With Timeout severity1 1 5 30 + Should Be True ${result} severity1 should be of level 1 with icon_id 5 Stop Engine Kindly Stop Broker @@ -81,13 +81,13 @@ BEUSEV1 Broker Config Log module0 neb debug Broker Config Log central sql debug Clear Retention - ${start}= Get Current Date + ${start} Get Current Date Start Broker Start Engine - ${result}= check severity With Timeout severity20 5 1 30 - Should Be True ${result} msg=severity20 should be of level 5 with icon_id 1 - ${result}= check severity With Timeout severity1 1 5 30 - Should Be True ${result} msg=severity1 should be of level 1 with icon_id 5 + ${result} check severity With Timeout severity20 5 1 30 + Should Be True ${result} severity20 should be of level 5 with icon_id 1 + ${result} check severity With Timeout severity1 1 5 30 + Should Be True ${result} severity1 should be of level 1 with icon_id 5 Stop Engine Kindly Stop Broker @@ -108,14 +108,14 @@ BEUSEV2 Broker Config Log module0 neb debug Broker Config Log central sql debug Clear Retention - ${start}= Get Current Date + ${start} Get Current Date Start Engine Sleep 1s Start Broker - ${result}= check severity With Timeout severity20 5 1 30 - Should Be True ${result} msg=severity20 should be of level 5 with icon_id 1 - ${result}= check severity With Timeout severity1 1 5 30 - Should Be True ${result} msg=severity1 should be of level 1 with icon_id 5 + ${result} check severity With Timeout severity20 5 1 30 + Should Be True ${result} severity20 should be of level 5 with icon_id 1 + ${result} check severity With Timeout severity1 1 5 30 + Should Be True ${result} severity1 should be of level 1 with icon_id 5 Stop Engine Kindly Stop Broker @@ -137,23 +137,23 @@ BEUSEV3 Broker Config Log module0 neb debug Broker Config Log central sql trace Clear Retention - ${start}= Get Current Date + ${start} Get Current Date Start Engine Start Broker Sleep 2s - ${result}= check service severity With Timeout 1 1 11 60 - Should Be True ${result} msg=Service (1, 1) should have severity_id=11 + ${result} check service severity With Timeout 1 1 11 60 + Should Be True ${result} Service (1, 1) should have severity_id=11 Remove Severities From Services ${0} Add Severity To Services 0 11 [2, 4] Add Severity To Services 0 7 [3] Reload Engine Reload Broker - ${result}= check service severity With Timeout 1 3 7 60 - Should Be True ${result} msg=Service (1, 3) should have severity_id=7 - ${result}= check service severity With Timeout 1 1 None 60 - Should Be True ${result} msg=Service (1, 1) should have no severity + ${result} check service severity With Timeout 1 3 7 60 + Should Be True ${result} Service (1, 3) should have severity_id=7 + ${result} check service severity With Timeout 1 1 None 60 + Should Be True ${result} Service (1, 1) should have no severity Stop Engine Kindly Stop Broker @@ -183,31 +183,31 @@ BEUSEV4 Broker Config Log module0 neb debug Broker Config Log central sql trace Clear Retention - ${start}= Get Current Date + ${start} Get Current Date Start Engine Start Broker Sleep 5s # We need to wait a little before reloading Engine - ${result}= check_service_severity_With_Timeout 1 2 19 60 - Should Be True ${result} msg=First step: Service (1, 2) should have severity_id=19 + ${result} check_service_severity_With_Timeout 1 2 19 60 + Should Be True ${result} First step: Service (1, 2) should have severity_id=19 - ${result}= check service severity With Timeout 1 4 19 60 - Should Be True ${result} msg=First step: Service (1, 4) should have severity_id=19 + ${result} check service severity With Timeout 1 4 19 60 + Should Be True ${result} First step: Service (1, 4) should have severity_id=19 - ${result}= check service severity With Timeout 26 501 19 60 - Should Be True ${result} msg=First step: Service (26, 501) should have severity_id=19 + ${result} check service severity With Timeout 26 501 19 60 + Should Be True ${result} First step: Service (26, 501) should have severity_id=19 - ${result}= check service severity With Timeout 26 502 19 60 - Should Be True ${result} msg=First step: Service (26, 502) should have severity_id=19 + ${result} check service severity With Timeout 26 502 19 60 + Should Be True ${result} First step: Service (26, 502) should have severity_id=19 - ${result}= check service severity With Timeout 1 3 17 60 - Should Be True ${result} msg=First step: Service (1, 3) should have severity_id=17 + ${result} check service severity With Timeout 1 3 17 60 + Should Be True ${result} First step: Service (1, 3) should have severity_id=17 - ${result}= check service severity With Timeout 1 5 17 60 - Should Be True ${result} msg=First step: Service (1, 5) should have severity_id=17 + ${result} check service severity With Timeout 1 5 17 60 + Should Be True ${result} First step: Service (1, 5) should have severity_id=17 - ${result}= check service severity With Timeout 26 503 17 60 - Should Be True ${result} msg=First step: Service (26, 503) should have severity_id=17 + ${result} check service severity With Timeout 26 503 17 60 + Should Be True ${result} First step: Service (26, 503) should have severity_id=17 Remove Severities From Services ${0} Create Severities File ${0} ${18} @@ -216,17 +216,17 @@ BEUSEV4 Reload Engine Reload Broker Sleep 3s - ${result}= check service severity With Timeout 26 503 17 60 - Should Be True ${result} msg=Second step: Service (26, 503) should have severity_id=17 + ${result} check service severity With Timeout 26 503 17 60 + Should Be True ${result} Second step: Service (26, 503) should have severity_id=17 - ${result}= check service severity With Timeout 1 4 None 60 - Should Be True ${result} msg=Second step: Service (1, 4) should have severity_id=None + ${result} check service severity With Timeout 1 4 None 60 + Should Be True ${result} Second step: Service (1, 4) should have severity_id=None - ${result}= check service severity With Timeout 1 3 None 60 - Should Be True ${result} msg=Second step: Service (1, 3) should have severity_id=17 + ${result} check service severity With Timeout 1 3 None 60 + Should Be True ${result} Second step: Service (1, 3) should have severity_id=17 - ${result}= check service severity With Timeout 1 5 None 60 - Should Be True ${result} msg=Second step: Service (1, 5) should have severity_id=17 + ${result} check service severity With Timeout 1 5 None 60 + Should Be True ${result} Second step: Service (1, 5) should have severity_id=17 Stop Engine Kindly Stop Broker @@ -261,25 +261,25 @@ BETUSEV1 Broker Config Log module0 neb debug Broker Config Log central sql trace Clear Retention - ${start}= Get Current Date + ${start} Get Current Date Start Engine Start Broker Sleep 5s # We need to wait a little before reloading Engine - ${result}= check service severity With Timeout 1 2 1 60 - Should Be True ${result} msg=First step: Service (1, 2) should have severity_id=1 + ${result} check service severity With Timeout 1 2 1 60 + Should Be True ${result} First step: Service (1, 2) should have severity_id=1 - ${result}= check service severity With Timeout 1 4 1 60 - Should Be True ${result} msg=First step: Service (1, 4) should have severity_id=1 + ${result} check service severity With Timeout 1 4 1 60 + Should Be True ${result} First step: Service (1, 4) should have severity_id=1 - ${result}= check service severity With Timeout 1 5 3 60 - Should Be True ${result} msg=First step: Service (1, 5) should have severity_id=3 + ${result} check service severity With Timeout 1 5 3 60 + Should Be True ${result} First step: Service (1, 5) should have severity_id=3 - ${result}= check service severity With Timeout 26 502 3 60 - Should Be True ${result} msg=First step: Service (26, 502) should have severity_id=3 + ${result} check service severity With Timeout 26 502 3 60 + Should Be True ${result} First step: Service (26, 502) should have severity_id=3 - ${result}= check service severity With Timeout 26 503 5 60 - Should Be True ${result} msg=First step: Service (26, 503) should have severity_id=5 + ${result} check service severity With Timeout 26 503 5 60 + Should Be True ${result} First step: Service (26, 503) should have severity_id=5 Stop Engine Kindly Stop Broker From 8097c526321bba3583d0fbea401c14d5d0dccdea Mon Sep 17 00:00:00 2001 From: David Boucher Date: Fri, 13 Oct 2023 09:34:06 +0200 Subject: [PATCH 11/84] fix(tests): some bench tests disabled on arm --- .github/scripts/collect-test-robot.sh | 11 ++++++++++- tests/broker-engine/bench.robot | 4 ++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/.github/scripts/collect-test-robot.sh b/.github/scripts/collect-test-robot.sh index cd0ec5f1bff..d8618d97a7a 100755 --- a/.github/scripts/collect-test-robot.sh +++ b/.github/scripts/collect-test-robot.sh @@ -11,6 +11,10 @@ database_type=$2 distrib=${ID} distrib=$(echo $distrib | tr '[:lower:]' '[:upper:]') +echo "##### Tests on #####" +echo "$distrib" +echo "####################" + if [ ${database_type} == 'mysql' ] && [ ! -f tests/${test_file}.mysql ]; then echo > tests/log.html echo '' > tests/output.xml @@ -105,5 +109,10 @@ echo "##### Starting tests #####" cd tests ./init-proto.sh +export exclude= +if [ "$distrib" = "ARM" ]; then + exclude="-e exclude-arm" +fi + echo "####################### Run Centreon Collect Robot Tests #######################" -robot $test_file +robot $exclude $test_file diff --git a/tests/broker-engine/bench.robot b/tests/broker-engine/bench.robot index 3fa16154ee1..f268b7fc692 100644 --- a/tests/broker-engine/bench.robot +++ b/tests/broker-engine/bench.robot @@ -91,7 +91,7 @@ BENCH_${nb_check}STATUS BENCH_${nb_check}STATUS_TRACES [Documentation] external command CHECK_SERVICE_RESULT ${nb_check} times - [Tags] broker engine bench + [Tags] broker engine bench exclude-arm Config Engine ${1} ${50} ${20} # We want all the services to be passive to avoid parasite checks during our test. Set Services Passive ${0} service_.* @@ -159,7 +159,7 @@ BENCH_${nb_check}STATUS_TRACES BENCH_1000STATUS_100${suffixe} [Documentation] external command CHECK_SERVICE_RESULT 100 times with 100 pollers with 20 services - [Tags] broker engine bench + [Tags] broker engine bench exclude-arm Config Engine ${100} ${100} ${20} Config Broker module ${100} Config Broker central From 08e70f70bb9d87ac18d6b44138ce5597b4202bb5 Mon Sep 17 00:00:00 2001 From: David Boucher Date: Fri, 13 Oct 2023 10:27:58 +0200 Subject: [PATCH 12/84] fix(ci): attempt to disable some bench tests --- .github/scripts/collect-test-robot.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/scripts/collect-test-robot.sh b/.github/scripts/collect-test-robot.sh index d8618d97a7a..36efad82454 100755 --- a/.github/scripts/collect-test-robot.sh +++ b/.github/scripts/collect-test-robot.sh @@ -12,7 +12,8 @@ distrib=${ID} distrib=$(echo $distrib | tr '[:lower:]' '[:upper:]') echo "##### Tests on #####" -echo "$distrib" +cpu=$(awk -F':' '$1 ~ "model name" { print $2 }' /proc/cpuinfo | head -1) +echo $cpu echo "####################" if [ ${database_type} == 'mysql' ] && [ ! -f tests/${test_file}.mysql ]; then @@ -110,7 +111,7 @@ cd tests ./init-proto.sh export exclude= -if [ "$distrib" = "ARM" ]; then +if [[ "$cpu" =~ "arm" ]]; then exclude="-e exclude-arm" fi From e01e04283c67d9339581ae49fb65daacc15ad488 Mon Sep 17 00:00:00 2001 From: David Boucher Date: Fri, 13 Oct 2023 12:41:38 +0200 Subject: [PATCH 13/84] wip(ci): attempt to get information about arm cpu --- .github/scripts/collect-test-robot.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/scripts/collect-test-robot.sh b/.github/scripts/collect-test-robot.sh index 36efad82454..23b4115e40c 100755 --- a/.github/scripts/collect-test-robot.sh +++ b/.github/scripts/collect-test-robot.sh @@ -12,6 +12,7 @@ distrib=${ID} distrib=$(echo $distrib | tr '[:lower:]' '[:upper:]') echo "##### Tests on #####" +cat /proc/cpuinfo cpu=$(awk -F':' '$1 ~ "model name" { print $2 }' /proc/cpuinfo | head -1) echo $cpu echo "####################" From cfa2804a00760097268d285cf48a32f951c1c336 Mon Sep 17 00:00:00 2001 From: David Boucher Date: Fri, 13 Oct 2023 13:19:00 +0200 Subject: [PATCH 14/84] wip(ci) --- .github/scripts/collect-test-robot.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/scripts/collect-test-robot.sh b/.github/scripts/collect-test-robot.sh index 23b4115e40c..50a8b49084a 100755 --- a/.github/scripts/collect-test-robot.sh +++ b/.github/scripts/collect-test-robot.sh @@ -12,6 +12,7 @@ distrib=${ID} distrib=$(echo $distrib | tr '[:lower:]' '[:upper:]') echo "##### Tests on #####" +lscpu | grep Architecture cat /proc/cpuinfo cpu=$(awk -F':' '$1 ~ "model name" { print $2 }' /proc/cpuinfo | head -1) echo $cpu From e8ed4a11eaa1d243770b9248bc53f88e9c6e4645 Mon Sep 17 00:00:00 2001 From: David Boucher Date: Fri, 13 Oct 2023 14:08:02 +0200 Subject: [PATCH 15/84] wip(ci) --- .github/scripts/collect-test-robot.sh | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/.github/scripts/collect-test-robot.sh b/.github/scripts/collect-test-robot.sh index 50a8b49084a..2b5e2029114 100755 --- a/.github/scripts/collect-test-robot.sh +++ b/.github/scripts/collect-test-robot.sh @@ -11,12 +11,7 @@ database_type=$2 distrib=${ID} distrib=$(echo $distrib | tr '[:lower:]' '[:upper:]') -echo "##### Tests on #####" -lscpu | grep Architecture -cat /proc/cpuinfo -cpu=$(awk -F':' '$1 ~ "model name" { print $2 }' /proc/cpuinfo | head -1) -echo $cpu -echo "####################" +cpu=$(lscpu | awk '$1 ~ "Architecture" { print $2 }') if [ ${database_type} == 'mysql' ] && [ ! -f tests/${test_file}.mysql ]; then echo > tests/log.html @@ -112,8 +107,8 @@ echo "##### Starting tests #####" cd tests ./init-proto.sh -export exclude= -if [[ "$cpu" =~ "arm" ]]; then +exclude= +if [[ "$cpu" =~ "aarch64" ]]; then exclude="-e exclude-arm" fi From 9d6441c6eb261ec86d3e33dbb388f22025aee91b Mon Sep 17 00:00:00 2001 From: David Boucher Date: Fri, 13 Oct 2023 14:18:52 +0200 Subject: [PATCH 16/84] wip(ci): attempt to reduce the artifact --- .github/workflows/robot-test.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/robot-test.yml b/.github/workflows/robot-test.yml index e537793ff7a..3b6ac99604b 100644 --- a/.github/workflows/robot-test.yml +++ b/.github/workflows/robot-test.yml @@ -92,10 +92,8 @@ jobs: run: | mkdir reports FILE_PREFIX=`echo "${{ matrix.feature }}" | sed -e "s#/#__#g"`-${{inputs.database_type}} - mv tests/log.html reports/$FILE_PREFIX-log.html - mv tests/output.xml reports/$FILE_PREFIX-output.xml - mv tests/report.html reports/$FILE_PREFIX-report.html if [ -d tests/failed ] ; then + mv tests/log.html reports/$FILE_PREFIX-log.html mv tests/failed reports/$FILE_PREFIX-failed fi From 4796c22dabb55f3bde54321679de860170bf8287 Mon Sep 17 00:00:00 2001 From: David Boucher Date: Fri, 13 Oct 2023 14:24:18 +0200 Subject: [PATCH 17/84] fix(tests): restoring db_variables.robot with its weird values --- tests/resources/db_variables.robot | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/resources/db_variables.robot b/tests/resources/db_variables.robot index 5badb0a6a95..f63d15a4d72 100644 --- a/tests/resources/db_variables.robot +++ b/tests/resources/db_variables.robot @@ -7,5 +7,5 @@ ${DBHost} localhost ${DBUser} centreon ${DBPass} centreon ${DBPort} 3306 -${DBUserRoot} root +${DBUserRoot} root_centreon ${DBPassRoot} centreon From 06b177638d4344b1e241f47127e9f5ef7af1c0fb Mon Sep 17 00:00:00 2001 From: David Boucher Date: Fri, 13 Oct 2023 14:28:32 +0200 Subject: [PATCH 18/84] wip(ci) --- .github/scripts/collect-test-robot.sh | 2 +- tests/broker-engine/bench.robot | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/scripts/collect-test-robot.sh b/.github/scripts/collect-test-robot.sh index 2b5e2029114..e9b0ad45f5c 100755 --- a/.github/scripts/collect-test-robot.sh +++ b/.github/scripts/collect-test-robot.sh @@ -108,7 +108,7 @@ cd tests ./init-proto.sh exclude= -if [[ "$cpu" =~ "aarch64" ]]; then +if [ "$cpu" = "aarch64" ]; then exclude="-e exclude-arm" fi diff --git a/tests/broker-engine/bench.robot b/tests/broker-engine/bench.robot index f268b7fc692..58f5857678b 100644 --- a/tests/broker-engine/bench.robot +++ b/tests/broker-engine/bench.robot @@ -24,7 +24,7 @@ Test Teardown Stop Engine Broker And Save Logs *** Test Cases *** BENCH_${nb_check}STATUS [Documentation] external command CHECK_SERVICE_RESULT 1000 times - [Tags] broker engine bench + [Tags] broker engine bench exclude-arm Config Engine ${1} ${50} ${20} # We want all the services to be passive to avoid parasite checks during our test. Set Services Passive ${0} service_.* From c3b1c1201fe34d328e86cae5cc215cdc7ca0cc70 Mon Sep 17 00:00:00 2001 From: David Boucher Date: Sat, 14 Oct 2023 11:51:23 +0200 Subject: [PATCH 19/84] wip(tests) --- .github/scripts/collect-test-robot.sh | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/scripts/collect-test-robot.sh b/.github/scripts/collect-test-robot.sh index e9b0ad45f5c..eb2cd4f31bd 100755 --- a/.github/scripts/collect-test-robot.sh +++ b/.github/scripts/collect-test-robot.sh @@ -13,6 +13,10 @@ distrib=$(echo $distrib | tr '[:lower:]' '[:upper:]') cpu=$(lscpu | awk '$1 ~ "Architecture" { print $2 }') +if [ "$cpu" = "aarch64" -a "$test_file" = "broker-engine/bench.robot" ]; then + exit 0 +fi + if [ ${database_type} == 'mysql' ] && [ ! -f tests/${test_file}.mysql ]; then echo > tests/log.html echo '' > tests/output.xml @@ -107,10 +111,5 @@ echo "##### Starting tests #####" cd tests ./init-proto.sh -exclude= -if [ "$cpu" = "aarch64" ]; then - exclude="-e exclude-arm" -fi - echo "####################### Run Centreon Collect Robot Tests #######################" -robot $exclude $test_file +robot $test_file From 0df35be9e712423efe5761c688ea3d665cfffd3b Mon Sep 17 00:00:00 2001 From: David Boucher Date: Sat, 14 Oct 2023 14:22:19 +0200 Subject: [PATCH 20/84] fix(ci) --- tests/broker-engine/tags.robot | 14 +++++++++----- tests/resources/Common.py | 9 +++------ 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/tests/broker-engine/tags.robot b/tests/broker-engine/tags.robot index 009b1bbfc5d..4bb1b044db1 100644 --- a/tests/broker-engine/tags.robot +++ b/tests/broker-engine/tags.robot @@ -309,7 +309,7 @@ BEUTAG6 Kindly Stop Broker BEUTAG7 - [Documentation] some services are configured and deleted with tags on two pollers. + [Documentation] Some services are configured with tags on two pollers. Then tags configuration is modified. [Tags] broker engine protobuf bbdo tags Config Engine ${2} Create Tags File ${0} ${20} @@ -343,7 +343,7 @@ BEUTAG7 ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} A message telling check_for_external_commands() should be available. - # We need to wait a little before reloading Engine + # We check in the DB if the service (1,1) has well its servicegroup tags configured. ${result} check resources tags With Timeout 1 1 servicegroup [2,4] 60 Should Be True ${result} First step: Service (1, 1) should have servicegroup tags 2 and 4 @@ -359,17 +359,21 @@ BEUTAG7 Create Tags File ${0} ${18} Create Tags File ${1} ${18} Add Tags To Services ${1} group_tags 3,5 [505, 506, 507, 508] + ${start} Get Round Current Date Reload Engine Reload Broker - Sleep 3s + # Let's wait for the external command check start + ${content} Create List check_for_external_commands() + ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + Should Be True ${result} A message telling check_for_external_commands() should be available. + ${result} check resources tags With Timeout 26 507 servicegroup [3,5] 60 Should Be True ${result} Second step: Service (26, 507) should have servicegroup tags 3 and 5 ${result} check resources tags With Timeout 26 508 servicegroup [3,5] 60 Should Be True ${result} Second step: Service (26, 508) should have servicegroup tags 3 and 5 - Stop Engine - Kindly Stop Broker + [Teardown] Run Keywords Stop Engine AND Kindly Stop Broker BEUTAG8 [Documentation] Services have tags provided by templates. diff --git a/tests/resources/Common.py b/tests/resources/Common.py index 2357c617ce9..591f223f002 100644 --- a/tests/resources/Common.py +++ b/tests/resources/Common.py @@ -1052,10 +1052,8 @@ def check_resources_tags_with_timeout(parent_id: int, mid: int, typ: str, tag_id with connection: with connection.cursor() as cursor: - logger.console("select t.id from resources r inner join resources_tags rt on r.resource_id=rt.resource_id inner join tags t on rt.tag_id=t.tag_id WHERE r.id={} and r.parent_id={} and t.type={}".format( - mid, parent_id, t)) - cursor.execute("select t.id from resources r inner join resources_tags rt on r.resource_id=rt.resource_id inner join tags t on rt.tag_id=t.tag_id WHERE r.id={} and r.parent_id={} and t.type={}".format( - mid, parent_id, t)) + logger.console(f"select t.id from resources r inner join resources_tags rt on r.resource_id=rt.resource_id inner join tags t on rt.tag_id=t.tag_id WHERE r.id={mid} and r.parent_id={parent_id} and t.type={t}") + cursor.execute(f"select t.id from resources r inner join resources_tags rt on r.resource_id=rt.resource_id inner join tags t on rt.tag_id=t.tag_id WHERE r.id={mid} and r.parent_id={parent_id} and t.type={t}") result = cursor.fetchall() logger.console(result) if not enabled: @@ -1077,8 +1075,7 @@ def check_resources_tags_with_timeout(parent_id: int, mid: int, typ: str, tag_id break return True else: - logger.console("different sizes: result:{} and tag_ids:{}".format( - len(result), len(tag_ids))) + logger.console("Result and tag_ids should have the same size, moreover 'id' in result should be values of tag_ids, result size = {len(result)} and tag_ids size = {len(tag_ids)} - their content are result: {result} and tag_ids: {tag_ids}") else: logger.console("result") logger.console(result) From cf99e316bec97dfa74fc8cbd2022f24e6f3ab964 Mon Sep 17 00:00:00 2001 From: David Boucher Date: Sat, 14 Oct 2023 19:04:05 +0200 Subject: [PATCH 21/84] fix(broker/feeder): feeder can be not stopped when switched off --- broker/core/src/processing/feeder.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/broker/core/src/processing/feeder.cc b/broker/core/src/processing/feeder.cc index 416aa17249e..0fee937c898 100644 --- a/broker/core/src/processing/feeder.cc +++ b/broker/core/src/processing/feeder.cc @@ -95,6 +95,7 @@ feeder::feeder(const std::string& name, * Destructor. */ feeder::~feeder() { + stop(); SPDLOG_LOGGER_DEBUG(log_v2::core(), "destroy feeder {}, {:p}", get_name(), static_cast(this)); stop(); @@ -264,6 +265,8 @@ void feeder::stop() { * */ void feeder::_stop_no_lock() { + SPDLOG_LOGGER_INFO(log_v2::processing(), "{} Stop without lock called", + _name); state expected = state::running; if (!_state.compare_exchange_strong(expected, state::finished)) { return; From e2873594e470cc569482ecfc7930d102ebc5b9f4 Mon Sep 17 00:00:00 2001 From: David Boucher Date: Sat, 14 Oct 2023 19:06:50 +0200 Subject: [PATCH 22/84] fix(tests): cleanup of some keywords --- tests/bam/bam_pb.robot | 26 ++-- tests/bam/boolean_rules.robot | 12 +- tests/bam/inherited_downtime.robot | 18 +-- tests/bam/pb_inherited_downtime.robot | 18 +-- .../dedicated-connection.robot | 4 +- tests/broker-engine/acknowledgement.robot | 12 +- tests/broker-engine/anomaly-detection.robot | 10 +- tests/broker-engine/bbdo-protobuf.robot | 6 +- tests/broker-engine/bench.robot | 8 +- tests/broker-engine/delete-poller.robot | 60 +++---- tests/broker-engine/downtimes.robot | 12 +- tests/broker-engine/external-commands.robot | 58 +++---- tests/broker-engine/external-commands2.robot | 76 ++++----- tests/broker-engine/muxer_filter.robot | 44 +++--- tests/broker-engine/output-tables.robot | 8 +- .../broker-engine/retention-duplicates.robot | 46 +++--- tests/broker-engine/reverse-connection.robot | 10 +- tests/broker-engine/services-increased.robot | 6 +- tests/broker-engine/services.robot | 2 +- tests/broker-engine/start-stop.robot | 4 +- tests/broker-engine/tags.robot | 146 +++++++++--------- tests/broker-engine/victoria.robot | 8 +- tests/broker/command-line.robot | 2 +- tests/broker/start-stop.robot | 2 +- tests/connector_ssh/connector_ssh.robot | 16 +- tests/engine/forced_checks.robot | 22 +-- tests/engine/perl-connectors.robot | 4 +- tests/resources/Engine.py | 62 +++----- tests/resources/db_variables.robot | 2 +- tests/resources/resources.robot | 4 + 30 files changed, 350 insertions(+), 358 deletions(-) diff --git a/tests/bam/bam_pb.robot b/tests/bam/bam_pb.robot index c1fb4a51187..62b14b54efc 100644 --- a/tests/bam/bam_pb.robot +++ b/tests/bam/bam_pb.robot @@ -24,14 +24,14 @@ BAWORST BAM Init @{svc} Set Variable ${{ [("host_16", "service_314"), ("host_16", "service_303")] }} - Create BA With Services test worst ${svc} + Create Ba With Services test worst ${svc} Start Broker ${start} Get Current Date Start Engine # Let's wait for the external command check start ${content} Create List check_for_external_commands() - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} A message telling check_for_external_commands() should be available. ${result} Check Ba Status With Timeout test 0 60 @@ -104,7 +104,7 @@ BABEST_SERVICE_CRITICAL BAM Init @{svc} Set Variable ${{ [("host_16", "service_314"), ("host_16", "service_303")] }} - Create BA With Services test best ${svc} + Create Ba With Services test best ${svc} # Command of service_314 is set to critical ${cmd_1} Get Command Id 314 Log To Console service_314 has command id ${cmd_1} @@ -114,7 +114,7 @@ BABEST_SERVICE_CRITICAL Start Engine # Let's wait for the external command check start ${content} Create List check_for_external_commands() - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} A message telling check_for_external_commands() should be available. ${result} Check Ba Status With Timeout test 0 60 @@ -213,7 +213,7 @@ BA_IMPACT_2KPI_SERVICES Start Engine # Let's wait for the external command check start ${content} Create List check_for_external_commands() - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} A message telling check_for_external_commands() should be available. # service_302 critical service_303 warning => ba warning 30% @@ -335,7 +335,7 @@ BA_RATIO_PERCENT_BA_SERVICE Start Engine # Let's wait for the external command check start ${content} Create List check_for_external_commands() - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} A message telling check_for_external_commands() should be available. ${result} Check Ba Status With Timeout test 0 60 @@ -446,7 +446,7 @@ BA_RATIO_NUMBER_BA_SERVICE Start Engine # Let's wait for the external command check start ${content} Create List check_for_external_commands() - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} A message telling check_for_external_commands() should be available. ${result} Check Ba Status With Timeout test 0 60 @@ -561,7 +561,7 @@ BA_BOOL_KPI Start Engine # Let's wait for the external command check start ${content} Create List check_for_external_commands() - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} A message telling check_for_external_commands() should be available. # 302 warning and 303 critical => ba critical @@ -632,7 +632,7 @@ BEPB_DIMENSION_BA_EVENT Remove File /tmp/all_lua_event.log @{svc} Set Variable ${{ [("host_16", "service_314")] }} - Create BA With Services test worst ${svc} + Create Ba With Services test worst ${svc} Broker Config Add Lua Output central test-protobuf ${SCRIPTS}test-log-all-event.lua @@ -666,7 +666,7 @@ BEPB_DIMENSION_BA_BV_RELATION_EVENT Clear Db mod_bam_reporting_relations_ba_bv @{svc} Set Variable ${{ [("host_16", "service_314")] }} - Create BA With Services test worst ${svc} + Create Ba With Services test worst ${svc} Broker Config Add Lua Output central test-protobuf ${SCRIPTS}test-log-all-event.lua @@ -700,7 +700,7 @@ BEPB_DIMENSION_TIMEPERIOD BAM Init @{svc} Set Variable ${{ [("host_16", "service_314")] }} - Create BA With Services test worst ${svc} + Create Ba With Services test worst ${svc} Remove File /tmp/all_lua_event.log @@ -921,7 +921,7 @@ BA_RATIO_NUMBER_BA_4_SERVICE Start Engine # Let's wait for the external command check start ${content} Create List check_for_external_commands() - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} A message telling check_for_external_commands() should be available. # all serv ok => ba ok @@ -982,7 +982,7 @@ BA_RATIO_PERCENT_BA_4_SERVICE Start Engine # Let's wait for the external command check start ${content} Create List check_for_external_commands() - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} A message telling check_for_external_commands() should be available. # all serv ok => ba ok diff --git a/tests/bam/boolean_rules.robot b/tests/bam/boolean_rules.robot index 89928a3e543..f5c75a00f10 100644 --- a/tests/bam/boolean_rules.robot +++ b/tests/bam/boolean_rules.robot @@ -55,7 +55,7 @@ BABOO Start Engine # Let's wait for the external command check start ${content} Create List check_for_external_commands() - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} A message telling check_for_external_commands() should be available. # 393 is set to ok. @@ -129,7 +129,7 @@ BABOOOR Start Engine # Let's wait for the external command check start ${content} Create List check_for_external_commands() - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} A message telling check_for_external_commands() should be available. # 303 is unknown but since the boolean operator is OR, if 302 result is true, we should have already a result. @@ -182,7 +182,7 @@ BABOOAND Start Engine # Let's wait for the external command check start ${content} Create List check_for_external_commands() - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} A message telling check_for_external_commands() should be available. # 303 is unknown but since the boolean operator is AND, if 302 result is false, we should have already a result. @@ -284,7 +284,7 @@ BABOOORREL # Let's wait for the external command check start ${content} Create List check_for_external_commands() - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} A message telling check_for_external_commands() should be available. ${result} Check Ba Status With Timeout boolean-ba 0 30 Dump Ba On Error ${result} ${id_ba__sid[0]} @@ -299,7 +299,7 @@ BABOOORREL # Let's wait for the external command check start ${content} Create List check_for_external_commands() - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} A message telling check_for_external_commands() should be available. ${result} Check Ba Status With Timeout boolean-ba 2 30 Dump Ba On Error ${result} ${id_ba__sid[0]} @@ -343,7 +343,7 @@ BABOOCOMPL Start Engine # Let's wait for the external command check start ${content} Create List check_for_external_commands() - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} A message telling check_for_external_commands() should be available. FOR ${i} IN RANGE ${1} ${21} Repeat Keyword diff --git a/tests/bam/inherited_downtime.robot b/tests/bam/inherited_downtime.robot index 12bee1eff8e..49db69cf7f5 100644 --- a/tests/bam/inherited_downtime.robot +++ b/tests/bam/inherited_downtime.robot @@ -30,7 +30,7 @@ BEBAMIDT1 Add Bam Config To Engine @{svc} Set Variable ${{ [("host_16", "service_314")] }} - Create BA With Services test worst ${svc} + Create Ba With Services test worst ${svc} Add Bam Config To Broker central # Command of service_314 is set to critical ${cmd_1} Get Command Id 314 @@ -41,7 +41,7 @@ BEBAMIDT1 Start Engine # Let's wait for the initial service states. ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial service state on service (50, 1000) should be raised before we can start external commands. @@ -90,7 +90,7 @@ BEBAMIDT2 Add Bam Config To Engine @{svc} Set Variable ${{ [("host_16", "service_314")] }} - Create BA With Services test worst ${svc} + Create Ba With Services test worst ${svc} Add Bam Config To Broker central # Command of service_314 is set to critical ${cmd_1} Get Command Id 314 @@ -101,7 +101,7 @@ BEBAMIDT2 Start Engine # Let's wait for the initial service states. ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial service state on service (50, 1000) should be raised before we can start external commands. @@ -133,7 +133,7 @@ BEBAMIDT2 Start Engine # Let's wait for the initial service states. ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial service state on service (50, 1000) should be raised before we can start external commands. @@ -185,7 +185,7 @@ BEBAMIGNDT1 Add Bam Config To Engine @{svc} Set Variable ${{ [("host_16", "service_313"), ("host_16", "service_314")] }} - Create BA With Services test worst ${svc} ignore + Create Ba With Services test worst ${svc} ignore Add Bam Config To Broker central # Command of service_313 is set to ok @@ -203,7 +203,7 @@ BEBAMIGNDT1 Start Engine # Let's wait for the initial service states. ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial service state on service (50, 1000) should be raised before we can start external commands. @@ -288,7 +288,7 @@ BEBAMIGNDT2 Add Bam Config To Engine @{svc} Set Variable ${{ [("host_16", "service_313"), ("host_16", "service_314")] }} - Create BA With Services test worst ${svc} ignore + Create Ba With Services test worst ${svc} ignore Add Bam Config To Broker central # Command of service_314 is set to critical ${cmd_1} Get Command Id 313 @@ -302,7 +302,7 @@ BEBAMIGNDT2 Start Engine # Let's wait for the initial service states. ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial service state on service (50, 1000) should be raised before we can start external commands. diff --git a/tests/bam/pb_inherited_downtime.robot b/tests/bam/pb_inherited_downtime.robot index c5d46bf921e..9077347c756 100644 --- a/tests/bam/pb_inherited_downtime.robot +++ b/tests/bam/pb_inherited_downtime.robot @@ -31,7 +31,7 @@ BEBAMIDTU1 Add Bam Config To Engine @{svc} Set Variable ${{ [("host_16", "service_314")] }} - Create BA With Services test worst ${svc} + Create Ba With Services test worst ${svc} Add Bam Config To Broker central # Command of service_314 is set to critical ${cmd_1} Get Command Id 314 @@ -42,7 +42,7 @@ BEBAMIDTU1 Start Engine # Let's wait for the initial service states. ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial service state on service (50, 1000) should be raised before we can start external commands. @@ -94,7 +94,7 @@ BEBAMIDTU2 Add Bam Config To Engine @{svc} Set Variable ${{ [("host_16", "service_314")] }} - Create BA With Services test worst ${svc} + Create Ba With Services test worst ${svc} Add Bam Config To Broker central # Command of service_314 is set to critical ${cmd_1} Get Command Id 314 @@ -105,7 +105,7 @@ BEBAMIDTU2 Start Engine # Let's wait for the initial service states. ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial service state on service (50, 1000) should be raised before we can start external commands. @@ -133,7 +133,7 @@ BEBAMIDTU2 Start Engine # Let's wait for the initial service states. ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial service state on service (50, 1000) should be raised before we can start external commands. @@ -189,7 +189,7 @@ BEBAMIGNDTU1 Add Bam Config To Engine @{svc} Set Variable ${{ [("host_16", "service_313"), ("host_16", "service_314")] }} - Create BA With Services test worst ${svc} ignore + Create Ba With Services test worst ${svc} ignore Add Bam Config To Broker central # Command of service_313 is set to ok @@ -207,7 +207,7 @@ BEBAMIGNDTU1 Start Engine # Let's wait for the initial service states. ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial service state on service (50, 1000) should be raised before we can start external commands. @@ -296,7 +296,7 @@ BEBAMIGNDTU2 Add Bam Config To Engine @{svc} Set Variable ${{ [("host_16", "service_313"), ("host_16", "service_314")] }} - Create BA With Services test worst ${svc} ignore + Create Ba With Services test worst ${svc} ignore Add Bam Config To Broker central # Command of service_314 is set to critical ${cmd_1} Get Command Id 313 @@ -310,7 +310,7 @@ BEBAMIGNDTU2 Start Engine # Let's wait for the initial service states. ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial service state on service (50, 1000) should be raised before we can start external commands. diff --git a/tests/broker-database/dedicated-connection.robot b/tests/broker-database/dedicated-connection.robot index 756c73f9024..64352282986 100644 --- a/tests/broker-database/dedicated-connection.robot +++ b/tests/broker-database/dedicated-connection.robot @@ -28,13 +28,13 @@ DEDICATED_DB_CONNECTION_${nb_conn}_${store_in_data_bin} ${start} Get Current Date Start Broker only_central=${True} ${content} Create List unified sql: stream class instanciation - ${result} Find In Log with Timeout ${centralLog} ${start} ${content} 60 + ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 60 Should Be True ${result} No unified sql instanciation IF ${nb_conn} > 1 ${nb_dedicated} Evaluate ${nb_conn_expected} - 1 ${content} Create List use of ${nb_dedicated} dedicated connection for logs and data_bin tables - ${result} Find In Log with Timeout ${centralLog} ${start} ${content} 5 + ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 5 Should Be True ${result} No dedicated message END diff --git a/tests/broker-engine/acknowledgement.robot b/tests/broker-engine/acknowledgement.robot index 5087269c04c..6dddf99b0c9 100644 --- a/tests/broker-engine/acknowledgement.robot +++ b/tests/broker-engine/acknowledgement.robot @@ -32,7 +32,7 @@ BEACK1 Start Broker Start Engine ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial service state on (host_50,service_1000) should be raised before we can start our external commands. @@ -75,7 +75,7 @@ BEACK2 Start Engine # Let's wait for the external command check start ${content} Create List check_for_external_commands() - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} A message telling check_for_external_commands() should be available. # Time to set the service to CRITICAL HARD. @@ -114,7 +114,7 @@ BEACK3 Start Broker Start Engine ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial service state on (host_50,service_1000) should be raised before we can start our external commands. @@ -153,7 +153,7 @@ BEACK4 Start Broker Start Engine ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial service state on (host_50,service_1000) should be raised before we can start our external commands. @@ -194,7 +194,7 @@ BEACK5 Start Broker Start Engine ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial service state on (host_50,service_1000) should be raised before we can start our external commands. @@ -242,7 +242,7 @@ BEACK6 Start Broker Start Engine ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial service state on (host_50,service_1000) should be raised before we can start our external commands. diff --git a/tests/broker-engine/anomaly-detection.robot b/tests/broker-engine/anomaly-detection.robot index 117a0e2dd24..59295771363 100644 --- a/tests/broker-engine/anomaly-detection.robot +++ b/tests/broker-engine/anomaly-detection.robot @@ -181,7 +181,7 @@ AOUTLU1 Start Engine # Let's wait for the check of external commands ${content} Create List check_for_external_commands - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} No check for external commands executed for 1mn. Process Service Check result host_1 anomaly_${serv_id} 2 taratata|metric=80%;50;75 @@ -217,7 +217,7 @@ ANO_DT1 Start Engine # Let's wait for the check of external commands ${content} Create List check_for_external_commands - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} No check for external commands executed for 1mn. #create dependent service downtime @@ -254,7 +254,7 @@ ANO_DT2 Start Engine # Let's wait for the check of external commands ${content} Create List check_for_external_commands - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} No check for external commands executed for 1mn. #create dependent service downtime @@ -295,7 +295,7 @@ ANO_DT3 Start Engine # Let's wait for the check of external commands ${content} Create List check_for_external_commands - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} No check for external commands executed for 1mn. #create dependent service downtime @@ -337,7 +337,7 @@ ANO_DT4 Start Engine # Let's wait for the check of external commands ${content} Create List check_for_external_commands - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} No check for external commands executed for 1mn. #create dependent service downtime diff --git a/tests/broker-engine/bbdo-protobuf.robot b/tests/broker-engine/bbdo-protobuf.robot index 00d485a0d9f..34cf997bb99 100644 --- a/tests/broker-engine/bbdo-protobuf.robot +++ b/tests/broker-engine/bbdo-protobuf.robot @@ -34,7 +34,7 @@ BEPBBEE1 Start Broker Start Engine ${content} Create List BBDO: peer is using protocol version 3.0.0 whereas we're using protocol version 2.0.0 - ${result} Find In Log with timeout ${centralLog} ${start} ${content} 30 + ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 30 Should Be True ${result} Message about not matching bbdo versions not available Stop Engine Kindly Stop Broker @@ -57,7 +57,7 @@ BEPBBEE2 Start Engine ${content} Create List ... Configuration check error: bbdo versions >= 3.0.0 need the unified_sql module to be configured. - ${result} Find In Log with timeout ${centralLog} ${start} ${content} 30 + ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 30 Should Be True ${result} Message about a missing config of unified_sql not available. Stop Engine @@ -176,7 +176,7 @@ BEPBCVS Start Broker True Start Engine ${content} Create List check_for_external_commands - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} No check for external commands executed for 1mn. Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} diff --git a/tests/broker-engine/bench.robot b/tests/broker-engine/bench.robot index 58f5857678b..2e8156183a8 100644 --- a/tests/broker-engine/bench.robot +++ b/tests/broker-engine/bench.robot @@ -42,7 +42,7 @@ BENCH_${nb_check}STATUS Start Broker Start Engine ${content} Create List check_for_external_commands - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} No check for external commands executed for 1mn. ${broker_stat_before} Get Broker Process Stat 51001 @@ -110,7 +110,7 @@ BENCH_${nb_check}STATUS_TRACES Start Broker Start Engine ${content} Create List check_for_external_commands - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} No check for external commands executed for 1mn. ${broker_stat_before} Get Broker Process Stat 51001 @@ -180,7 +180,7 @@ BENCH_1000STATUS_100${suffixe} ${connected} Wait For Connections 5669 100 Should Be True ${connected} No 100 engine to broker connections ${content} Create List check_for_external_commands - ${result} Find In Log with Timeout ${ENGINE_LOG}/config99/centengine.log ${start} ${content} 60 + ${result} Find In Log With Timeout ${ENGINE_LOG}/config99/centengine.log ${start} ${content} 60 Should Be True ${result} No check for external commands executed for 1mn. Sleep 5 @@ -213,7 +213,7 @@ BENCH_1000STATUS_100${suffixe} ${diff_engine} Diff Process Stat ${engine_stat_after} ${engine_stat_before} ${content} Create List pb service (100, 2000) status 1 type 1 check result output: <> - ${result} Find In Log with Timeout with Line ${centralLog} ${start_check} ${content} 240 + ${result} Find In Log With Timeout with Line ${centralLog} ${start_check} ${content} 240 Should Be True ${result[0]} No check check result received. ${date_last_check_received} Extract Date From Log ${result[1][0]} ${all_check_delay} Subtract Date From Date ${date_last_check_received} ${start_check} diff --git a/tests/broker-engine/delete-poller.robot b/tests/broker-engine/delete-poller.robot index 21b56561dd9..16704fac9e3 100644 --- a/tests/broker-engine/delete-poller.robot +++ b/tests/broker-engine/delete-poller.robot @@ -33,7 +33,7 @@ EBDP1 # Let's wait until engine listens to external_commands. ${content} Create List check_for_external_commands() - ${result} Find In Log with Timeout ${engineLog3} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog3} ${start} ${content} 60 Should Be True ${result} check_for_external_commands is missing. Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} @@ -54,7 +54,7 @@ EBDP1 # Let's wait for the initial service states. ${content} Create List check_for_external_commands() - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} check_for_external_commands is missing. Remove Poller 51001 Poller3 @@ -86,7 +86,7 @@ EBDP2 # Let's wait until engine listens to external_commands. ${content} Create List check_for_external_commands() - ${result} Find In Log with Timeout ${engineLog2} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog2} ${start} ${content} 60 Should Be True ${result} check_for_external_commands is missing. Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} @@ -121,7 +121,7 @@ EBDP2 # Let's wait until engine listens to external_commands. ${content} Create List check_for_external_commands() - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} check_for_external_commands is missing. Remove Poller 51001 Poller2 @@ -158,7 +158,7 @@ EBDP_GRPC2 # Let's wait until engine listens to external_commands. ${content} Create List check_for_external_commands() - ${result} Find In Log with Timeout ${engineLog2} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog2} ${start} ${content} 60 Should Be True ${result} check_for_external_commands is missing. Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} @@ -194,7 +194,7 @@ EBDP_GRPC2 # Let's wait until engine listens to external_commands. ${content} Create List check_for_external_commands() - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} check_for_external_commands is missing. Remove Poller 51001 Poller2 @@ -225,7 +225,7 @@ EBDP3 # Let's wait until engine listens to external_commands. ${content} Create List check_for_external_commands() - ${result} Find In Log with Timeout ${engineLog2} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog2} ${start} ${content} 60 Should Be True ${result} check_for_external_commands is missing. Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} @@ -254,7 +254,7 @@ EBDP3 # Let's wait until engine listens to external_commands. ${content} Create List check_for_external_commands() - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} check_for_external_commands is missing. Remove Poller 51001 Poller2 @@ -288,7 +288,7 @@ EBDP4 # Let's wait until engine listens to external_commands. ${content} Create List check_for_external_commands() - ${result} Find In Log with Timeout ${engineLog3} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog3} ${start} ${content} 60 Should Be True ${result} check_for_external_commands is missing. Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} @@ -301,7 +301,7 @@ EBDP4 # Let's brutally kill the poller ${content} Create List processing poller event (id: 4, name: Poller3, running: - ${result} Find In log with timeout ${centralLog} ${start} ${content} 60 + ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 60 Should Be True ${result} We want the poller 4 event before stopping broker Kindly Stop Broker Remove Files ${centralLog} ${rrdLog} @@ -314,11 +314,11 @@ EBDP4 ${content} Create List ... SERVICE ALERT: host_40;service_781;CRITICAL ... SERVICE ALERT: host_40;service_782;WARNING - ${result} Find In log with timeout ${engineLog3} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog3} ${start} ${content} 60 Should Be True ${result} Service alerts about service 781 and 782 should be raised ${content} Create List callbacks: service (40, 781) has no perfdata service (40, 782) has no perfdata - ${result} Find In log with timeout ${moduleLog3} ${start} ${content} 60 + ${result} Find In Log With Timeout ${moduleLog3} ${start} ${content} 60 Should Be True ${result} pb service status on services (40, 781) and (40, 782) should be generated Stop Engine @@ -335,7 +335,7 @@ EBDP4 # Let's wait until engine listens to external_commands. ${content} Create List check_for_external_commands() - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} check_for_external_commands is missing. Remove Poller 51001 Poller3 @@ -349,12 +349,12 @@ EBDP4 Start Engine # Let's wait until engine listens to external_commands. ${content} Create List check_for_external_commands() - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} check_for_external_commands is missing. ${content} Create List service status (40, 781) thrown away because host 40 is not known by any poller log to console date ${start} - ${result} Find in Log With Timeout ${centralLog} ${start} ${content} 60 + ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 60 Should be True ${result} No message about these two wrong service status. Stop Engine Kindly Stop Broker @@ -374,7 +374,7 @@ EBDP5 # Let's wait until engine listens to external_commands ${content} Create List check_for_external_commands - ${result} Find In Log with Timeout ${engineLog3} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog3} ${start} ${content} 60 Should Be True ${result} check_for_external_commands is missing. Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} @@ -395,7 +395,7 @@ EBDP5 # Let's wait until engine listens to external_commands ${content} Create List check_for_external_commands - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} check_for_external_commands is missing. ${remove_time} Get Current Date @@ -403,7 +403,7 @@ EBDP5 # wait unified receive instance event ${content} Create List central-broker-unified-sql read neb:Instance - ${result} Find In Log with Timeout ${centralLog} ${remove_time} ${content} 60 + ${result} Find In Log With Timeout ${centralLog} ${remove_time} ${content} 60 Should Be True ${result} central-broker-unified-sql read neb:Instance is missing Stop Engine @@ -431,7 +431,7 @@ EBDP6 # Let's wait until engine listens to external_commands. ${content} Create List check_for_external_commands() - ${result} Find In Log with Timeout ${engineLog2} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog2} ${start} ${content} 60 Should Be True ${result} check_for_external_commands is missing. Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} @@ -462,7 +462,7 @@ EBDP6 # Let's wait until engine listens to external_commands. ${content} Create List check_for_external_commands() - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} check_for_external_commands is missing. ${remove_time} Get Current Date @@ -470,7 +470,7 @@ EBDP6 # wait unified receive instance event ${content} Create List central-broker-unified-sql read neb:Instance - ${result} Find In Log with Timeout ${centralLog} ${remove_time} ${content} 60 + ${result} Find In Log With Timeout ${centralLog} ${remove_time} ${content} 60 Should Be True ${result} central-broker-unified-sql read neb:Instance is missing Stop Engine @@ -499,7 +499,7 @@ EBDP7 # Let's wait until engine listens to external_commands. ${content} Create List check_for_external_commands() - ${result} Find In Log with Timeout ${engineLog2} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog2} ${start} ${content} 60 Should Be True ${result} check_for_external_commands is missing. Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} @@ -528,7 +528,7 @@ EBDP7 # Let's wait until engine listens to external_commands. ${content} Create List check_for_external_commands() - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} check_for_external_commands is missing. ${remove_time} Get Current Date @@ -536,7 +536,7 @@ EBDP7 # wait unified receive instance event ${content} Create List central-broker-unified-sql read neb:Instance - ${result} Find In Log with Timeout ${centralLog} ${remove_time} ${content} 60 + ${result} Find In Log With Timeout ${centralLog} ${remove_time} ${content} 60 Should Be True ${result} central-broker-unified-sql read neb:Instance is missing Stop Engine @@ -568,7 +568,7 @@ EBDP8 # Let's wait until engine listens to external_commands. ${content} Create List check_for_external_commands() - ${result} Find In Log with Timeout ${engineLog3} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog3} ${start} ${content} 60 Should Be True ${result} check_for_external_commands is missing. Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} @@ -581,7 +581,7 @@ EBDP8 # Let's brutally kill the poller ${content} Create List processing poller event (id: 4, name: Poller3, running: - ${result} Find In log with timeout ${centralLog} ${start} ${content} 60 + ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 60 Should Be True ${result} We want the poller 4 event before stopping broker Kindly Stop Broker Remove Files ${centralLog} ${rrdLog} @@ -594,11 +594,11 @@ EBDP8 ${content} Create List ... SERVICE ALERT: host_40;service_781;CRITICAL ... SERVICE ALERT: host_40;service_782;WARNING - ${result} Find In log with timeout ${engineLog3} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog3} ${start} ${content} 60 Should Be True ${result} Service alerts about service 781 and 782 should be raised ${content} Create List callbacks: service (40, 781) has no perfdata service (40, 782) has no perfdata - ${result} Find In log with timeout ${moduleLog3} ${start} ${content} 60 + ${result} Find In Log With Timeout ${moduleLog3} ${start} ${content} 60 Should Be True ${result} pb service status on services (40, 781) and (40, 782) should be generated Stop Engine @@ -623,12 +623,12 @@ EBDP8 Start Engine # Let's wait until engine listens to external_commands. ${content} Create List check_for_external_commands() - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} check_for_external_commands is missing. ${content} Create List service status (40, 781) thrown away because host 40 is not known by any poller log to console date ${start} - ${result} Find in Log With Timeout ${centralLog} ${start} ${content} 60 + ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 60 Should be True ${result} No message about these two wrong service status. Stop Engine Kindly Stop Broker diff --git a/tests/broker-engine/downtimes.robot b/tests/broker-engine/downtimes.robot index 439b6c68f1f..0d044de66d0 100644 --- a/tests/broker-engine/downtimes.robot +++ b/tests/broker-engine/downtimes.robot @@ -46,7 +46,7 @@ BEDTMASS1 Start Engine # Let's wait for the initial service states. ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; - ${result} Find In Log with Timeout ${engineLog2} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog2} ${start} ${content} 60 Should Be True ... ${result} ... An Initial service state on service (50, 1000) should be raised before we can start external commands. @@ -102,7 +102,7 @@ BEDTMASS2 Start Engine # Let's wait for the initial service states. ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; - ${result} Find In Log with Timeout ${engineLog2} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog2} ${start} ${content} 60 Should Be True ... ${result} ... An Initial service state on service (50, 1000) should be raised before we can start external commands. @@ -153,7 +153,7 @@ BEDTSVCREN1 Start Engine # Let's wait for the check of external commands ${content} Create List check_for_external_commands - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} No check for external commands executed for 1mn. # It's time to schedule a downtime @@ -168,7 +168,7 @@ BEDTSVCREN1 Reload Engine # Let's wait for the check of external commands ${content} Create List check_for_external_commands - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} No check for external commands executed for 1mn. Delete service downtime full ${0} host_1 toto_1 @@ -196,7 +196,7 @@ BEDTSVCFIXED Start Engine # Let's wait for the check of external commands ${content} Create List check_for_external_commands - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} No check for external commands executed for 1mn. # It's time to schedule a downtime @@ -231,7 +231,7 @@ BEDTHOSTFIXED Start Engine # Let's wait for the check of external commands ${content} Create List check_for_external_commands - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} No check for external commands executed for 1mn. # It's time to schedule downtimes diff --git a/tests/broker-engine/external-commands.robot b/tests/broker-engine/external-commands.robot index 7f0f8166d4a..c7767162a89 100644 --- a/tests/broker-engine/external-commands.robot +++ b/tests/broker-engine/external-commands.robot @@ -37,7 +37,7 @@ BEEXTCMD1 Start Broker Start Engine ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. @@ -74,7 +74,7 @@ BEEXTCMD2 Start Broker Start Engine ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. @@ -117,7 +117,7 @@ BEEXTCMD3 Start Broker Start Engine ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. @@ -153,7 +153,7 @@ BEEXTCMD4 Start Broker Start Engine ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. @@ -192,7 +192,7 @@ BEEXTCMD5 Start Broker Start Engine ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. @@ -229,7 +229,7 @@ BEEXTCMD6 Start Broker Start Engine ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. @@ -272,7 +272,7 @@ BEEXTCMD7 Start Broker Start Engine ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. @@ -308,7 +308,7 @@ BEEXTCMD8 Start Broker Start Engine ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. @@ -347,7 +347,7 @@ BEEXTCMD9 Start Broker Start Engine ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. @@ -394,7 +394,7 @@ BEEXTCMD10 Start Broker Start Engine ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. @@ -437,7 +437,7 @@ BEEXTCMD11 Start Broker Start Engine ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. @@ -482,7 +482,7 @@ BEEXTCMD12 Start Broker Start Engine ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. @@ -524,7 +524,7 @@ BEEXTCMD13 Start Broker Start Engine ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. @@ -561,7 +561,7 @@ BEEXTCMD14 Start Broker Start Engine ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. @@ -603,7 +603,7 @@ BEEXTCMD15 Start Broker Start Engine ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. @@ -640,7 +640,7 @@ BEEXTCMD16 Start Broker Start Engine ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. @@ -682,7 +682,7 @@ BEEXTCMD17 Start Broker Start Engine ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. @@ -721,7 +721,7 @@ BEEXTCMD18 Start Broker Start Engine ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. @@ -765,7 +765,7 @@ BEEXTCMD19 Start Broker Start Engine ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. @@ -804,7 +804,7 @@ BEEXTCMD20 Start Broker Start Engine ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. @@ -849,7 +849,7 @@ BEEXTCMD21 Start Broker Start Engine ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. @@ -916,7 +916,7 @@ BEEXTCMD22 Start Broker Start Engine ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. @@ -968,7 +968,7 @@ BEEXTCMD23 Start Broker Start Engine ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. @@ -1050,7 +1050,7 @@ BEEXTCMD24 Start Broker Start Engine ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. @@ -1120,7 +1120,7 @@ BEEXTCMD25 Start Broker Start Engine ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. @@ -1167,7 +1167,7 @@ BEEXTCMD26 Start Broker Start Engine ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. @@ -1219,7 +1219,7 @@ BEEXTCMD27 Start Broker Start Engine ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. @@ -1266,7 +1266,7 @@ BEEXTCMD28 Start Broker Start Engine ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. @@ -1320,7 +1320,7 @@ BEEXTCMD29 Start Broker Start Engine ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. diff --git a/tests/broker-engine/external-commands2.robot b/tests/broker-engine/external-commands2.robot index c3540496dd3..a12e6aa34e5 100644 --- a/tests/broker-engine/external-commands2.robot +++ b/tests/broker-engine/external-commands2.robot @@ -35,7 +35,7 @@ BEEXTCMD30 Start Broker Start Engine ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. @@ -87,7 +87,7 @@ BEEXTCMD31 Start Broker Start Engine ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. @@ -177,7 +177,7 @@ BEEXTCMD32 Start Broker Start Engine ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. @@ -255,7 +255,7 @@ BEEXTCMD33 Start Broker Start Engine ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. @@ -306,7 +306,7 @@ BEEXTCMD34 Start Broker Start Engine ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. @@ -362,7 +362,7 @@ BEEXTCMD35 Start Broker Start Engine ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. @@ -427,7 +427,7 @@ BEEXTCMD36 Start Broker Start Engine ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. @@ -479,7 +479,7 @@ BEEXTCMD37 Start Broker Start Engine ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. @@ -548,7 +548,7 @@ BEEXTCMD38 Start Broker Start Engine ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. @@ -604,7 +604,7 @@ BEEXTCMD39 Start Broker Start Engine ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. @@ -651,7 +651,7 @@ BEEXTCMD40 Start Broker Start Engine ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. @@ -703,7 +703,7 @@ BEEXTCMD41 Start Broker Start Engine ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. @@ -754,7 +754,7 @@ BEEXTCMD42 Start Broker Start Engine ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. @@ -811,7 +811,7 @@ BEEXTCMD_GRPC1 Start Broker Start Engine ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. @@ -850,7 +850,7 @@ BEEXTCMD_GRPC2 Start Broker Start Engine ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. @@ -895,7 +895,7 @@ BEEXTCMD_GRPC3 Start Broker Start Engine ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. @@ -933,7 +933,7 @@ BEEXTCMD_GRPC4 Start Broker Start Engine ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. @@ -979,7 +979,7 @@ BEEXTCMD_REVERSE_GRPC1 Start Broker Start Engine ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. @@ -1022,7 +1022,7 @@ BEEXTCMD_REVERSE_GRPC2 Start Broker Start Engine ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. @@ -1071,7 +1071,7 @@ BEEXTCMD_REVERSE_GRPC3 Start Broker Start Engine ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. @@ -1113,7 +1113,7 @@ BEEXTCMD_REVERSE_GRPC4 Start Broker Start Engine ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. @@ -1157,7 +1157,7 @@ BEEXTCMD_COMPRESS_GRPC1 Start Broker Start Engine ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. @@ -1192,7 +1192,7 @@ BEATOI11 Start Broker Start Engine ${content} Create List check_for_external_commands - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} No check for external commands executed for 1mn. SEND CUSTOM HOST NOTIFICATION host_1 1 admin foobar ${content} Create List EXTERNAL COMMAND: SEND_CUSTOM_HOST_NOTIFICATION;host_1;1;admin;foobar @@ -1214,12 +1214,12 @@ BEATOI12 Start Broker Start Engine ${content} Create List check_for_external_commands - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} No check for external commands executed for 1mn. SEND CUSTOM HOST NOTIFICATION host_1 8 admin foobar ${content} Create List ... Error: could not send custom host notification: '8' must be an integer between 0 and 7 - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} command argument notification_option must be an integer between 0 and 7. Stop Engine Kindly Stop Broker @@ -1237,12 +1237,12 @@ BEATOI13 Start Broker Start Engine ${content} Create List check_for_external_commands - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} No check for external commands executed for 1mn. ${date} Get Current Date result_format=epoch SCHEDULE SERVICE DOWNTIME host_1 service_1 -1 ${content} Create List Error: could not schedule downtime : duration - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} command argument duration must be an integer >= 0. Stop Engine Kindly Stop Broker @@ -1260,11 +1260,11 @@ BEATOI21 Start Broker Start Engine ${content} Create List check_for_external_commands - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} No check for external commands executed for 1mn. ADD HOST COMMENT host_1 1 user comment ${content} Create List ADD_HOST_COMMENT - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} the comment with id:1 was not added. ${com_id} Find Internal Id ${start} True 30 Should Be True ${com_id}>0 Comment id should be a positive integer. @@ -1288,16 +1288,16 @@ BEATOI22 Start Broker Start Engine ${content} Create List check_for_external_commands - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} No check for external commands executed for 1mn. ADD HOST COMMENT host_1 1 user comment ${content} Create List ADD_HOST_COMMENT - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} the comment with id:1 was not added. ${com_id} Find Internal Id ${start} True 30 DEL HOST COMMENT -1 ${content} Create List Error: could not delete comment : comment_id - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} comment_id must be an unsigned integer. ${result} Find Internal Id ${start} True 30 Should Be True ${result} comment with id:-1 was deleted. @@ -1317,12 +1317,12 @@ BEATOI23 Start Broker Start Engine ${content} Create List check_for_external_commands - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} No check for external commands executed for 1mn. ${date} Get Current Date result_format=epoch ADD SVC COMMENT host_1 service_1 0 user comment ${content} Create List ADD_SVC_COMMENT - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} command argument persistent_flag must be 0 or 1. Stop Engine Kindly Stop Broker @@ -1341,7 +1341,7 @@ BECUSTOMHOSTVAR Start Broker Start Engine ${content} Create List check_for_external_commands - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} No check for external commands executed for 1mn. ${date} Get Current Date result_format=epoch CHANGE CUSTOM HOST VAR COMMAND host_1 SNMPVERSION 789456 @@ -1376,7 +1376,7 @@ BECUSTOMSVCVAR Start Broker Start Engine ${content} Create List check_for_external_commands - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} No check for external commands executed for 1mn. ${date} Get Current Date result_format=epoch CHANGE CUSTOM SVC VAR COMMAND host_1 service_1 CRITICAL 456123 @@ -1411,7 +1411,7 @@ BESERVCHECK Start Broker Start Engine ${content} Create List check_for_external_commands - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} No check for external commands executed for 1mn. Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} Execute SQL String UPDATE services set command_line='toto', next_check=0 where service_id=1 and host_id=1 @@ -1438,7 +1438,7 @@ BEHOSTCHECK Start Broker Start Engine ${content} Create List check_for_external_commands - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} No check for external commands executed for 1mn. Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} diff --git a/tests/broker-engine/muxer_filter.robot b/tests/broker-engine/muxer_filter.robot index c11a6d6054f..e31b6f9d108 100644 --- a/tests/broker-engine/muxer_filter.robot +++ b/tests/broker-engine/muxer_filter.robot @@ -35,7 +35,7 @@ STUPID_FILTER ${content} Create List ... The configured write filters for the endpoint 'central-broker-unified-sql' are too restrictive and will be ignored. neb,bbdo,extcmd categories are mandatory. - ${result} Find In Log with Timeout ${centralLog} ${start} ${content} 60 + ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 60 Should Be True ${result} A message telling bad filter should be available. Stop Engine @@ -133,7 +133,7 @@ BAM_STREAM_FILTER Add Bam Config To Engine @{svc} Set Variable ${{ [("host_16", "service_314")] }} - Create BA With Services test worst ${svc} + Create Ba With Services test worst ${svc} Add Bam Config To Broker central # Command of service_314 is set to critical ${cmd_1} Get Command Id 314 @@ -144,7 +144,7 @@ BAM_STREAM_FILTER Start Engine # Let's wait for the external command check start ${content} Create List check_for_external_commands() - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} A message telling check_for_external_commands() should be available. # KPI set to critical @@ -227,7 +227,7 @@ UNIFIED_SQL_FILTER # Let's wait for the external command check start ${content} Create List check_for_external_commands() - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} A message telling check_for_external_commands() should be available. # one service set to critical in order to have some events @@ -266,18 +266,18 @@ CBD_RELOAD_AND_FILTERS # Let's wait for the external command check start ${content} Create List check_for_external_commands() - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} A message telling check_for_external_commands() should be available. # Let's wait for storage data written into rrd files ${content} Create List RRD: new pb status data for index - ${result} Find In Log with Timeout ${rrdLog} ${start} ${content} 60 + ${result} Find In Log With Timeout ${rrdLog} ${start} ${content} 60 Should Be True ${result} No status from central broker for 1mn. # We check that output filters to rrd are set to "all" ${content} Create List ... endpoint applier: filters for endpoint 'centreon-broker-master-rrd' reduced to the needed ones: all - ${result} Find In Log with Timeout ${centralLog} ${start} ${content} 60 + ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 60 Should Be True ${result} No message about the output filters to rrd broker. # New configuration @@ -289,7 +289,7 @@ CBD_RELOAD_AND_FILTERS Reload Broker #wait broker reload ${content} Create List creating endpoint centreon-broker-master-rrd - ${result} Find In Log with Timeout ${centralLog} ${start} ${content} 60 + ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 60 Should Be True ${result} No creating endpoint centreon-broker-master-rrd. ${start2} Get Current Date @@ -298,12 +298,12 @@ CBD_RELOAD_AND_FILTERS ... create endpoint TCP for endpoint 'centreon-broker-master-rrd' ... endpoint applier: filters ... storage for endpoint 'centreon-broker-master-rrd' applied. - ${result} Find In Log with Timeout ${centralLog} ${start} ${content} 60 + ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 60 Should Be True ${result} No message about the output filters to rrd broker. # Let's wait for storage data written into rrd files ${content} Create List RRD: new pb status data for index - ${result} Find In Log with Timeout ${rrdLog} ${start2} ${content} 60 + ${result} Find In Log With Timeout ${rrdLog} ${start2} ${content} 60 Should Be True ${result} No status from central broker for 1mn. # We check that output filters to rrd are set to "storage" @@ -319,20 +319,20 @@ CBD_RELOAD_AND_FILTERS Reload Broker # wait broker reload ${content} Create List creating endpoint centreon-broker-master-rrd - ${result} Find In Log with Timeout ${centralLog} ${start} ${content} 60 + ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 60 Should Be True ${result} No creating endpoint centreon-broker-master-rrd. ${start2} Get Current Date # We check that output filters to rrd are set to "all" ${content} Create List ... endpoint applier: filters for endpoint 'centreon-broker-master-rrd' reduced to the needed ones: all - ${result} Find In Log with Timeout ${centralLog} ${start} ${content} 60 + ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 60 Should Be True ${result} No message about the output filters to rrd broker. ${start} Get Current Date # Let's wait for storage data written into rrd files ${content} Create List RRD: new pb status data for index - ${result} Find In Log with Timeout ${rrdLog} ${start2} ${content} 60 + ${result} Find In Log With Timeout ${rrdLog} ${start2} ${content} 60 Should Be True ${result} No status from central broker for 1mn. # We check that output filters to rrd doesn't filter anything @@ -369,18 +369,18 @@ CBD_RELOAD_AND_FILTERS_WITH_OPR # Let's wait for the external command check start ${content} Create List check_for_external_commands() - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} A message telling check_for_external_commands() should be available. # Let's wait for storage data written into rrd files ${content} Create List RRD: new pb status data for index - ${result} Find In Log with Timeout ${rrdLog} ${start} ${content} 60 + ${result} Find In Log With Timeout ${rrdLog} ${start} ${content} 60 Should Be True ${result} No status from central broker for 1mn. # We check that output filters to rrd are set to "all" ${content} Create List ... endpoint applier: filters for endpoint 'centreon-broker-master-rrd' reduced to the needed ones: all - ${result} Find In Log with Timeout ${centralLog} ${start} ${content} 60 + ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 60 Should Be True ${result} No message about the output filters to rrd broker. # New configuration @@ -392,7 +392,7 @@ CBD_RELOAD_AND_FILTERS_WITH_OPR Reload Broker #wait broker reload ${content} Create List creating endpoint centreon-broker-master-rrd - ${result} Find In Log with Timeout ${centralLog} ${start} ${content} 60 + ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 60 Should Be True ${result} No creating endpoint centreon-broker-master-rrd. ${start2} Get Current Date @@ -401,12 +401,12 @@ CBD_RELOAD_AND_FILTERS_WITH_OPR ... create endpoint TCP for endpoint 'centreon-broker-master-rrd' ... endpoint applier: filters ... storage for endpoint 'centreon-broker-master-rrd' applied. - ${result} Find In Log with Timeout ${centralLog} ${start} ${content} 60 + ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 60 Should Be True ${result} No message about the output filters to rrd broker. # Let's wait for storage data written into rrd files ${content} Create List RRD: new pb status data for index - ${result} Find In Log with Timeout ${rrdLog} ${start2} ${content} 60 + ${result} Find In Log With Timeout ${rrdLog} ${start2} ${content} 60 Should Be True ${result} No status from central broker for 1mn. # We check that output filters to rrd are set to "storage" @@ -422,19 +422,19 @@ CBD_RELOAD_AND_FILTERS_WITH_OPR Reload Broker #wait broker reload ${content} Create List creating endpoint centreon-broker-master-rrd - ${result} Find In Log with Timeout ${centralLog} ${start} ${content} 60 + ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 60 Should Be True ${result} No creating endpoint centreon-broker-master-rrd. ${start2} Get Current Date # We check that output filters to rrd are set to "all" ${content} Create List ... endpoint applier: filters for endpoint 'centreon-broker-master-rrd' reduced to the needed ones: all - ${result} Find In Log with Timeout ${centralLog} ${start} ${content} 60 + ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 60 Should Be True ${result} No message about the output filters to rrd broker. # Let's wait for storage data written into rrd files ${content} Create List RRD: new pb status data for index - ${result} Find In Log with Timeout ${rrdLog} ${start2} ${content} 60 + ${result} Find In Log With Timeout ${rrdLog} ${start2} ${content} 60 Should Be True ${result} No status from central broker for 1mn. # We check that output filters to rrd doesn't filter anything diff --git a/tests/broker-engine/output-tables.robot b/tests/broker-engine/output-tables.robot index e373f3264b5..bbd4b1bfcd1 100644 --- a/tests/broker-engine/output-tables.robot +++ b/tests/broker-engine/output-tables.robot @@ -44,7 +44,7 @@ BERES1 ... processing service status event (host: ... UPDATE services SET checked= ${content_present} Create List UPDATE resources SET status= - ${result} Find In log With Timeout ${centralLog} ${start} ${content_present} 60 + ${result} Find In Log With Timeout ${centralLog} ${start} ${content_present} 60 Should Be True ${result} no updates concerning resources available. FOR ${l} IN ${content_not_present} ${result} Find In Log ${centralLog} ${start} ${content_not_present} @@ -79,7 +79,7 @@ BEHS1 ... INSERT INTO tags ... UPDATE severities ... INSERT INTO severities - ${result} Find In log With Timeout ${centralLog} ${start} ${content_present} 60 + ${result} Find In Log With Timeout ${centralLog} ${start} ${content_present} 60 Should Be True ${result} no updates concerning hosts/services available. FOR ${l} IN ${content_not_present} ${result} Find In Log ${centralLog} ${start} ${content_not_present} @@ -114,7 +114,7 @@ BEINSTANCESTATUS Start Broker Start Engine ${content} Create List check_for_external_commands - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} No check for external commands executed for 1mn. ${result} check_field_db_value ... SELECT global_host_event_handler FROM instances WHERE instance_id=1 @@ -206,7 +206,7 @@ BE_NOTIF_OVERFLOW ${start} Get Current Date ${content} Create List INITIAL SERVICE STATE: host_16;service_314; - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 30 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 30 Should Be True ... ${result} ... An Initial host state on host_16 should be raised before we can start our external commands. diff --git a/tests/broker-engine/retention-duplicates.robot b/tests/broker-engine/retention-duplicates.robot index 6ce2d654cd3..92c2c0ee7db 100644 --- a/tests/broker-engine/retention-duplicates.robot +++ b/tests/broker-engine/retention-duplicates.robot @@ -37,9 +37,9 @@ BERD1 Start Broker Start Engine ${content} Create List lua: initializing the Lua virtual machine - ${result} Find In Log with timeout ${centralLog} ${start} ${content} 30 + ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 30 Should Be True ${result} Lua not started in cbd - ${result} Find In Log with timeout ${moduleLog0} ${start} ${content} 30 + ${result} Find In Log With Timeout ${moduleLog0} ${start} ${content} 30 Should Be True ${result} Lua not started in centengine ${result} Check Connections Should Be True ${result} Engine and Broker not connected. @@ -78,9 +78,9 @@ BERD2 Start Broker Start Engine ${content} Create List lua: initializing the Lua virtual machine - ${result} Find In Log with timeout ${centralLog} ${start} ${content} 30 + ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 30 Should Be True ${result} Lua not started in cbd - ${result} Find In Log with timeout ${moduleLog0} ${start} ${content} 30 + ${result} Find In Log With Timeout ${moduleLog0} ${start} ${content} 30 Should Be True ${result} Lua not started in centengine ${result} Check Connections Should Be True ${result} Engine and Broker not connected. @@ -118,9 +118,9 @@ BERDUC1 Start Broker Start Engine ${content} Create List lua: initializing the Lua virtual machine - ${result} Find In Log with timeout ${centralLog} ${start} ${content} 30 + ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 30 Should Be True ${result} Lua not started in cbd - ${result} Find In Log with timeout ${moduleLog0} ${start} ${content} 30 + ${result} Find In Log With Timeout ${moduleLog0} ${start} ${content} 30 Should Be True ${result} Lua not started in centengine ${result} Check Connections Should Be True ${result} Engine and Broker not connected. @@ -157,9 +157,9 @@ BERDUCU1 Start Broker Start Engine ${content} Create List lua: initializing the Lua virtual machine - ${result} Find In Log with timeout ${centralLog} ${start} ${content} 30 + ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 30 Should Be True ${result} Lua not started in cbd - ${result} Find In Log with timeout ${moduleLog0} ${start} ${content} 30 + ${result} Find In Log With Timeout ${moduleLog0} ${start} ${content} 30 Should Be True ${result} Lua not started in centengine Sleep 5s Kindly Stop Broker @@ -192,9 +192,9 @@ BERDUC2 Start Broker Start Engine ${content} Create List lua: initializing the Lua virtual machine - ${result} Find In Log with timeout ${centralLog} ${start} ${content} 30 + ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 30 Should Be True ${result} Lua not started in cbd - ${result} Find In Log with timeout ${moduleLog0} ${start} ${content} 30 + ${result} Find In Log With Timeout ${moduleLog0} ${start} ${content} 30 Should Be True ${result} Lua not started in centengine ${result} Check Connections Should Be True ${result} Engine and Broker not connected. @@ -231,9 +231,9 @@ BERDUCU2 Start Broker Start Engine ${content} Create List lua: initializing the Lua virtual machine - ${result} Find In Log with timeout ${centralLog} ${start} ${content} 30 + ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 30 Should Be True ${result} Lua not started in cbd - ${result} Find In Log with timeout ${moduleLog0} ${start} ${content} 30 + ${result} Find In Log With Timeout ${moduleLog0} ${start} ${content} 30 Should Be True ${result} Lua not started in centengine ${result} Check Connections Should Be True ${result} Engine and Broker not connected. @@ -271,9 +271,9 @@ BERDUC3U1 Start Broker Start Engine ${content} Create List lua: initializing the Lua virtual machine - ${result} Find In Log with timeout ${centralLog} ${start} ${content} 30 + ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 30 Should Be True ${result} Lua not started in cbd - ${result} Find In Log with timeout ${moduleLog0} ${start} ${content} 30 + ${result} Find In Log With Timeout ${moduleLog0} ${start} ${content} 30 Should Be True ${result} Lua not started in centengine ${result} Check Connections Should Be True ${result} Engine and Broker not connected. @@ -315,14 +315,14 @@ BERDUC3U2 # Let's wait for the lua to be correctly initialized ${content} Create List lua: initializing the Lua virtual machine - ${result} Find In Log with timeout ${centralLog} ${start} ${content} 30 + ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 30 Should Be True ${result} Lua not started in cbd - ${result} Find In Log with timeout ${moduleLog0} ${start} ${content} 30 + ${result} Find In Log With Timeout ${moduleLog0} ${start} ${content} 30 Should Be True ${result} Lua not started in centengine # Let's wait for all the services configuration. ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 ${start} Get Round Current Date # Let's wait for a first service status. @@ -375,15 +375,15 @@ BERDUCA300 # Let's wait for all the services configuration. ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Stop Engine ${content} Create List BBDO: sending pb stop packet to peer - ${result} Find in Log with Timeout ${moduleLog0} ${start} ${content} 30 + ${result} Find In Log With Timeout ${moduleLog0} ${start} ${content} 30 Should Be True ${result} Engine should send a pb stop message to cbd. ${content} Create List BBDO: received pb stop from peer - ${result} Find in Log with Timeout ${centralLog} ${start} ${content} 30 + ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 30 Should Be True ${result} Broker should receive a pb stop message from engine. ${content} Create List send acknowledgement for [0-9]+ events @@ -428,15 +428,15 @@ BERDUCA301 # Let's wait for all the services configuration. ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Stop Engine ${content} Create List BBDO: sending pb stop packet to peer - ${result} Find in Log with Timeout ${moduleLog0} ${start} ${content} 30 + ${result} Find In Log With Timeout ${moduleLog0} ${start} ${content} 30 Should Be True ${result} Engine should send a pb stop message to cbd. ${content} Create List BBDO: received pb stop from peer - ${result} Find in Log with Timeout ${centralLog} ${start} ${content} 30 + ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 30 Should Be True ${result} Broker should receive a pb stop message from engine. ${content} Create List send pb acknowledgement for [0-9]+ events diff --git a/tests/broker-engine/reverse-connection.robot b/tests/broker-engine/reverse-connection.robot index 58644d7f370..8f9b36f346d 100644 --- a/tests/broker-engine/reverse-connection.robot +++ b/tests/broker-engine/reverse-connection.robot @@ -34,7 +34,7 @@ BRGC1 Start Engine # Let's wait for the external command check start ${content} Create List check_for_external_commands() - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} A message telling check_for_external_commands() should be available. Run Reverse Bam ${50} ${0.2} @@ -66,7 +66,7 @@ BRCTS1 Start Engine # Let's wait for the external command check start ${content} Create List check_for_external_commands() - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} A message telling check_for_external_commands() should be available. Run Reverse Bam ${150} ${10} @@ -98,7 +98,7 @@ BRCS1 Start Engine # Let's wait for the external command check start ${content} Create List check_for_external_commands() - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} A message telling check_for_external_commands() should be available. Kindly Stop Broker Stop Engine @@ -135,7 +135,7 @@ BRCTSMN Start Engine # Let's wait for the external command check start ${content} Create List check_for_external_commands() - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} A message telling check_for_external_commands() should be available. # pb_service pb_host pb_service_status pb_host_status ${expected_events} Create List 65563 65566 65565 65568 @@ -183,7 +183,7 @@ BRCTSMNS Start Engine # Let's wait for the external command check start ${content} Create List check_for_external_commands() - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} A message telling check_for_external_commands() should be available. # pb_service pb_host pb_service_status pb_host_status pb_metric pb_status pb_index_mapping ${expected_events} Create List 65563 65566 65565 65568 196617 196618 196619 diff --git a/tests/broker-engine/services-increased.robot b/tests/broker-engine/services-increased.robot index 236548de8e1..84a1190d0c8 100644 --- a/tests/broker-engine/services-increased.robot +++ b/tests/broker-engine/services-increased.robot @@ -89,14 +89,14 @@ Service_increased_huge_check_interval Should be true ${result} host_1 should be pending ${content} Create List INITIAL HOST STATE: host_1; - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} "host_1 init not found in log" # End Checkers Process Service Check result with metrics host_1 service_1 1 warning0 1 ${content} Create List new pb data for metric - ${result} Find In Log with Timeout ${rrdLog} ${start} ${content} 60 + ${result} Find In Log With Timeout ${rrdLog} ${start} ${content} 60 ${index} Get Indexes To Rebuild 2 ${metrics} Get Metrics Matching Indexes ${index} @@ -129,7 +129,7 @@ Service_increased_huge_check_interval Reload Engine ${content} Create List INITIAL SERVICE STATE: host_1;service_${new_service_id}; - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} "service_"${new_service_id}" init not found in log" ${start} Get Current Date diff --git a/tests/broker-engine/services.robot b/tests/broker-engine/services.robot index ecd243428b7..1172abffb02 100644 --- a/tests/broker-engine/services.robot +++ b/tests/broker-engine/services.robot @@ -37,7 +37,7 @@ SDER # Let's wait for the external command check start ${content} Create List check_for_external_commands() - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} A message telling check_for_external_commands() should be available. Stop Engine diff --git a/tests/broker-engine/start-stop.robot b/tests/broker-engine/start-stop.robot index b812fa1a7ac..c10af219302 100644 --- a/tests/broker-engine/start-stop.robot +++ b/tests/broker-engine/start-stop.robot @@ -389,7 +389,7 @@ BESS_ENGINE_DELETE_HOST Start Broker True Start Engine ${content} Create List check_for_external_commands - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. @@ -456,7 +456,7 @@ Start_Stop_Engine_Broker_${id} ${start_stop} Get Current Date Stop Engine ${content} Create List feeder 'central-broker-master-input-1', connection closed - ${result} Find In Log with Timeout ${centralLog} ${start_stop} ${content} 60 + ${result} Find In Log With Timeout ${centralLog} ${start_stop} ${content} 60 Should Be True ${result} connection closed not found Examples: id grpc -- diff --git a/tests/broker-engine/tags.robot b/tests/broker-engine/tags.robot index 4bb1b044db1..a846442fd24 100644 --- a/tests/broker-engine/tags.robot +++ b/tests/broker-engine/tags.robot @@ -35,7 +35,7 @@ BETAG1 # Let's wait for the external command check start ${content} Create List check_for_external_commands() - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} A message telling check_for_external_commands() should be available. ${result} check tag With Timeout tag20 3 30 @@ -64,7 +64,7 @@ BETAG2 # Let's wait for the external command check start ${content} Create List check_for_external_commands() - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} A message telling check_for_external_commands() should be available. ${result} check tag With Timeout tag20 3 30 @@ -96,7 +96,7 @@ BEUTAG1 # Let's wait for the external command check start ${content} Create List check_for_external_commands() - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} A message telling check_for_external_commands() should be available. ${result} check tag With Timeout tag20 3 30 @@ -132,7 +132,7 @@ BEUTAG2 # Let's wait for the external command check start ${content} Create List check_for_external_commands() - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} A message telling check_for_external_commands() should be available. ${svc} Create Service ${0} 1 1 @@ -145,10 +145,10 @@ BEUTAG2 # Let's wait for the external command check start ${content} Create List check_for_external_commands() - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} A message telling check_for_external_commands() should be available. - ${result} check resources tags With Timeout 1 ${svc} servicegroup [4] 60 + ${result} Check Resources Tags With Timeout 1 ${svc} servicegroup [4] 60 Should Be True ${result} New service should have a service group tag of id 4. Stop Engine Kindly Stop Broker @@ -176,7 +176,7 @@ BEUTAG3 # Let's wait for the external command check start ${content} Create List check_for_external_commands() - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} A message telling check_for_external_commands() should be available. ${result} check tag With Timeout tag20 3 30 @@ -212,16 +212,16 @@ BEUTAG4 # Let's wait for the external command check start ${content} Create List check_for_external_commands() - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} A message telling check_for_external_commands() should be available. - ${result} check resources tags With Timeout 1 1 servicegroup [4, 5] 60 + ${result} Check Resources Tags With Timeout 1 1 servicegroup [4, 5] 60 Should Be True ${result} Service (1, 1) should have servicegroup tag ids 4 and 5 - ${result} check resources tags With Timeout 1 3 servicegroup [4, 5] 60 + ${result} Check Resources Tags With Timeout 1 3 servicegroup [4, 5] 60 Should Be True ${result} Service (1, 3) should have servicegroup tag ids 4, 5 - ${result} check resources tags With Timeout 1 3 servicecategory [2, 4] 60 + ${result} Check Resources Tags With Timeout 1 3 servicecategory [2, 4] 60 Should Be True ${result} Service (1, 3) should have servicecategory tag ids 2, 4 - ${result} check resources tags With Timeout 1 5 servicecategory [2, 4] 60 + ${result} Check Resources Tags With Timeout 1 5 servicecategory [2, 4] 60 Should Be True ${result} Service (1, 5) should have servicecategory tag ids 2, 4 Stop Engine Kindly Stop Broker @@ -252,16 +252,16 @@ BEUTAG5 # Let's wait for the external command check start ${content} Create List check_for_external_commands() - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} A message telling check_for_external_commands() should be available. - ${result} check resources tags With Timeout 0 1 hostgroup [2,3] 60 + ${result} Check Resources Tags With Timeout 0 1 hostgroup [2,3] 60 Should Be True ${result} Host 1 should have hostgroup tags 2 and 3 - ${result} check resources tags With Timeout 0 2 hostgroup [2,3] 60 + ${result} Check Resources Tags With Timeout 0 2 hostgroup [2,3] 60 Should Be True ${result} Host 2 should have hostgroup tags 2 and 3 - ${result} check resources tags With Timeout 0 2 hostcategory [2, 3] 60 + ${result} Check Resources Tags With Timeout 0 2 hostcategory [2, 3] 60 Should Be True ${result} Host 2 should have hostcategory tags 2 and 3 - ${result} check resources tags With Timeout 0 3 hostcategory [2, 3] 60 + ${result} Check Resources Tags With Timeout 0 3 hostcategory [2, 3] 60 Should Be True ${result} Host 3 should have hostcategory tags 2 and 3 Stop Engine Kindly Stop Broker @@ -294,16 +294,16 @@ BEUTAG6 # Let's wait for the external command check start ${content} Create List check_for_external_commands() - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} A message telling check_for_external_commands() should be available. - ${result} check resources tags With Timeout 0 1 hostgroup [2,4] 60 + ${result} Check Resources Tags With Timeout 0 1 hostgroup [2,4] 60 Should Be True ${result} Host 1 should have hostgroup tag_id 2 and 4 - ${result} check resources tags With Timeout 0 1 hostcategory [1,5] 60 + ${result} Check Resources Tags With Timeout 0 1 hostcategory [1,5] 60 Should Be True ${result} Host 1 should have hostcategory tag_id 1 and 5 - ${result} check resources tags With Timeout 1 1 servicegroup [2,4] 60 + ${result} Check Resources Tags With Timeout 1 1 servicegroup [2,4] 60 Should Be True ${result} Service (1, 1) should have servicegroup tag_id 2 and 4. - ${result} check resources tags With Timeout 1 1 servicecategory [3,5] 60 + ${result} Check Resources Tags With Timeout 1 1 servicecategory [3,5] 60 Should Be True ${result} Service (1, 1) should have servicecategory tag_id 3 and 5. Stop Engine Kindly Stop Broker @@ -340,16 +340,16 @@ BEUTAG7 # Let's wait for the external command check start ${content} Create List check_for_external_commands() - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} A message telling check_for_external_commands() should be available. # We check in the DB if the service (1,1) has well its servicegroup tags configured. - ${result} check resources tags With Timeout 1 1 servicegroup [2,4] 60 + ${result} Check Resources Tags With Timeout 1 1 servicegroup [2,4] 60 Should Be True ${result} First step: Service (1, 1) should have servicegroup tags 2 and 4 - ${result} check resources tags With Timeout 26 502 servicecategory [2,4] 60 + ${result} Check Resources Tags With Timeout 26 502 servicecategory [2,4] 60 Should Be True ${result} First step: Service (26, 502) should have servicecategory tags 13, 9, 3 and 11. - ${result} check resources tags With Timeout 26 502 servicegroup [3,5] 60 + ${result} Check Resources Tags With Timeout 26 502 servicegroup [3,5] 60 Should Be True ${result} First step: Service (26, 502) should have servicegroup tags 3 and 5. Remove Tags From Services ${0} group_tags @@ -364,13 +364,13 @@ BEUTAG7 Reload Broker # Let's wait for the external command check start ${content} Create List check_for_external_commands() - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} A message telling check_for_external_commands() should be available. - ${result} check resources tags With Timeout 26 507 servicegroup [3,5] 60 + ${result} Check Resources Tags With Timeout 26 507 servicegroup [3,5] 60 Should Be True ${result} Second step: Service (26, 507) should have servicegroup tags 3 and 5 - ${result} check resources tags With Timeout 26 508 servicegroup [3,5] 60 + ${result} Check Resources Tags With Timeout 26 508 servicegroup [3,5] 60 Should Be True ${result} Second step: Service (26, 508) should have servicegroup tags 3 and 5 [Teardown] Run Keywords Stop Engine AND Kindly Stop Broker @@ -416,22 +416,22 @@ BEUTAG8 # Let's wait for the external command check start ${content} Create List check_for_external_commands() - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} A message telling check_for_external_commands() should be available. # We need to wait a little before reloading Engine - ${result} check resources tags With Timeout 1 2 servicecategory [3,5] 60 + ${result} Check Resources Tags With Timeout 1 2 servicecategory [3,5] 60 Should Be True ${result} First step: Service (1, 2) should have servicecategory tags 3 and 5. - ${result} check resources tags With Timeout 1 2 servicegroup [1] 60 + ${result} Check Resources Tags With Timeout 1 2 servicegroup [1] 60 Should Be True ${result} First step: Service (1, 2) should have servicegroup tag 1. - ${result} check resources tags With Timeout 1 5 servicegroup [9] 60 + ${result} Check Resources Tags With Timeout 1 5 servicegroup [9] 60 Should Be True ${result} First step: Service (1, 5) should have servicegroup tag 9 - ${result} check resources tags With Timeout 26 502 servicegroup [1,4,5] 60 + ${result} Check Resources Tags With Timeout 26 502 servicegroup [1,4,5] 60 Should Be True ${result} First step: Service (26, 502) should have tags 1, 4 and 5 - ${result} check resources tags With Timeout 26 503 servicegroup [7] 60 + ${result} Check Resources Tags With Timeout 26 503 servicegroup [7] 60 Should Be True ${result} First step: Service (26, 503) should have servicegroup tag 7 Stop Engine @@ -475,32 +475,32 @@ BEUTAG9 # Let's wait for the external command check start ${content} Create List check_for_external_commands() - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} A message telling check_for_external_commands() should be available. # We need to wait a little before reloading Engine - ${result} check resources tags With Timeout 0 9 hostgroup [2] 60 + ${result} Check Resources Tags With Timeout 0 9 hostgroup [2] 60 Should Be True ${result} First step: resource 9 should have hostgroup tag with id=2 - ${result} check resources tags With Timeout 0 10 hostgroup [2] 60 + ${result} Check Resources Tags With Timeout 0 10 hostgroup [2] 60 Should Be True ${result} First step: resource 10 should have hostgroup tag with id=2 - ${result} check resources tags With Timeout 0 11 hostgroup [6] 60 + ${result} Check Resources Tags With Timeout 0 11 hostgroup [6] 60 Should Be True ${result} First step: resource 11 should have hostgroup tag with id=6 - ${result} check resources tags With Timeout 0 12 hostgroup [6] 60 + ${result} Check Resources Tags With Timeout 0 12 hostgroup [6] 60 Should Be True ${result} First step: resource 12 should have hostgroup tag with id=6 - ${result} check resources tags With Timeout 0 30 hostgroup [8] 60 + ${result} Check Resources Tags With Timeout 0 30 hostgroup [8] 60 Should Be True ${result} First step: resource 30 should have hostgroup tag with id=10 - ${result} check resources tags With Timeout 0 31 hostgroup [8] 60 + ${result} Check Resources Tags With Timeout 0 31 hostgroup [8] 60 Should Be True ${result} First step: resource 31 should have hostgroup tag with id=10 - ${result} check resources tags With Timeout 0 32 hostgroup [9] 60 + ${result} Check Resources Tags With Timeout 0 32 hostgroup [9] 60 Should Be True ${result} First step: resource 32 should have hostgroup tag with id=14 - ${result} check resources tags With Timeout 0 33 hostgroup [9] 60 + ${result} Check Resources Tags With Timeout 0 33 hostgroup [9] 60 Should Be True ${result} First step: host 33 should have hostgroup tag with id=14 Stop Engine @@ -538,17 +538,17 @@ BEUTAG10 # Let's wait for the external command check start ${content} Create List check_for_external_commands() - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} A message telling check_for_external_commands() should be available. - ${result} check resources tags With Timeout 1 4 servicegroup [2,4] 60 + ${result} Check Resources Tags With Timeout 1 4 servicegroup [2,4] 60 Should Be True ${result} First step: Service (1, 4) should have servicegroup tags 2 and 4 - ${result} check resources tags With Timeout 1 3 servicecategory [3,5] 60 + ${result} Check Resources Tags With Timeout 1 3 servicecategory [3,5] 60 Should Be True ${result} First step: Service (1, 3) should have servicecategory tags 3 and 5 - ${result} check resources tags With Timeout 26 504 servicegroup [3,5] 60 + ${result} Check Resources Tags With Timeout 26 504 servicegroup [3,5] 60 Should Be True ${result} First step: Service (26, 504) should have servicegroup tags 3 and 5. - ${result} check resources tags With Timeout 26 503 servicecategory [2,4] 60 + ${result} Check Resources Tags With Timeout 26 503 servicecategory [2,4] 60 Should Be True ${result} First step: Service (26, 503) should have servicecategory tags 2 and 4. Remove Tags From Services ${0} group_tags @@ -563,16 +563,16 @@ BEUTAG10 Add Tags To Services ${1} category_tags 2,4 [501, 502, 504] Reload Engine Reload Broker - ${result} check resources tags With Timeout 1 4 servicegroup [2,4] 60 False + ${result} Check Resources Tags With Timeout 1 4 servicegroup [2,4] 60 False Should Be True ${result} Second step: Service (1, 4) should not have servicegroup tags 2 and 4 - ${result} check resources tags With Timeout 1 3 servicecategory [3,5] 60 False + ${result} Check Resources Tags With Timeout 1 3 servicecategory [3,5] 60 False Should Be True ${result} Second step: Service (1, 3) should not have servicecategory tags 3 and 5 - ${result} check resources tags With Timeout 26 504 servicegroup [3,5] 60 False + ${result} Check Resources Tags With Timeout 26 504 servicegroup [3,5] 60 False Should Be True ${result} Second step: Service (26, 504) should not have servicegroup tags 3 and 5 - ${result} check resources tags With Timeout 26 503 servicecategory [3,5] 60 False + ${result} Check Resources Tags With Timeout 26 503 servicecategory [3,5] 60 False Should Be True ${result} Second step: Service (26, 503) should not have servicecategory tags 3 and 5 Stop Engine @@ -610,17 +610,17 @@ BEUTAG11 # Let's wait for the external command check start ${content} Create List check_for_external_commands() - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} A message telling check_for_external_commands() should be available. - ${result} check resources tags With Timeout 1 4 servicegroup [2,4] 60 + ${result} Check Resources Tags With Timeout 1 4 servicegroup [2,4] 60 Should Be True ${result} First step: Service (1, 4) should have servicegroup tags 2 and 4 - ${result} check resources tags With Timeout 1 3 servicecategory [3,5] 60 + ${result} Check Resources Tags With Timeout 1 3 servicecategory [3,5] 60 Should Be True ${result} First step: Service (1, 3) should have servicecategory tags 3 and 5 - ${result} check resources tags With Timeout 26 504 servicegroup [3,5] 60 + ${result} Check Resources Tags With Timeout 26 504 servicegroup [3,5] 60 Should Be True ${result} First step: Service (26, 504) should have servicegroup tags 3 and 5. - ${result} check resources tags With Timeout 26 503 servicecategory [2,4] 60 + ${result} Check Resources Tags With Timeout 26 503 servicecategory [2,4] 60 Should Be True ${result} First step: Service (26, 503) should have servicecategory tags 2 and 4. Remove Tags From Services ${0} group_tags @@ -635,16 +635,16 @@ BEUTAG11 Add Tags To Services ${1} category_tags 2,4 [501, 502, 504] Reload Engine Reload Broker - ${result} check resources tags With Timeout 1 4 servicegroup [2,4] 60 + ${result} Check Resources Tags With Timeout 1 4 servicegroup [2,4] 60 Should Be True ${result} Second step: Service (1, 4) should not have servicegroup tags 2 and 4 - ${result} check resources tags With Timeout 1 3 servicecategory [5] 60 False + ${result} Check Resources Tags With Timeout 1 3 servicecategory [5] 60 False Should Be True ${result} Second step: Service (1, 3) should not have servicecategory tags 5 - ${result} check resources tags With Timeout 26 504 servicegroup [3,5] 60 False + ${result} Check Resources Tags With Timeout 26 504 servicegroup [3,5] 60 False Should Be True ${result} Second step: Service (26, 504) should not have servicegroup tags 3 and 5 - ${result} check resources tags With Timeout 26 503 servicecategory [3,5] 60 + ${result} Check Resources Tags With Timeout 26 503 servicecategory [3,5] 60 Should Be True ${result} Second step: Service (26, 503) should not have servicecategory tags 3 and 5 Stop Engine @@ -676,16 +676,16 @@ BEUTAG12 # Let's wait for the external command check start ${content} Create List check_for_external_commands() - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} A message telling check_for_external_commands() should be available. - ${result} check resources tags With Timeout 0 1 hostgroup [2,3] 60 + ${result} Check Resources Tags With Timeout 0 1 hostgroup [2,3] 60 Should Be True ${result} Host 1 should have hostgroup tags 2 and 3 - ${result} check resources tags With Timeout 0 2 hostgroup [2,3] 60 + ${result} Check Resources Tags With Timeout 0 2 hostgroup [2,3] 60 Should Be True ${result} Host 2 should have hostgroup tags 2 and 3 - ${result} check resources tags With Timeout 0 2 hostcategory [2, 3] 60 + ${result} Check Resources Tags With Timeout 0 2 hostcategory [2, 3] 60 Should Be True ${result} Host 2 should have hostcategory tags 2 and 3 - ${result} check resources tags With Timeout 0 3 hostcategory [2, 3] 60 + ${result} Check Resources Tags With Timeout 0 3 hostcategory [2, 3] 60 Should Be True ${result} Host 3 should have hostcategory tags 2 and 3 Remove Tags From Hosts ${0} group_tags @@ -696,15 +696,15 @@ BEUTAG12 Reload Engine Reload Broker - ${result} check resources tags With Timeout 0 1 hostgroup [2,3] 60 False + ${result} Check Resources Tags With Timeout 0 1 hostgroup [2,3] 60 False Should Be True ${result} Host 1 should not have hostgroup tags 2 nor 3 - ${result} check resources tags With Timeout 0 2 hostgroup [2,3] 60 False + ${result} Check Resources Tags With Timeout 0 2 hostgroup [2,3] 60 False Should Be True ${result} Host 2 should not have hostgroup tags 2 nor 3 - ${result} check resources tags With Timeout 0 2 hostcategory [2,3] 60 False + ${result} Check Resources Tags With Timeout 0 2 hostcategory [2,3] 60 False Should Be True ${result} Host 2 should not have hostgroup tags 2 nor 3 - ${result} check resources tags With Timeout 0 3 hostcategory [2,3] 60 False + ${result} Check Resources Tags With Timeout 0 3 hostcategory [2,3] 60 False Should Be True ${result} Host 3 should not have hostgroup tags 2 nor 3 - ${result} check resources tags With Timeout 0 4 hostcategory [2,3] 60 False + ${result} Check Resources Tags With Timeout 0 4 hostcategory [2,3] 60 False Should Be True ${result} Host 4 should not have hostgroup tags 2 nor 3 Stop Engine @@ -714,4 +714,4 @@ BEUTAG12 *** Keywords *** Init Test Stop Processes - truncate_resource_host_service + Truncate Resource Host Service diff --git a/tests/broker-engine/victoria.robot b/tests/broker-engine/victoria.robot index 9508d3d31f9..45f84c79b61 100644 --- a/tests/broker-engine/victoria.robot +++ b/tests/broker-engine/victoria.robot @@ -38,7 +38,7 @@ VICT_ONE_CHECK_METRIC Start Server 127.0.0.1 8000 # wait all is started ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. @@ -97,7 +97,7 @@ VICT_ONE_CHECK_STATUS Start Server 127.0.0.1 8000 # wait all is started ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. @@ -223,7 +223,7 @@ VICT_ONE_CHECK_METRIC_AFTER_FAILURE Start Engine # wait all is started ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. @@ -232,7 +232,7 @@ VICT_ONE_CHECK_METRIC_AFTER_FAILURE ${start} Get Round Current Date ${content} Create List [victoria_metrics] name: "metric_taratata" - ${result} Find In Log with Timeout ${centralLog} ${start} ${content} 60 + ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 60 Should Be True ${result} victoria should add metric in a request Start Server 127.0.0.1 8000 diff --git a/tests/broker/command-line.robot b/tests/broker/command-line.robot index bdb93c02a55..443654707e6 100644 --- a/tests/broker/command-line.robot +++ b/tests/broker/command-line.robot @@ -30,7 +30,7 @@ BCL2 Sleep 1s Start Broker With Args -s5 ${EtcRoot}/centreon-broker/central-broker.json ${table} Create List Starting the TCP thread pool of 5 threads - ${logger_res} Find in log with timeout ${centralLog} ${start} ${table} 30 + ${logger_res} Find In Log With Timeout ${centralLog} ${start} ${table} 30 Should be True ... ${logger_res} ... Didn't found 5 threads in ${VarRoot}/log/centreon-broker/central-broker-master.log diff --git a/tests/broker/start-stop.robot b/tests/broker/start-stop.robot index 225cd09d257..8188ac73c9f 100644 --- a/tests/broker/start-stop.robot +++ b/tests/broker/start-stop.robot @@ -107,7 +107,7 @@ START_STOP_CBD # wait engine start ${content} Create List INITIAL SERVICE STATE: host_50;service_1000; check_for_external_commands() - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial service state on (host_50,service_1000) should be raised before we can start our external commands. diff --git a/tests/connector_ssh/connector_ssh.robot b/tests/connector_ssh/connector_ssh.robot index 9a2a1819177..f04bde09d88 100644 --- a/tests/connector_ssh/connector_ssh.robot +++ b/tests/connector_ssh/connector_ssh.robot @@ -33,7 +33,7 @@ TestBadUser ${start}= Get Current Date ${content} Create List INITIAL SERVICE STATE: host_1;service_1; check_for_external_commands() - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. @@ -42,7 +42,7 @@ TestBadUser schedule forced host check host_1 ${VarRoot}/lib/centreon-engine/config0/rw/centengine.cmd ${content} Create List fail to connect to toto@127.0.0.10 - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} A message fail to connect to toto@127.0.0.10 should be available. Stop Engine @@ -62,7 +62,7 @@ TestBadPwd ${start}= Get Current Date ${content} Create List INITIAL SERVICE STATE: host_1;service_1; check_for_external_commands() - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. @@ -71,7 +71,7 @@ TestBadPwd schedule forced host check host_1 ${VarRoot}/lib/centreon-engine/config0/rw/centengine.cmd ${content} Create List fail to connect to testconnssh@127.0.0.11 - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} A message fail to connect to testconnssh@127.0.0.11 should be available. Stop Engine @@ -108,7 +108,7 @@ Test6Hosts ${start}= Get Current Date ${content} Create List INITIAL SERVICE STATE: host_1;service_1; check_for_external_commands() - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. @@ -120,17 +120,17 @@ Test6Hosts IF "${run_env}" == "docker" ${content} Create List output='toto=127.0.0.1' - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} A message output='toto=127.0.0.1' should be available. ELSE ${content} Create List output='toto=::1' - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} A message output='toto=::1' should be available. END FOR ${idx} IN RANGE 2 7 ${content} Create List output='toto=127.0.0.${idx} - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} A message output='toto=127.0.0.${idx}' should be available. END diff --git a/tests/engine/forced_checks.robot b/tests/engine/forced_checks.robot index df3399b8861..a85e38f5074 100644 --- a/tests/engine/forced_checks.robot +++ b/tests/engine/forced_checks.robot @@ -37,7 +37,7 @@ EFHC1 Should be true ${result} host_1 should be pending ${content} Create List INITIAL HOST STATE: host_1; - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. @@ -54,7 +54,7 @@ EFHC1 ... EXTERNAL COMMAND: SCHEDULE_FORCED_HOST_CHECK;host_1; ... HOST ALERT: host_1;DOWN;HARD;3; - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} Message about SCHEDULE FORCED CHECK and HOST ALERT should be available in log. ${result} Check host status host_1 1 1 False @@ -80,7 +80,7 @@ EFHC2 Start Engine Start Broker ${content} Create List INITIAL HOST STATE: host_1; - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. @@ -97,7 +97,7 @@ EFHC2 ... EXTERNAL COMMAND: SCHEDULE_FORCED_HOST_CHECK;host_1; ... HOST ALERT: host_1;DOWN;HARD;3; - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} Message about SCHEDULE FORCED CHECK and HOST ALERT should be available in log. ${result} Check host status host_1 1 1 False @@ -132,7 +132,7 @@ EFHCU1 ${result} Check host status host_1 4 1 True Should be true ${result} host_1 should be pending ${content} Create List INITIAL HOST STATE: host_1; - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. @@ -149,7 +149,7 @@ EFHCU1 ... EXTERNAL COMMAND: SCHEDULE_FORCED_HOST_CHECK;host_1; ... HOST ALERT: host_1;DOWN;HARD;3; - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} Message about SCHEDULE FORCED CHECK and HOST ALERT should be available in log. ${result} Check host status host_1 1 1 True @@ -183,7 +183,7 @@ EFHCU2 ${result} Check host status host_1 4 1 True Should be true ${result} host_1 should be pending ${content} Create List INITIAL HOST STATE: host_1; - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. @@ -200,7 +200,7 @@ EFHCU2 ... EXTERNAL COMMAND: SCHEDULE_FORCED_HOST_CHECK;host_1; ... HOST ALERT: host_1;DOWN;HARD;3; - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} Message about SCHEDULE FORCED CHECK and HOST ALERT should be available in log. ${result} Check host status host_1 1 1 True @@ -228,7 +228,7 @@ EMACROS Start Broker ${content} Create List INITIAL HOST STATE: host_1; - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. @@ -237,7 +237,7 @@ EMACROS ${content} Create List ... ResourceFile: /tmp/etc/centreon-engine/config0/resource.cfg - LogFile: /tmp/var/log/centreon-engine/config0/centengine.log - AdminEmail: titus@bidibule.com - AdminPager: admin - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} AdminEmail: titus@bidibule.com - AdminPager: admin not found in log. Stop Engine @@ -271,7 +271,7 @@ EMACROS_NOTIF Start Broker ${content} Create List INITIAL HOST STATE: host_1; - ${result} Find In Log with Timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. diff --git a/tests/engine/perl-connectors.robot b/tests/engine/perl-connectors.robot index 12323e12667..fc779903230 100644 --- a/tests/engine/perl-connectors.robot +++ b/tests/engine/perl-connectors.robot @@ -25,11 +25,11 @@ EPC1 Start Engine ${content} Create List connector::run: connector='Perl Connector' - ${result} Find In Log with timeout ${engineLog0} ${start} ${content} 60 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} Missing a message talking about 'Perl Connector' ${content} Create List connector::data_is_available - ${result} Find In Log with timeout ${engineLog0} ${start} ${content} 20 + ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 20 Should Be True ${result} Missing a message telling data is available from the Perl connector Stop Engine diff --git a/tests/resources/Engine.py b/tests/resources/Engine.py index f8cb3554d4f..ff70a9fe23a 100755 --- a/tests/resources/Engine.py +++ b/tests/resources/Engine.py @@ -196,7 +196,6 @@ def create_service(self, host_id: int, cmd_ids: int): host_id, service_id, self.service_cmd[service_id]) return retval - def create_anomaly_detection(self, host_id: int, dependent_service_id: int, metric_name: string, sensitivity: float = 0.0): self.last_service_id += 1 service_id = self.last_service_id @@ -751,6 +750,7 @@ def engine_config_set_value_in_services(idx: int, desc: str, key: str, value: st f.writelines(lines) f.close() + def engine_config_replace_value_in_services(idx: int, desc: str, key: str, value: str): """! Function to update a value in the services.cfg for the config idx. @param idx index of the configuration (from 0) @@ -917,6 +917,7 @@ def engine_config_set_value_in_escalations(idx: int, desc: str, key: str, value: with open(f"{ETC_ROOT}/centreon-engine/config{idx}/escalations.cfg", "w") as ff: ff.writelines(lines) + def engine_config_remove_service_host(idx: int, host: str): filename = ETC_ROOT + "/centreon-engine/config{}/services.cfg".format(idx) f = open(filename, "r") @@ -1049,11 +1050,13 @@ def add_service_group(index: int, id_service_group: int, members: list): f.write(engine.create_service_group(id_service_group, members)) f.close() + def add_contact_group(index: int, id_contact_group: int, members: list): with open(f"{ETC_ROOT}/centreon-engine/config{index}/contactgroups.cfg", "a+") as f: logger.console(members) f.write(engine.create_contact_group(id_contact_group, members)) + def create_service(index: int, host_id: int, cmd_id: int): f = open(ETC_ROOT + "/centreon-engine/config{}/services.cfg".format(index), "a+") svc = engine.create_service(host_id, [1, cmd_id]) @@ -1556,40 +1559,36 @@ def stop_obsessing_over_svc(use_grpc: int, hst: str, svc: str): f.close() +def external_command(func): + def wrapper(*args): + now = int(time.time()) + cmd = f"[{now}] {func(*args)}" + with open(f"{VAR_ROOT}/lib/centreon-engine/config0/rw/centengine.cmd", "w") as f: + f.write(cmd) + + return wrapper + + +@external_command def service_ext_commands(hst: str, svc: str, state: int, output: str): - now = int(time.time()) - cmd = "[{}] PROCESS_SERVICE_CHECK_RESULT;{};{};{};{}\n".format( - now, hst, svc, state, output) - f = open(VAR_ROOT + "/lib/centreon-engine/config0/rw/centengine.cmd", "w") - f.write(cmd) - f.close() + return f"PROCESS_SERVICE_CHECK_RESULT;{hst};{svc};{state};{output}\n" +@external_command def process_host_check_result(hst: str, state: int, output: str): - now = int(time.time()) - cmd = "[{}] PROCESS_HOST_CHECK_RESULT;{};{};{}\n".format( - now, hst, state, output) - f = open(VAR_ROOT + "/lib/centreon-engine/config0/rw/centengine.cmd", "w") - f.write(cmd) - f.close() + return f"PROCESS_HOST_CHECK_RESULT;{hst};{state};{output}\n" +@external_command def schedule_service_downtime(hst: str, svc: str, duration: int): now = int(time.time()) - cmd = "[{2}] SCHEDULE_SVC_DOWNTIME;{0};{1};{2};{3};0;0;{4};admin;Downtime set by admin\n".format( - hst, svc, now, now+duration, duration) - f = open(f"{VAR_ROOT}/lib/centreon-engine/config0/rw/centengine.cmd", "w") - f.write(cmd) - f.close() + return f"SCHEDULE_SVC_DOWNTIME;{hst};{svc};{now};{now+int(duration)};0;0;{duration};admin;Downtime set by admin\n" +@external_command def schedule_service_fixed_downtime(hst: str, svc: str, duration: int): now = int(time.time()) - cmd = "[{2}] SCHEDULE_SVC_DOWNTIME;{0};{1};{2};{3};1;0;{4};admin;Downtime set by admin\n".format( - hst, svc, now, now + duration, duration) - f = open(VAR_ROOT + "/lib/centreon-engine/config0/rw/centengine.cmd", "w") - f.write(cmd) - f.close() + return f"SCHEDULE_SVC_DOWNTIME;{hst};{svc};{now};{now+int(duration)};1;0;{duration};admin;Downtime set by admin\n" def schedule_host_fixed_downtime(poller: int, hst: str, duration: int): @@ -1920,17 +1919,6 @@ def config_engine_remove_cfg_file(poller: int, fic: str): ff.close() -def external_command(func): - def wrapper(*args): - now = int(time.time()) - cmd = f"[{now}] {func(*args)}" - f = open(VAR_ROOT + "/lib/centreon-engine/config0/rw/centengine.cmd", "w") - f.write(cmd) - f.close() - - return wrapper - - def process_service_check_result_with_metrics(hst: str, svc: str, state: int, output: str, metrics: int, config='config0'): now = int(time.time()) pd = [output + " | "] @@ -1956,7 +1944,6 @@ def process_service_check_result(hst: str, svc: str, state: int, output: str, co with open(f"{VAR_ROOT}/lib/centreon-engine/{config}/rw/centengine.cmd", "w") as f: for i in range(nb_check): cmd = f"[{now}] PROCESS_SERVICE_CHECK_RESULT;{hst};{svc};{state};{output}_{i}\n" - logger.console(cmd) f.write(cmd) @@ -2209,6 +2196,7 @@ def send_bench(id: int, port: int): stub = engine_pb2_grpc.EngineStub(channel) stub.SendBench(engine_pb2.BenchParam(id=id, ts=ts)) + def config_host_command_status(idx: int, cmd_name: str, status: int): filename = f"{ETC_ROOT}/centreon-engine/config{idx}/commands.cfg" with open(filename, "r") as f: @@ -2217,9 +2205,9 @@ def config_host_command_status(idx: int, cmd_name: str, status: int): r = re.compile(rf"^\s*command_name\s+{cmd_name}\s*$") for i in range(len(lines)): if r.match(lines[i]): - lines[i + 1] = f" command_line {ENGINE_HOME}/check.pl 0 {status}\n" + lines[i + + 1] = f" command_line {ENGINE_HOME}/check.pl 0 {status}\n" break with open(filename, "w") as f: f.writelines(lines) - diff --git a/tests/resources/db_variables.robot b/tests/resources/db_variables.robot index f63d15a4d72..5badb0a6a95 100644 --- a/tests/resources/db_variables.robot +++ b/tests/resources/db_variables.robot @@ -7,5 +7,5 @@ ${DBHost} localhost ${DBUser} centreon ${DBPass} centreon ${DBPort} 3306 -${DBUserRoot} root_centreon +${DBUserRoot} root ${DBPassRoot} centreon diff --git a/tests/resources/resources.robot b/tests/resources/resources.robot index fb3db68b44d..401b700f6d0 100644 --- a/tests/resources/resources.robot +++ b/tests/resources/resources.robot @@ -88,11 +88,13 @@ Kindly Stop Broker ${result} Wait For Process b1 timeout=60s # In case of process not stopping IF "${result}" == "${None}" + Save Logs Dump Process b1 /usr/sbin/cbd broker-central Send Signal To Process SIGKILL b1 Fail Central Broker not correctly stopped (coredump generated) ELSE IF ${result.rc} != 0 + Save Logs Copy Coredump In Failed Dir b1 /usr/sbin/cbd broker_central Coredump Info b1 /usr/sbin/cbd broker_central Should Be Equal As Integers ${result.rc} 0 Central Broker not correctly stopped @@ -103,11 +105,13 @@ Kindly Stop Broker ${result} Wait For Process b2 timeout=60s on_timeout=kill # In case of process not stopping IF "${result}" == "${None}" + Save Logs Dump Process b2 /usr/sbin/cbd broker-rrd Send Signal To Process SIGKILL b2 Fail RRD Broker not correctly stopped (coredump generated) ELSE IF ${result.rc} != 0 + Save Logs Copy Coredump In Failed Dir b2 /usr/sbin/cbd broker_rrd Coredump info b2 /usr/sbin/cbd broker_rrd Should Be Equal As Integers ${result.rc} 0 RRD Broker not correctly stopped From d2ef8c9cdf0de977eb6d3284de0154284a0f2677 Mon Sep 17 00:00:00 2001 From: David Boucher Date: Sat, 14 Oct 2023 19:38:23 +0200 Subject: [PATCH 23/84] wip(tests): oops --- tests/resources/db_variables.robot | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/resources/db_variables.robot b/tests/resources/db_variables.robot index 5badb0a6a95..f63d15a4d72 100644 --- a/tests/resources/db_variables.robot +++ b/tests/resources/db_variables.robot @@ -7,5 +7,5 @@ ${DBHost} localhost ${DBUser} centreon ${DBPass} centreon ${DBPort} 3306 -${DBUserRoot} root +${DBUserRoot} root_centreon ${DBPassRoot} centreon From 53dc6e65dda9071eee09a587c037ad872d44a598 Mon Sep 17 00:00:00 2001 From: David Boucher Date: Sat, 14 Oct 2023 22:24:02 +0200 Subject: [PATCH 24/84] wip(ci) --- .github/scripts/collect-test-robot.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/scripts/collect-test-robot.sh b/.github/scripts/collect-test-robot.sh index eb2cd4f31bd..f0a56dd2266 100755 --- a/.github/scripts/collect-test-robot.sh +++ b/.github/scripts/collect-test-robot.sh @@ -11,11 +11,11 @@ database_type=$2 distrib=${ID} distrib=$(echo $distrib | tr '[:lower:]' '[:upper:]') -cpu=$(lscpu | awk '$1 ~ "Architecture" { print $2 }') - -if [ "$cpu" = "aarch64" -a "$test_file" = "broker-engine/bench.robot" ]; then - exit 0 -fi +#cpu=$(lscpu | awk '$1 ~ "Architecture" { print $2 }') +# +#if [ "$cpu" = "aarch64" -a "$test_file" = "broker-engine/bench.robot" ]; then +# exit 0 +#fi if [ ${database_type} == 'mysql' ] && [ ! -f tests/${test_file}.mysql ]; then echo > tests/log.html From d1d4db23443faed397eefd5793ae41c95b0d6e29 Mon Sep 17 00:00:00 2001 From: David Boucher Date: Sat, 14 Oct 2023 23:46:38 +0200 Subject: [PATCH 25/84] wip(tests) --- tests/bam/bam_pb.robot | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/bam/bam_pb.robot b/tests/bam/bam_pb.robot index 62b14b54efc..0461dd86c50 100644 --- a/tests/bam/bam_pb.robot +++ b/tests/bam/bam_pb.robot @@ -828,6 +828,7 @@ BEPB_BA_DURATION_EVENT ${output} Query ... SELECT start_time, end_time, duration, sla_duration, timeperiod_is_default FROM mod_bam_reporting_ba_events_durations WHERE ba_event_id = 1 Sleep 1s + Log To Console ${output} IF ${output} and len(${output}) >= 1 and len(${output[0]}) >= 5 BREAK END From b45efc3f9df87f3a24bc765cff8f2ef28aca310e Mon Sep 17 00:00:00 2001 From: David Boucher Date: Mon, 16 Oct 2023 08:00:41 +0200 Subject: [PATCH 26/84] enh(tests): unstable feature added --- .github/scripts/collect-test-robot.sh | 9 ++-- ...tion.robot => notification-unstable.robot} | 0 tests/broker-engine/tags.robot | 2 +- tests/resources/Common.py | 43 +++++++++++++++++-- tests/resources/Engine.py | 2 +- 5 files changed, 46 insertions(+), 10 deletions(-) rename tests/broker-engine/{notification.robot => notification-unstable.robot} (100%) diff --git a/.github/scripts/collect-test-robot.sh b/.github/scripts/collect-test-robot.sh index f0a56dd2266..da38d9aa372 100755 --- a/.github/scripts/collect-test-robot.sh +++ b/.github/scripts/collect-test-robot.sh @@ -12,10 +12,9 @@ distrib=${ID} distrib=$(echo $distrib | tr '[:lower:]' '[:upper:]') #cpu=$(lscpu | awk '$1 ~ "Architecture" { print $2 }') -# -#if [ "$cpu" = "aarch64" -a "$test_file" = "broker-engine/bench.robot" ]; then -# exit 0 -#fi +if [[ "$test_file" =~ "unstable" ]] ; then + exit 0 +fi if [ ${database_type} == 'mysql' ] && [ ! -f tests/${test_file}.mysql ]; then echo > tests/log.html @@ -112,4 +111,4 @@ cd tests ./init-proto.sh echo "####################### Run Centreon Collect Robot Tests #######################" -robot $test_file +robot -e unstable $test_file diff --git a/tests/broker-engine/notification.robot b/tests/broker-engine/notification-unstable.robot similarity index 100% rename from tests/broker-engine/notification.robot rename to tests/broker-engine/notification-unstable.robot diff --git a/tests/broker-engine/tags.robot b/tests/broker-engine/tags.robot index a846442fd24..cf078af6033 100644 --- a/tests/broker-engine/tags.robot +++ b/tests/broker-engine/tags.robot @@ -310,7 +310,7 @@ BEUTAG6 BEUTAG7 [Documentation] Some services are configured with tags on two pollers. Then tags configuration is modified. - [Tags] broker engine protobuf bbdo tags + [Tags] broker engine protobuf bbdo tags unstable Config Engine ${2} Create Tags File ${0} ${20} Create Tags File ${1} ${20} diff --git a/tests/resources/Common.py b/tests/resources/Common.py index 591f223f002..a466bf70378 100644 --- a/tests/resources/Common.py +++ b/tests/resources/Common.py @@ -802,6 +802,40 @@ def check_downtimes_with_timeout(nb: int, timeout: int): return False +def check_host_downtime_with_timeout(hostname: str, enabled, timeout: int): + limit = time.time() + timeout + while time.time() < limit: + connection = pymysql.connect(host=DB_HOST, + user=DB_USER, + password=DB_PASS, + database=DB_NAME_STORAGE, + charset='utf8mb4', + cursorclass=pymysql.cursors.DictCursor) + + with connection: + with connection.cursor() as cursor: + if enabled != '0': + cursor.execute( + f"SELECT h.scheduled_downtime_depth FROM downtimes d INNER JOIN hosts h ON d.host_id=h.host_id AND d.service_id=0 WHERE d.deletion_time is null AND h.name='{hostname}'") + result = cursor.fetchall() + if len(result) == int(enabled) and not result[0]['scheduled_downtime_depth'] is None and result[0]['scheduled_downtime_depth'] == int(enabled): + return True + if (len(result) > 0): + logger.console( + f"{len(result)} downtimes for host {hostname} scheduled_downtime_depth={result[0]['scheduled_downtime_depth']}") + else: + logger.console( + f"{len(result)} downtimes for host {hostname} scheduled_downtime_depth=None") + else: + cursor.execute( + f"SELECT h.scheduled_downtime_depth, d.deletion_time, d.downtime_id FROM hosts h LEFT JOIN downtimes d ON h.host_id = d.host_id AND d.service_id=0 WHERE h.name='{hostname}'") + result = cursor.fetchall() + if len(result) > 0 and not result[0]['scheduled_downtime_depth'] is None and result[0]['scheduled_downtime_depth'] == 0 and (result[0]['downtime_id'] is None or not result[0]['deletion_time'] is None): + return True + time.sleep(1) + return False + + def check_service_downtime_with_timeout(hostname: str, service_desc: str, enabled, timeout: int): limit = time.time() + timeout while time.time() < limit: @@ -1052,8 +1086,10 @@ def check_resources_tags_with_timeout(parent_id: int, mid: int, typ: str, tag_id with connection: with connection.cursor() as cursor: - logger.console(f"select t.id from resources r inner join resources_tags rt on r.resource_id=rt.resource_id inner join tags t on rt.tag_id=t.tag_id WHERE r.id={mid} and r.parent_id={parent_id} and t.type={t}") - cursor.execute(f"select t.id from resources r inner join resources_tags rt on r.resource_id=rt.resource_id inner join tags t on rt.tag_id=t.tag_id WHERE r.id={mid} and r.parent_id={parent_id} and t.type={t}") + logger.console( + f"select t.id from resources r inner join resources_tags rt on r.resource_id=rt.resource_id inner join tags t on rt.tag_id=t.tag_id WHERE r.id={mid} and r.parent_id={parent_id} and t.type={t}") + cursor.execute( + f"select t.id from resources r inner join resources_tags rt on r.resource_id=rt.resource_id inner join tags t on rt.tag_id=t.tag_id WHERE r.id={mid} and r.parent_id={parent_id} and t.type={t}") result = cursor.fetchall() logger.console(result) if not enabled: @@ -1075,7 +1111,8 @@ def check_resources_tags_with_timeout(parent_id: int, mid: int, typ: str, tag_id break return True else: - logger.console("Result and tag_ids should have the same size, moreover 'id' in result should be values of tag_ids, result size = {len(result)} and tag_ids size = {len(tag_ids)} - their content are result: {result} and tag_ids: {tag_ids}") + logger.console( + f"Result and tag_ids should have the same size, moreover 'id' in result should be values of tag_ids, result size = {len(result)} and tag_ids size = {len(tag_ids)} - their content are result: {result} and tag_ids: {tag_ids}") else: logger.console("result") logger.console(result) diff --git a/tests/resources/Engine.py b/tests/resources/Engine.py index ff70a9fe23a..64cbdf09bb8 100755 --- a/tests/resources/Engine.py +++ b/tests/resources/Engine.py @@ -1645,7 +1645,7 @@ def schedule_forced_svc_check(host: str, svc: str, pipe: str = VAR_ROOT + "/lib/ time.sleep(0.05) -def schedule_forced_host_check(host: str, pipe: str = VAR_ROOT + "/lib/centreon-engine/config0/rw/centengine.cmd"): +def schedule_forced_host_check(host: str, pipe: str = f"{VAR_ROOT}/lib/centreon-engine/config0/rw/centengine.cmd"): now = int(time.time()) cmd = f"[{now}] SCHEDULE_FORCED_HOST_CHECK;{host};{now}\n" with open(pipe, "w") as f: From 004e54333a9175af76001feedfad1efc9c20f009 Mon Sep 17 00:00:00 2001 From: David Boucher Date: Mon, 16 Oct 2023 10:02:17 +0200 Subject: [PATCH 27/84] wip(ci) --- .github/workflows/robot-test.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/robot-test.yml b/.github/workflows/robot-test.yml index 3b6ac99604b..68194480d78 100644 --- a/.github/workflows/robot-test.yml +++ b/.github/workflows/robot-test.yml @@ -88,7 +88,7 @@ jobs: AWS_BUCKET: centreon-collect-robot-report - name: Move reports - if: ${{ !cancelled() }} + if: ${{ failure() }} run: | mkdir reports FILE_PREFIX=`echo "${{ matrix.feature }}" | sed -e "s#/#__#g"`-${{inputs.database_type}} @@ -98,7 +98,7 @@ jobs: fi - name: Upload Test Results - if: ${{ !cancelled() }} + if: ${{ failure() }} uses: actions/upload-artifact@v3 with: name: robot-test-reports-${{inputs.database_type}}-${{ inputs.distrib }}-${{ inputs.arch }} @@ -107,7 +107,7 @@ jobs: robot-test-report: needs: [robot-test] - if: ${{ !cancelled() }} + if: ${{ failure() }} runs-on: ubuntu-22.04 steps: From fcfab314ea9efa0f00eab589b70a8e92b6464482 Mon Sep 17 00:00:00 2001 From: David Boucher Date: Mon, 16 Oct 2023 10:27:05 +0200 Subject: [PATCH 28/84] wip(ci): dev-23.10 added --- .github/workflows/robot-nightly.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/robot-nightly.yml b/.github/workflows/robot-nightly.yml index f97693528c0..02353da2f79 100644 --- a/.github/workflows/robot-nightly.yml +++ b/.github/workflows/robot-nightly.yml @@ -19,10 +19,10 @@ jobs: uses: actions/checkout@v4 - run: | + gh workflow run robot-nightly.yml -r "dev-23.10.x" gh workflow run robot-nightly.yml -r "dev-23.04.x" gh workflow run robot-nightly.yml -r "dev-22.10.x" gh workflow run robot-nightly.yml -r "dev-22.04.x" - gh workflow run robot-nightly.yml -r "dev-21.10.x" shell: bash env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From f8a3f116883aa6e8858e63433e8ec889ff65fbb1 Mon Sep 17 00:00:00 2001 From: David Boucher Date: Mon, 16 Oct 2023 11:11:21 +0200 Subject: [PATCH 29/84] fix(ci): output.xml restored --- .github/workflows/robot-test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/robot-test.yml b/.github/workflows/robot-test.yml index 68194480d78..3f87f26baa5 100644 --- a/.github/workflows/robot-test.yml +++ b/.github/workflows/robot-test.yml @@ -94,6 +94,7 @@ jobs: FILE_PREFIX=`echo "${{ matrix.feature }}" | sed -e "s#/#__#g"`-${{inputs.database_type}} if [ -d tests/failed ] ; then mv tests/log.html reports/$FILE_PREFIX-log.html + mv tests/output.xml reports/$FILE_PREFIX-output.xml mv tests/failed reports/$FILE_PREFIX-failed fi From a0ddc1b3800a3fcad1fdbffa2401e85ec4cd5b4e Mon Sep 17 00:00:00 2001 From: David Boucher Date: Mon, 16 Oct 2023 11:13:08 +0200 Subject: [PATCH 30/84] fix(tests): unused tag removed --- tests/broker-engine/bench.robot | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/broker-engine/bench.robot b/tests/broker-engine/bench.robot index 2e8156183a8..838e4954eb1 100644 --- a/tests/broker-engine/bench.robot +++ b/tests/broker-engine/bench.robot @@ -24,7 +24,7 @@ Test Teardown Stop Engine Broker And Save Logs *** Test Cases *** BENCH_${nb_check}STATUS [Documentation] external command CHECK_SERVICE_RESULT 1000 times - [Tags] broker engine bench exclude-arm + [Tags] broker engine bench Config Engine ${1} ${50} ${20} # We want all the services to be passive to avoid parasite checks during our test. Set Services Passive ${0} service_.* @@ -91,7 +91,7 @@ BENCH_${nb_check}STATUS BENCH_${nb_check}STATUS_TRACES [Documentation] external command CHECK_SERVICE_RESULT ${nb_check} times - [Tags] broker engine bench exclude-arm + [Tags] broker engine bench Config Engine ${1} ${50} ${20} # We want all the services to be passive to avoid parasite checks during our test. Set Services Passive ${0} service_.* @@ -159,7 +159,7 @@ BENCH_${nb_check}STATUS_TRACES BENCH_1000STATUS_100${suffixe} [Documentation] external command CHECK_SERVICE_RESULT 100 times with 100 pollers with 20 services - [Tags] broker engine bench exclude-arm + [Tags] broker engine bench Config Engine ${100} ${100} ${20} Config Broker module ${100} Config Broker central From 80f0b504911735791b9ee8a22c9b6bc7aab9168a Mon Sep 17 00:00:00 2001 From: David Boucher Date: Mon, 16 Oct 2023 15:36:22 +0200 Subject: [PATCH 31/84] fix(cmake): issue with python 3.x, x < 11 --- cmake.sh | 4 +++- common/inc/com/centreon/common/hex_dump.hh | 5 +++-- common/src/hex_dump.cc | 4 ++-- tests/Makefile | 6 +++--- 4 files changed, 11 insertions(+), 8 deletions(-) diff --git a/cmake.sh b/cmake.sh index 12e5aad141c..a6006535950 100755 --- a/cmake.sh +++ b/cmake.sh @@ -262,7 +262,9 @@ elif [ -r /etc/issue ] ; then fi fi -pip3 install conan==1.57.0 --upgrade --break-system-packages +if ! pip3 install conan==1.57.0 --upgrade --break-system-packages ; then + pip3 install conan==1.57.0 --upgrade +fi if which conan ; then conan=$(which conan) diff --git a/common/inc/com/centreon/common/hex_dump.hh b/common/inc/com/centreon/common/hex_dump.hh index 1a56f39c160..a6cef4a5087 100644 --- a/common/inc/com/centreon/common/hex_dump.hh +++ b/common/inc/com/centreon/common/hex_dump.hh @@ -27,9 +27,10 @@ CCCM_BEGIN() std::string hex_dump(const unsigned char* buffer, size_t buff_len, - int nb_char_per_line); + uint32_t nb_char_per_line); -inline std::string hex_dump(const std::string& buffer, int nb_char_per_line) { +inline std::string hex_dump(const std::string& buffer, + uint32_t nb_char_per_line) { return hex_dump(reinterpret_cast(buffer.data()), buffer.size(), nb_char_per_line); } diff --git a/common/src/hex_dump.cc b/common/src/hex_dump.cc index 66314365896..700f281d717 100644 --- a/common/src/hex_dump.cc +++ b/common/src/hex_dump.cc @@ -40,7 +40,7 @@ inline void char_to_hex(unsigned char c, std::string& output) noexcept { */ std::string com::centreon::common::hex_dump(const unsigned char* buffer, size_t buff_len, - int nb_char_per_line) { + uint32_t nb_char_per_line) { std::string ret; if (nb_char_per_line > 0) { size_t address_len = 0; @@ -75,7 +75,7 @@ std::string com::centreon::common::hex_dump(const unsigned char* buffer, } } ret.push_back(' '); - for (unsigned pad = char_part.length(); pad < nb_char_per_line; ++pad) { + for (uint32_t pad = char_part.length(); pad < nb_char_per_line; ++pad) { ret.push_back(' '); ret.push_back(' '); } diff --git a/tests/Makefile b/tests/Makefile index 48337096913..4f2647e0648 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -1,6 +1,6 @@ test: yum install -y python3-devel - pip3 install grpcio==1.33.2 - pip3 install grpcio-tools==1.33.2 + pip3 install grpcio + pip3 install grpcio-tools ./init-proto.sh - robot . +#robot . From b9051597f08a8af07ec108383265156d57b13c7a Mon Sep 17 00:00:00 2001 From: David Boucher Date: Mon, 16 Oct 2023 16:30:57 +0200 Subject: [PATCH 32/84] cleanup(tests): unused buggy function commented before it is really used --- tests/resources/Common.py | 64 +++++++++++++++++++-------------------- 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/tests/resources/Common.py b/tests/resources/Common.py index a466bf70378..1abc12b72b9 100644 --- a/tests/resources/Common.py +++ b/tests/resources/Common.py @@ -802,38 +802,38 @@ def check_downtimes_with_timeout(nb: int, timeout: int): return False -def check_host_downtime_with_timeout(hostname: str, enabled, timeout: int): - limit = time.time() + timeout - while time.time() < limit: - connection = pymysql.connect(host=DB_HOST, - user=DB_USER, - password=DB_PASS, - database=DB_NAME_STORAGE, - charset='utf8mb4', - cursorclass=pymysql.cursors.DictCursor) - - with connection: - with connection.cursor() as cursor: - if enabled != '0': - cursor.execute( - f"SELECT h.scheduled_downtime_depth FROM downtimes d INNER JOIN hosts h ON d.host_id=h.host_id AND d.service_id=0 WHERE d.deletion_time is null AND h.name='{hostname}'") - result = cursor.fetchall() - if len(result) == int(enabled) and not result[0]['scheduled_downtime_depth'] is None and result[0]['scheduled_downtime_depth'] == int(enabled): - return True - if (len(result) > 0): - logger.console( - f"{len(result)} downtimes for host {hostname} scheduled_downtime_depth={result[0]['scheduled_downtime_depth']}") - else: - logger.console( - f"{len(result)} downtimes for host {hostname} scheduled_downtime_depth=None") - else: - cursor.execute( - f"SELECT h.scheduled_downtime_depth, d.deletion_time, d.downtime_id FROM hosts h LEFT JOIN downtimes d ON h.host_id = d.host_id AND d.service_id=0 WHERE h.name='{hostname}'") - result = cursor.fetchall() - if len(result) > 0 and not result[0]['scheduled_downtime_depth'] is None and result[0]['scheduled_downtime_depth'] == 0 and (result[0]['downtime_id'] is None or not result[0]['deletion_time'] is None): - return True - time.sleep(1) - return False +#def check_host_downtime_with_timeout(hostname: str, enabled, timeout: int): +# limit = time.time() + timeout +# while time.time() < limit: +# connection = pymysql.connect(host=DB_HOST, +# user=DB_USER, +# password=DB_PASS, +# database=DB_NAME_STORAGE, +# charset='utf8mb4', +# cursorclass=pymysql.cursors.DictCursor) +# +# with connection: +# with connection.cursor() as cursor: +# if enabled != '0': +# cursor.execute( +# f"SELECT h.scheduled_downtime_depth FROM downtimes d INNER JOIN hosts h ON d.host_id=h.host_id AND d.service_id=0 WHERE d.deletion_time is null AND h.name='{hostname}'") +# result = cursor.fetchall() +# if len(result) == int(enabled) and not result[0]['scheduled_downtime_depth'] is None and result[0]['scheduled_downtime_depth'] == int(enabled): +# return True +# if (len(result) > 0): +# logger.console( +# f"{len(result)} downtimes for host {hostname} scheduled_downtime_depth={result[0]['scheduled_downtime_depth']}") +# else: +# logger.console( +# f"{len(result)} downtimes for host {hostname} scheduled_downtime_depth=None") +# else: +# cursor.execute( +# f"SELECT h.scheduled_downtime_depth, d.deletion_time, d.downtime_id FROM hosts h LEFT JOIN downtimes d ON h.host_id = d.host_id AND d.service_id=0 WHERE h.name='{hostname}'") +# result = cursor.fetchall() +# if len(result) > 0 and not result[0]['scheduled_downtime_depth'] is None and result[0]['scheduled_downtime_depth'] == 0 and (result[0]['downtime_id'] is None or not result[0]['deletion_time'] is None): +# return True +# time.sleep(1) +# return False def check_service_downtime_with_timeout(hostname: str, service_desc: str, enabled, timeout: int): From c1fd4557cb35cae759a823625376f87598d0d500 Mon Sep 17 00:00:00 2001 From: David Boucher Date: Mon, 16 Oct 2023 18:38:14 +0200 Subject: [PATCH 33/84] wip(tests): changes after review --- common/src/process_stat.cc | 2 +- tests/broker-engine/rrd-from-db.robot | 4 +-- tests/broker-engine/scheduler.robot | 2 +- tests/broker-engine/start-stop.robot | 2 +- tests/broker-engine/tags.robot | 2 +- tests/migration/migration.robot | 2 +- tests/resources/Bench.py | 30 ++++++--------------- tests/severities/severities.robot | 38 +++++++++++++-------------- 8 files changed, 34 insertions(+), 48 deletions(-) diff --git a/common/src/process_stat.cc b/common/src/process_stat.cc index ad12cf31578..9e9f208fe24 100644 --- a/common/src/process_stat.cc +++ b/common/src/process_stat.cc @@ -110,7 +110,7 @@ process_stat::process_stat(pid_t process_id) } else if (first_char == 'w') { if (second_char == 'c') { // wchar _query_write_bytes = extract_io_value(line, file_path); - } else if (second_char == 'e') { // write_bytes + } else if (second_char == 'r') { // write_bytes _real_write_bytes = extract_io_value(line, file_path); } } diff --git a/tests/broker-engine/rrd-from-db.robot b/tests/broker-engine/rrd-from-db.robot index 7112151f6f3..834193dfec6 100644 --- a/tests/broker-engine/rrd-from-db.robot +++ b/tests/broker-engine/rrd-from-db.robot @@ -222,7 +222,7 @@ BRRDUPLICATE # We get 3 indexes to rebuild ${index} Get Indexes To Rebuild 3 2 - ${duplicates} add_duplicate_metrics + ${duplicates} Add Duplicate Metrics Rebuild Rrd Graphs from DB ${index} Log To Console Indexes to rebuild: ${index} ${metrics} Get Metrics Matching Indexes ${index} @@ -241,5 +241,5 @@ BRRDUPLICATE ${result} Find In Log With Timeout ${rrdLog} ${start} ${content1} 500 Should Be True ${result} RRD cbd did not receive metrics to rebuild END - ${result} check_for_NaN_metric ${duplicates} + ${result} Check For Nan Metric ${duplicates} Should Be True ${result} at least one metric contains NaN value diff --git a/tests/broker-engine/scheduler.robot b/tests/broker-engine/scheduler.robot index 054c8c574f2..bc676b9ed35 100644 --- a/tests/broker-engine/scheduler.robot +++ b/tests/broker-engine/scheduler.robot @@ -50,4 +50,4 @@ ENRSCHE1 ${result} Check Reschedule With Timeout ${engineLog0} ${start} ${content} False 240 Should Be True ${result} The delta between last_check and next_check is not equal to 300 as expected for a normal check - [Teardown] Run Keywords Stop Engine AND Kindly Stop Broker + [Teardown] Stop Engine Broker And Save Logs diff --git a/tests/broker-engine/start-stop.robot b/tests/broker-engine/start-stop.robot index c10af219302..a5348bba744 100644 --- a/tests/broker-engine/start-stop.robot +++ b/tests/broker-engine/start-stop.robot @@ -96,7 +96,7 @@ BESS5 Start Engine ${result} Check Connections Should Be True ${result} Broker and Engine seem not connected - [Teardown] Run Keywords Kindly Stop Broker AND Stop Engine + [Teardown] Stop Engine Broker And Save Logs BESS_GRPC1 [Documentation] Start-Stop grpc version Broker/Engine - Broker started first - Broker stopped first diff --git a/tests/broker-engine/tags.robot b/tests/broker-engine/tags.robot index cf078af6033..b77a0273309 100644 --- a/tests/broker-engine/tags.robot +++ b/tests/broker-engine/tags.robot @@ -373,7 +373,7 @@ BEUTAG7 ${result} Check Resources Tags With Timeout 26 508 servicegroup [3,5] 60 Should Be True ${result} Second step: Service (26, 508) should have servicegroup tags 3 and 5 - [Teardown] Run Keywords Stop Engine AND Kindly Stop Broker + [Teardown] Stop Engine Broker And Save Logs BEUTAG8 [Documentation] Services have tags provided by templates. diff --git a/tests/migration/migration.robot b/tests/migration/migration.robot index 724f36d025a..342cc8dfff2 100644 --- a/tests/migration/migration.robot +++ b/tests/migration/migration.robot @@ -114,4 +114,4 @@ MIGRATION ${result} Find In Log With Timeout ${rrdLog} ${start} ${contentRRD} 30 Should Be True ${result} No metric sent to rrd cbd for 30s - [Teardown] Run Keywords Stop Engine Kindly Stop Broker + [Teardown] Stop Engine Broker And Save Logs diff --git a/tests/resources/Bench.py b/tests/resources/Bench.py index a3c06002249..5fe6075b338 100644 --- a/tests/resources/Bench.py +++ b/tests/resources/Bench.py @@ -12,6 +12,7 @@ from cpuinfo import get_cpu_info from robot.api import logger from dateutil import parser as date_parser +from Common import get_version class delta_process_stat: @@ -156,6 +157,13 @@ def store_result_in_unqlite(file_path: str, test_name: str, broker_or_engine: s for key, value in other_bench_data.items(): row[key] = value + version = get_version() + version = version[0:version.rfind(".")] + ".x" + # This will have to be changed when we will release the next version + if version == "24.04.x": + version = "develop" + row['origin'] = version + # rev_name is like ~* rev_name_dev_branch = re.compile( r'[0-9a-f]+\s(dev[\w\.]+).*') @@ -169,28 +177,6 @@ def store_result_in_unqlite(file_path: str, test_name: str, broker_or_engine: s repo = Repo(os.getcwd() + "/..") commit = repo.head.commit row['date_commit'] = commit.authored_datetime.timestamp() - origin_found = False - while True: - m = rev_name_dev_branch.match(commit.name_rev) - if m is not None: - row['origin'] = m.group(1) - origin_found = True - break - m = remote_rev_name_dev_branch.match(commit.name_rev) - if m is not None: - row['origin'] = m.group(1) - origin_found = True - break - - parents = commit.parents - if len(parents) == 0: - break - commit = parents[0] - - if not origin_found: - logger.console( - f"origin not found for commit {repo.head.commit} your branch needs rebase?") - return False if repo.is_dirty(): row['commit'] = f'uncommited files last_commit:{repo.head.commit.hexsha}' else: diff --git a/tests/severities/severities.robot b/tests/severities/severities.robot index f57a513443d..6ad9466126d 100644 --- a/tests/severities/severities.robot +++ b/tests/severities/severities.robot @@ -142,7 +142,7 @@ BEUSEV3 Start Broker Sleep 2s - ${result} check service severity With Timeout 1 1 11 60 + ${result} Check Service Severity With Timeout 1 1 11 60 Should Be True ${result} Service (1, 1) should have severity_id=11 Remove Severities From Services ${0} @@ -150,9 +150,9 @@ BEUSEV3 Add Severity To Services 0 7 [3] Reload Engine Reload Broker - ${result} check service severity With Timeout 1 3 7 60 + ${result} Check Service Severity With Timeout 1 3 7 60 Should Be True ${result} Service (1, 3) should have severity_id=7 - ${result} check service severity With Timeout 1 1 None 60 + ${result} Check Service Severity With Timeout 1 1 None 60 Should Be True ${result} Service (1, 1) should have no severity Stop Engine @@ -188,25 +188,25 @@ BEUSEV4 Start Broker Sleep 5s # We need to wait a little before reloading Engine - ${result} check_service_severity_With_Timeout 1 2 19 60 + ${result} Check Service Severity With Timeout 1 2 19 60 Should Be True ${result} First step: Service (1, 2) should have severity_id=19 - ${result} check service severity With Timeout 1 4 19 60 + ${result} Check Service Severity With Timeout 1 4 19 60 Should Be True ${result} First step: Service (1, 4) should have severity_id=19 - ${result} check service severity With Timeout 26 501 19 60 + ${result} Check Service Severity With Timeout 26 501 19 60 Should Be True ${result} First step: Service (26, 501) should have severity_id=19 - ${result} check service severity With Timeout 26 502 19 60 + ${result} Check Service Severity With Timeout 26 502 19 60 Should Be True ${result} First step: Service (26, 502) should have severity_id=19 - ${result} check service severity With Timeout 1 3 17 60 + ${result} Check Service Severity With Timeout 1 3 17 60 Should Be True ${result} First step: Service (1, 3) should have severity_id=17 - ${result} check service severity With Timeout 1 5 17 60 + ${result} Check Service Severity With Timeout 1 5 17 60 Should Be True ${result} First step: Service (1, 5) should have severity_id=17 - ${result} check service severity With Timeout 26 503 17 60 + ${result} Check Service Severity With Timeout 26 503 17 60 Should Be True ${result} First step: Service (26, 503) should have severity_id=17 Remove Severities From Services ${0} @@ -216,16 +216,16 @@ BEUSEV4 Reload Engine Reload Broker Sleep 3s - ${result} check service severity With Timeout 26 503 17 60 + ${result} Check Service Severity With Timeout 26 503 17 60 Should Be True ${result} Second step: Service (26, 503) should have severity_id=17 - ${result} check service severity With Timeout 1 4 None 60 + ${result} Check Service Severity With Timeout 1 4 None 60 Should Be True ${result} Second step: Service (1, 4) should have severity_id=None - ${result} check service severity With Timeout 1 3 None 60 + ${result} Check Service Severity With Timeout 1 3 None 60 Should Be True ${result} Second step: Service (1, 3) should have severity_id=17 - ${result} check service severity With Timeout 1 5 None 60 + ${result} Check Service Severity With Timeout 1 5 None 60 Should Be True ${result} Second step: Service (1, 5) should have severity_id=17 Stop Engine @@ -266,19 +266,19 @@ BETUSEV1 Start Broker Sleep 5s # We need to wait a little before reloading Engine - ${result} check service severity With Timeout 1 2 1 60 + ${result} Check Service Severity With Timeout 1 2 1 60 Should Be True ${result} First step: Service (1, 2) should have severity_id=1 - ${result} check service severity With Timeout 1 4 1 60 + ${result} Check Service Severity With Timeout 1 4 1 60 Should Be True ${result} First step: Service (1, 4) should have severity_id=1 - ${result} check service severity With Timeout 1 5 3 60 + ${result} Check Service Severity With Timeout 1 5 3 60 Should Be True ${result} First step: Service (1, 5) should have severity_id=3 - ${result} check service severity With Timeout 26 502 3 60 + ${result} Check Service Severity With Timeout 26 502 3 60 Should Be True ${result} First step: Service (26, 502) should have severity_id=3 - ${result} check service severity With Timeout 26 503 5 60 + ${result} Check Service Severity With Timeout 26 503 5 60 Should Be True ${result} First step: Service (26, 503) should have severity_id=5 Stop Engine From de62a4a89c6b4243bf183cd5f0c2569136d6aeb3 Mon Sep 17 00:00:00 2001 From: David Boucher Date: Mon, 16 Oct 2023 18:43:30 +0200 Subject: [PATCH 34/84] fix(tests): changes after review --- tests/broker-engine/output-tables.robot | 2 +- tests/broker-engine/servicegroups.robot | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/broker-engine/output-tables.robot b/tests/broker-engine/output-tables.robot index bbd4b1bfcd1..930bf58d43e 100644 --- a/tests/broker-engine/output-tables.robot +++ b/tests/broker-engine/output-tables.robot @@ -211,7 +211,7 @@ BE_NOTIF_OVERFLOW ... ${result} ... An Initial host state on host_16 should be raised before we can start our external commands. - set_svc_notification_number host_16 service_314 40000 + Set Svc Notification Number host_16 service_314 40000 Repeat Keyword 3 times Process Service Check Result host_16 service_314 2 output critical for 314 ${result} Check Service Status With Timeout host_16 service_314 2 30 Should Be True ${result} The service (host_16,service_314) is not CRITICAL as expected diff --git a/tests/broker-engine/servicegroups.robot b/tests/broker-engine/servicegroups.robot index 15ff55c74a7..ef8fe7b4a61 100644 --- a/tests/broker-engine/servicegroups.robot +++ b/tests/broker-engine/servicegroups.robot @@ -114,13 +114,13 @@ EBNSGU2 Reload Engine Sleep 3s - ${result} Check Number of relations between servicegroup and services 1 12 30 + ${result} Check Number Of Relations Between Servicegroup And Services 1 12 30 Should Be True ${result} We should get 12 relations between the servicegroup 1 and services. Config Engine Remove Cfg File ${0} servicegroups.cfg Reload Broker Reload Engine - ${result} Check Number of relations between servicegroup and services 1 9 30 + ${result} Check Number Of Relations Between Servicegroup And Services 1 9 30 Should Be True ${result} We should get 9 relations between the servicegroup 1 and services. *** Keywords *** From 2ddd1474f51f8809db251e90a96fc2af48f8a67b Mon Sep 17 00:00:00 2001 From: David Boucher Date: Mon, 16 Oct 2023 13:17:59 -0400 Subject: [PATCH 35/84] fix(tests): no more develop branch in benches --- tests/resources/Bench.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/tests/resources/Bench.py b/tests/resources/Bench.py index 5fe6075b338..8eab0da08e2 100644 --- a/tests/resources/Bench.py +++ b/tests/resources/Bench.py @@ -159,9 +159,6 @@ def store_result_in_unqlite(file_path: str, test_name: str, broker_or_engine: s version = get_version() version = version[0:version.rfind(".")] + ".x" - # This will have to be changed when we will release the next version - if version == "24.04.x": - version = "develop" row['origin'] = version # rev_name is like ~* From b4ad13271f21ceb088a83ab0d3dce35c8ff450d1 Mon Sep 17 00:00:00 2001 From: David Boucher Date: Mon, 16 Oct 2023 18:02:10 -0400 Subject: [PATCH 36/84] fix(tests/reverse_bam): the process should be better killed --- broker/core/src/pool.cc | 32 ++++++++++++++++---------------- tests/resources/Broker.py | 8 +++++--- 2 files changed, 21 insertions(+), 19 deletions(-) diff --git a/broker/core/src/pool.cc b/broker/core/src/pool.cc index b7cb47c1be5..1dad3b1b0b8 100644 --- a/broker/core/src/pool.cc +++ b/broker/core/src/pool.cc @@ -1,20 +1,20 @@ /* -** Copyright 2020-2022 Centreon -** -** Licensed under the Apache License, Version 2.0 (the "License"); -** you may not use this file except in compliance with the License. -** You may obtain a copy of the License at -** -** http://www.apache.org/licenses/LICENSE-2.0 -** -** Unless required by applicable law or agreed to in writing, software -** distributed under the License is distributed on an "AS IS" BASIS, -** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -** See the License for the specific language governing permissions and -** limitations under the License. -** -** For more information : contact@centreon.com -*/ + * Copyright 2020-2022 Centreon + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * For more information : contact@centreon.com + */ #include "com/centreon/broker/pool.hh" #include "com/centreon/broker/log_v2.hh" diff --git a/tests/resources/Broker.py b/tests/resources/Broker.py index 6895df3c5aa..11bee95ee82 100755 --- a/tests/resources/Broker.py +++ b/tests/resources/Broker.py @@ -1,3 +1,5 @@ +from os import import setsid +import signal from os import makedirs from os.path import exists, dirname import pymysql.cursors @@ -1323,10 +1325,10 @@ def create_metrics(count: int): def run_reverse_bam(duration, interval): - subp.Popen("broker/map_client.py {:f}".format(interval), - shell=True, stdout=subp.PIPE, stdin=subp.PIPE) + pro = subp.Popen("broker/map_client.py {:f}".format(interval), + shell=True, stdout=subp.PIPE, stdin=subp.PIPE, preexec_fn=setsid) time.sleep(duration) - getoutput("kill -9 $(ps aux | grep map_client.py | awk '{print $2}')") + os.killpg(os.getpgid(pro.pid), signal.SIGKILL) def start_map(): From 8a344d35f1c2e4bf2004bfbc531045f24c028045 Mon Sep 17 00:00:00 2001 From: David Boucher Date: Mon, 16 Oct 2023 18:14:14 -0400 Subject: [PATCH 37/84] fix(tests): map process better killed --- tests/resources/Broker.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/resources/Broker.py b/tests/resources/Broker.py index 11bee95ee82..f61c56b11cf 100755 --- a/tests/resources/Broker.py +++ b/tests/resources/Broker.py @@ -1,5 +1,5 @@ -from os import import setsid import signal +from os import setsid from os import makedirs from os.path import exists, dirname import pymysql.cursors From 91e8e6f7c6a8a53dc8b3effcae2741354cbb0b2e Mon Sep 17 00:00:00 2001 From: David Boucher Date: Tue, 17 Oct 2023 03:58:20 -0400 Subject: [PATCH 38/84] cleanup(tests): Changes to satisfay the Architect --- tests/bam/bam_pb.robot | 8 +- tests/bam/boolean_rules.robot | 2 +- tests/bam/inherited_downtime.robot | 50 +++--- tests/bam/pb_inherited_downtime.robot | 48 +++--- tests/broker-database/networkFailure.robot | 22 +-- tests/broker-engine/acknowledgement.robot | 2 +- tests/broker-engine/anomaly-detection.robot | 22 +-- tests/broker-engine/bbdo-protobuf.robot | 6 +- tests/broker-engine/bench.robot | 6 +- tests/broker-engine/compression.robot | 6 +- tests/broker-engine/delete-poller.robot | 60 +++---- tests/broker-engine/downtimes.robot | 58 +++---- tests/broker-engine/external-commands.robot | 12 +- tests/broker-engine/external-commands2.robot | 44 ++--- tests/broker-engine/hostgroups.robot | 20 +-- .../hosts-with-notes-and-actions.robot | 8 +- tests/broker-engine/log-v2_engine.robot | 2 +- tests/broker-engine/muxer_filter.robot | 2 +- .../broker-engine/notification-unstable.robot | 4 +- tests/broker-engine/output-tables.robot | 24 +-- .../broker-engine/retention-duplicates.robot | 2 +- tests/broker-engine/reverse-connection.robot | 4 +- tests/broker-engine/rrd-from-db.robot | 24 +-- tests/broker-engine/rrd.robot | 16 +- tests/broker-engine/rrdcached-from-db.robot | 22 +-- tests/broker-engine/rrdcached.robot | 8 +- tests/broker-engine/scheduler.robot | 2 +- tests/broker-engine/servicegroups.robot | 14 +- .../services-and-bulk-stmt.robot | 22 +-- tests/broker-engine/services-increased.robot | 12 +- .../services-with-notes-and-actions.robot | 8 +- tests/broker-engine/services.robot | 12 +- tests/broker-engine/start-stop.robot | 150 +++++++++--------- tests/broker-engine/tags.robot | 10 +- tests/broker-engine/tls.robot | 118 +++++++------- tests/broker-engine/victoria.robot | 2 +- .../broker/bbdo-server-client-reversed.robot | 64 ++++---- tests/broker/bbdo-server-client.robot | 62 ++++---- tests/broker/command-line.robot | 10 +- tests/broker/grpc-stream.robot | 26 +-- tests/broker/sql.robot | 42 ++--- tests/ccc/ccc.robot | 2 +- tests/connector_perl/connector_perl.robot | 6 +- tests/connector_ssh/connector_ssh.robot | 6 +- tests/engine/forced_checks.robot | 56 +++---- tests/resources/resources.robot | 30 ++-- tests/severities/hosts.robot | 40 ++--- tests/severities/severities.robot | 12 +- 48 files changed, 597 insertions(+), 591 deletions(-) diff --git a/tests/bam/bam_pb.robot b/tests/bam/bam_pb.robot index 0461dd86c50..2528393c0ce 100644 --- a/tests/bam/bam_pb.robot +++ b/tests/bam/bam_pb.robot @@ -14,7 +14,7 @@ Library Telnet Suite Setup Clean Before Suite Suite Teardown Clean After Suite Test Setup BAM Setup -Test Teardown Save logs If Failed +Test Teardown Save Logs If Failed *** Test Cases *** @@ -328,7 +328,7 @@ BA_RATIO_PERCENT_BA_SERVICE @{svc} Set Variable ${{ [("host_16", "service_314")] }} ${id_ba__sid__child} Create Ba With Services test_child worst ${svc} - add_ba_kpi ${id_ba__sid__child[0]} ${id_ba__sid[0]} 1 2 3 + Add Ba Kpi ${id_ba__sid__child[0]} ${id_ba__sid[0]} 1 2 3 Start Broker ${start} Get Current Date @@ -356,7 +356,7 @@ BA_RATIO_PERCENT_BA_SERVICE ... output critical for service_302 ${result} Check Service Status With Timeout host_16 service_302 2 60 HARD Should Be True ${result} The service (host_16,service_302) is not CRITICAL as expected - sleep 2s + Sleep 2s ${result} Check Ba Status With Timeout test 0 60 Should Be True ${result} The BA test is not OK as expected ${result} Check Ba Output With Timeout @@ -587,7 +587,7 @@ BA_BOOL_KPI ${result} Check Service Status With Timeout host_16 service_314 0 30 HARD Should Be True ${result} The service (host_16,service_314) is not OK as expected -# schedule_forced_svc_check _Module_BAM_1 ba_1 +# Schedule Forced Svc Check _Module_BAM_1 ba_1 ${result} Check Ba Status With Timeout test 2 30 Should Be True ${result} The BA test is not CRITICAL as expected diff --git a/tests/bam/boolean_rules.robot b/tests/bam/boolean_rules.robot index f5c75a00f10..fbb0ce46aa3 100644 --- a/tests/bam/boolean_rules.robot +++ b/tests/bam/boolean_rules.robot @@ -13,7 +13,7 @@ Library ../resources/Engine.py Suite Setup Clean Before Suite Suite Teardown Clean After Suite Test Setup BAM Setup -Test Teardown Save logs If Failed +Test Teardown Save Logs If Failed *** Test Cases *** diff --git a/tests/bam/inherited_downtime.robot b/tests/bam/inherited_downtime.robot index 49db69cf7f5..ca78940d61a 100644 --- a/tests/bam/inherited_downtime.robot +++ b/tests/bam/inherited_downtime.robot @@ -12,7 +12,7 @@ Library ../resources/Engine.py Suite Setup Clean Before Suite Suite Teardown Clean After Suite Test Setup BAM Setup -Test Teardown Save logs If Failed +Test Teardown Save Logs If Failed *** Test Cases *** @@ -139,9 +139,9 @@ BEBAMIDT2 ... An Initial service state on service (50, 1000) should be raised before we can start external commands. # Broker is restarted - log to console Broker is stopped (step ${i}) + Log To Console Broker is stopped (step ${i}) Kindly Stop Broker - log to console Broker is started + Log To Console Broker is started Start Broker END @@ -159,7 +159,7 @@ BEBAMIDT2 ${result} Check Service Downtime With Timeout _Module_BAM_1 ba_1 0 60 Should Be True ${result} The BA ba_1 is in downtime as it should not - log to console Broker is stopped (end of BEBAMIDT2) + Log To Console Broker is stopped (end of BEBAMIDT2) Stop Engine Kindly Stop Broker @@ -171,7 +171,7 @@ BEBAMIGNDT1 Config Broker central Broker Config Log central bam trace Broker Config Log central sql trace - broker_config_source_log central true + Broker Config Source Log central true Broker Config Flush Log module0 0 Broker Config Log module0 neb trace Config Broker rrd @@ -221,54 +221,54 @@ BEBAMIGNDT1 # The BA should become critical ${result} Check Ba Status With Timeout test 2 60 Should Be True ${result} The BA ba_1 is not CRITICAL as expected - Log To console The BA is critical. + Log To Console The BA is critical. # Two downtimes are applied on service_314 Schedule Service Downtime host_16 service_314 3600 ${result} Check Service Downtime With Timeout host_16 service_314 1 60 Should Be True ${result} The service (host_16, service_314) is not in downtime as it should be - Log to console One downtime applied to service_314. + Log To Console One downtime applied to service_314. Schedule Service Downtime host_16 service_314 1800 ${result} Check Service Downtime With Timeout host_16 service_314 2 60 Should Be True ${result} The service (host_16, service_314) is not in downtime as it should be - Log to console Two downtimes applied to service_314. + Log To Console Two downtimes applied to service_314. ${result} Check Service Downtime With Timeout _Module_BAM_1 ba_1 0 60 Should Be True ${result} The BA ba_1 is in downtime but should not - Log to console The BA is configured to ignore kpis in downtime + Log To Console The BA is configured to ignore kpis in downtime ${result} Check Ba Status With Timeout test 0 60 Should Be True ${result} The service in downtime should be ignored while computing the state of this BA. - Log to console The BA is OK, since the critical service is in downtime. + Log To Console The BA is OK, since the critical service is in downtime. # The first downtime is deleted Delete Service Downtime host_16 service_314 ${result} Check Service Downtime With Timeout host_16 service_314 1 60 Should Be True ${result} The service (host_16, service_314) does not contain 1 downtime as it should - Log to console Still one downtime applied to service_314. + Log To Console Still one downtime applied to service_314. ${result} Check Downtimes With Timeout 1 60 Should Be True ${result} We should have one downtime ${result} Check Ba Status With Timeout test 0 60 Should Be True ${result} The BA is not OK whereas the service_314 is still in downtime. - Log to console The BA is still OK + Log To Console The BA is still OK # The second downtime is deleted Delete Service Downtime host_16 service_314 ${result} Check Service Downtime With Timeout host_16 service_314 0 60 Should Be True ${result} The service (host_16, service_314) does not contain 0 downtime as it should - Log to console No more downtime applied to service_314. + Log To Console No more downtime applied to service_314. ${result} Check Downtimes With Timeout 0 60 Should Be True ${result} We should have no more running downtimes ${result} Check Ba Status With Timeout test 2 60 Should Be True ${result} The critical service is no more in downtime, the BA should be critical. - Log to console The BA is now critical (no more downtime) + Log To Console The BA is now critical (no more downtime) Stop Engine Kindly Stop Broker @@ -320,38 +320,38 @@ BEBAMIGNDT2 # The BA should become critical ${result} Check Ba Status With Timeout test 2 60 Should Be True ${result} The BA ba_1 is not CRITICAL as expected - Log To console The BA is critical. + Log To Console The BA is critical. # Two downtimes are applied on service_314 Schedule Service Downtime host_16 service_314 60 ${result} Check Service Downtime With Timeout host_16 service_314 1 60 Should Be True ${result} The service (host_16, service_314) is not in downtime as it should be - Log to console One downtime applied to service_314. + Log To Console One downtime applied to service_314. Schedule Service Downtime host_16 service_314 30 ${result} Check Service Downtime With Timeout host_16 service_314 2 60 Should Be True ${result} The service (host_16, service_314) is not in downtime as it should be - Log to console Two downtimes applied to service_314. + Log To Console Two downtimes applied to service_314. ${result} Check Service Downtime With Timeout _Module_BAM_1 ba_1 0 60 Should Be True ${result} The BA ba_1 is in downtime but should not - Log to console The BA is configured to ignore kpis in downtime + Log To Console The BA is configured to ignore kpis in downtime ${result} Check Ba Status With Timeout test 0 60 Should Be True ${result} The service in downtime should be ignored while computing the state of this BA. - Log to console The BA is OK, since the critical service is in downtime. + Log To Console The BA is OK, since the critical service is in downtime. # The first downtime should reach its end - Log to console After 30s, the first downtime should be finished. + Log To Console After 30s, the first downtime should be finished. ${result} Check Service Downtime With Timeout host_16 service_314 1 60 Should Be True ${result} The service (host_16, service_314) does not contain 1 downtime as it should - Log to console Still one downtime applied to service_314. + Log To Console Still one downtime applied to service_314. - Log to console After 30s, the second downtime should be finished. + Log To Console After 30s, the second downtime should be finished. ${result} Check Ba Status With Timeout test 0 60 Should Be True ${result} The BA is not OK whereas the service_314 is still in downtime. - Log to console The BA is still OK + Log To Console The BA is still OK ${result} Check Downtimes With Timeout 0 60 Should Be True ${result} We should have no more running downtimes @@ -359,7 +359,7 @@ BEBAMIGNDT2 # The second downtime finishes ${result} Check Ba Status With Timeout test 2 60 Should Be True ${result} The critical service is no more in downtime, the BA should be critical. - Log to console The BA is now critical (no more downtime) + Log To Console The BA is now critical (no more downtime) Stop Engine Kindly Stop Broker @@ -370,6 +370,6 @@ BAM Setup Stop Processes Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} ${date} Get Current Date result_format=epoch - log to console date=${date} + Log To Console date=${date} Execute SQL String ... UPDATE downtimes SET deletion_time=${date}, actual_end_time=${date} WHERE actual_end_time is null diff --git a/tests/bam/pb_inherited_downtime.robot b/tests/bam/pb_inherited_downtime.robot index 9077347c756..a1092027bb6 100644 --- a/tests/bam/pb_inherited_downtime.robot +++ b/tests/bam/pb_inherited_downtime.robot @@ -12,7 +12,7 @@ Library ../resources/Engine.py Suite Setup Clean Before Suite Suite Teardown Clean After Suite Test Setup BAM Setup -Test Teardown Save logs If Failed +Test Teardown Save Logs If Failed *** Test Cases *** @@ -139,9 +139,9 @@ BEBAMIDTU2 ... An Initial service state on service (50, 1000) should be raised before we can start external commands. # Broker is restarted - log to console Broker is stopped (step ${i}) + Log To Console Broker is stopped (step ${i}) Kindly Stop Broker - log to console Broker is started + Log To Console Broker is started Start Broker END @@ -160,7 +160,7 @@ BEBAMIDTU2 ${result} Number Of Downtimes Is 0 60 Should Be True ${result} We should have no more downtime - log to console Broker is stopped (end of BEBAMIDT2) + Log To Console Broker is stopped (end of BEBAMIDT2) Stop Engine Kindly Stop Broker @@ -225,37 +225,37 @@ BEBAMIGNDTU1 # The BA should become critical ${result} Check Ba Status With Timeout test 2 60 Should Be True ${result} The BA ba_1 is not CRITICAL as expected - Log To console The BA is critical. + Log To Console The BA is critical. # Two downtimes are applied on service_314 Schedule Service Downtime host_16 service_314 3600 ${result} Check Service Downtime With Timeout host_16 service_314 1 60 Should Be True ${result} The service (host_16, service_314) is not in downtime as it should be - Log to console One downtime applied to service_314. + Log To Console One downtime applied to service_314. Schedule Service Downtime host_16 service_314 1800 ${result} Check Service Downtime With Timeout host_16 service_314 2 60 Should Be True ${result} The service (host_16, service_314) is not in downtime as it should be - Log to console Two downtimes applied to service_314. + Log To Console Two downtimes applied to service_314. ${result} Check Service Downtime With Timeout _Module_BAM_1 ba_1 0 60 Should Be True ${result} The BA ba_1 is in downtime but should not - Log to console The BA is configured to ignore kpis in downtime + Log To Console The BA is configured to ignore kpis in downtime ${result} Check Ba Status With Timeout test 0 60 Should Be True ${result} The service in downtime should be ignored while computing the state of this BA. - Log to console The BA is OK, since the critical service is in downtime. + Log To Console The BA is OK, since the critical service is in downtime. # The first downtime is deleted Delete Service Downtime host_16 service_314 ${result} Check Service Downtime With Timeout host_16 service_314 1 60 Should Be True ${result} The service (host_16, service_314) does not contain 1 downtime as it should - Log to console Still one downtime applied to service_314. + Log To Console Still one downtime applied to service_314. ${result} Check Ba Status With Timeout test 0 60 Should Be True ${result} The BA is not OK whereas the service_314 is still in downtime. - Log to console The BA is still OK + Log To Console The BA is still OK ${result} Check Downtimes With Timeout 1 60 Should Be True ${result} We should have one running downtime @@ -265,14 +265,14 @@ BEBAMIGNDTU1 ${result} Check Service Downtime With Timeout host_16 service_314 0 60 Should Be True ${result} The service (host_16, service_314) does not contain 0 downtime as it should - Log to console No more downtime applied to service_314. + Log To Console No more downtime applied to service_314. ${result} Check Downtimes With Timeout 0 60 Should Be True ${result} We should have no more running downtimes ${result} Check Ba Status With Timeout test 2 60 Should Be True ${result} The critical service is no more in downtime, the BA should be critical. - Log to console The BA is now critical (no more downtime) + Log To Console The BA is now critical (no more downtime) Stop Engine Kindly Stop Broker @@ -328,43 +328,43 @@ BEBAMIGNDTU2 # The BA should become critical ${result} Check Ba Status With Timeout test 2 60 Should Be True ${result} The BA ba_1 is not CRITICAL as expected - Log To console The BA is critical. + Log To Console The BA is critical. # Two downtimes are applied on service_314 Schedule Service Downtime host_16 service_314 90 ${result} Check Service Downtime With Timeout host_16 service_314 1 60 Should Be True ${result} The service (host_16, service_314) is not in downtime as it should be - Log to console One downtime applied to service_314. + Log To Console One downtime applied to service_314. Schedule Service Downtime host_16 service_314 30 ${result} Check Service Downtime With Timeout host_16 service_314 2 60 Should Be True ${result} The service (host_16, service_314) is not in downtime as it should be - Log to console Two downtimes applied to service_314. + Log To Console Two downtimes applied to service_314. ${result} Check Service Downtime With Timeout _Module_BAM_1 ba_1 0 60 Should Be True ${result} The BA ba_1 is in downtime but should not - Log to console The BA is configured to ignore kpis in downtime + Log To Console The BA is configured to ignore kpis in downtime ${result} Check Ba Status With Timeout test 0 60 Should Be True ${result} The service in downtime should be ignored while computing the state of this BA. - Log to console The BA is OK, since the critical service is in downtime. + Log To Console The BA is OK, since the critical service is in downtime. # The first downtime should reach its end - Log to console After 30s, the first downtime should be finished. + Log To Console After 30s, the first downtime should be finished. ${result} Check Service Downtime With Timeout host_16 service_314 1 60 Should Be True ${result} The service (host_16, service_314) does not contain 1 downtime as it should - Log to console Still one downtime applied to service_314. + Log To Console Still one downtime applied to service_314. - Log to console After 30s, the second downtime should be finished. + Log To Console After 30s, the second downtime should be finished. ${result} Check Ba Status With Timeout test 0 60 Should Be True ${result} The BA is not OK whereas the service_314 is still in downtime. - Log to console The BA is still OK + Log To Console The BA is still OK # The second downtime finishes ${result} Check Ba Status With Timeout test 2 90 Should Be True ${result} The critical service is no more in downtime, the BA should be critical. - Log to console The BA is now critical (no more downtime) + Log To Console The BA is now critical (no more downtime) Stop Engine Kindly Stop Broker @@ -375,6 +375,6 @@ BAM Setup Stop Processes Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} ${date} Get Current Date result_format=epoch - log to console Cleaning downtimes at date=${date} + Log To Console Cleaning downtimes at date=${date} Execute SQL String ... UPDATE downtimes SET deletion_time=${date}, actual_end_time=${date} WHERE actual_end_time is null diff --git a/tests/broker-database/networkFailure.robot b/tests/broker-database/networkFailure.robot index 6bb5ab97753..d6acab8c3bc 100644 --- a/tests/broker-database/networkFailure.robot +++ b/tests/broker-database/networkFailure.robot @@ -46,9 +46,9 @@ NetworkDBFail6 Config Engine ${1} Config Broker central Broker Config Output Set central central-broker-master-sql db_host 127.0.0.1 - Broker Config Output set central central-broker-master-sql connections_count 5 + Broker Config Output Set central central-broker-master-sql connections_count 5 Broker Config Output Set central central-broker-master-perfdata db_host 127.0.0.1 - Broker Config Output set central central-broker-master-perfdata connections_count 5 + Broker Config Output Set central central-broker-master-perfdata connections_count 5 Broker Config Log central sql trace Config Broker rrd Config Broker module @@ -76,7 +76,7 @@ NetworkDBFailU6 Config Broker central Config Broker Sql Output central unified_sql Broker Config Output Set central central-broker-unified-sql db_host 127.0.0.1 - Broker Config Output set central central-broker-unified-sql connections_count 5 + Broker Config Output Set central central-broker-unified-sql connections_count 5 Broker Config Log central sql trace Config Broker rrd Config Broker module @@ -89,9 +89,9 @@ NetworkDBFailU6 ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 40 Should Be True ${result} No SELECT done by broker in the DB Disable Eth Connection On Port port=3306 - Log to console Waiting for 1m while the connection to the DB is cut. + Log To Console Waiting for 1m while the connection to the DB is cut. Sleep 1m - Log to console Reestablishing the connection and test last steps. + Log To Console Reestablishing the connection and test last steps. Reset Eth Connection ${content} Create List 0 events acknowledged ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 40 @@ -105,9 +105,9 @@ NetworkDBFail7 Config Broker central Reset Eth Connection Broker Config Output Set central central-broker-master-sql db_host 127.0.0.1 - Broker Config Output set central central-broker-master-sql connections_count 5 + Broker Config Output Set central central-broker-master-sql connections_count 5 Broker Config Output Set central central-broker-master-perfdata db_host 127.0.0.1 - Broker Config Output set central central-broker-master-perfdata connections_count 5 + Broker Config Output Set central central-broker-master-perfdata connections_count 5 Broker Config Log central sql trace Config Broker rrd Config Broker module @@ -139,7 +139,7 @@ NetworkDBFailU7 Config Broker central Config Broker Sql Output central unified_sql Broker Config Output Set central central-broker-unified-sql db_host 127.0.0.1 - Broker Config Output set central central-broker-unified-sql connections_count 5 + Broker Config Output Set central central-broker-unified-sql connections_count 5 Broker Config Log central sql trace Config Broker rrd Config Broker module @@ -179,11 +179,11 @@ Network Failure Config Broker rrd Config Broker central Broker Config Output Set central central-broker-master-sql db_host 127.0.0.1 - Broker Config Output set central central-broker-master-sql connections_count 10 + Broker Config Output Set central central-broker-master-sql connections_count 10 Broker Config Output Set central central-broker-master-perfdata db_host 127.0.0.1 - Broker Config Output set central central-broker-master-perfdata connections_count 10 + Broker Config Output Set central central-broker-master-perfdata connections_count 10 Broker Config Log central sql trace - broker_config_source_log central true + Broker Config Source Log central true ${start} Get Current Date Start Broker Start Engine diff --git a/tests/broker-engine/acknowledgement.robot b/tests/broker-engine/acknowledgement.robot index 6dddf99b0c9..4f3303cda61 100644 --- a/tests/broker-engine/acknowledgement.robot +++ b/tests/broker-engine/acknowledgement.robot @@ -14,7 +14,7 @@ Library ../resources/Common.py Suite Setup Clean Before Suite Suite Teardown Clean After Suite Test Setup Stop Processes -Test Teardown Save logs If Failed +Test Teardown Save Logs If Failed *** Test Cases *** diff --git a/tests/broker-engine/anomaly-detection.robot b/tests/broker-engine/anomaly-detection.robot index 59295771363..cfc38ab2fbf 100644 --- a/tests/broker-engine/anomaly-detection.robot +++ b/tests/broker-engine/anomaly-detection.robot @@ -12,7 +12,7 @@ Library ../resources/Common.py Suite Setup Clean Before Suite Suite Teardown Clean After Suite Test Setup Stop Processes -Test Teardown Save logs If Failed +Test Teardown Save Logs If Failed *** Test Cases *** @@ -30,7 +30,7 @@ ANO_NOFILE Clear Db services Start Broker True Start Engine - Process Service Check result host_1 anomaly_${serv_id} 2 taratata + Process Service Check Result host_1 anomaly_${serv_id} 2 taratata Check Service Status With Timeout host_1 anomaly_${serv_id} 3 30 Stop Broker True Stop Engine @@ -50,7 +50,7 @@ ANO_TOO_OLD_FILE Clear Db services Start Broker True Start Engine - Process Service Check result host_1 anomaly_${serv_id} 2 taratata|metric=70%;50;75 + Process Service Check Result host_1 anomaly_${serv_id} 2 taratata|metric=70%;50;75 Check Service Status With Timeout host_1 anomaly_${serv_id} 3 30 Stop Broker True Stop Engine @@ -70,7 +70,7 @@ ANO_OUT_LOWER_THAN_LIMIT Clear Db services Start Broker True Start Engine - Process Service Check result host_1 anomaly_${serv_id} 2 taratata|metric=20%;50;75 + Process Service Check Result host_1 anomaly_${serv_id} 2 taratata|metric=20%;50;75 Check Service Status With Timeout host_1 anomaly_${serv_id} 2 30 Stop Broker True Stop Engine @@ -90,7 +90,7 @@ ANO_OUT_UPPER_THAN_LIMIT Clear Db services Start Broker True Start Engine - Process Service Check result host_1 anomaly_${serv_id} 2 taratata|metric=80%;50;75 + Process Service Check Result host_1 anomaly_${serv_id} 2 taratata|metric=80%;50;75 Check Service Status With Timeout host_1 anomaly_${serv_id} 2 30 Stop Broker True Stop Engine @@ -184,7 +184,7 @@ AOUTLU1 ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} No check for external commands executed for 1mn. - Process Service Check result host_1 anomaly_${serv_id} 2 taratata|metric=80%;50;75 + Process Service Check Result host_1 anomaly_${serv_id} 2 taratata|metric=80%;50;75 Check Service Status With Timeout host_1 anomaly_${serv_id} 2 30 Stop Engine Kindly Stop Broker @@ -221,7 +221,7 @@ ANO_DT1 Should Be True ${result} No check for external commands executed for 1mn. #create dependent service downtime - schedule_service_fixed_downtime host_1 service_1 3600 + Schedule Service Fixed Downtime host_1 service_1 3600 ${result} Check Service Downtime With Timeout host_1 service_1 1 60 Should Be True ${result} dependent service must be in downtime @@ -258,7 +258,7 @@ ANO_DT2 Should Be True ${result} No check for external commands executed for 1mn. #create dependent service downtime - schedule_service_fixed_downtime host_1 service_1 3600 + Schedule Service Fixed Downtime host_1 service_1 3600 ${result} Check Service Downtime With Timeout host_1 anomaly_${serv_id} 1 60 Should Be True ${result} anomaly service must be in downtime @@ -299,7 +299,7 @@ ANO_DT3 Should Be True ${result} No check for external commands executed for 1mn. #create dependent service downtime - schedule_service_fixed_downtime host_1 service_1 3600 + Schedule Service Fixed Downtime host_1 service_1 3600 ${result} Check Service Downtime With Timeout host_1 anomaly_${serv_id} 1 60 Should Be True ${result} anomaly service must be in downtime @@ -341,8 +341,8 @@ ANO_DT4 Should Be True ${result} No check for external commands executed for 1mn. #create dependent service downtime - schedule_service_fixed_downtime host_1 service_1 3600 - schedule_service_fixed_downtime host_1 anomaly_${serv_id} 3600 + Schedule Service Fixed Downtime host_1 service_1 3600 + Schedule Service Fixed Downtime host_1 anomaly_${serv_id} 3600 ${result} Check Service Downtime With Timeout host_1 anomaly_${serv_id} 2 60 Should Be True ${result} anomaly service must be in double downtime diff --git a/tests/broker-engine/bbdo-protobuf.robot b/tests/broker-engine/bbdo-protobuf.robot index 34cf997bb99..e95a1152327 100644 --- a/tests/broker-engine/bbdo-protobuf.robot +++ b/tests/broker-engine/bbdo-protobuf.robot @@ -15,7 +15,7 @@ Library ../resources/specific-duplication.py Suite Setup Clean Before Suite Suite Teardown Clean After Suite Test Setup Stop Processes -Test Teardown Save logs If Failed +Test Teardown Save Logs If Failed *** Test Cases *** @@ -138,8 +138,8 @@ BEPBRI1 Broker Config Add Item central bbdo_version 3.0.0 Broker Config Log central sql trace Config Broker Sql Output central unified_sql - broker_config_output_set central central-broker-unified-sql read_timeout 2 - broker_config_output_set central central-broker-unified-sql instance_timeout 2 + Broker Config Output Set central central-broker-unified-sql read_timeout 2 + Broker Config Output Set central central-broker-unified-sql instance_timeout 2 Broker Config Add Lua Output central test-protobuf ${SCRIPTS}test-responsiveinstance.lua Clear Retention diff --git a/tests/broker-engine/bench.robot b/tests/broker-engine/bench.robot index 838e4954eb1..18e6010f80a 100644 --- a/tests/broker-engine/bench.robot +++ b/tests/broker-engine/bench.robot @@ -47,7 +47,7 @@ BENCH_${nb_check}STATUS ${broker_stat_before} Get Broker Process Stat 51001 ${engine_stat_before} Get Engine Process Stat 50001 - Process Service Check result host_1 service_1 1 warning config0 1 ${nb_check} + Process Service Check Result host_1 service_1 1 warning config0 1 ${nb_check} Send Bench 1 50001 ${bench_data} Get Last Bench Result With Timeout ${rrdLog} 1 central-rrd-master-output 60 ${broker_stat_after} Get Broker Process Stat 51001 @@ -115,7 +115,7 @@ BENCH_${nb_check}STATUS_TRACES ${broker_stat_before} Get Broker Process Stat 51001 ${engine_stat_before} Get Engine Process Stat 50001 - Process Service Check result host_1 service_1 1 warning config0 1 ${nb_check} + Process Service Check Result host_1 service_1 1 warning config0 1 ${nb_check} Send Bench 1 50001 ${bench_data} Get Last Bench Result With Timeout ${rrdLog} 1 central-rrd-master-output 60 ${broker_stat_after} Get Broker Process Stat 51001 @@ -194,7 +194,7 @@ BENCH_1000STATUS_100${suffixe} ${host_id} Evaluate ${poller_index} + 1 FOR ${serv_index} IN RANGE 20 ${serv_id} Evaluate 1 + ${serv_index} + ${poller_index} * 20 - Process Service Check result + Process Service Check Result ... host_${host_id} ... service_${serv_id} ... 1 diff --git a/tests/broker-engine/compression.robot b/tests/broker-engine/compression.robot index a5bf780599c..db0ad702779 100644 --- a/tests/broker-engine/compression.robot +++ b/tests/broker-engine/compression.robot @@ -13,7 +13,7 @@ Library ../resources/Common.py Suite Setup Clean Before Suite Suite Teardown Clean After Suite Test Setup Stop Processes -Test Teardown Save logs If Failed +Test Teardown Save Logs If Failed *** Variables *** @@ -32,8 +32,8 @@ BECC1 Log To Console Compression set to ${comp1} on central and to ${comp2} on module Config Broker central Config Broker module - Broker Config Input set central central-broker-master-input compression ${comp1} - Broker Config Output set module0 central-module-master-output compression ${comp2} + Broker Config Input Set central central-broker-master-input compression ${comp1} + Broker Config Output Set module0 central-module-master-output compression ${comp2} Broker Config Log central bbdo info Broker Config Log module0 bbdo info ${start} Get Current Date diff --git a/tests/broker-engine/delete-poller.robot b/tests/broker-engine/delete-poller.robot index 16704fac9e3..daff6cff7c9 100644 --- a/tests/broker-engine/delete-poller.robot +++ b/tests/broker-engine/delete-poller.robot @@ -14,7 +14,7 @@ Library ../resources/Common.py Suite Setup Clean Before Suite Suite Teardown Clean After Suite Test Setup Stop Processes -Test Teardown Save logs If Failed +Test Teardown Save Logs If Failed *** Test Cases *** @@ -93,7 +93,7 @@ EBDP2 FOR ${index} IN RANGE 60 ${output} Query SELECT instance_id FROM instances WHERE name='Poller2' Sleep 1s - log to console Output= ${output} + Log To Console Output= ${output} IF "${output}" != "()" BREAK END Should Be Equal As Strings ${output} ((3,),) @@ -110,7 +110,7 @@ EBDP2 ${result} Find Regex In Log With Timeout ${centralLog} ${start_remove} ${content} 60 Should Be True ${result} connection closed not found. - log to console Reconfiguration of 2 pollers + Log To Console Reconfiguration of 2 pollers # Poller2 is removed from the engine configuration but still there in centreon_storage DB Config Engine ${2} ${50} ${20} ${start} Get Current Date @@ -132,7 +132,7 @@ EBDP2 FOR ${index} IN RANGE 60 ${output} Query SELECT instance_id FROM instances WHERE name='Poller2' Sleep 1s - log to console Output= ${output} + Log To Console Output= ${output} IF "${output}" == "()" BREAK END Should Be Equal As Strings ${output} () @@ -165,7 +165,7 @@ EBDP_GRPC2 FOR ${index} IN RANGE 60 ${output} Query SELECT instance_id FROM instances WHERE name='Poller2' Sleep 1s - log to console Output= ${output} + Log To Console Output= ${output} IF "${output}" != "()" BREAK END Should Be Equal As Strings ${output} ((3,),) @@ -183,7 +183,7 @@ EBDP_GRPC2 ${result} Find Regex In Log With Timeout ${centralLog} ${start_remove} ${content} 60 Should Be True ${result} connection closed not found. - log to console Reconfiguration of 2 pollers + Log To Console Reconfiguration of 2 pollers # Poller2 is removed from the engine configuration but still there in centreon_storage DB Config Engine ${2} ${50} ${20} ${start} Get Current Date @@ -205,7 +205,7 @@ EBDP_GRPC2 FOR ${index} IN RANGE 60 ${output} Query SELECT instance_id FROM instances WHERE name='Poller2' Sleep 1s - log to console Output= ${output} + Log To Console Output= ${output} IF "${output}" == "()" BREAK END Should Be Equal As Strings ${output} () @@ -232,7 +232,7 @@ EBDP3 FOR ${index} IN RANGE 60 ${output} Query SELECT instance_id FROM instances WHERE name='Poller2' Sleep 1s - log to console Output= ${output} + Log To Console Output= ${output} IF "${output}" != "()" BREAK END Should Be Equal As Strings ${output} ((3,),) @@ -245,7 +245,7 @@ EBDP3 Terminate Process e1 Terminate Process e2 - log to console Reconfiguration of 2 pollers + Log To Console Reconfiguration of 2 pollers # Poller2 is removed from the engine configuration but still there in centreon_storage DB Config Engine ${2} ${50} ${20} ${start} Get Current Date @@ -265,7 +265,7 @@ EBDP3 FOR ${index} IN RANGE 60 ${output} Query SELECT instance_id FROM instances WHERE name='Poller2' Sleep 1s - log to console Output= ${output} + Log To Console Output= ${output} IF "${output}" == "()" BREAK END Should Be Equal As Strings ${output} () @@ -281,7 +281,7 @@ EBDP4 Broker Config Log central core error Broker Config Log central sql trace Broker Config Log module3 neb trace - Broker Config Flush log central 0 + Broker Config Flush Log central 0 ${start} Get Current Date Start Broker Start Engine @@ -308,8 +308,8 @@ EBDP4 # Generation of many service status but kept in memory on poller3. FOR ${i} IN RANGE 200 - Process Service Check result host_40 service_781 2 service_781 should fail config3 - Process Service Check result host_40 service_782 1 service_782 should fail config3 + Process Service Check Result host_40 service_781 2 service_781 should fail config3 + Process Service Check Result host_40 service_782 1 service_782 should fail config3 END ${content} Create List ... SERVICE ALERT: host_40;service_781;CRITICAL @@ -353,9 +353,9 @@ EBDP4 Should Be True ${result} check_for_external_commands is missing. ${content} Create List service status (40, 781) thrown away because host 40 is not known by any poller - log to console date ${start} + Log To Console date ${start} ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 60 - Should be True ${result} No message about these two wrong service status. + Should Be True ${result} No message about these two wrong service status. Stop Engine Kindly Stop Broker @@ -399,7 +399,7 @@ EBDP5 Should Be True ${result} check_for_external_commands is missing. ${remove_time} Get Current Date - Remove Poller by id 51001 ${4} + Remove Poller By Id 51001 ${4} # wait unified receive instance event ${content} Create List central-broker-unified-sql read neb:Instance @@ -438,7 +438,7 @@ EBDP6 FOR ${index} IN RANGE 60 ${output} Query SELECT instance_id FROM instances WHERE name='Poller2' Sleep 1s - log to console Output= ${output} + Log To Console Output= ${output} IF "${output}" != "()" BREAK END Should Be Equal As Strings ${output} ((3,),) @@ -451,7 +451,7 @@ EBDP6 Terminate Process e1 Terminate Process e2 - log to console Reconfiguration of 2 pollers + Log To Console Reconfiguration of 2 pollers # Poller2 is removed from the engine configuration but still there in centreon_storage DB Config Engine ${2} ${50} ${20} ${start} Get Current Date @@ -466,7 +466,7 @@ EBDP6 Should Be True ${result} check_for_external_commands is missing. ${remove_time} Get Current Date - Remove Poller by id 51001 ${3} + Remove Poller By Id 51001 ${3} # wait unified receive instance event ${content} Create List central-broker-unified-sql read neb:Instance @@ -479,7 +479,7 @@ EBDP6 FOR ${index} IN RANGE 60 ${output} Query SELECT instance_id FROM instances WHERE name='Poller2' Sleep 1s - log to console Output= ${output} + Log To Console Output= ${output} IF "${output}" == "()" BREAK END Should Be Equal As Strings ${output} () @@ -506,7 +506,7 @@ EBDP7 FOR ${index} IN RANGE 60 ${output} Query SELECT instance_id FROM instances WHERE name='Poller2' Sleep 1s - log to console Output= ${output} + Log To Console Output= ${output} IF "${output}" != "()" BREAK END Should Be Equal As Strings ${output} ((3,),) @@ -519,7 +519,7 @@ EBDP7 Terminate Process e1 Terminate Process e2 - log to console Reconfiguration of 2 pollers + Log To Console Reconfiguration of 2 pollers # Poller2 is removed from the engine configuration but still there in centreon_storage DB Config Engine ${2} ${50} ${20} ${start} Get Current Date @@ -532,7 +532,7 @@ EBDP7 Should Be True ${result} check_for_external_commands is missing. ${remove_time} Get Current Date - Remove Poller by id 51001 ${3} + Remove Poller By Id 51001 ${3} # wait unified receive instance event ${content} Create List central-broker-unified-sql read neb:Instance @@ -545,7 +545,7 @@ EBDP7 FOR ${index} IN RANGE 60 ${output} Query SELECT instance_id FROM instances WHERE name='Poller2' Sleep 1s - log to console Output= ${output} + Log To Console Output= ${output} IF "${output}" == "()" BREAK END Should Be Equal As Strings ${output} () @@ -561,7 +561,7 @@ EBDP8 Broker Config Log central core error Broker Config Log central sql trace Broker Config Log module3 neb trace - Broker Config Flush log central 0 + Broker Config Flush Log central 0 ${start} Get Current Date Start Broker Start Engine @@ -588,8 +588,8 @@ EBDP8 # Generation of many service status but kept in memory on poller3. FOR ${i} IN RANGE 200 - Process Service Check result host_40 service_781 2 service_781 should fail config3 - Process Service Check result host_40 service_782 1 service_782 should fail config3 + Process Service Check Result host_40 service_781 2 service_781 should fail config3 + Process Service Check Result host_40 service_782 1 service_782 should fail config3 END ${content} Create List ... SERVICE ALERT: host_40;service_781;CRITICAL @@ -612,7 +612,7 @@ EBDP8 # Restart Broker Start Broker - Remove Poller by id 51001 ${4} + Remove Poller By Id 51001 ${4} FOR ${index} IN RANGE 60 ${output} Query SELECT instance_id FROM instances WHERE name='Poller3' Sleep 1s @@ -627,8 +627,8 @@ EBDP8 Should Be True ${result} check_for_external_commands is missing. ${content} Create List service status (40, 781) thrown away because host 40 is not known by any poller - log to console date ${start} + Log To Console date ${start} ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 60 - Should be True ${result} No message about these two wrong service status. + Should Be True ${result} No message about these two wrong service status. Stop Engine Kindly Stop Broker diff --git a/tests/broker-engine/downtimes.robot b/tests/broker-engine/downtimes.robot index 0d044de66d0..8d41f5d73b1 100644 --- a/tests/broker-engine/downtimes.robot +++ b/tests/broker-engine/downtimes.robot @@ -14,7 +14,7 @@ Library ../resources/Common.py Suite Setup Clean Downtimes Before Suite Suite Teardown Clean After Suite Test Setup Stop Processes -Test Teardown Save logs If Failed +Test Teardown Save Logs If Failed *** Test Cases *** @@ -56,26 +56,26 @@ BEDTMASS1 ${host0} Catenate SEPARATOR= host_ ${i + 1} ${host1} Catenate SEPARATOR= host_ ${i + 18} ${host2} Catenate SEPARATOR= host_ ${i + 35} - Schedule host downtime ${0} ${host0} ${3600} - Schedule host downtime ${1} ${host1} ${3600} - Schedule host downtime ${2} ${host2} ${3600} + Schedule Host Downtime ${0} ${host0} ${3600} + Schedule Host Downtime ${1} ${host1} ${3600} + Schedule Host Downtime ${2} ${host2} ${3600} END ${result} check number of downtimes ${1050} ${start} ${60} - Should be true ${result} We should have 1050 downtimes enabled. + Should Be True ${result} We should have 1050 downtimes enabled. # It's time to delete downtimes FOR ${i} IN RANGE ${17} ${host0} Catenate SEPARATOR= host_ ${i + 1} ${host1} Catenate SEPARATOR= host_ ${i + 18} ${host2} Catenate SEPARATOR= host_ ${i + 35} - Delete host downtimes ${0} ${host0} - Delete host downtimes ${1} ${host1} - Delete host downtimes ${2} ${host2} + Delete Host Downtimes ${0} ${host0} + Delete Host Downtimes ${1} ${host1} + Delete Host Downtimes ${2} ${host2} END ${result} check number of downtimes ${0} ${start} ${60} - Should be true ${result} We should have no downtime enabled. + Should Be True ${result} We should have no downtime enabled. Stop Engine Kindly Stop Broker @@ -112,26 +112,26 @@ BEDTMASS2 ${host0} Catenate SEPARATOR= host_ ${i + 1} ${host1} Catenate SEPARATOR= host_ ${i + 18} ${host2} Catenate SEPARATOR= host_ ${i + 35} - Schedule host downtime ${0} ${host0} ${3600} - Schedule host downtime ${1} ${host1} ${3600} - Schedule host downtime ${2} ${host2} ${3600} + Schedule Host Downtime ${0} ${host0} ${3600} + Schedule Host Downtime ${1} ${host1} ${3600} + Schedule Host Downtime ${2} ${host2} ${3600} END ${result} check number of downtimes ${1050} ${start} ${60} - Should be true ${result} We should have 1050 downtimes enabled. + Should Be True ${result} We should have 1050 downtimes enabled. # It's time to delete downtimes FOR ${i} IN RANGE ${17} ${host0} Catenate SEPARATOR= host_ ${i + 1} ${host1} Catenate SEPARATOR= host_ ${i + 18} ${host2} Catenate SEPARATOR= host_ ${i + 35} - Delete host downtimes ${0} ${host0} - Delete host downtimes ${1} ${host1} - Delete host downtimes ${2} ${host2} + Delete Host Downtimes ${0} ${host0} + Delete Host Downtimes ${1} ${host1} + Delete Host Downtimes ${2} ${host2} END ${result} check number of downtimes ${0} ${start} ${60} - Should be true ${result} We should have no downtime enabled. + Should Be True ${result} We should have no downtime enabled. Stop Engine Kindly Stop Broker @@ -157,10 +157,10 @@ BEDTSVCREN1 Should Be True ${result} No check for external commands executed for 1mn. # It's time to schedule a downtime - Schedule service downtime host_1 service_1 ${3600} + Schedule Service Downtime host_1 service_1 ${3600} ${result} check number of downtimes ${1} ${start} ${60} - Should be true ${result} We should have 1 downtime enabled. + Should Be True ${result} We should have 1 downtime enabled. # Let's rename the service service_1 Rename Service ${0} host_1 service_1 toto_1 @@ -171,10 +171,10 @@ BEDTSVCREN1 ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} No check for external commands executed for 1mn. - Delete service downtime full ${0} host_1 toto_1 + Delete Service Downtime Full ${0} host_1 toto_1 ${result} check number of downtimes ${0} ${start} ${60} - Should be true ${result} We should have no downtime enabled. + Should Be True ${result} We should have no downtime enabled. Stop Engine Kindly Stop Broker @@ -200,15 +200,15 @@ BEDTSVCFIXED Should Be True ${result} No check for external commands executed for 1mn. # It's time to schedule a downtime - Schedule service downtime host_1 service_1 ${3600} + Schedule Service Downtime host_1 service_1 ${3600} ${result} check number of downtimes ${1} ${start} ${60} - Should be true ${result} We should have 1 downtime enabled. + Should Be True ${result} We should have 1 downtime enabled. - Delete service downtime full ${0} host_1 service_1 + Delete Service Downtime Full ${0} host_1 service_1 ${result} check number of downtimes ${0} ${start} ${60} - Should be true ${result} We should have no downtime enabled. + Should Be True ${result} We should have no downtime enabled. Stop Engine Kindly Stop Broker @@ -235,16 +235,16 @@ BEDTHOSTFIXED Should Be True ${result} No check for external commands executed for 1mn. # It's time to schedule downtimes - Schedule host fixed downtime ${0} host_1 ${3600} + Schedule Host Fixed Downtime ${0} host_1 ${3600} ${result} check number of downtimes ${21} ${start} ${60} - Should be true ${result} We should have 21 downtimes (1 host + 20 services) enabled. + Should Be True ${result} We should have 21 downtimes (1 host + 20 services) enabled. # It's time to delete downtimes - Delete host downtimes ${0} host_1 + Delete Host Downtimes ${0} host_1 ${result} check number of downtimes ${0} ${start} ${60} - Should be true ${result} We should have no downtime enabled. + Should Be True ${result} We should have no downtime enabled. Stop Engine Kindly Stop Broker diff --git a/tests/broker-engine/external-commands.robot b/tests/broker-engine/external-commands.robot index c7767162a89..0bceef2c0e9 100644 --- a/tests/broker-engine/external-commands.robot +++ b/tests/broker-engine/external-commands.robot @@ -14,7 +14,7 @@ Library ../resources/Common.py Suite Setup Clean Before Suite Suite Teardown Clean After Suite Test Setup Stop Processes -Test Teardown Save logs If Failed +Test Teardown Save Logs If Failed *** Test Cases *** @@ -853,7 +853,7 @@ BEEXTCMD21 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. - Disable Host And child Notifications ${use_grpc} host_1 + Disable Host And Child Notifications ${use_grpc} host_1 Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} @@ -875,7 +875,7 @@ BEEXTCMD21 END Should Be Equal As Strings ${output} ((0,),) - Enable Host And child Notifications ${use_grpc} host_1 + Enable Host And Child Notifications ${use_grpc} host_1 FOR ${index} IN RANGE 30 Log To Console SELECT notify FROM hosts WHERE name='host_1' @@ -920,7 +920,7 @@ BEEXTCMD22 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. - Disable Host And child Notifications ${use_grpc} host_1 + Disable Host And Child Notifications ${use_grpc} host_1 Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} @@ -933,7 +933,7 @@ BEEXTCMD22 END Should Be Equal As Strings ${output} ((0,),) - Enable Host And child Notifications ${use_grpc} host_1 + Enable Host And Child Notifications ${use_grpc} host_1 FOR ${index} IN RANGE 30 Log To Console SELECT notify FROM hosts WHERE name='host_1' @@ -1270,7 +1270,7 @@ BEEXTCMD28 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. - Disable Host Flap detection ${use_grpc} host_1 + Disable Host Flap Detection ${use_grpc} host_1 Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} diff --git a/tests/broker-engine/external-commands2.robot b/tests/broker-engine/external-commands2.robot index a12e6aa34e5..3f21e613738 100644 --- a/tests/broker-engine/external-commands2.robot +++ b/tests/broker-engine/external-commands2.robot @@ -14,7 +14,7 @@ Library ../resources/Common.py Suite Setup Clean Before Suite Suite Teardown Clean After Suite Test Setup Stop Processes -Test Teardown Save logs If Failed +Test Teardown Save Logs If Failed *** Test Cases *** @@ -797,8 +797,8 @@ BEEXTCMD_GRPC1 Config Broker rrd Config Broker central Config Broker module ${1} - Change Broker tcp output to grpc module0 - Change Broker tcp input to grpc central + Change Broker Tcp Output To Grpc module0 + Change Broker Tcp Input To Grpc central Broker Config Add Item module0 bbdo_version 3.0.0 Broker Config Add Item central bbdo_version 3.0.0 Broker Config Add Item rrd bbdo_version 3.0.0 @@ -840,8 +840,8 @@ BEEXTCMD_GRPC2 Config Broker rrd Config Broker central Config Broker module ${1} - Change Broker tcp output to grpc module0 - Change Broker tcp input to grpc central + Change Broker Tcp Output To Grpc module0 + Change Broker Tcp Input To Grpc central Broker Config Log central sql debug FOR ${use_grpc} IN RANGE 0 2 Log To Console external command CHANGE_NORMAL_SVC_CHECK_INTERVAL on bbdo2.0 use_grpc=${use_grpc} @@ -879,8 +879,8 @@ BEEXTCMD_GRPC3 Config Broker rrd Config Broker central Config Broker module ${1} - Change Broker tcp output to grpc module0 - Change Broker tcp input to grpc central + Change Broker Tcp Output To Grpc module0 + Change Broker Tcp Input To Grpc central Broker Config Add Item module0 bbdo_version 3.0.0 Broker Config Add Item central bbdo_version 3.0.0 Broker Config Add Item rrd bbdo_version 3.0.0 @@ -922,8 +922,8 @@ BEEXTCMD_GRPC4 Config Broker rrd Config Broker central Config Broker module ${1} - Change Broker tcp output to grpc module0 - Change Broker tcp input to grpc central + Change Broker Tcp Output To Grpc module0 + Change Broker Tcp Input To Grpc central Broker Config Log central core error Broker Config Log central sql debug FOR ${use_grpc} IN RANGE 0 2 @@ -960,8 +960,8 @@ BEEXTCMD_REVERSE_GRPC1 Config Broker rrd Config Broker central Config Broker module ${1} - Change Broker tcp output to grpc module0 - Change Broker tcp input to grpc central + Change Broker Tcp Output To Grpc module0 + Change Broker Tcp Input To Grpc central Broker Config Output Remove module0 central-module-master-output host Broker Config Output Remove central centreon-broker-master-rrd host Broker Config Input Set central central-broker-master-input host 127.0.0.1 @@ -1008,8 +1008,8 @@ BEEXTCMD_REVERSE_GRPC2 Config Broker rrd Config Broker central Config Broker module ${1} - Change Broker tcp output to grpc module0 - Change Broker tcp input to grpc central + Change Broker Tcp Output To Grpc module0 + Change Broker Tcp Input To Grpc central Broker Config Output Remove module0 central-module-master-output host Broker Config Output Remove central centreon-broker-master-rrd host Broker Config Input Set central central-broker-master-input host 127.0.0.1 @@ -1051,8 +1051,8 @@ BEEXTCMD_REVERSE_GRPC3 Config Broker rrd Config Broker central Config Broker module ${1} - Change Broker tcp output to grpc module0 - Change Broker tcp input to grpc central + Change Broker Tcp Output To Grpc module0 + Change Broker Tcp Input To Grpc central Broker Config Add Item module0 bbdo_version 3.0.0 Broker Config Add Item central bbdo_version 3.0.0 Broker Config Add Item rrd bbdo_version 3.0.0 @@ -1098,8 +1098,8 @@ BEEXTCMD_REVERSE_GRPC4 Config Broker rrd Config Broker central Config Broker module ${1} - Change Broker tcp output to grpc module0 - Change Broker tcp input to grpc central + Change Broker Tcp Output To Grpc module0 + Change Broker Tcp Input To Grpc central Broker Config Output Remove module0 central-module-master-output host Broker Config Output Remove central centreon-broker-master-rrd host Broker Config Input Set central central-broker-master-input host 127.0.0.1 @@ -1141,8 +1141,8 @@ BEEXTCMD_COMPRESS_GRPC1 Config Broker rrd Config Broker central Config Broker module ${1} - Change Broker tcp output to grpc module0 - Change Broker tcp input to grpc central + Change Broker Tcp Output To Grpc module0 + Change Broker Tcp Input To Grpc central Change Broker Compression Output module0 central-module-master-output yes Change Broker Compression Input central centreon-broker-master-input yes Broker Config Add Item module0 bbdo_version 3.0.0 @@ -1225,7 +1225,7 @@ BEATOI12 Kindly Stop Broker BEATOI13 - [Documentation] external command SCHEDULE SERVICE DOWNTIME with duration<0 should fail + [Documentation] external command Schedule Service Downtime with duration<0 should fail [Tags] broker engine host extcmd atoi Config Engine ${1} ${50} ${20} Config Broker rrd @@ -1240,7 +1240,7 @@ BEATOI13 ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} No check for external commands executed for 1mn. ${date} Get Current Date result_format=epoch - SCHEDULE SERVICE DOWNTIME host_1 service_1 -1 + Schedule Service Downtime host_1 service_1 -1 ${content} Create List Error: could not schedule downtime : duration ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} command argument duration must be an integer >= 0. @@ -1415,7 +1415,7 @@ BESERVCHECK Should Be True ${result} No check for external commands executed for 1mn. Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} Execute SQL String UPDATE services set command_line='toto', next_check=0 where service_id=1 and host_id=1 - schedule_forced_svc_check host_1 service_1 + Schedule Forced Svc Check host_1 service_1 ${command_param} get_command_service_param 1 ${result} check_service_check_with_timeout ... host_1 diff --git a/tests/broker-engine/hostgroups.robot b/tests/broker-engine/hostgroups.robot index 53fe8d5fd2e..a04c1d0ebdd 100644 --- a/tests/broker-engine/hostgroups.robot +++ b/tests/broker-engine/hostgroups.robot @@ -14,7 +14,7 @@ Library ../resources/Common.py Suite Setup Clean Before Suite Suite Teardown Clean After Suite Test Setup Stop Processes -Test Teardown Save logs If Failed +Test Teardown Save Logs If Failed *** Test Cases *** @@ -110,7 +110,7 @@ EBNHGU2 ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 45 Should Be True ${result} One of the new host groups not found in logs. Stop Engine - Kindly stop Broker + Kindly Stop Broker EBNHGU3 [Documentation] New host group with several pollers and connections to DB with broker configured with unified_sql @@ -188,14 +188,14 @@ EBNHG4 Sleep 10s ${start} Get Current Date - Log to Console Step-1 + Log To Console Step-1 Reload Broker - Log to Console Step0 + Log To Console Step0 Reload Engine - Log to Console Step1 + Log To Console Step1 Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} - Log to Console Step1 + Log To Console Step1 FOR ${index} IN RANGE 60 Log To Console SELECT name FROM hostgroups WHERE hostgroup_id = ${1} ${output} Query SELECT name FROM hostgroups WHERE hostgroup_id = ${1} @@ -239,14 +239,14 @@ EBNHGU4 Sleep 10s ${start} Get Current Date - Log to Console Step-1 + Log To Console Step-1 Reload Broker - Log to Console Step0 + Log To Console Step0 Reload Engine - Log to Console Step1 + Log To Console Step1 Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} - Log to Console Step1 + Log To Console Step1 FOR ${index} IN RANGE 60 Log To Console SELECT name FROM hostgroups WHERE hostgroup_id = ${1} ${output} Query SELECT name FROM hostgroups WHERE hostgroup_id = ${1} diff --git a/tests/broker-engine/hosts-with-notes-and-actions.robot b/tests/broker-engine/hosts-with-notes-and-actions.robot index ec6d0f0876d..5dd803c4601 100644 --- a/tests/broker-engine/hosts-with-notes-and-actions.robot +++ b/tests/broker-engine/hosts-with-notes-and-actions.robot @@ -14,7 +14,7 @@ Library ../resources/Common.py Suite Setup Clean Before Suite Suite Teardown Clean After Suite Test Setup Stop Processes -Test Teardown Save logs If Failed +Test Teardown Save Logs If Failed *** Test Cases *** @@ -31,7 +31,7 @@ EBSNU1 Broker Config Log central sql debug Config Broker Sql Output central unified_sql ${nu} Evaluate 2000*"X" - Engine Config set value in hosts 0 host_1 notes_url ${nu} + Engine Config Set Value In Hosts 0 host_1 notes_url ${nu} Clear Retention Start Broker Start Engine @@ -65,7 +65,7 @@ EBSAU2 Broker Config Log central sql debug Config Broker Sql Output central unified_sql ${au} Evaluate 2000*"Y" - Engine Config set value in hosts 0 host_2 action_url ${au} + Engine Config Set Value In Hosts 0 host_2 action_url ${au} Clear Retention Start Broker Start Engine @@ -99,7 +99,7 @@ EBSN3 Broker Config Log central sql debug Config Broker Sql Output central unified_sql ${n} Evaluate 500*"Z" - Engine Config set value in hosts 0 host_3 notes ${n} + Engine Config Set Value In Hosts 0 host_3 notes ${n} Clear Retention Start Broker Start Engine diff --git a/tests/broker-engine/log-v2_engine.robot b/tests/broker-engine/log-v2_engine.robot index 2609d628be3..811d8d2e435 100644 --- a/tests/broker-engine/log-v2_engine.robot +++ b/tests/broker-engine/log-v2_engine.robot @@ -14,7 +14,7 @@ Library ../resources/Common.py Suite Setup Clean Before Suite Suite Teardown Clean After Suite Test Setup Stop Processes -Test Teardown Save logs If Failed +Test Teardown Save Logs If Failed *** Test Cases *** diff --git a/tests/broker-engine/muxer_filter.robot b/tests/broker-engine/muxer_filter.robot index e31b6f9d108..9be543fcacd 100644 --- a/tests/broker-engine/muxer_filter.robot +++ b/tests/broker-engine/muxer_filter.robot @@ -13,7 +13,7 @@ Library ../resources/Common.py Suite Setup Clean Before Suite Suite Teardown Clean After Suite Test Setup Stop Processes -Test Teardown Save logs If Failed +Test Teardown Save Logs If Failed *** Test Cases *** diff --git a/tests/broker-engine/notification-unstable.robot b/tests/broker-engine/notification-unstable.robot index 191ad2a4153..d3dd209ccfa 100644 --- a/tests/broker-engine/notification-unstable.robot +++ b/tests/broker-engine/notification-unstable.robot @@ -14,7 +14,7 @@ Library ../resources/Common.py Suite Setup Clean Before Suite Suite Teardown Clean After Suite Test Setup Stop Processes -Test Teardown Save logs If Failed +Test Teardown Save Logs If Failed *** Test Cases *** @@ -624,7 +624,7 @@ not13 Config Engine ${1} ${2} ${1} Engine Config Set Value 0 interval_length 10 True Config Engine Add Cfg File ${0} servicegroups.cfg - Add service Group ${0} ${1} ["host_1","service_1", "host_2","service_2"] + Add Service Group ${0} ${1} ["host_1","service_1", "host_2","service_2"] Config Notifications Config Escalations diff --git a/tests/broker-engine/output-tables.robot b/tests/broker-engine/output-tables.robot index 930bf58d43e..12218f27fab 100644 --- a/tests/broker-engine/output-tables.robot +++ b/tests/broker-engine/output-tables.robot @@ -15,7 +15,7 @@ Library ../resources/specific-duplication.py Suite Setup Clean Before Suite Suite Teardown Clean After Suite Test Setup Stop Processes -Test Teardown Save logs If Failed +Test Teardown Save Logs If Failed *** Test Cases *** @@ -92,17 +92,17 @@ BEINSTANCESTATUS [Documentation] Instance status to bdd [Tags] broker engine Config Engine ${1} ${50} ${20} - engine_config_set_value 0 enable_flap_detection 1 True - engine_config_set_value 0 enable_notifications 0 True - engine_config_set_value 0 execute_host_checks 0 True - engine_config_set_value 0 execute_service_checks 0 True - engine_config_set_value 0 global_host_event_handler command_1 True - engine_config_set_value 0 global_service_event_handler command_2 True - engine_config_set_value 0 instance_heartbeat_interval 1 True - engine_config_set_value 0 obsess_over_hosts 1 True - engine_config_set_value 0 obsess_over_services 1 True - engine_config_set_value 0 accept_passive_host_checks 0 True - engine_config_set_value 0 accept_passive_service_checks 0 True + Engine Config Set Value 0 enable_flap_detection 1 True + Engine Config Set Value 0 enable_notifications 0 True + Engine Config Set Value 0 execute_host_checks 0 True + Engine Config Set Value 0 execute_service_checks 0 True + Engine Config Set Value 0 global_host_event_handler command_1 True + Engine Config Set Value 0 global_service_event_handler command_2 True + Engine Config Set Value 0 instance_heartbeat_interval 1 True + Engine Config Set Value 0 obsess_over_hosts 1 True + Engine Config Set Value 0 obsess_over_services 1 True + Engine Config Set Value 0 accept_passive_host_checks 0 True + Engine Config Set Value 0 accept_passive_service_checks 0 True Config Broker central Config Broker module ${1} diff --git a/tests/broker-engine/retention-duplicates.robot b/tests/broker-engine/retention-duplicates.robot index 92c2c0ee7db..844d0a688d1 100644 --- a/tests/broker-engine/retention-duplicates.robot +++ b/tests/broker-engine/retention-duplicates.robot @@ -13,7 +13,7 @@ Library ../resources/specific-duplication.py Suite Setup Clean Before Suite Suite Teardown Clean After Suite Test Setup Stop Processes -Test Teardown Save logs If Failed +Test Teardown Save Logs If Failed *** Test Cases *** diff --git a/tests/broker-engine/reverse-connection.robot b/tests/broker-engine/reverse-connection.robot index 8f9b36f346d..9072ed6a9ca 100644 --- a/tests/broker-engine/reverse-connection.robot +++ b/tests/broker-engine/reverse-connection.robot @@ -14,7 +14,7 @@ Library ../resources/Common.py Suite Setup Clean Before Suite Suite Teardown Clean After Suite Test Setup Stop Processes -Test Teardown Save logs If Failed +Test Teardown Save Logs If Failed *** Test Cases *** @@ -204,7 +204,7 @@ BRCTSMNS # The output file of the map script is cleared. Remove File ${/}tmp${/}map-output.log - log to console Second configuration with one more service per host + Log To Console Second configuration with one more service per host # For each host, one service is added (20 -> 21) Config Engine ${1} ${50} ${21} Reload Engine diff --git a/tests/broker-engine/rrd-from-db.robot b/tests/broker-engine/rrd-from-db.robot index 834193dfec6..cf6d6e8e9f6 100644 --- a/tests/broker-engine/rrd-from-db.robot +++ b/tests/broker-engine/rrd-from-db.robot @@ -14,7 +14,7 @@ Library ../resources/Common.py Suite Setup Clean Before Suite Suite Teardown Clean After Suite Test Setup Stop Processes -Test Teardown Save logs If Failed +Test Teardown Save Logs If Failed *** Test Cases *** @@ -45,7 +45,7 @@ BRRDDMDB1 Log To Console Metrics to delete ${metrics} ${empty} Create List - Remove Graphs from DB ${empty} ${metrics} + Remove Graphs From Db ${empty} ${metrics} Reload Broker ${metrics_str} Catenate SEPARATOR=, @{metrics} ${content} Create List metrics ${metrics_str} erased from database @@ -53,7 +53,7 @@ BRRDDMDB1 ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 30 Should Be True ${result} No log message telling about metrics ${metrics_str} deletion. FOR ${m} IN @{metrics} - Log to Console Waiting for ${VarRoot}/lib/centreon/metrics/${m}.rrd to be deleted + Log To Console Waiting for ${VarRoot}/lib/centreon/metrics/${m}.rrd to be deleted Wait Until Removed ${VarRoot}/lib/centreon/metrics/${m}.rrd 20s END @@ -79,15 +79,15 @@ BRRDDIDDB1 ${result} Check Connections Should Be True ${result} Engine and Broker not connected - log to console STEP1 + Log To Console STEP1 ${indexes} Get Indexes To Delete 2 - log to console STEP2 + Log To Console STEP2 ${metrics} Get Metrics Matching Indexes ${indexes} - log to console STEP3 + Log To Console STEP3 Log To Console indexes ${indexes} to delete with their metrics ${empty} Create List - Remove Graphs from DB ${indexes} ${empty} + Remove Graphs From Db ${indexes} ${empty} Reload Broker ${indexes_str} Catenate SEPARATOR=, @{indexes} ${content} Create List indexes ${indexes_str} erased from database @@ -95,11 +95,11 @@ BRRDDIDDB1 ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 30 Should Be True ${result} No log message telling about indexes ${indexes_str} deletion. FOR ${i} IN @{indexes} - log to console Wait for ${VarRoot}/lib/centreon/status/${i}.rrd to be deleted + Log To Console Wait for ${VarRoot}/lib/centreon/status/${i}.rrd to be deleted Wait Until Removed ${VarRoot}/lib/centreon/status/${i}.rrd 20s END FOR ${m} IN @{metrics} - log to console Wait for ${VarRoot}/lib/centreon/metrics/${m}.rrd to be deleted + Log To Console Wait for ${VarRoot}/lib/centreon/metrics/${m}.rrd to be deleted Wait Until Removed ${VarRoot}/lib/centreon/metrics/${m}.rrd 20s END @@ -125,7 +125,7 @@ BRRDRBDB1 # We get 3 indexes to rebuild ${index} Get Indexes To Rebuild 3 - Rebuild Rrd Graphs from DB ${index} + Rebuild Rrd Graphs From Db ${index} Log To Console Indexes to rebuild: ${index} ${metrics} Get Metrics Matching Indexes ${index} Log To Console Metrics to rebuild: ${metrics} @@ -175,7 +175,7 @@ BRRDRBUDB1 # We get 3 indexes to rebuild ${index} Get Indexes To Rebuild 3 - Rebuild Rrd Graphs from DB ${index} + Rebuild Rrd Graphs From Db ${index} Reload Broker Log To Console Indexes to rebuild: ${index} ${metrics} Get Metrics Matching Indexes ${index} @@ -223,7 +223,7 @@ BRRDUPLICATE # We get 3 indexes to rebuild ${index} Get Indexes To Rebuild 3 2 ${duplicates} Add Duplicate Metrics - Rebuild Rrd Graphs from DB ${index} + Rebuild Rrd Graphs From Db ${index} Log To Console Indexes to rebuild: ${index} ${metrics} Get Metrics Matching Indexes ${index} Log To Console Metrics to rebuild: ${metrics} diff --git a/tests/broker-engine/rrd.robot b/tests/broker-engine/rrd.robot index c33d570093e..362f5a3364e 100644 --- a/tests/broker-engine/rrd.robot +++ b/tests/broker-engine/rrd.robot @@ -58,7 +58,7 @@ BRRDDM1 END END FOR ${m} IN @{metrics} - Log to Console Waiting for ${VarRoot}/lib/centreon/metrics/${m}.rrd to be deleted + Log To Console Waiting for ${VarRoot}/lib/centreon/metrics/${m}.rrd to be deleted Wait Until Removed ${VarRoot}/lib/centreon/metrics/${m}.rrd 20s END @@ -126,11 +126,11 @@ BRRDDID1 END FOR ${i} IN @{indexes} - log to console Wait for ${VarRoot}/lib/centreon/status/${i}.rrd to be deleted + Log To Console Wait for ${VarRoot}/lib/centreon/status/${i}.rrd to be deleted Wait Until Removed ${VarRoot}/lib/centreon/status/${i}.rrd 20s END FOR ${m} IN @{metrics} - log to console Wait for ${VarRoot}/lib/centreon/metrics/${m}.rrd to be deleted + Log To Console Wait for ${VarRoot}/lib/centreon/metrics/${m}.rrd to be deleted Wait Until Removed ${VarRoot}/lib/centreon/metrics/${m}.rrd 20s END @@ -402,8 +402,8 @@ BRRDRMU1 ... Data before RRD rebuild contain index_id % 3. The expected average is 100 if modulo==0, 75 if modulo==1, 0 if modulo==2 . END -Rrd_1 - [Documentation] RRD metric rebuild with gRPC API. 3 non existing indexes ids are selected then a error message is sent. This is done with unified_sql output. +RRD1 + [Documentation] RRD metric rebuild asked with gRPC API. Three non existing indexes IDs are selected then an error message is sent. This is done with unified_sql output. [Tags] rrd metric rebuild unified_sql grpc Config Engine ${1} Config Broker rrd @@ -436,3 +436,9 @@ Rrd_1 ${content1} Create List mysql_connection: You have an error in your SQL syntax ${result} Find In Log With Timeout ${rrdLog} ${start} ${content1} 45 Should Not Be True ${result} Database did not receive command to rebuild metrics + +*** Keywords *** +Test Clean + Stop Engine + Kindly Stop Broker + Save Logs If Failed diff --git a/tests/broker-engine/rrdcached-from-db.robot b/tests/broker-engine/rrdcached-from-db.robot index ffc69ae7e24..8e76a9916ac 100644 --- a/tests/broker-engine/rrdcached-from-db.robot +++ b/tests/broker-engine/rrdcached-from-db.robot @@ -14,7 +14,7 @@ Library ../resources/Common.py Suite Setup Clean Before Suite With rrdcached Suite Teardown Clean After Suite With rrdcached Test Setup Stop Processes -Test Teardown Save logs If Failed +Test Teardown Save Logs If Failed *** Test Cases *** @@ -46,7 +46,7 @@ BRRDCDDMDB1 Log To Console Metrics to delete ${metrics} ${empty} Create List - Remove Graphs from DB ${empty} ${metrics} + Remove Graphs From Db ${empty} ${metrics} Reload Broker ${metrics_str} Catenate SEPARATOR=, @{metrics} ${content} Create List metrics ${metrics_str} erased from database @@ -54,7 +54,7 @@ BRRDCDDMDB1 ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 30 Should Be True ${result} No log message telling about metrics ${metrics_str} deletion. FOR ${m} IN @{metrics} - Log to Console Waiting for ${VarRoot}/lib/centreon/metrics/${m}.rrd to be deleted + Log To Console Waiting for ${VarRoot}/lib/centreon/metrics/${m}.rrd to be deleted Wait Until Removed ${VarRoot}/lib/centreon/metrics/${m}.rrd 20s END @@ -81,15 +81,15 @@ BRRDCDDIDDB1 ${result} Check Connections Should Be True ${result} Engine and Broker not connected - log to console STEP1 + Log To Console STEP1 ${indexes} Get Indexes To Delete 2 - log to console STEP2 + Log To Console STEP2 ${metrics} Get Metrics Matching Indexes ${indexes} - log to console STEP3 + Log To Console STEP3 Log To Console indexes ${indexes} to delete with their metrics ${empty} Create List - Remove Graphs from DB ${indexes} ${empty} + Remove Graphs From Db ${indexes} ${empty} Reload Broker ${indexes_str} Catenate SEPARATOR=, @{indexes} ${content} Create List indexes ${indexes_str} erased from database @@ -97,11 +97,11 @@ BRRDCDDIDDB1 ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 30 Should Be True ${result} No log message telling about indexes ${indexes_str} deletion. FOR ${i} IN @{indexes} - log to console Wait for ${VarRoot}/lib/centreon/status/${i}.rrd to be deleted + Log To Console Wait for ${VarRoot}/lib/centreon/status/${i}.rrd to be deleted Wait Until Removed ${VarRoot}/lib/centreon/status/${i}.rrd 20s END FOR ${m} IN @{metrics} - log to console Wait for ${VarRoot}/lib/centreon/metrics/${m}.rrd to be deleted + Log To Console Wait for ${VarRoot}/lib/centreon/metrics/${m}.rrd to be deleted Wait Until Removed ${VarRoot}/lib/centreon/metrics/${m}.rrd 20s END @@ -128,7 +128,7 @@ BRRDCDRBDB1 # We get 3 indexes to rebuild ${index} Get Indexes To Rebuild 3 - Rebuild Rrd Graphs from DB ${index} + Rebuild Rrd Graphs From Db ${index} Log To Console Indexes to rebuild: ${index} ${metrics} Get Metrics Matching Indexes ${index} Log To Console Metrics to rebuild: ${metrics} @@ -179,7 +179,7 @@ BRRDCDRBUDB1 # We get 3 indexes to rebuild ${index} Get Indexes To Rebuild 3 - Rebuild Rrd Graphs from DB ${index} + Rebuild Rrd Graphs From Db ${index} Reload Broker Log To Console Indexes to rebuild: ${index} ${metrics} Get Metrics Matching Indexes ${index} diff --git a/tests/broker-engine/rrdcached.robot b/tests/broker-engine/rrdcached.robot index aac2cf27d57..0022abea339 100644 --- a/tests/broker-engine/rrdcached.robot +++ b/tests/broker-engine/rrdcached.robot @@ -14,7 +14,7 @@ Library ../resources/Common.py Suite Setup Clean Before Suite With rrdcached Suite Teardown Clean After Suite With rrdcached Test Setup Stop Processes -Test Teardown Save logs If Failed +Test Teardown Save Logs If Failed *** Test Cases *** @@ -50,7 +50,7 @@ BRRDCDDM1 ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 30 Should Be True ${result} No log message telling about metrics ${metrics_str} deletion. FOR ${m} IN @{metrics} - Log to Console Waiting for ${VarRoot}/lib/centreon/metrics/${m}.rrd to be deleted + Log To Console Waiting for ${VarRoot}/lib/centreon/metrics/${m}.rrd to be deleted Wait Until Removed ${VarRoot}/lib/centreon/metrics/${m}.rrd 20s END @@ -86,11 +86,11 @@ BRRDCDDID1 ${result} Find In Log With Timeout ${centralLog} ${start} ${content} 30 Should Be True ${result} No log message telling about indexes ${indexes_str} deletion. FOR ${i} IN @{indexes} - log to console Wait for ${VarRoot}/lib/centreon/status/${i}.rrd to be deleted + Log To Console Wait for ${VarRoot}/lib/centreon/status/${i}.rrd to be deleted Wait Until Removed ${VarRoot}/lib/centreon/status/${i}.rrd 20s END FOR ${m} IN @{metrics} - log to console Wait for ${VarRoot}/lib/centreon/metrics/${m}.rrd to be deleted + Log To Console Wait for ${VarRoot}/lib/centreon/metrics/${m}.rrd to be deleted Wait Until Removed ${VarRoot}/lib/centreon/metrics/${m}.rrd 20s END diff --git a/tests/broker-engine/scheduler.robot b/tests/broker-engine/scheduler.robot index bc676b9ed35..0170eeebc65 100644 --- a/tests/broker-engine/scheduler.robot +++ b/tests/broker-engine/scheduler.robot @@ -14,7 +14,7 @@ Library ../resources/Common.py Suite Setup Clean Before Suite Suite Teardown Clean After Suite Test Setup Stop Processes -Test Teardown Save logs If Failed +Test Teardown Save Logs If Failed *** Test Cases *** diff --git a/tests/broker-engine/servicegroups.robot b/tests/broker-engine/servicegroups.robot index ef8fe7b4a61..4f9dc48194a 100644 --- a/tests/broker-engine/servicegroups.robot +++ b/tests/broker-engine/servicegroups.robot @@ -33,7 +33,7 @@ EBNSG1 ${start} Get Current Date Start Broker Start Engine - Add service Group ${0} ${1} ["host_1","service_1", "host_1","service_2","host_1", "service_3"] + Add Service Group ${0} ${1} ["host_1","service_1", "host_1","service_2","host_1", "service_3"] Config Engine Add Cfg File ${0} servicegroups.cfg Sleep 3s @@ -64,7 +64,7 @@ EBNSGU1 ${start} Get Current Date Start Broker Start Engine - Add service Group ${0} ${1} ["host_1","service_1", "host_1","service_2","host_1", "service_3"] + Add Service Group ${0} ${1} ["host_1","service_1", "host_1","service_2","host_1", "service_3"] Config Engine Add Cfg File ${0} servicegroups.cfg Sleep 3s @@ -101,10 +101,10 @@ EBNSGU2 Clear Retention Start Broker Start Engine - Add service Group ${0} ${1} ["host_1","service_1", "host_1","service_2","host_1", "service_3"] - Add service Group ${1} ${1} ["host_14","service_261", "host_14","service_262","host_14", "service_263"] - Add service Group ${2} ${1} ["host_27","service_521", "host_27","service_522","host_27", "service_523"] - Add service Group ${3} ${1} ["host_40","service_781", "host_40","service_782","host_40", "service_783"] + Add Service Group ${0} ${1} ["host_1","service_1", "host_1","service_2","host_1", "service_3"] + Add Service Group ${1} ${1} ["host_14","service_261", "host_14","service_262","host_14", "service_263"] + Add Service Group ${2} ${1} ["host_27","service_521", "host_27","service_522","host_27", "service_523"] + Add Service Group ${3} ${1} ["host_40","service_781", "host_40","service_782","host_40", "service_783"] Config Engine Add Cfg File ${0} servicegroups.cfg Config Engine Add Cfg File ${1} servicegroups.cfg Config Engine Add Cfg File ${2} servicegroups.cfg @@ -127,4 +127,4 @@ EBNSGU2 Test End Stop Engine Kindly Stop Broker - Save logs If Failed + Save Logs If Failed diff --git a/tests/broker-engine/services-and-bulk-stmt.robot b/tests/broker-engine/services-and-bulk-stmt.robot index f8b1841bd55..74d2bbe0240 100644 --- a/tests/broker-engine/services-and-bulk-stmt.robot +++ b/tests/broker-engine/services-and-bulk-stmt.robot @@ -23,7 +23,7 @@ EBBPS1 [Tags] broker engine services unified_sql Config Engine ${1} ${1} ${1000} # We want all the services to be passive to avoid parasite checks during our test. - Set Services passive ${0} service_.* + Set Services Passive ${0} service_.* Config Broker rrd Config Broker central Config Broker module ${1} @@ -76,11 +76,11 @@ EBBPS1 ... ${first_service_status_content} ... 30 Should Be True ${result} No service_status processing found. - Log to Console Stopping Broker + Log To Console Stopping Broker Kindly Stop Broker - Log to Console Waiting for 5s + Log To Console Waiting for 5s Sleep 5s - Log to Console Restarting Broker + Log To Console Restarting Broker ${start_broker} Get Current Date Start Broker END @@ -108,7 +108,7 @@ EBBPS2 [Tags] broker engine services unified_sql Config Engine ${1} ${1} ${1000} # We want all the services to be passive to avoid parasite checks during our test. - Set Services passive ${0} service_.* + Set Services Passive ${0} service_.* Config Broker rrd Config Broker central Config Broker module ${1} @@ -162,9 +162,9 @@ EBBPS2 ... 30 Should Be True ${result} No service_status processing found. Kindly Stop Broker - Log to Console Waiting for 5s + Log To Console Waiting for 5s Sleep 5s - Log to Console Restarting Broker + Log To Console Restarting Broker ${start_broker} Get Current Date Start Broker END @@ -193,7 +193,7 @@ EBMSSM Clear Metrics Config Engine ${1} ${1} ${1000} # We want all the services to be passive to avoid parasite checks during our test. - Set Services passive ${0} service_.* + Set Services Passive ${0} service_.* Config Broker central Config Broker rrd Config Broker module ${1} @@ -240,7 +240,7 @@ EBPS2 Clear Metrics Config Engine ${1} ${1} ${1000} # We want all the services to be passive to avoid parasite checks during our test. - Set Services passive ${0} service_.* + Set Services Passive ${0} service_.* Config Broker central Config Broker rrd Config Broker module ${1} @@ -393,7 +393,7 @@ metric_mapping # We force several checks with metrics FOR ${i} IN RANGE ${10} - Process Service Check result with metrics host_1 service_${i+1} 1 warning${i} 20 + Process Service Check Result With Metrics host_1 service_${i+1} 1 warning${i} 20 END Wait Until Created /tmp/test.log 30s @@ -404,4 +404,4 @@ metric_mapping Test Clean Stop Engine Kindly Stop Broker - Save logs If Failed + Save Logs If Failed diff --git a/tests/broker-engine/services-increased.robot b/tests/broker-engine/services-increased.robot index 84a1190d0c8..6226a4ddd97 100644 --- a/tests/broker-engine/services-increased.robot +++ b/tests/broker-engine/services-increased.robot @@ -14,7 +14,7 @@ Library ../resources/Common.py Suite Setup Clean Before Suite Suite Teardown Clean After Suite Test Setup Stop Processes -Test Teardown Save logs If Failed +Test Teardown Save Logs If Failed *** Test Cases *** @@ -39,7 +39,7 @@ EBNSVC1 FOR ${i} IN RANGE ${3} Sleep 10s ${srv_by_host} Evaluate 20 + 4 * $i - log to console ${srv_by_host} services by host with 50 hosts among 3 pollers. + Log To Console ${srv_by_host} services by host with 50 hosts among 3 pollers. Config Engine ${3} ${50} ${srv_by_host} Reload Engine Reload Broker @@ -79,21 +79,21 @@ Service_increased_huge_check_interval Clear Db index_data Clear Db metrics - Delete All rrd metrics + Delete All Rrd Metrics ${start} Get Current Date Start Broker Start Engine # Start Checkers ${result} Check host status host_1 4 1 False - Should be true ${result} host_1 should be pending + Should Be True ${result} host_1 should be pending ${content} Create List INITIAL HOST STATE: host_1; ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} "host_1 init not found in log" # End Checkers - Process Service Check result with metrics host_1 service_1 1 warning0 1 + Process Service Check Result With Metrics host_1 service_1 1 warning0 1 ${content} Create List new pb data for metric ${result} Find In Log With Timeout ${rrdLog} ${start} ${content} 60 @@ -136,7 +136,7 @@ Service_increased_huge_check_interval Sleep 5 - Process Service Check result with metrics host_1 service_${new_service_id} 1 warning0 1 + Process Service Check Result With Metrics host_1 service_${new_service_id} 1 warning0 1 ${metrics} Get Metrics For Service ${new_service_id} diff --git a/tests/broker-engine/services-with-notes-and-actions.robot b/tests/broker-engine/services-with-notes-and-actions.robot index 48dc53c5507..15342cf865f 100644 --- a/tests/broker-engine/services-with-notes-and-actions.robot +++ b/tests/broker-engine/services-with-notes-and-actions.robot @@ -14,7 +14,7 @@ Library ../resources/Common.py Suite Setup Clean Before Suite Suite Teardown Clean After Suite Test Setup Stop Processes -Test Teardown Save logs If Failed +Test Teardown Save Logs If Failed *** Test Cases *** @@ -32,7 +32,7 @@ EBSNU1 Broker Config Log central bbdo debug Config Broker Sql Output central unified_sql ${nu} Evaluate 2000*"X" - Engine Config set value in services 0 service_1 notes_url ${nu} + Engine Config Set Value In Services 0 service_1 notes_url ${nu} Clear Retention Start Broker Start Engine @@ -67,7 +67,7 @@ EBSAU2 Broker Config Log central bbdo debug Config Broker Sql Output central unified_sql ${au} Evaluate 2000*"Y" - Engine Config set value in services 0 service_2 action_url ${au} + Engine Config Set Value In Services 0 service_2 action_url ${au} Clear Retention Start Broker Start Engine @@ -102,7 +102,7 @@ EBSN3 Broker Config Log central bbdo debug Config Broker Sql Output central unified_sql ${n} Evaluate 500*"Z" - Engine Config set value in services 0 service_3 notes ${n} + Engine Config Set Value In Services 0 service_3 notes ${n} Clear Retention Start Broker Start Engine diff --git a/tests/broker-engine/services.robot b/tests/broker-engine/services.robot index 1172abffb02..cef4ea3b88b 100644 --- a/tests/broker-engine/services.robot +++ b/tests/broker-engine/services.robot @@ -14,7 +14,7 @@ Library ../resources/Common.py Suite Setup Clean Before Suite Suite Teardown Clean After Suite Test Setup Stop Processes -Test Teardown Save logs If Failed +Test Teardown Save Logs If Failed *** Test Cases *** @@ -42,13 +42,13 @@ SDER Stop Engine - modify retention dat 0 host_1 service_1 current_attempt 280 + Modify Retention Dat 0 host_1 service_1 current_attempt 280 # modified attributes is a bit field. We must set the bit corresponding to MAX_ATTEMPTS to be allowed to change max_attempts. Otherwise it will be set to 3. - modify retention dat 0 host_1 service_1 modified_attributes 65535 - modify retention dat 0 host_1 service_1 max_attempts 280 + Modify Retention Dat 0 host_1 service_1 modified_attributes 65535 + Modify Retention Dat 0 host_1 service_1 max_attempts 280 - modify retention dat 0 host_1 service_1 current_state 2 - modify retention dat 0 host_1 service_1 state_type 1 + Modify Retention Dat 0 host_1 service_1 current_state 2 + Modify Retention Dat 0 host_1 service_1 state_type 1 Start Engine Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} diff --git a/tests/broker-engine/start-stop.robot b/tests/broker-engine/start-stop.robot index a5348bba744..0b63f08d062 100644 --- a/tests/broker-engine/start-stop.robot +++ b/tests/broker-engine/start-stop.robot @@ -105,10 +105,10 @@ BESS_GRPC1 Config Broker central Config Broker module Config Broker rrd - Change Broker tcp output to grpc central - Change Broker tcp output to grpc module0 - Change Broker tcp input to grpc central - Change Broker tcp input to grpc rrd + Change Broker Tcp Output To Grpc central + Change Broker Tcp Output To Grpc module0 + Change Broker Tcp Input To Grpc central + Change Broker Tcp Input To Grpc rrd Start Broker Start Engine ${result} Check Connections @@ -123,10 +123,10 @@ BESS_GRPC2 Config Broker central Config Broker module Config Broker rrd - Change Broker tcp output to grpc central - Change Broker tcp output to grpc module0 - Change Broker tcp input to grpc central - Change Broker tcp input to grpc rrd + Change Broker Tcp Output To Grpc central + Change Broker Tcp Output To Grpc module0 + Change Broker Tcp Input To Grpc central + Change Broker Tcp Input To Grpc rrd Start Broker Start Engine ${result} Check Connections @@ -145,10 +145,10 @@ BESS_GRPC3 Config Broker central Config Broker module Config Broker rrd - Change Broker tcp output to grpc central - Change Broker tcp output to grpc module0 - Change Broker tcp input to grpc central - Change Broker tcp input to grpc rrd + Change Broker Tcp Output To Grpc central + Change Broker Tcp Output To Grpc module0 + Change Broker Tcp Input To Grpc central + Change Broker Tcp Input To Grpc rrd Start Engine Start Broker ${result} Check Connections @@ -167,10 +167,10 @@ BESS_GRPC4 Config Broker central Config Broker module Config Broker rrd - Change Broker tcp output to grpc central - Change Broker tcp output to grpc module0 - Change Broker tcp input to grpc central - Change Broker tcp input to grpc rrd + Change Broker Tcp Output To Grpc central + Change Broker Tcp Output To Grpc module0 + Change Broker Tcp Input To Grpc central + Change Broker Tcp Input To Grpc rrd Start Engine Start Broker ${result} Check Connections @@ -186,10 +186,10 @@ BESS_GRPC5 Config Broker module Config Broker rrd Engine Config Set Value ${0} debug_level ${-1} - Change Broker tcp output to grpc central - Change Broker tcp output to grpc module0 - Change Broker tcp input to grpc central - Change Broker tcp input to grpc rrd + Change Broker Tcp Output To Grpc central + Change Broker Tcp Output To Grpc module0 + Change Broker Tcp Input To Grpc central + Change Broker Tcp Input To Grpc rrd Start Broker Start Engine ${result} Check Connections @@ -208,10 +208,10 @@ BESS_GRPC_COMPRESS1 Config Broker central Config Broker module Config Broker rrd - Change Broker tcp output to grpc central - Change Broker tcp output to grpc module0 - Change Broker tcp input to grpc central - Change Broker tcp input to grpc rrd + Change Broker Tcp Output To Grpc central + Change Broker Tcp Output To Grpc module0 + Change Broker Tcp Input To Grpc central + Change Broker Tcp Input To Grpc rrd Change Broker Compression Output module0 central-module-master-output yes Change Broker Compression Input central centreon-broker-master-input yes Start Broker @@ -235,14 +235,14 @@ BESS_CRYPTED_GRPC1 Copy File ../broker/grpc/test/grpc_test_keys/ca_1234.crt /tmp/ Copy File ../broker/grpc/test/grpc_test_keys/server_1234.key /tmp/ Copy File ../broker/grpc/test/grpc_test_keys/server_1234.crt /tmp/ - Change Broker tcp output to grpc central - Change Broker tcp output to grpc module0 - Change Broker tcp input to grpc central - Change Broker tcp input to grpc rrd - Add Broker tcp output grpc crypto module0 True False - Add Broker tcp input grpc crypto central True False - Remove Host from broker output module0 central-module-master-output - Add Host to broker output module0 central-module-master-output localhost + Change Broker Tcp Output To Grpc central + Change Broker Tcp Output To Grpc module0 + Change Broker Tcp Input To Grpc central + Change Broker Tcp Input To Grpc rrd + Add Broker Tcp Output Grpc Crypto module0 True False + Add Broker Tcp Input Grpc Crypto central True False + Remove Host From Broker Output module0 central-module-master-output + Add Host To Broker Output module0 central-module-master-output localhost FOR ${i} IN RANGE 0 5 Start Broker Start Engine @@ -266,11 +266,11 @@ BESS_CRYPTED_GRPC2 Copy File ../broker/grpc/test/grpc_test_keys/ca_1234.crt /tmp/ Copy File ../broker/grpc/test/grpc_test_keys/server_1234.key /tmp/ Copy File ../broker/grpc/test/grpc_test_keys/server_1234.crt /tmp/ - Change Broker tcp output to grpc central - Change Broker tcp output to grpc module0 - Change Broker tcp input to grpc central - Change Broker tcp input to grpc rrd - Add Broker tcp input grpc crypto central True False + Change Broker Tcp Output To Grpc central + Change Broker Tcp Output To Grpc module0 + Change Broker Tcp Input To Grpc central + Change Broker Tcp Input To Grpc rrd + Add Broker Tcp Input Grpc Crypto central True False FOR ${i} IN RANGE 0 5 Start Broker Start Engine @@ -289,11 +289,11 @@ BESS_CRYPTED_GRPC3 Copy File ../broker/grpc/test/grpc_test_keys/ca_1234.crt /tmp/ Copy File ../broker/grpc/test/grpc_test_keys/server_1234.key /tmp/ Copy File ../broker/grpc/test/grpc_test_keys/server_1234.crt /tmp/ - Change Broker tcp output to grpc central - Change Broker tcp output to grpc module0 - Change Broker tcp input to grpc central - Change Broker tcp input to grpc rrd - Add Broker tcp output grpc crypto module0 True False + Change Broker Tcp Output To Grpc central + Change Broker Tcp Output To Grpc module0 + Change Broker Tcp Input To Grpc central + Change Broker Tcp Input To Grpc rrd + Add Broker Tcp Output Grpc Crypto module0 True False FOR ${i} IN RANGE 0 5 Start Broker Start Engine @@ -312,14 +312,14 @@ BESS_CRYPTED_REVERSED_GRPC1 Copy File ../broker/grpc/test/grpc_test_keys/ca_1234.crt /tmp/ Copy File ../broker/grpc/test/grpc_test_keys/server_1234.key /tmp/ Copy File ../broker/grpc/test/grpc_test_keys/server_1234.crt /tmp/ - Change Broker tcp output to grpc central - Change Broker tcp output to grpc module0 - Change Broker tcp input to grpc central - Change Broker tcp input to grpc rrd - Add Broker tcp output grpc crypto module0 True True - Add Broker tcp input grpc crypto central True True - Add Host to broker input central central-broker-master-input localhost - Remove Host from broker output module0 central-module-master-output + Change Broker Tcp Output To Grpc central + Change Broker Tcp Output To Grpc module0 + Change Broker Tcp Input To Grpc central + Change Broker Tcp Input To Grpc rrd + Add Broker Tcp Output Grpc Crypto module0 True True + Add Broker Tcp Input Grpc Crypto central True True + Add Host To Broker Input central central-broker-master-input localhost + Remove Host From Broker Output module0 central-module-master-output FOR ${i} IN RANGE 0 5 Start Broker Start Engine @@ -340,13 +340,13 @@ BESS_CRYPTED_REVERSED_GRPC2 Copy File ../broker/grpc/test/grpc_test_keys/ca_1234.crt /tmp/ Copy File ../broker/grpc/test/grpc_test_keys/server_1234.key /tmp/ Copy File ../broker/grpc/test/grpc_test_keys/server_1234.crt /tmp/ - Change Broker tcp output to grpc central - Change Broker tcp output to grpc module0 - Change Broker tcp input to grpc central - Change Broker tcp input to grpc rrd - Add Broker tcp output grpc crypto module0 True True - Add Host to broker input central central-broker-master-input localhost - Remove Host from broker output module0 central-module-master-output + Change Broker Tcp Output To Grpc central + Change Broker Tcp Output To Grpc module0 + Change Broker Tcp Input To Grpc central + Change Broker Tcp Input To Grpc rrd + Add Broker Tcp Output Grpc Crypto module0 True True + Add Host To Broker Input central central-broker-master-input localhost + Remove Host From Broker Output module0 central-module-master-output FOR ${i} IN RANGE 0 5 Start Broker Start Engine @@ -363,13 +363,13 @@ BESS_CRYPTED_REVERSED_GRPC3 Config Broker module Config Broker rrd Copy File ../broker/grpc/test/grpc_test_keys/ca_1234.crt /tmp/ - Change Broker tcp output to grpc central - Change Broker tcp output to grpc module0 - Change Broker tcp input to grpc central - Change Broker tcp input to grpc rrd - Add Broker tcp input grpc crypto central True True - Add Host to broker input central central-broker-master-input localhost - Remove Host from broker output module0 central-module-master-output + Change Broker Tcp Output To Grpc central + Change Broker Tcp Output To Grpc module0 + Change Broker Tcp Input To Grpc central + Change Broker Tcp Input To Grpc rrd + Add Broker Tcp Input Grpc Crypto central True True + Add Host To Broker Input central central-broker-master-input localhost + Remove Host From Broker Output module0 central-module-master-output FOR ${i} IN RANGE 0 5 Start Broker Start Engine @@ -395,8 +395,8 @@ BESS_ENGINE_DELETE_HOST ... An Initial host state on host_1 should be raised before we can start our external commands. Kindly Stop Broker True Start Broker True - engine_config_remove_service_host ${0} host_16 - engine_config_remove_host ${0} host_16 + Engine Config Remove Service Host ${0} host_16 + Engine Config Remove Host ${0} host_16 Reload Engine Sleep 2s Kindly Stop Broker True @@ -416,7 +416,7 @@ BESSBQ1 Broker Config Log central core debug Config Broker Sql Output central unified_sql Clear Retention - Create bad queue central-broker-master.queue.central-broker-master-sql + Create Bad Queue central-broker-master.queue.central-broker-master-sql ${start} Get Current Date Start Broker Start Engine @@ -439,10 +439,10 @@ Start_Stop_Engine_Broker_${id} Broker Config Log central processing info Config Broker Sql Output central unified_sql IF ${grpc} - Change Broker tcp output to grpc central - Change Broker tcp output to grpc module0 - Change Broker tcp input to grpc central - Change Broker tcp input to grpc rrd + Change Broker Tcp Output To Grpc central + Change Broker Tcp Output To Grpc module0 + Change Broker Tcp Input To Grpc central + Change Broker Tcp Input To Grpc rrd END ${start} Get Current Date Start Broker @@ -474,10 +474,10 @@ Start_Stop_Broker_Engine_${id} Broker Config Flush Log central 0 Broker Config Log central core debug IF ${grpc} - Change Broker tcp output to grpc central - Change Broker tcp output to grpc module0 - Change Broker tcp input to grpc central - Change Broker tcp input to grpc rrd + Change Broker Tcp Output To Grpc central + Change Broker Tcp Output To Grpc module0 + Change Broker Tcp Input To Grpc central + Change Broker Tcp Input To Grpc rrd END ${start} Get Current Date diff --git a/tests/broker-engine/tags.robot b/tests/broker-engine/tags.robot index b77a0273309..b84328d2809 100644 --- a/tests/broker-engine/tags.robot +++ b/tests/broker-engine/tags.robot @@ -13,7 +13,7 @@ Library ../resources/specific-duplication.py Suite Setup Clean Before Suite Suite Teardown Clean After Suite Test Setup Init Test -Test Teardown Save logs If Failed +Test Teardown Save Logs If Failed *** Test Cases *** @@ -189,7 +189,7 @@ BEUTAG3 BEUTAG4 [Documentation] Engine is configured with some tags. Group tags tag9, tag13 are set to services 1 and 3. Category tags tag3 and tag11 are added to services 1, 3, 5 and 6. The centreon_storage.resources and resources_tags tables are well filled. [Tags] broker engine protobuf bbdo tags unified_sql - # Clear DB tags + # Clear Db tags Config Engine ${1} Create Tags File ${0} ${20} Config Engine Add Cfg File ${0} tags.cfg @@ -229,7 +229,7 @@ BEUTAG4 BEUTAG5 [Documentation] Engine is configured with some tags. Group tags tag2, tag6 are set to hosts 1 and 2. Category tags tag4 and tag8 are added to hosts 2, 3, 4. The resources and resources_tags tables are well filled. [Tags] broker engine protobuf bbdo tags - # Clear DB tags + # Clear Db tags Config Engine ${1} Create Tags File ${0} ${20} Config Engine Add Cfg File ${0} tags.cfg @@ -269,7 +269,7 @@ BEUTAG5 BEUTAG6 [Documentation] Engine is configured with some tags. When broker receives them, it stores them in the centreon_storage.resources_tags table. Engine is started before. [Tags] broker engine protobuf bbdo tags - # Clear DB tags + # Clear Db tags Config Engine ${1} Create Tags File ${0} ${20} Config Engine Add Cfg File ${0} tags.cfg @@ -653,7 +653,7 @@ BEUTAG11 BEUTAG12 [Documentation] Engine is configured with some tags. Group tags tag2, tag6 are set to hosts 1 and 2. Category tags tag4 and tag8 are added to hosts 2, 3, 4. The resources and resources_tags tables are well filled. The tag6 and tag8 are removed and resources_tags is also well updated. [Tags] broker engine protobuf bbdo tags - # Clear DB tags + # Clear Db tags Config Engine ${1} Create Tags File ${0} ${20} Config Engine Add Cfg File ${0} tags.cfg diff --git a/tests/broker-engine/tls.robot b/tests/broker-engine/tls.robot index 18586ff887c..e564cc7d80e 100644 --- a/tests/broker-engine/tls.robot +++ b/tests/broker-engine/tls.robot @@ -13,7 +13,7 @@ Library ../resources/Common.py Suite Setup Clean Before Suite Suite Teardown Clean After Suite Test Setup Stop Processes -Test Teardown Save logs If Failed +Test Teardown Save Logs If Failed *** Variables *** @@ -33,8 +33,8 @@ BECT1 Log To Console TLS set to ${comp1} on central and to ${comp2} on module Config Broker central Config Broker module - Broker Config Input set central central-broker-master-input tls ${comp1} - Broker Config Output set module0 central-module-master-output tls ${comp2} + Broker Config Input Set central central-broker-master-input tls ${comp1} + Broker Config Output Set module0 central-module-master-output tls ${comp2} Broker Config Log central bbdo info Broker Config Log module0 bbdo info ${start} Get Current Date @@ -82,32 +82,32 @@ BECT2 ... ${EtcRoot}/centreon-broker/client.key ... ${EtcRoot}/centreon-broker/client.crt - Broker Config Input set + Broker Config Input Set ... central ... central-broker-master-input ... private_key ... ${EtcRoot}/centreon-broker/client.key - Broker Config Input set + Broker Config Input Set ... central ... central-broker-master-input ... public_cert ... ${EtcRoot}/centreon-broker/client.crt - Broker Config Input set + Broker Config Input Set ... central ... central-broker-master-input ... ca_certificate ... ${EtcRoot}/centreon-broker/server.crt - Broker Config Output set + Broker Config Output Set ... module0 ... central-module-master-output ... private_key ... ${EtcRoot}/centreon-broker/server.key - Broker Config Output set + Broker Config Output Set ... module0 ... central-module-master-output ... public_cert ... ${EtcRoot}/centreon-broker/server.crt - Broker Config Output set + Broker Config Output Set ... module0 ... central-module-master-output ... ca_certificate @@ -116,8 +116,8 @@ BECT2 Broker Config Log module0 tls debug Broker Config Log central bbdo info Broker Config Log module0 bbdo info - Broker Config Input set central central-broker-master-input tls yes - Broker Config Output set module0 central-module-master-output tls yes + Broker Config Input Set central central-broker-master-input tls yes + Broker Config Output Set module0 central-module-master-output tls yes ${start} Get Current Date Start Broker Start Engine @@ -146,12 +146,12 @@ BECT3 Create Certificate ${hostname} ${EtcRoot}/centreon-broker/server.crt Create Certificate ${hostname} ${EtcRoot}/centreon-broker/client.crt - Broker Config Input set + Broker Config Input Set ... central ... central-broker-master-input ... ca_certificate ... ${EtcRoot}/centreon-broker/server.crt - Broker Config Output set + Broker Config Output Set ... module0 ... central-module-master-output ... ca_certificate @@ -160,8 +160,8 @@ BECT3 Broker Config Log module0 tls debug Broker Config Log central bbdo info Broker Config Log module0 bbdo info - Broker Config Input set central central-broker-master-input tls yes - Broker Config Output set module0 central-module-master-output tls yes + Broker Config Input Set central central-broker-master-input tls yes + Broker Config Output Set module0 central-module-master-output tls yes # We get the current date just before starting broker ${start} Get Current Date Start Broker @@ -199,12 +199,12 @@ BECT4 ... ${EtcRoot}/centreon-broker/client.key ... ${EtcRoot}/centreon-broker/client.crt - Broker Config Input set + Broker Config Input Set ... central ... central-broker-master-input ... ca_certificate ... ${EtcRoot}/centreon-broker/server.crt - Broker Config Output set + Broker Config Output Set ... module0 ... central-module-master-output ... ca_certificate @@ -213,35 +213,35 @@ BECT4 Broker Config Log module0 tls debug Broker Config Log central bbdo info Broker Config Log module0 bbdo info - Broker Config Input set central central-broker-master-input tls yes - Broker Config Input set + Broker Config Input Set central central-broker-master-input tls yes + Broker Config Input Set ... central ... central-broker-master-input ... private_key ... ${EtcRoot}/centreon-broker/client.key - Broker Config Input set + Broker Config Input Set ... central ... central-broker-master-input ... public_cert ... ${EtcRoot}/centreon-broker/client.crt - Broker Config Input set + Broker Config Input Set ... central ... central-broker-master-input ... ca_certificate ... ${EtcRoot}/centreon-broker/server.crt - Broker Config Input set central central-broker-master-input tls_hostname centreon - Broker Config Output set module0 central-module-master-output tls yes - Broker Config Output set + Broker Config Input Set central central-broker-master-input tls_hostname centreon + Broker Config Output Set module0 central-module-master-output tls yes + Broker Config Output Set ... module0 ... central-module-master-output ... private_key ... ${EtcRoot}/centreon-broker/server.key - Broker Config Output set + Broker Config Output Set ... module0 ... central-module-master-output ... public_cert ... ${EtcRoot}/centreon-broker/server.crt - Broker Config Output set + Broker Config Output Set ... module0 ... central-module-master-output ... ca_certificate @@ -275,14 +275,14 @@ BECT_GRPC1 Log To Console TLS set to ${comp1} on central and to ${comp2} on module Config Broker central Config Broker module - Broker Config Input set central central-broker-master-input tls ${comp1} - Broker Config Output set module0 central-module-master-output tls ${comp2} + Broker Config Input Set central central-broker-master-input tls ${comp1} + Broker Config Output Set module0 central-module-master-output tls ${comp2} Broker Config Log central bbdo info Broker Config Log module0 bbdo info Broker Config Log central grpc debug Broker Config Log module0 grpc debug - Change Broker tcp output to grpc module0 - Change Broker tcp input to grpc central + Change Broker Tcp Output To Grpc module0 + Change Broker Tcp Input To Grpc central ${start} Get Current Date Start Broker Start Engine @@ -327,32 +327,32 @@ BECT_GRPC2 ... ${EtcRoot}/centreon-broker/client.key ... ${EtcRoot}/centreon-broker/client.crt - Broker Config Input set + Broker Config Input Set ... central ... central-broker-master-input ... private_key ... ${EtcRoot}/centreon-broker/client.key - Broker Config Input set + Broker Config Input Set ... central ... central-broker-master-input ... public_cert ... ${EtcRoot}/centreon-broker/client.crt - Broker Config Input set + Broker Config Input Set ... central ... central-broker-master-input ... ca_certificate ... ${EtcRoot}/centreon-broker/server.crt - Broker Config Output set + Broker Config Output Set ... module0 ... central-module-master-output ... private_key ... ${EtcRoot}/centreon-broker/server.key - Broker Config Output set + Broker Config Output Set ... module0 ... central-module-master-output ... public_cert ... ${EtcRoot}/centreon-broker/server.crt - Broker Config Output set + Broker Config Output Set ... module0 ... central-module-master-output ... ca_certificate @@ -361,10 +361,10 @@ BECT_GRPC2 Broker Config Log module0 tls debug Broker Config Log central bbdo info Broker Config Log module0 bbdo info - Broker Config Input set central central-broker-master-input tls yes - Broker Config Output set module0 central-module-master-output tls yes - Change Broker tcp output to grpc module0 - Change Broker tcp input to grpc central + Broker Config Input Set central central-broker-master-input tls yes + Broker Config Output Set module0 central-module-master-output tls yes + Change Broker Tcp Output To Grpc module0 + Change Broker Tcp Input To Grpc central ${start} Get Current Date Start Broker Start Engine @@ -395,12 +395,12 @@ BECT_GRPC3 Create Certificate ${hostname} ${EtcRoot}/centreon-broker/server.crt Create Certificate ${hostname} ${EtcRoot}/centreon-broker/client.crt - Broker Config Input set + Broker Config Input Set ... central ... central-broker-master-input ... ca_certificate ... ${EtcRoot}/centreon-broker/server.crt - Broker Config Output set + Broker Config Output Set ... module0 ... central-module-master-output ... ca_certificate @@ -409,10 +409,10 @@ BECT_GRPC3 Broker Config Log module0 tls debug Broker Config Log central bbdo info Broker Config Log module0 bbdo info - Change Broker tcp output to grpc module0 - Change Broker tcp input to grpc central - Broker Config Input set central central-broker-master-input tls yes - Broker Config Output set module0 central-module-master-output tls yes + Change Broker Tcp Output To Grpc module0 + Change Broker Tcp Input To Grpc central + Broker Config Input Set central central-broker-master-input tls yes + Broker Config Output Set module0 central-module-master-output tls yes # We get the current date just before starting broker ${start} Get Current Date Start Broker @@ -450,12 +450,12 @@ BECT_GRPC4 ... ${EtcRoot}/centreon-broker/client.key ... ${EtcRoot}/centreon-broker/client.crt - Broker Config Input set + Broker Config Input Set ... central ... central-broker-master-input ... ca_certificate ... ${EtcRoot}/centreon-broker/server.crt - Broker Config Output set + Broker Config Output Set ... module0 ... central-module-master-output ... ca_certificate @@ -464,37 +464,37 @@ BECT_GRPC4 Broker Config Log module0 tls debug Broker Config Log central bbdo info Broker Config Log module0 bbdo info - Change Broker tcp output to grpc module0 - Change Broker tcp input to grpc central - Broker Config Input set central central-broker-master-input tls yes - Broker Config Input set + Change Broker Tcp Output To Grpc module0 + Change Broker Tcp Input To Grpc central + Broker Config Input Set central central-broker-master-input tls yes + Broker Config Input Set ... central ... central-broker-master-input ... private_key ... ${EtcRoot}/centreon-broker/client.key - Broker Config Input set + Broker Config Input Set ... central ... central-broker-master-input ... public_cert ... ${EtcRoot}/centreon-broker/client.crt - Broker Config Input set + Broker Config Input Set ... central ... central-broker-master-input ... ca_certificate ... ${EtcRoot}/centreon-broker/server.crt - Broker Config Input set central central-broker-master-input tls_hostname centreon - Broker Config Output set module0 central-module-master-output tls yes - Broker Config Output set + Broker Config Input Set central central-broker-master-input tls_hostname centreon + Broker Config Output Set module0 central-module-master-output tls yes + Broker Config Output Set ... module0 ... central-module-master-output ... private_key ... ${EtcRoot}/centreon-broker/server.key - Broker Config Output set + Broker Config Output Set ... module0 ... central-module-master-output ... public_cert ... ${EtcRoot}/centreon-broker/server.crt - Broker Config Output set + Broker Config Output Set ... module0 ... central-module-master-output ... ca_certificate diff --git a/tests/broker-engine/victoria.robot b/tests/broker-engine/victoria.robot index 45f84c79b61..2bf7d70d402 100644 --- a/tests/broker-engine/victoria.robot +++ b/tests/broker-engine/victoria.robot @@ -14,7 +14,7 @@ Library ../resources/Common.py Suite Setup Clean Before Suite Suite Teardown Clean After Suite Test Setup Stop Processes -Test Teardown Save logs If Failed +Test Teardown Save Logs If Failed *** Test Cases *** diff --git a/tests/broker/bbdo-server-client-reversed.robot b/tests/broker/bbdo-server-client-reversed.robot index 3d81bbc3892..3f38ef69562 100644 --- a/tests/broker/bbdo-server-client-reversed.robot +++ b/tests/broker/bbdo-server-client-reversed.robot @@ -10,7 +10,7 @@ Library ../resources/Broker.py Suite Setup Prepare Suite Suite Teardown Clean After Suite Test Setup Stop Processes -Test Teardown Save logs If Failed +Test Teardown Save Logs If Failed *** Test Cases *** @@ -32,7 +32,7 @@ BSCSSRR1 Config Broker rrd Config Broker BBDO Input central bbdo_server 5669 tcp Config Broker BBDO Output central bbdo_server 5670 tcp - Broker Config Output set central central-broker-master-output retention yes + Broker Config Output Set central central-broker-master-output retention yes Config Broker BBDO Input rrd bbdo_client 5670 tcp localhost Broker Config Log central config debug ${start} Get Round Current Date @@ -49,7 +49,7 @@ BSCSSPRR1 Config Broker BBDO Input central bbdo_server 5669 tcp Config Broker BBDO Output central bbdo_server 5670 tcp localhost Config Broker BBDO Input rrd bbdo_client 5670 tcp localhost - Broker Config Output set central central-broker-master-output retention yes + Broker Config Output Set central central-broker-master-output retention yes Broker Config Log central config info Repeat Keyword 5 times Start Stop Service 0 @@ -59,7 +59,7 @@ BSCSSRR2 Config Broker central Config Broker BBDO Input central bbdo_client 5669 tcp localhost Config Broker BBDO Output central bbdo_server 5670 tcp - Broker Config Output set central central-broker-master-output retention yes + Broker Config Output Set central central-broker-master-output retention yes Repeat Keyword 10 times Start Stop Instance 300ms BSCSSGRR1 @@ -69,7 +69,7 @@ BSCSSGRR1 Config Broker rrd Config Broker BBDO Input central bbdo_server 5669 grpc localhost Config Broker BBDO Output central bbdo_server 5670 grpc - Broker Config Output set central central-broker-master-output retention yes + Broker Config Output Set central central-broker-master-output retention yes Config Broker BBDO Input rrd bbdo_client 5670 grpc localhost Broker Config Log central config info ${start} Get Round Current Date @@ -87,9 +87,9 @@ BSCSSTRR1 Config Broker rrd Config Broker BBDO Output central bbdo_server 5670 tcp Config Broker BBDO Input rrd bbdo_client 5670 tcp localhost - Broker Config Output set central central-broker-master-output encryption yes - Broker Config Output set central central-broker-master-output retention yes - Broker Config Input set rrd rrd-broker-master-input encryption yes + Broker Config Output Set central central-broker-master-output encryption yes + Broker Config Output Set central central-broker-master-output retention yes + Broker Config Input Set rrd rrd-broker-master-input encryption yes Broker Config Log central config off Broker Config Log central core off Broker Config Log central tls debug @@ -106,29 +106,29 @@ BSCSSTRR2 Config Broker rrd Config Broker BBDO Output central bbdo_server 5670 tcp Config Broker BBDO Input rrd bbdo_client 5670 tcp localhost - Broker Config Output set central central-broker-master-output encryption yes - Broker Config Output set central central-broker-master-output retention yes - Broker Config Input set rrd rrd-broker-master-input encryption yes + Broker Config Output Set central central-broker-master-output encryption yes + Broker Config Output Set central central-broker-master-output retention yes + Broker Config Input Set rrd rrd-broker-master-input encryption yes Broker Config Log central config off Broker Config Log central core off Broker Config Log central tls debug - Broker Config Output set + Broker Config Output Set ... central ... central-broker-master-output ... private_key ... ${EtcRoot}/centreon-broker/server.key - Broker Config Output set + Broker Config Output Set ... central ... central-broker-master-output ... certificate ... ${EtcRoot}/centreon-broker/server.crt - Broker Config Output set + Broker Config Output Set ... central ... central-broker-master-output ... ca_certificate ... ${EtcRoot}/centreon-broker/client.crt - Broker Config Input set rrd rrd-broker-master-input private_key ${EtcRoot}/centreon-broker/client.key - Broker Config Input set rrd rrd-broker-master-input certificate ${EtcRoot}/centreon-broker/client.crt + Broker Config Input Set rrd rrd-broker-master-input private_key ${EtcRoot}/centreon-broker/client.key + Broker Config Input Set rrd rrd-broker-master-input certificate ${EtcRoot}/centreon-broker/client.crt ${start} Get Round Current Date Repeat Keyword 5 times Start Stop Service 0 ${content} Create List TLS: successful handshake @@ -142,9 +142,9 @@ BSCSSTGRR2 Config Broker rrd Config Broker BBDO Output central bbdo_server 5670 grpc Config Broker BBDO Input rrd bbdo_client 5670 grpc localhost - Broker Config Output set central central-broker-master-output encryption yes - Broker Config Output set central central-broker-master-output retention yes - Broker Config Input set rrd rrd-broker-master-input encryption yes + Broker Config Output Set central central-broker-master-output encryption yes + Broker Config Output Set central central-broker-master-output retention yes + Broker Config Input Set rrd rrd-broker-master-input encryption yes Broker Config Flush Log central 0 Broker Config Flush Log rrd 0 Broker Config Log central config off @@ -161,19 +161,19 @@ BSCSSTGRR2 ... ${EtcRoot}/centreon-broker/client.key ... ${EtcRoot}/centreon-broker/client.crt - Broker Config Output set + Broker Config Output Set ... central ... central-broker-master-output ... private_key ... ${EtcRoot}/centreon-broker/server.key - Broker Config Output set + Broker Config Output Set ... central ... central-broker-master-output ... certificate ... ${EtcRoot}/centreon-broker/server.crt - Broker Config Input set rrd rrd-broker-master-input private_key ${EtcRoot}/centreon-broker/client.key - Broker Config Input set rrd rrd-broker-master-input certificate ${EtcRoot}/centreon-broker/client.crt - Broker Config Input set + Broker Config Input Set rrd rrd-broker-master-input private_key ${EtcRoot}/centreon-broker/client.key + Broker Config Input Set rrd rrd-broker-master-input certificate ${EtcRoot}/centreon-broker/client.crt + Broker Config Input Set ... rrd ... rrd-broker-master-input ... ca_certificate @@ -192,8 +192,8 @@ BSCSSCRR1 Config Broker rrd Config Broker BBDO Output central bbdo_server 5670 tcp Config Broker BBDO Input rrd bbdo_client 5670 tcp localhost - Broker Config Output set central central-broker-master-output compression yes - Broker Config Output set central central-broker-master-output retention yes + Broker Config Output Set central central-broker-master-output compression yes + Broker Config Output Set central central-broker-master-output retention yes Broker Config Log central config off Broker Config Log central core trace Broker Config Log rrd core trace @@ -212,8 +212,8 @@ BSCSSCRR2 Config Broker rrd Config Broker BBDO Output central bbdo_server 5670 tcp Config Broker BBDO Input rrd bbdo_client 5670 tcp localhost - Broker Config Output set central central-broker-master-output compression no - Broker Config Output set central central-broker-master-output retention yes + Broker Config Output Set central central-broker-master-output compression no + Broker Config Output Set central central-broker-master-output retention yes Broker Config Log central config off Broker Config Log central core off Broker Config Log rrd core trace @@ -233,8 +233,8 @@ BSCSSCGRR1 Config Broker rrd Config Broker BBDO Output central bbdo_server 5670 grpc Config Broker BBDO Input rrd bbdo_client 5670 grpc localhost - Broker Config Output set central central-broker-master-output compression yes - Broker Config Output set central central-broker-master-output retention yes + Broker Config Output Set central central-broker-master-output compression yes + Broker Config Output Set central central-broker-master-output retention yes Broker Config Log central config off Broker Config Log central core off Broker Config Log rrd core off @@ -255,8 +255,8 @@ BSCSSCGRR2 Config Broker rrd Config Broker BBDO Output central bbdo_server 5670 grpc Config Broker BBDO Input rrd bbdo_client 5670 grpc localhost - Broker Config Output set central central-broker-master-output compression no - Broker Config Output set central central-broker-master-output retention yes + Broker Config Output Set central central-broker-master-output compression no + Broker Config Output Set central central-broker-master-output retention yes Broker Config Log central config off Broker Config Log central core off Broker Config Log rrd core off diff --git a/tests/broker/bbdo-server-client.robot b/tests/broker/bbdo-server-client.robot index cb5232526ea..2fcb7ed584a 100644 --- a/tests/broker/bbdo-server-client.robot +++ b/tests/broker/bbdo-server-client.robot @@ -102,8 +102,8 @@ BSCSST1 Config Broker BBDO Input central bbdo_server 5669 tcp Config Broker BBDO Output central bbdo_client 5670 tcp localhost Config Broker BBDO Input rrd bbdo_server 5670 tcp - Broker Config Output set central central-broker-master-output encryption yes - Broker Config Input set rrd rrd-broker-master-input encryption yes + Broker Config Output Set central central-broker-master-output encryption yes + Broker Config Input Set rrd rrd-broker-master-input encryption yes Broker Config Log central config off Broker Config Log central core off Broker Config Log central tls debug @@ -121,28 +121,28 @@ BSCSST2 Config Broker BBDO Input central bbdo_server 5669 tcp Config Broker BBDO Output central bbdo_client 5670 tcp localhost Config Broker BBDO Input rrd bbdo_server 5670 tcp - Broker Config Output set central central-broker-master-output encryption yes - Broker Config Input set rrd rrd-broker-master-input encryption yes + Broker Config Output Set central central-broker-master-output encryption yes + Broker Config Input Set rrd rrd-broker-master-input encryption yes Broker Config Log central config off Broker Config Log central core off Broker Config Log central tls debug - Broker Config Output set + Broker Config Output Set ... central ... central-broker-master-output ... private_key ... ${EtcRoot}/centreon-broker/server.key - Broker Config Output set + Broker Config Output Set ... central ... central-broker-master-output ... certificate ... ${EtcRoot}/centreon-broker/server.crt - Broker Config Output set + Broker Config Output Set ... central ... central-broker-master-output ... ca_certificate ... ${EtcRoot}/centreon-broker/client.crt - Broker Config Input set rrd rrd-broker-master-input private_key ${EtcRoot}/centreon-broker/client.key - Broker Config Input set rrd rrd-broker-master-input certificate ${EtcRoot}/centreon-broker/client.crt + Broker Config Input Set rrd rrd-broker-master-input private_key ${EtcRoot}/centreon-broker/client.key + Broker Config Input Set rrd rrd-broker-master-input certificate ${EtcRoot}/centreon-broker/client.crt ${start} Get Current Date Repeat Keyword 5 times Start Stop Service 0 ${content} Create List TLS: successful handshake @@ -157,8 +157,8 @@ BSCSSTG1 Config Broker BBDO Input central bbdo_server 5669 gRPC Config Broker BBDO Output central bbdo_client 5670 gRPC localhost Config Broker BBDO Input rrd bbdo_server 5670 gRPC - Broker Config Output set central central-broker-master-output encryption yes - Broker Config Input set rrd rrd-broker-master-input encryption yes + Broker Config Output Set central central-broker-master-output encryption yes + Broker Config Input Set rrd rrd-broker-master-input encryption yes Broker Config Log central config off Broker Config Log central core off Broker Config Log rrd core off @@ -183,8 +183,8 @@ BSCSSTG2 Config Broker BBDO Input central bbdo_server 5669 grpc Config Broker BBDO Output central bbdo_client 5670 grpc localhost Config Broker BBDO Input rrd bbdo_server 5670 grpc - Broker Config Output set central central-broker-master-output encryption yes - Broker Config Input set rrd rrd-broker-master-input encryption yes + Broker Config Output Set central central-broker-master-output encryption yes + Broker Config Input Set rrd rrd-broker-master-input encryption yes Broker Config Log central config off Broker Config Log central core off Broker Config Log rrd core off @@ -200,23 +200,23 @@ BSCSSTG2 ... ${EtcRoot}/centreon-broker/client.key ... ${EtcRoot}/centreon-broker/client.crt - Broker Config Output set + Broker Config Output Set ... central ... central-broker-master-output ... private_key ... ${EtcRoot}/centreon-broker/server.key - Broker Config Output set + Broker Config Output Set ... central ... central-broker-master-output ... certificate ... ${EtcRoot}/centreon-broker/server.crt - Broker Config Output set + Broker Config Output Set ... central ... central-broker-master-output ... ca_certificate ... ${EtcRoot}/centreon-broker/client.crt - Broker Config Input set rrd rrd-broker-master-input private_key ${EtcRoot}/centreon-broker/client.key - Broker Config Input set rrd rrd-broker-master-input certificate ${EtcRoot}/centreon-broker/client.crt + Broker Config Input Set rrd rrd-broker-master-input private_key ${EtcRoot}/centreon-broker/client.key + Broker Config Input Set rrd rrd-broker-master-input certificate ${EtcRoot}/centreon-broker/client.crt ${start} Get Current Date Start Broker ${content} Create List encrypted connection write: buff: write done: buff: @@ -232,8 +232,8 @@ BSCSSTG3 Config Broker BBDO Input central bbdo_server 5669 grpc Config Broker BBDO Output central bbdo_client 5670 grpc localhost Config Broker BBDO Input rrd bbdo_server 5670 grpc - Broker Config Output set central central-broker-master-output encryption yes - Broker Config Input set rrd rrd-broker-master-input encryption yes + Broker Config Output Set central central-broker-master-output encryption yes + Broker Config Input Set rrd rrd-broker-master-input encryption yes Broker Config Log central config off Broker Config Log central core off Broker Config Log rrd core off @@ -249,27 +249,27 @@ BSCSSTG3 ... ${EtcRoot}/centreon-broker/client.key ... ${EtcRoot}/centreon-broker/client.crt - Broker Config Output set + Broker Config Output Set ... central ... central-broker-master-output ... private_key ... ${EtcRoot}/centreon-broker/server.key - Broker Config Output set + Broker Config Output Set ... central ... central-broker-master-output ... certificate ... ${EtcRoot}/centreon-broker/server.crt - Broker Config Output set + Broker Config Output Set ... central ... central-broker-master-output ... ca_certificate ... ${EtcRoot}/centreon-broker/client.crt - Broker Config Input set + Broker Config Input Set ... rrd ... rrd-broker-master-input ... private_key ... ${EtcRoot}/centreon-broker/missing-client.key - Broker Config Input set rrd rrd-broker-master-input certificate ${EtcRoot}/centreon-broker/client.crt + Broker Config Input Set rrd rrd-broker-master-input certificate ${EtcRoot}/centreon-broker/client.crt ${start} Get Current Date Start Broker ${content} Create List @@ -285,7 +285,7 @@ BSCSSC1 Config Broker BBDO Input central bbdo_server 5669 tcp Config Broker BBDO Output central bbdo_client 5670 tcp localhost Config Broker BBDO Input rrd bbdo_server 5670 tcp - Broker Config Output set central central-broker-master-output compression yes + Broker Config Output Set central central-broker-master-output compression yes Broker Config Log central config off Broker Config Log central core trace Broker Config Log rrd core trace @@ -305,7 +305,7 @@ BSCSSC2 Config Broker BBDO Input central bbdo_server 5669 tcp Config Broker BBDO Output central bbdo_client 5670 tcp localhost Config Broker BBDO Input rrd bbdo_server 5670 tcp - Broker Config Output set central central-broker-master-output compression no + Broker Config Output Set central central-broker-master-output compression no Broker Config Log central config off Broker Config Log central core off Broker Config Log rrd core trace @@ -326,7 +326,7 @@ BSCSSCG1 Config Broker BBDO Input central bbdo_server 5669 grpc Config Broker BBDO Output central bbdo_client 5670 grpc localhost Config Broker BBDO Input rrd bbdo_server 5670 grpc - Broker Config Output set central central-broker-master-output compression yes + Broker Config Output Set central central-broker-master-output compression yes Broker Config Log central config off Broker Config Log central core trace Broker Config Log rrd core off @@ -349,7 +349,7 @@ BSCSSGA1 Config Broker BBDO Input central bbdo_server 5669 grpc Config Broker BBDO Output central bbdo_client 5670 grpc localhost Config Broker BBDO Input rrd bbdo_server 5670 grpc - Broker Config input set rrd rrd-broker-master-input authorization titus + Broker Config Input Set rrd rrd-broker-master-input authorization titus Broker Config Log central config off Broker Config Log central core off Broker Config Log rrd core off @@ -372,8 +372,8 @@ BSCSSGA2 Config Broker BBDO Input central bbdo_server 5669 grpc Config Broker BBDO Output central bbdo_client 5670 grpc localhost Config Broker BBDO Input rrd bbdo_server 5670 grpc - Broker Config input set rrd rrd-broker-master-input authorization titus - Broker Config output set central central-broker-master-output authorization titus + Broker Config Input Set rrd rrd-broker-master-input authorization titus + Broker Config Output Set central central-broker-master-output authorization titus Broker Config Log central config trace Broker Config Log central core trace Broker Config Log rrd core off diff --git a/tests/broker/command-line.robot b/tests/broker/command-line.robot index 443654707e6..ed2e0299319 100644 --- a/tests/broker/command-line.robot +++ b/tests/broker/command-line.robot @@ -20,7 +20,7 @@ BCL1 Start Broker With Args -s foobar ${result} Wait For Broker ${expected} Evaluate "The option -s expects a positive integer" in """${result}""" - Should be True ${expected} expected error 'The option -s expects a positive integer' + Should Be True ${expected} expected error 'The option -s expects a positive integer' BCL2 [Documentation] Starting broker with option '-s5' should work @@ -31,7 +31,7 @@ BCL2 Start Broker With Args -s5 ${EtcRoot}/centreon-broker/central-broker.json ${table} Create List Starting the TCP thread pool of 5 threads ${logger_res} Find In Log With Timeout ${centralLog} ${start} ${table} 30 - Should be True + Should Be True ... ${logger_res} ... Didn't found 5 threads in ${VarRoot}/log/centreon-broker/central-broker-master.log Stop Broker With Args @@ -45,7 +45,7 @@ BCL3 Start Broker With Args -D ${EtcRoot}/centreon-broker/central-broker.json ${result} Wait For Broker ${expected} Evaluate "diagnostic:" in """${result}""" - Should be True ${expected} diagnostic mode didn't launch + Should Be True ${expected} diagnostic mode didn't launch BCL4 [Documentation] Starting broker with options '-s2' and '-D' should work. @@ -54,13 +54,13 @@ BCL4 Start Broker With Args -s2 -D ${EtcRoot}/centreon-broker/central-broker.json ${result} Wait For Broker ${expected} Evaluate "diagnostic:" in """${result}""" - Should be True ${expected} diagnostic mode didn't launch + Should Be True ${expected} diagnostic mode didn't launch *** Keywords *** Start Broker With Args [Arguments] @{options} - log to console @{options} + Log To Console @{options} Start Process /usr/sbin/cbd @{options} alias=b1 stdout=/tmp/output.txt Wait For broker diff --git a/tests/broker/grpc-stream.robot b/tests/broker/grpc-stream.robot index 5dfbaac453e..12110ad4561 100644 --- a/tests/broker/grpc-stream.robot +++ b/tests/broker/grpc-stream.robot @@ -9,7 +9,7 @@ Library ../resources/Broker.py Suite Setup Clean Before Suite Suite Teardown Clean After Suite Test Setup Stop Processes -Test Teardown Save logs If Failed +Test Teardown Save Logs If Failed *** Test Cases *** @@ -18,36 +18,36 @@ BGRPCSS1 [Tags] broker start-stop grpc Config Broker central Config Broker rrd - Change Broker tcp output to grpc central - Change Broker tcp input to grpc rrd + Change Broker Tcp Output To Grpc central + Change Broker Tcp Input To Grpc rrd Repeat Keyword 5 times Start Stop Service 100ms BGRPCSS2 [Documentation] Start/Stop 10 times broker configured with grpc stream with 300ms interval and no coredump [Tags] broker start-stop grpc Config Broker central - Change Broker tcp output to grpc central + Change Broker Tcp Output To Grpc central Repeat Keyword 10 times Start Stop Instance 300ms BGRPCSS3 [Documentation] Start-Stop one instance of broker configured with grpc stream and no coredump [Tags] broker start-stop grpc Config Broker central - Change Broker tcp output to grpc central + Change Broker Tcp Output To Grpc central Repeat Keyword 5 times Start Stop Instance 100ms BGRPCSS4 [Documentation] Start/Stop 10 times broker configured with grpc stream with 1sec interval and no coredump [Tags] broker start-stop grpc Config Broker central - Change Broker tcp output to grpc central + Change Broker Tcp Output To Grpc central Repeat Keyword 10 times Start Stop Instance 1s BGRPCSS5 [Documentation] Start-Stop with reversed connection on grpc acceptor with only one instance and no deadlock [Tags] broker start-stop grpc Config Broker central - Change Broker tcp output to grpc central + Change Broker Tcp Output To Grpc central Broker Config Output Set central centreon-broker-master-rrd one_peer_retention_mode yes Broker Config Output Remove central centreon-broker-master-rrd host Repeat Keyword 5 times Start Stop Instance 1s @@ -58,8 +58,8 @@ BGRPCSSU1 Config Broker central Config Broker rrd Config Broker Sql Output central unified_sql - Change Broker tcp output to grpc central - Change Broker tcp input to grpc rrd + Change Broker Tcp Output To Grpc central + Change Broker Tcp Input To Grpc rrd Repeat Keyword 5 times Start Stop Service 100ms BGRPCSSU2 @@ -67,14 +67,14 @@ BGRPCSSU2 [Tags] broker start-stop unified_sql grpc Config Broker central Config Broker Sql Output central unified_sql - Change Broker tcp output to grpc central + Change Broker Tcp Output To Grpc central Repeat Keyword 10 times Start Stop Instance 300ms BGRPCSSU3 [Documentation] Start-Stop with unified_sql one instance of broker configured with grpc and no coredump [Tags] broker start-stop unified_sql grpc Config Broker central - Change Broker tcp output to grpc central + Change Broker Tcp Output To Grpc central Config Broker Sql Output central unified_sql Repeat Keyword 5 times Start Stop Instance 100ms @@ -82,7 +82,7 @@ BGRPCSSU4 [Documentation] Start/Stop with unified_sql 10 times broker configured with grpc stream with 1sec interval and no coredump [Tags] broker start-stop unified_sql grpc Config Broker central - Change Broker tcp output to grpc central + Change Broker Tcp Output To Grpc central Config Broker Sql Output central unified_sql Repeat Keyword 10 times Start Stop Instance 1s @@ -93,7 +93,7 @@ BGRPCSSU5 Config Broker Sql Output central unified_sql Broker Config Output Set central centreon-broker-master-rrd one_peer_retention_mode yes Broker Config Output Remove central centreon-broker-master-rrd host - Change Broker tcp output to grpc central + Change Broker Tcp Output To Grpc central Repeat Keyword 5 times Start Stop Instance 1s diff --git a/tests/broker/sql.robot b/tests/broker/sql.robot index d8cfc11a704..8cc3180504f 100644 --- a/tests/broker/sql.robot +++ b/tests/broker/sql.robot @@ -21,7 +21,7 @@ BDB1 Config Broker central Config Broker rrd Config Broker module - Broker Config Output set central central-broker-master-sql db_name centreon + Broker Config Output Set central central-broker-master-sql db_name centreon FOR ${i} IN RANGE 0 5 ${start} Get Current Date Start Broker @@ -40,7 +40,7 @@ BDB2 Broker Config Log central sql info Config Broker rrd Config Broker module - Broker Config Output set central central-broker-master-perfdata db_name centreon + Broker Config Output Set central central-broker-master-perfdata db_name centreon FOR ${i} IN RANGE 0 5 ${start} Get Current Date Start Broker @@ -58,7 +58,7 @@ BDB3 Config Broker central Config Broker rrd Config Broker module - Broker Config Output set central central-broker-master-sql db_name centreon1 + Broker Config Output Set central central-broker-master-sql db_name centreon1 FOR ${i} IN RANGE 0 5 ${start} Get Current Date Start Broker @@ -74,8 +74,8 @@ BDB4 Config Broker central Config Broker rrd Config Broker module - Broker Config Output set central central-broker-master-perfdata db_name centreon1 - Broker Config Output set central central-broker-master-sql db_name centreon1 + Broker Config Output Set central central-broker-master-perfdata db_name centreon1 + Broker Config Output Set central central-broker-master-sql db_name centreon1 FOR ${i} IN RANGE 0 5 ${start} Get Current Date Start Broker @@ -93,8 +93,8 @@ BDB5 Config Broker central Config Broker rrd Config Broker module - Broker Config Output set central central-broker-master-perfdata db_host 1.2.3.4 - Broker Config Output set central central-broker-master-sql db_host 1.2.3.4 + Broker Config Output Set central central-broker-master-perfdata db_host 1.2.3.4 + Broker Config Output Set central central-broker-master-sql db_host 1.2.3.4 FOR ${i} IN RANGE 0 5 ${start} Get Current Date Start Broker @@ -110,7 +110,7 @@ BDB6 Config Broker central Config Broker rrd Config Broker module - Broker Config Output set central central-broker-master-sql db_host 1.2.3.4 + Broker Config Output Set central central-broker-master-sql db_host 1.2.3.4 FOR ${i} IN RANGE 0 5 ${start} Get Current Date Start Broker @@ -126,8 +126,8 @@ BDB7 Config Broker central Config Broker rrd Config Broker module - Broker Config Output set central central-broker-master-sql db_password centreon1 - Broker Config Output set central central-broker-master-perfdata db_password centreon1 + Broker Config Output Set central central-broker-master-sql db_password centreon1 + Broker Config Output Set central central-broker-master-perfdata db_password centreon1 ${start} Get Current Date Start Broker ${content} Create List mysql_connection: error while starting connection @@ -141,8 +141,8 @@ BDB8 Config Broker central Config Broker rrd Config Broker module - Broker Config Output set central central-broker-master-perfdata db_password centreon1 - Broker Config Output set central central-broker-master-sql db_password centreon1 + Broker Config Output Set central central-broker-master-perfdata db_password centreon1 + Broker Config Output Set central central-broker-master-sql db_password centreon1 ${start} Get Current Date Start Broker ${content} Create List mysql_connection: error while starting connection @@ -156,7 +156,7 @@ BDB9 Config Broker central Config Broker rrd Config Broker module - Broker Config Output set central central-broker-master-sql db_password centreon1 + Broker Config Output Set central central-broker-master-sql db_password centreon1 ${start} Get Current Date Start Broker ${content} Create List mysql_connection: error while starting connection @@ -262,8 +262,8 @@ BDBM1 @{lst} Create List 1 6 FOR ${c} IN @{lst} Config Broker central - Broker Config Output set central central-broker-master-sql connections_count ${c} - Broker Config Output set central central-broker-master-perfdata connections_count ${c} + Broker Config Output Set central central-broker-master-sql connections_count ${c} + Broker Config Output Set central central-broker-master-perfdata connections_count ${c} Config Broker rrd Config Broker module Config Engine ${1} @@ -291,7 +291,7 @@ BDBU1 Config Broker rrd Config Broker module # We replace the usual centreon_storage database by centreon to make the wanted error - Broker Config Output set central central-broker-unified-sql db_name centreon + Broker Config Output Set central central-broker-unified-sql db_name centreon Broker Config Log central sql trace Broker Config Flush Log central 0 FOR ${i} IN RANGE 0 5 @@ -310,7 +310,7 @@ BDBU3 Config Broker Sql Output central unified_sql Config Broker rrd Config Broker module - Broker Config Output set central central-broker-unified-sql db_name centreon1 + Broker Config Output Set central central-broker-unified-sql db_name centreon1 FOR ${i} IN RANGE 0 5 ${start} Get Current Date Start Broker @@ -327,7 +327,7 @@ BDBU5 Config Broker Sql Output central unified_sql Config Broker rrd Config Broker module - Broker Config Output set central central-broker-unified-sql db_host 1.2.3.4 + Broker Config Output Set central central-broker-unified-sql db_host 1.2.3.4 FOR ${i} IN RANGE 0 5 ${start} Get Current Date Start Broker @@ -344,7 +344,7 @@ BDBU7 Config Broker Sql Output central unified_sql Config Broker rrd Config Broker module - Broker Config Output set central central-broker-unified-sql db_password centreon1 + Broker Config Output Set central central-broker-unified-sql db_password centreon1 ${start} Get Current Date Start Broker ${content} Create List mysql_connection: error while starting connection @@ -375,8 +375,8 @@ BDBMU1 FOR ${c} IN @{lst} Config Broker central Config Broker Sql Output central unified_sql - Broker Config Output set central central-broker-unified-sql connections_count ${c} - Broker Config Output set central central-broker-unified-sql retry_interval 5 + Broker Config Output Set central central-broker-unified-sql connections_count ${c} + Broker Config Output Set central central-broker-unified-sql retry_interval 5 Config Broker rrd Config Broker module Config Engine ${1} diff --git a/tests/ccc/ccc.robot b/tests/ccc/ccc.robot index f9f7bd71f96..8ae9296dda7 100644 --- a/tests/ccc/ccc.robot +++ b/tests/ccc/ccc.robot @@ -36,7 +36,7 @@ BECCC1 IF len("${content.strip()}") > 0 BREAK Sleep 1s END - should be equal as strings ${content.strip()} You must specify a port for the connection to the gRPC server + Should Be Equal As Strings ${content.strip()} You must specify a port for the connection to the gRPC server Stop Engine Kindly Stop Broker Remove File /tmp/output.txt diff --git a/tests/connector_perl/connector_perl.robot b/tests/connector_perl/connector_perl.robot index b83864b77c2..00a710e60e2 100644 --- a/tests/connector_perl/connector_perl.robot +++ b/tests/connector_perl/connector_perl.robot @@ -14,7 +14,7 @@ Suite Teardown Stop engine test use connector perl exist script [Documentation] test exist script [Tags] connector engine - schedule forced host check local_host_test_machine /tmp/test_connector_perl/rw/centengine.cmd + Schedule Forced Host Check local_host_test_machine /tmp/test_connector_perl/rw/centengine.cmd Sleep 5 seconds we wait engine forced checks ${search_result} check search /tmp/test_connector_perl/log/centengine.debug test.pl Should Contain ${search_result} a dummy check check not found @@ -22,7 +22,7 @@ test use connector perl exist script test use connector perl unknown script [Documentation] test unknown script [Tags] connector engine - schedule forced host check local_host_test_machine_bad_test /tmp/test_connector_perl/rw/centengine.cmd + Schedule Forced Host Check local_host_test_machine_bad_test /tmp/test_connector_perl/rw/centengine.cmd Sleep 5 seconds we wait engine forced checks ${search_result} check search /tmp/test_connector_perl/log/centengine.debug test_titi.pl Should Contain @@ -35,7 +35,7 @@ test use connector perl multiple script [Tags] connector engine FOR ${idx} IN RANGE 2 12 ${host} Catenate SEPARATOR= local_host_test_machine. ${idx} - schedule forced host check ${host} /tmp/test_connector_perl/rw/centengine.cmd + Schedule Forced Host Check ${host} /tmp/test_connector_perl/rw/centengine.cmd END Sleep 10 seconds we wait engine forced checks FOR ${idx} IN RANGE 2 12 diff --git a/tests/connector_ssh/connector_ssh.robot b/tests/connector_ssh/connector_ssh.robot index f04bde09d88..35e38f111b3 100644 --- a/tests/connector_ssh/connector_ssh.robot +++ b/tests/connector_ssh/connector_ssh.robot @@ -39,7 +39,7 @@ TestBadUser ... An Initial host state on host_1 should be raised before we can start our external commands. ${start}= Get Current Date - schedule forced host check host_1 ${VarRoot}/lib/centreon-engine/config0/rw/centengine.cmd + Schedule Forced Host Check host_1 ${VarRoot}/lib/centreon-engine/config0/rw/centengine.cmd ${content} Create List fail to connect to toto@127.0.0.10 ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 @@ -68,7 +68,7 @@ TestBadPwd ... An Initial host state on host_1 should be raised before we can start our external commands. ${start}= Get Current Date - schedule forced host check host_1 ${VarRoot}/lib/centreon-engine/config0/rw/centengine.cmd + Schedule Forced Host Check host_1 ${VarRoot}/lib/centreon-engine/config0/rw/centengine.cmd ${content} Create List fail to connect to testconnssh@127.0.0.11 ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 @@ -115,7 +115,7 @@ Test6Hosts ${start}= Get Current Date FOR ${idx} IN RANGE 1 7 - schedule forced host check host_${idx} /tmp/var/lib/centreon-engine/config0/rw/centengine.cmd + Schedule Forced Host Check host_${idx} /tmp/var/lib/centreon-engine/config0/rw/centengine.cmd END IF "${run_env}" == "docker" diff --git a/tests/engine/forced_checks.robot b/tests/engine/forced_checks.robot index a85e38f5074..b103b50b5cb 100644 --- a/tests/engine/forced_checks.robot +++ b/tests/engine/forced_checks.robot @@ -29,19 +29,19 @@ EFHC1 Engine Config Set Value ${0} log_flush_period 0 Clear Retention - Clear DB hosts + Clear Db hosts ${start} Get Current Date Start Engine Start Broker ${result} Check host status host_1 4 1 False - Should be true ${result} host_1 should be pending + Should Be True ${result} host_1 should be pending ${content} Create List INITIAL HOST STATE: host_1; ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. - Process host check result host_1 0 host_1 UP + Process Host Check Result host_1 0 host_1 UP FOR ${i} IN RANGE ${4} Schedule Forced Host Check host_1 ${VarRoot}/lib/centreon-engine/config0/rw/centengine.cmd Sleep 5s @@ -58,7 +58,7 @@ EFHC1 Should Be True ${result} Message about SCHEDULE FORCED CHECK and HOST ALERT should be available in log. ${result} Check host status host_1 1 1 False - Should be true ${result} host_1 should be down/hard + Should Be True ${result} host_1 should be down/hard Stop Engine Kindly Stop Broker @@ -84,9 +84,9 @@ EFHC2 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. - Process host check result host_1 0 host_1 UP + Process Host Check Result host_1 0 host_1 UP FOR ${i} IN RANGE ${4} - Schedule Forced HOST CHECK host_1 ${VarRoot}/lib/centreon-engine/config0/rw/centengine.cmd + Schedule Forced Host Check host_1 ${VarRoot}/lib/centreon-engine/config0/rw/centengine.cmd Sleep 5s END ${content} Create List @@ -101,7 +101,7 @@ EFHC2 Should Be True ${result} Message about SCHEDULE FORCED CHECK and HOST ALERT should be available in log. ${result} Check host status host_1 1 1 False - Should be true ${result} host_1 should be down/hard + Should Be True ${result} host_1 should be down/hard Stop Engine Kindly Stop Broker @@ -125,20 +125,20 @@ EFHCU1 Broker Config Add Item rrd bbdo_version 3.0.0 Clear Retention - Clear db resources + Clear Db resources ${start} Get Current Date Start Engine Start Broker ${result} Check host status host_1 4 1 True - Should be true ${result} host_1 should be pending + Should Be True ${result} host_1 should be pending ${content} Create List INITIAL HOST STATE: host_1; ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. - Process host check result host_1 0 host_1 UP + Process Host Check Result host_1 0 host_1 UP FOR ${i} IN RANGE ${4} - Schedule Forced HOST CHECK host_1 ${VarRoot}/lib/centreon-engine/config0/rw/centengine.cmd + Schedule Forced Host Check host_1 ${VarRoot}/lib/centreon-engine/config0/rw/centengine.cmd Sleep 5s END ${content} Create List @@ -153,7 +153,7 @@ EFHCU1 Should Be True ${result} Message about SCHEDULE FORCED CHECK and HOST ALERT should be available in log. ${result} Check host status host_1 1 1 True - Should be true ${result} host_1 should be down/hard + Should Be True ${result} host_1 should be down/hard Stop Engine Kindly Stop Broker @@ -181,15 +181,15 @@ EFHCU2 Start Engine Start Broker ${result} Check host status host_1 4 1 True - Should be true ${result} host_1 should be pending + Should Be True ${result} host_1 should be pending ${content} Create List INITIAL HOST STATE: host_1; ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. - Process host check result host_1 0 host_1 UP + Process Host Check Result host_1 0 host_1 UP FOR ${i} IN RANGE ${4} - Schedule Forced HOST CHECK host_1 ${VarRoot}/lib/centreon-engine/config0/rw/centengine.cmd + Schedule Forced Host Check host_1 ${VarRoot}/lib/centreon-engine/config0/rw/centengine.cmd Sleep 5s END ${content} Create List @@ -204,7 +204,7 @@ EFHCU2 Should Be True ${result} Message about SCHEDULE FORCED CHECK and HOST ALERT should be available in log. ${result} Check host status host_1 1 1 True - Should be true ${result} host_1 should be down/hard + Should Be True ${result} host_1 should be down/hard Stop Engine Kindly Stop Broker @@ -217,8 +217,8 @@ EMACROS Config Broker module ${1} Engine Config Set Value ${0} log_legacy_enabled ${0} Engine Config Set Value ${0} log_v2_enabled ${1} - engine_config_set_value 0 log_level_checks trace True - engine_config_change_command + Engine Config Set Value 0 log_level_checks trace True + Engine Config Change Command ... 0 ... \\d+ ... /bin/echo "ResourceFile: $RESOURCEFILE$ - LogFile: $LOGFILE$ - AdminEmail: $ADMINEMAIL$ - AdminPager: $ADMINPAGER$" @@ -232,7 +232,7 @@ EMACROS Should Be True ... ${result} ... An Initial host state on host_1 should be raised before we can start our external commands. - schedule_forced_svc_check host_1 service_1 + Schedule Forced Svc Check host_1 service_1 Sleep 5s ${content} Create List @@ -252,17 +252,17 @@ EMACROS_NOTIF Config Broker module ${1} Engine Config Set Value ${0} log_legacy_enabled ${0} Engine Config Set Value ${0} log_v2_enabled ${1} - engine_config_set_value 0 log_level_checks trace True - engine_config_add_value 0 cfg_file ${EtcRoot}/centreon-engine/config0/contacts.cfg - engine_config_add_command + Engine Config Set Value 0 log_level_checks trace True + Engine Config Add Value 0 cfg_file ${EtcRoot}/centreon-engine/config0/contacts.cfg + Engine Config Add Command ... 0 ... command_notif ... /bin/sh -c '/bin/echo "ResourceFile: $RESOURCEFILE$ - LogFile: $LOGFILE$ - AdminEmail: $ADMINEMAIL$ - AdminPager: $ADMINPAGER$" >> /tmp/notif_toto.txt' - engine_config_set_value_in_services 0 service_1 contacts John_Doe - engine_config_set_value_in_services 0 service_1 notification_options w,c,r - engine_config_set_value_in_services 0 service_1 notifications_enabled 1 - engine_config_set_value_in_contacts 0 John_Doe host_notification_commands command_notif - engine_config_set_value_in_contacts 0 John_Doe service_notification_commands command_notif + Engine Config Set Value In Services 0 service_1 contacts John_Doe + Engine Config Set Value In Services 0 service_1 notification_options w,c,r + Engine Config Set Value In Services 0 service_1 notifications_enabled 1 + Engine Config Set Value In Contacts 0 John_Doe host_notification_commands command_notif + Engine Config Set Value In Contacts 0 John_Doe service_notification_commands command_notif Remove File /tmp/notif_toto.txt Clear Retention @@ -277,7 +277,7 @@ EMACROS_NOTIF ... An Initial host state on host_1 should be raised before we can start our external commands. FOR ${i} IN RANGE 3 - Process Service Check result host_1 service_1 2 critical + Process Service Check Result host_1 service_1 2 critical END Wait Until Created /tmp/notif_toto.txt 30s diff --git a/tests/resources/resources.robot b/tests/resources/resources.robot index 401b700f6d0..65bb613f398 100644 --- a/tests/resources/resources.robot +++ b/tests/resources/resources.robot @@ -45,11 +45,11 @@ Clean Before Suite Clean Before Suite With rrdcached Clean Before Suite - log to console Starting RRDCached + Log To Console Starting RRDCached Run Process /usr/bin/rrdcached -l unix:${BROKER_LIB}/rrdcached.sock -V LOG_DEBUG -F Clean Grpc Before Suite - set grpc port 0 + Set Grpc Port 0 Clean Before Suite Clean After Suite @@ -58,8 +58,8 @@ Clean After Suite Terminate All Processes kill=True Clean After Suite With rrdcached - Clean after Suite - log to console Stopping RRDCached + Clean After Suite + Log To Console Stopping RRDCached Stop rrdcached Clear Engine Logs @@ -113,7 +113,7 @@ Kindly Stop Broker IF ${result.rc} != 0 Save Logs Copy Coredump In Failed Dir b2 /usr/sbin/cbd broker_rrd - Coredump info b2 /usr/sbin/cbd broker_rrd + Coredump Info b2 /usr/sbin/cbd broker_rrd Should Be Equal As Integers ${result.rc} 0 RRD Broker not correctly stopped END END @@ -182,7 +182,7 @@ Stop Engine ELSE IF ${result.rc} != 0 and ${result.rc} != -15 Copy Coredump In Failed Dir ${alias} /usr/sbin/centengine ${alias} - Coredump info ${alias} /usr/sbin/centengine ${alias} + Coredump Info ${alias} /usr/sbin/centengine ${alias} END Should Be True ... ${result.rc} == -15 or ${result.rc} == 0 @@ -200,9 +200,9 @@ Stop Engine Broker And Save Logs TRY Kindly Stop Broker only_central=${only_central} EXCEPT - Log can't kindly stop broker + Log Can't kindly stop Broker END - Save Logs If failed + Save Logs If Failed Get Engine Pid [Arguments] ${process_alias} @@ -222,12 +222,12 @@ Check Connections FOR ${idx} IN RANGE 0 ${count} ${alias} Catenate SEPARATOR= e ${idx} ${pid2} Get Process Id ${alias} - Log to console Check Connection 5669 ${pid1} ${pid2} + Log To Console Check Connection 5669 ${pid1} ${pid2} ${retval} Check Connection 5669 ${pid1} ${pid2} IF ${retval} == ${False} RETURN ${False} END ${pid2} Get Process Id b2 - Log to console Check Connection 5670 ${pid1} ${pid2} + Log To Console Check Connection 5670 ${pid1} ${pid2} ${retval} Check Connection 5670 ${pid1} ${pid2} RETURN ${retval} @@ -241,17 +241,17 @@ Reset Eth Connection Run iptables -F Run iptables -X -Save Logs If failed +Save Logs If Failed Run Keyword If Test Failed Save Logs Save Logs Create Directory failed ${failDir} Catenate SEPARATOR= failed/ ${Test Name} Create Directory ${failDir} - Copy files ${centralLog} ${failDir} - Copy files ${rrdLog} ${failDir} - Copy files ${moduleLog0} ${failDir} - Copy files ${engineLog0} ${failDir} + Copy Files ${centralLog} ${failDir} + Copy Files ${rrdLog} ${failDir} + Copy Files ${moduleLog0} ${failDir} + Copy Files ${engineLog0} ${failDir} Copy Files ${EtcRoot}/centreon-engine/config0/*.cfg ${failDir}/etc/centreon-engine/config0 Copy Files ${EtcRoot}/centreon-broker/*.json ${failDir}/etc/centreon-broker Move Files /tmp/lua*.log ${failDir} diff --git a/tests/severities/hosts.robot b/tests/severities/hosts.robot index b27981a1c1d..43444d9184b 100644 --- a/tests/severities/hosts.robot +++ b/tests/severities/hosts.robot @@ -19,7 +19,7 @@ Test Setup Stop Processes BEUHSEV1 [Documentation] Four hosts have a severity added. Then we remove the severity from host 1. Then we change severity 10 to severity8 for host 3. [Tags] broker engine protobuf bbdo severities - # Clear DB severities + # Clear Db severities Config Engine ${1} Create Severities File ${0} ${20} Config Engine Add Cfg File ${0} severities.cfg @@ -39,7 +39,7 @@ BEUHSEV1 Start Broker Sleep 2s - ${result} check host severity With Timeout 1 10 60 + ${result} Check Host Severity With Timeout 1 10 60 Should Be True ${result} Host 1 should have severity_id=10 Remove Severities From Hosts ${0} @@ -47,9 +47,9 @@ BEUHSEV1 Add Severity To Hosts 0 8 [3] Reload Engine Reload Broker - ${result} check host severity With Timeout 3 8 60 + ${result} Check Host Severity With Timeout 3 8 60 Should Be True ${result} Host 3 should have severity_id=8 - ${result} check host severity With Timeout 1 None 60 + ${result} Check Host Severity With Timeout 1 None 60 Should Be True ${result} Host 1 should have no severity Stop Engine @@ -86,25 +86,25 @@ BEUHSEV2 Start Broker Sleep 5s # We need to wait a little before reloading Engine - ${result} check host severity With Timeout 2 18 60 + ${result} Check Host Severity With Timeout 2 18 60 Should Be True ${result} First step: Host 2 should have severity_id=18 - ${result} check host severity With Timeout 4 18 60 + ${result} Check Host Severity With Timeout 4 18 60 Should Be True ${result} First step: Host 4 should have severity_id=18 - ${result} check host severity With Timeout 26 18 60 + ${result} Check Host Severity With Timeout 26 18 60 Should Be True ${result} First step: Host 26 should have severity_id=18 - ${result} check host severity With Timeout 27 18 60 + ${result} Check Host Severity With Timeout 27 18 60 Should Be True ${result} First step: Host 27 should have severity_id=18 - ${result} check host severity With Timeout 3 16 60 + ${result} Check Host Severity With Timeout 3 16 60 Should Be True ${result} First step: Host 3 should have severity_id=16 - ${result} check host severity With Timeout 5 16 60 + ${result} Check Host Severity With Timeout 5 16 60 Should Be True ${result} First step: Host 5 should have severity_id=16 - ${result} check host severity With Timeout 28 16 60 + ${result} Check Host Severity With Timeout 28 16 60 Should Be True ${result} First step: Host 28 should have severity_id=16 Remove Severities From Hosts ${0} @@ -114,16 +114,16 @@ BEUHSEV2 Reload Engine Reload Broker Sleep 3s - ${result} check host severity With Timeout 28 16 60 + ${result} Check Host Severity With Timeout 28 16 60 Should Be True ${result} Second step: Host 28 should have severity_id=16 - ${result} check host severity With Timeout 4 None 60 + ${result} Check Host Severity With Timeout 4 None 60 Should Be True ${result} Second step: Host 4 should have severity_id=None - ${result} check host severity With Timeout 3 None 60 + ${result} Check Host Severity With Timeout 3 None 60 Should Be True ${result} Second step: Host 3 should have severity_id=17 - ${result} check host severity With Timeout 5 None 60 + ${result} Check Host Severity With Timeout 5 None 60 Should Be True ${result} Second step: Host 5 should have severity_id=17 Stop Engine @@ -165,19 +165,19 @@ BETUHSEV1 Start Broker Sleep 5s # We need to wait a little before reloading Engine - ${result} check host severity With Timeout 2 2 60 + ${result} Check Host Severity With Timeout 2 2 60 Should Be True ${result} First step: Host 2 should have severity_id=2 - ${result} check host severity With Timeout 4 2 60 + ${result} Check Host Severity With Timeout 4 2 60 Should Be True ${result} First step: Host 4 should have severity_id=2 - ${result} check host severity With Timeout 5 4 60 + ${result} Check Host Severity With Timeout 5 4 60 Should Be True ${result} First step: Host 5 should have severity_id=4 - ${result} check host severity With Timeout 31 6 60 + ${result} Check Host Severity With Timeout 31 6 60 Should Be True ${result} First step: Host 31 should have severity_id=6 - ${result} check host severity With Timeout 33 10 60 + ${result} Check Host Severity With Timeout 33 10 60 Should Be True ${result} First step: Host 33 should have severity_id=10 Stop Engine diff --git a/tests/severities/severities.robot b/tests/severities/severities.robot index 6ad9466126d..b2997f7588f 100644 --- a/tests/severities/severities.robot +++ b/tests/severities/severities.robot @@ -13,14 +13,14 @@ Library ../resources/specific-duplication.py Suite Setup Clean Before Suite Suite Teardown Clean After Suite Test Setup Stop Processes -Test Teardown Save logs If Failed +Test Teardown Save Logs If Failed *** Test Cases *** BESEV1 [Documentation] Engine is configured with some severities. When broker receives them, it stores them in the centreon_storage.severities table. Broker is started before. [Tags] broker engine protobuf bbdo severities - # Clear DB severities + # Clear Db severities Config Engine ${1} Create Severities File ${0} ${20} Config Engine Add Cfg File ${0} severities.cfg @@ -43,7 +43,7 @@ BESEV1 BESEV2 [Documentation] Engine is configured with some severities. When broker receives them, it stores them in the centreon_storage.severities table. Engine is started before. [Tags] broker engine protobuf bbdo severities - # Clear DB severities + # Clear Db severities Config Engine ${1} Create Severities File ${0} ${20} Config Engine Add Cfg File ${0} severities.cfg @@ -67,7 +67,7 @@ BESEV2 BEUSEV1 [Documentation] Engine is configured with some severities. When broker receives them, it stores them in the centreon_storage.severities table. Broker is started before. [Tags] broker engine protobuf bbdo severities - # Clear DB severities + # Clear Db severities Config Engine ${1} Create Severities File ${0} ${20} Config Engine Add Cfg File ${0} severities.cfg @@ -94,7 +94,7 @@ BEUSEV1 BEUSEV2 [Documentation] Engine is configured with some severities. When broker receives them, it stores them in the centreon_storage.severities table. Engine is started before. [Tags] broker engine protobuf bbdo severities - # Clear DB severities + # Clear Db severities Config Engine ${1} Create Severities File ${0} ${20} Config Engine Add Cfg File ${0} severities.cfg @@ -122,7 +122,7 @@ BEUSEV2 BEUSEV3 [Documentation] Four services have a severity added. Then we remove the severity from service 1. Then we change severity 11 to severity7 for service 3. [Tags] broker engine protobuf bbdo severities - # Clear DB severities + # Clear Db severities Config Engine ${1} Create Severities File ${0} ${20} Config Engine Add Cfg File ${0} severities.cfg From 3928df9ecb99a9869f8f7e52927ce943fab606ba Mon Sep 17 00:00:00 2001 From: David Boucher Date: Tue, 17 Oct 2023 05:16:36 -0400 Subject: [PATCH 39/84] fix(tests): wip --- tests/resources/resources.robot | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/resources/resources.robot b/tests/resources/resources.robot index 65bb613f398..ea1209d7558 100644 --- a/tests/resources/resources.robot +++ b/tests/resources/resources.robot @@ -296,7 +296,7 @@ Coredump Info Copy Coredump In Failed Dir [Arguments] ${process_name} ${binary_path} ${name} ${docker_env} Get Environment Variable RUN_ENV ${None} - IF ${docker_env} is None + IF ${docker_env} == "" ${pid} Get Process Id ${process_name} ${failDir} Catenate SEPARATOR= failed/ ${Test Name} Create Directory ${failDir} From b9cd780a205e383740137750e6f245a66ad7eaf2 Mon Sep 17 00:00:00 2001 From: David Boucher Date: Wed, 18 Oct 2023 09:57:15 +0200 Subject: [PATCH 40/84] wip(tests) --- .github/workflows/package-collect.yml | 1 + CMakeLists.txt | 5 +++++ broker/core/inc/com/centreon/broker/misc/misc.hh | 6 ++++++ broker/core/multiplexing/src/engine.cc | 3 +++ broker/core/multiplexing/src/muxer.cc | 4 ++++ broker/core/src/log_v2.cc | 3 +++ broker/core/src/misc/filesystem.cc | 1 + broker/core/src/misc/misc.cc | 16 ++++++++++++++++ broker/core/src/processing/failover.cc | 3 +++ broker/core/src/processing/feeder.cc | 2 ++ cmake.sh | 2 +- 11 files changed, 45 insertions(+), 1 deletion(-) diff --git a/.github/workflows/package-collect.yml b/.github/workflows/package-collect.yml index 1f295db5e35..5cc4391c837 100644 --- a/.github/workflows/package-collect.yml +++ b/.github/workflows/package-collect.yml @@ -88,6 +88,7 @@ jobs: sudo $CMAKE \ -G "Ninja" \ + -DDEBUG_ROBOT \ -DWITH_TESTING=OFF \ -DWITH_BENCH=ON \ -DWITH_MODULE_SIMU=OFF \ diff --git a/CMakeLists.txt b/CMakeLists.txt index f901aa0a3c0..935229c2312 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -42,6 +42,7 @@ endif() add_definitions("-D_GLIBCXX_USE_CXX11_ABI=1") option(NG "C++17 build." OFF) +option(DEBUG_ROBOT OFF) if(NG) set(CMAKE_CXX_STANDARD 17) @@ -128,6 +129,10 @@ set(COLLECT_PATCH 0) set(COLLECT_VERSION "${COLLECT_MAJOR}.${COLLECT_MINOR}.${COLLECT_PATCH}") add_definitions(-DCENTREON_CONNECTOR_VERSION=\"${COLLECT_VERSION}\") +if (DEBUG_ROBOT) + add_definitions(-DDEBUG_ROBOT) +endif() + # ########### CONSTANTS ########### set(USER_BROKER centreon-broker) set(USER_ENGINE centreon-engine) diff --git a/broker/core/inc/com/centreon/broker/misc/misc.hh b/broker/core/inc/com/centreon/broker/misc/misc.hh index 7adf8fff48f..56675451ca0 100644 --- a/broker/core/inc/com/centreon/broker/misc/misc.hh +++ b/broker/core/inc/com/centreon/broker/misc/misc.hh @@ -36,8 +36,14 @@ std::string dump_filters(const multiplexing::muxer_filter& filters); std::list parse_perfdata(uint32_t host_id, uint32_t service_id, const char* str); +void debug(const std::string& content); } // namespace misc +#if DEBUG_ROBOT +#define DEBUG(content) misc::debug(content) +#else +#define DEBUG(content) +#endif CCB_END() #endif // !CCB_MISC_MISC_HH diff --git a/broker/core/multiplexing/src/engine.cc b/broker/core/multiplexing/src/engine.cc index 5fc4fa2bb53..1749888213f 100644 --- a/broker/core/multiplexing/src/engine.cc +++ b/broker/core/multiplexing/src/engine.cc @@ -25,6 +25,7 @@ #include "com/centreon/broker/config/applier/state.hh" #include "com/centreon/broker/io/events.hh" #include "com/centreon/broker/log_v2.hh" +#include "com/centreon/broker/misc/misc.hh" #include "com/centreon/broker/multiplexing/muxer.hh" #include "com/centreon/broker/pool.hh" @@ -281,11 +282,13 @@ engine::engine() _stats{stats::center::instance().register_engine()}, _unprocessed_events{0u}, _sending_to_subscribers{false} { + DEBUG(fmt::format("CONSTRUCTOR engine {:p}", static_cast(this))); stats::center::instance().update(&EngineStats::set_mode, _stats, EngineStats::NOT_STARTED); } engine::~engine() noexcept { + DEBUG(fmt::format("DESTRUCTOR engine {:p}", static_cast(this))); log_v2::core()->debug("core: cbd engine destroyed."); } diff --git a/broker/core/multiplexing/src/muxer.cc b/broker/core/multiplexing/src/muxer.cc index 334f59e29c5..17f3739b5b8 100644 --- a/broker/core/multiplexing/src/muxer.cc +++ b/broker/core/multiplexing/src/muxer.cc @@ -84,6 +84,8 @@ muxer::muxer(std::string name, _events_size{0u}, _last_stats{std::time(nullptr)} { // Load head queue file back in memory. + DEBUG(fmt::format("CONSTRUCTOR muxer {:p} {}", static_cast(this), + _name)); std::lock_guard lck(_mutex); if (_persistent) { try { @@ -197,6 +199,8 @@ muxer::~muxer() noexcept { "Destroying muxer {}: number of events in the queue: {}", _name, _events_size); _clean(); + DEBUG(fmt::format("DESTRUCTOR muxer {:p} {}", static_cast(this), + _name)); } /** diff --git a/broker/core/src/log_v2.cc b/broker/core/src/log_v2.cc index c9c00eac12d..c940b4841be 100644 --- a/broker/core/src/log_v2.cc +++ b/broker/core/src/log_v2.cc @@ -27,6 +27,7 @@ #include #include "com/centreon/exceptions/msg_fmt.hh" +#include "com/centreon/broker/misc/misc.hh" using namespace com::centreon::broker; using namespace com::centreon::exceptions; @@ -90,6 +91,7 @@ log_v2::log_v2(const std::shared_ptr& io_context) _flush_timer(*io_context), _flush_timer_active(true), _io_context(io_context) { + DEBUG(fmt::format("CONSTRUCTOR log_v2 {:p}", static_cast(this))); auto stdout_sink = std::make_shared(); auto create_logger = [&](const std::string& name) { std::shared_ptr log = @@ -128,6 +130,7 @@ log_v2::~log_v2() noexcept { _running = false; for (auto& l : _log) l.reset(); + DEBUG(fmt::format("DESTRUCTOR log_v2 {:p}", static_cast(this))); } void log_v2::apply(const config::state& conf) { diff --git a/broker/core/src/misc/filesystem.cc b/broker/core/src/misc/filesystem.cc index 8b9c5658e83..461193ccb7a 100644 --- a/broker/core/src/misc/filesystem.cc +++ b/broker/core/src/misc/filesystem.cc @@ -18,6 +18,7 @@ #include "com/centreon/broker/misc/filesystem.hh" #include +#include #include #include #include diff --git a/broker/core/src/misc/misc.cc b/broker/core/src/misc/misc.cc index 83d2bb77659..35e1afb3d9a 100644 --- a/broker/core/src/misc/misc.cc +++ b/broker/core/src/misc/misc.cc @@ -18,6 +18,7 @@ #include "com/centreon/broker/misc/misc.hh" +#include #include #include @@ -187,3 +188,18 @@ std::string misc::dump_filters(const multiplexing::muxer_filter& filters) { ret.append(", ").append(it->second); return ret; } + +void misc::debug(const std::string& content) { + int p = getpid(); + std::string filename{fmt::format("failed/{}.log", p)}; + FILE* f = fopen(filename.c_str(), "a"); + if (!f) { + if (mkdir("failed", 0755) != 0) + return; + f = fopen(filename.c_str(), "a"); + } + if (f) { + fprintf(f, "%s\n", content.c_str()); + fclose(f); + } +} diff --git a/broker/core/src/processing/failover.cc b/broker/core/src/processing/failover.cc index 11491b00b97..471bd19c976 100644 --- a/broker/core/src/processing/failover.cc +++ b/broker/core/src/processing/failover.cc @@ -24,6 +24,7 @@ #include "com/centreon/broker/exceptions/shutdown.hh" #include "com/centreon/broker/log_v2.hh" #include "com/centreon/exceptions/msg_fmt.hh" +#include "com/centreon/broker/misc/misc.hh" using namespace com::centreon::exceptions; using namespace com::centreon::broker; @@ -49,6 +50,7 @@ failover::failover(std::shared_ptr endp, _next_timeout(0), _muxer(mux), _update(false) { + DEBUG(fmt::format("CONSTRUCTOR failover {:p} {} - muxer: {:p}", static_cast(this), name, static_cast(mux.get()))); SPDLOG_LOGGER_TRACE(log_v2::core(), "failover '{}' construction.", _name); } @@ -57,6 +59,7 @@ failover::failover(std::shared_ptr endp, */ failover::~failover() { exit(); + DEBUG(fmt::format("DESTRUCTOR failover {:p}", static_cast(this))); } /** diff --git a/broker/core/src/processing/feeder.cc b/broker/core/src/processing/feeder.cc index 0fee937c898..94a670cc3af 100644 --- a/broker/core/src/processing/feeder.cc +++ b/broker/core/src/processing/feeder.cc @@ -81,6 +81,7 @@ feeder::feeder(const std::string& name, _stat_timer(pool::io_context()), _read_from_stream_timer(pool::io_context()), _io_context(pool::io_context_ptr()) { + DEBUG(fmt::format("CONSTRUCTOR feeder {:p} {} - muxer: {:p}", static_cast(this), name, static_cast(_muxer.get()))); if (!_client) throw msg_fmt("could not process '{}' with no client stream", _name); @@ -101,6 +102,7 @@ feeder::~feeder() { stop(); multiplexing::engine::instance_ptr()->unsubscribe(_muxer.get()); + DEBUG(fmt::format("DESTRUCTOR feeder {:p}", static_cast(this))); } bool feeder::is_finished() const noexcept { diff --git a/cmake.sh b/cmake.sh index a6006535950..27a10eee337 100755 --- a/cmake.sh +++ b/cmake.sh @@ -326,5 +326,5 @@ if [[ "$maj" == "Raspbian" ]] ; then elif [[ "$maj" == "Debian" ]] ; then CC=$CC CXX=$CXX CXXFLAGS="-Wall -Wextra" $cmake -DWITH_CLANG=$WITH_CLANG -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DWITH_USER_BROKER=centreon-broker -DWITH_USER_ENGINE=centreon-engine -DWITH_GROUP_BROKER=centreon-broker -DWITH_GROUP_ENGINE=centreon-engine -DWITH_TESTING=On -DWITH_PREFIX_LIB_CLIB=/usr/lib64/ -DWITH_MODULE_SIMU=On -DWITH_BENCH=On -DWITH_CREATE_FILES=OFF -DWITH_CONF=OFF $NG $* .. else - CC=$CC CXX=$CXX CXXFLAGS="-Wall -Wextra" $cmake -DWITH_CLANG=$WITH_CLANG -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DWITH_USER_BROKER=centreon-broker -DWITH_USER_ENGINE=centreon-engine -DWITH_GROUP_BROKER=centreon-broker -DWITH_GROUP_ENGINE=centreon-engine -DWITH_TESTING=On -DWITH_MODULE_SIMU=On -DWITH_BENCH=On -DWITH_CREATE_FILES=OFF -DWITH_CONF=OFF $NG $* .. + CC=$CC CXX=$CXX CXXFLAGS="-Wall -Wextra" $cmake -DDEBUG_ROBOT=On -DWITH_CLANG=$WITH_CLANG -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DWITH_USER_BROKER=centreon-broker -DWITH_USER_ENGINE=centreon-engine -DWITH_GROUP_BROKER=centreon-broker -DWITH_GROUP_ENGINE=centreon-engine -DWITH_TESTING=On -DWITH_MODULE_SIMU=On -DWITH_BENCH=On -DWITH_CREATE_FILES=OFF -DWITH_CONF=OFF $NG $* .. fi From 5fa8a6aebe89b80da9e2f1c07cbe672122acd4bd Mon Sep 17 00:00:00 2001 From: David Boucher Date: Wed, 18 Oct 2023 11:34:21 +0200 Subject: [PATCH 41/84] fix(broker): engine is directly accessible from muxers --- .../com/centreon/broker/processing/feeder.hh | 2 ++ .../centreon/broker/multiplexing/engine.hh | 4 ++-- .../com/centreon/broker/multiplexing/muxer.hh | 3 +++ broker/core/multiplexing/src/engine.cc | 7 +++--- broker/core/multiplexing/src/muxer.cc | 22 +++++++++++-------- broker/core/src/config/applier/endpoint.cc | 5 +++-- broker/core/src/processing/acceptor.cc | 3 ++- broker/core/src/processing/feeder.cc | 12 ++++++++-- broker/core/test/processing/feeder.cc | 3 ++- 9 files changed, 41 insertions(+), 20 deletions(-) diff --git a/broker/core/inc/com/centreon/broker/processing/feeder.hh b/broker/core/inc/com/centreon/broker/processing/feeder.hh index b52d23ebaf3..afd43ae102d 100644 --- a/broker/core/inc/com/centreon/broker/processing/feeder.hh +++ b/broker/core/inc/com/centreon/broker/processing/feeder.hh @@ -58,6 +58,7 @@ class feeder : public stat_visitable, protected: feeder(const std::string& name, + const std::shared_ptr& parent, std::shared_ptr& client, const multiplexing::muxer_filter& read_filters, const multiplexing::muxer_filter& write_filters); @@ -84,6 +85,7 @@ class feeder : public stat_visitable, public: static std::shared_ptr create( const std::string& name, + const std::shared_ptr& parent, std::shared_ptr& client, const multiplexing::muxer_filter& read_filters, const multiplexing::muxer_filter& write_filters); diff --git a/broker/core/multiplexing/inc/com/centreon/broker/multiplexing/engine.hh b/broker/core/multiplexing/inc/com/centreon/broker/multiplexing/engine.hh index 6aac7eb357a..0a0fd8e2f97 100644 --- a/broker/core/multiplexing/inc/com/centreon/broker/multiplexing/engine.hh +++ b/broker/core/multiplexing/inc/com/centreon/broker/multiplexing/engine.hh @@ -82,7 +82,7 @@ class engine : public std::enable_shared_from_this { std::deque> _kiew; // Subscriber. - std::vector> _muxers; + std::vector _muxers; std::mutex _muxers_m; // Statistics. @@ -111,7 +111,7 @@ class engine : public std::enable_shared_from_this { void publish(const std::deque>& to_publish); void start(); void stop(); - void subscribe(const std::shared_ptr& subscriber); + void subscribe(muxer* subscriber); void unsubscribe(const muxer* subscriber); }; } // namespace multiplexing diff --git a/broker/core/multiplexing/inc/com/centreon/broker/multiplexing/muxer.hh b/broker/core/multiplexing/inc/com/centreon/broker/multiplexing/muxer.hh index abe58a146c0..1c78e495243 100644 --- a/broker/core/multiplexing/inc/com/centreon/broker/multiplexing/muxer.hh +++ b/broker/core/multiplexing/inc/com/centreon/broker/multiplexing/muxer.hh @@ -57,6 +57,7 @@ class muxer : public io::stream { static uint32_t _event_queue_max_size; const std::string _name; + std::shared_ptr _engine; const std::string _queue_file_name; multiplexing::muxer_filter _read_filter; multiplexing::muxer_filter _write_filter; @@ -83,6 +84,7 @@ class muxer : public io::stream { void _update_stats(void) noexcept; muxer(std::string name, + const std::shared_ptr& parent, const muxer_filter& r_filter, const muxer_filter& w_filter, bool persistent = false); @@ -94,6 +96,7 @@ class muxer : public io::stream { static uint32_t event_queue_max_size() noexcept; static std::shared_ptr create(std::string name, + const std::shared_ptr& parent, const muxer_filter& r_filter, const muxer_filter& w_filter, bool persistent = false); diff --git a/broker/core/multiplexing/src/engine.cc b/broker/core/multiplexing/src/engine.cc index 1749888213f..dc2c6abf25a 100644 --- a/broker/core/multiplexing/src/engine.cc +++ b/broker/core/multiplexing/src/engine.cc @@ -237,6 +237,7 @@ void engine::stop() { EngineStats::STOPPED); } log_v2::core()->debug("multiplexing: engine stopped"); + DEBUG(fmt::format("STOP engine {:p}", static_cast(this))); } /** @@ -244,7 +245,7 @@ void engine::stop() { * * @param[in] subscriber A muxer. */ -void engine::subscribe(const std::shared_ptr& subscriber) { +void engine::subscribe(muxer* subscriber) { log_v2::config()->debug("engine: muxer {} subscribes to engine", subscriber->name()); std::lock_guard l(_engine_m); @@ -265,7 +266,7 @@ void engine::subscribe(const std::shared_ptr& subscriber) { void engine::unsubscribe(const muxer* subscriber) { std::lock_guard l(_engine_m); for (auto it = _muxers.begin(); it != _muxers.end(); ++it) { - if (it->get() == subscriber) { + if (*it == subscriber) { log_v2::config()->debug("engine: muxer {} unsubscribes to engine", subscriber->name()); _muxers.erase(it); @@ -362,7 +363,7 @@ bool engine::_send_to_subscribers(send_to_mux_callback_type&& callback) { // Process all queued events. std::shared_ptr>> kiew; - std::shared_ptr last_muxer; + muxer* last_muxer; std::shared_ptr cb; { std::lock_guard lck(_engine_m); diff --git a/broker/core/multiplexing/src/muxer.cc b/broker/core/multiplexing/src/muxer.cc index 17f3739b5b8..3594ad09890 100644 --- a/broker/core/multiplexing/src/muxer.cc +++ b/broker/core/multiplexing/src/muxer.cc @@ -62,6 +62,7 @@ absl::flat_hash_map> muxer::_running_muxers; * * @param name Name associated to this muxer. It is used to create * on-disk files. + * @param parent The engine that relies all the muxers. * @param r_filter The read filter constructed from the stream and the * user configuration. * @param w_filter The write filter constructed from the stream and the @@ -70,11 +71,13 @@ absl::flat_hash_map> muxer::_running_muxers; * events in a persistent storage. */ muxer::muxer(std::string name, + const std::shared_ptr& parent, const muxer_filter& r_filter, const muxer_filter& w_filter, bool persistent) : io::stream("muxer"), _name(std::move(name)), + _engine(parent), _queue_file_name{queue_file(_name)}, _read_filter{r_filter}, _write_filter{w_filter}, @@ -143,6 +146,7 @@ muxer::muxer(std::string name, * * @param name Name associated to this muxer. It is used to create * on-disk files. + * @param parent The engine that relies all the muxers. * @param r_filter The read filter constructed from the stream and the * user configuration. * @param w_filter The write filter constructed from the stream and the @@ -152,6 +156,7 @@ muxer::muxer(std::string name, * @return std::shared_ptr */ std::shared_ptr muxer::create(std::string name, + const std::shared_ptr& parent, const muxer_filter& r_filter, const muxer_filter& w_filter, bool persistent) { @@ -177,12 +182,12 @@ std::shared_ptr muxer::create(std::string name, } else { log_v2::config()->debug("muxer: muxer '{}' unknown, creating it", name); retval = std::shared_ptr( - new muxer(name, r_filter, w_filter, persistent)); + new muxer(name, parent, r_filter, w_filter, persistent)); _running_muxers[name] = retval; } } - engine::instance_ptr()->subscribe(retval); + parent->subscribe(retval.get()); return retval; } @@ -191,16 +196,14 @@ std::shared_ptr muxer::create(std::string name, */ muxer::~muxer() noexcept { stats::center::instance().unregister_muxer(_name); - auto eng = engine::instance_ptr(); - if (eng) - eng->unsubscribe(this); + _engine->unsubscribe(this); std::lock_guard lock(_mutex); SPDLOG_LOGGER_INFO(log_v2::core(), "Destroying muxer {}: number of events in the queue: {}", _name, _events_size); _clean(); - DEBUG(fmt::format("DESTRUCTOR muxer {:p} {}", static_cast(this), - _name)); + DEBUG( + fmt::format("DESTRUCTOR muxer {:p} {}", static_cast(this), _name)); } /** @@ -265,6 +268,7 @@ int32_t muxer::stop() { _name, _events_size); std::lock_guard lck(_mutex); _update_stats(); + DEBUG(fmt::format("STOP muxer {:p} {}", static_cast(this), _name)); return 0; } @@ -536,7 +540,7 @@ int muxer::write(std::shared_ptr const& d) { SPDLOG_LOGGER_INFO(log_v2::core(), "{} bench write {}", _name, io::data::dump_json{*d}); } - engine::instance_ptr()->publish(d); + _engine->publish(d); } else { SPDLOG_LOGGER_TRACE(log_v2::core(), "muxer {} event of type {:x} rejected by read filter", @@ -567,7 +571,7 @@ void muxer::write(std::deque>& to_publish) { } } if (!to_publish.empty()) { - engine::instance_ptr()->publish(to_publish); + _engine->publish(to_publish); } } diff --git a/broker/core/src/config/applier/endpoint.cc b/broker/core/src/config/applier/endpoint.cc index 32548329d83..ec2732e075d 100644 --- a/broker/core/src/config/applier/endpoint.cc +++ b/broker/core/src/config/applier/endpoint.cc @@ -205,8 +205,9 @@ void endpoint::apply(std::list const& endpoints) { "endpoint applier: filters {} for endpoint '{}' applied.", w_filter.get_allowed_categories(), ep.name); - auto mux = - multiplexing::muxer::create(ep.name, r_filter, w_filter, true); + auto mux = multiplexing::muxer::create( + ep.name, multiplexing::engine::instance_ptr(), r_filter, w_filter, + true); endp.reset(_create_failover(ep, mux, e, endp_to_create)); } { diff --git a/broker/core/src/processing/acceptor.cc b/broker/core/src/processing/acceptor.cc index fac84326b48..6bbd19cd31d 100644 --- a/broker/core/src/processing/acceptor.cc +++ b/broker/core/src/processing/acceptor.cc @@ -76,7 +76,8 @@ void acceptor::accept() { _read_filters.get_allowed_categories(), _write_filters.get_allowed_categories()); std::shared_ptr f = - feeder::create(name, u, _read_filters, _write_filters); + feeder::create(name, multiplexing::engine::instance_ptr(), u, + _read_filters, _write_filters); std::lock_guard lock(_stat_mutex); _feeders.push_back(f); diff --git a/broker/core/src/processing/feeder.cc b/broker/core/src/processing/feeder.cc index 94a670cc3af..fe99685294b 100644 --- a/broker/core/src/processing/feeder.cc +++ b/broker/core/src/processing/feeder.cc @@ -41,17 +41,19 @@ constexpr unsigned max_event_queue_size = 0x10000; * is created by a new * * @param[in] name Name. + * @param[in] parent Engine relying muxers. * @param[in] client Client stream. * @param[in] read_filters Read filters. * @param[in] write_filters Write filters. */ std::shared_ptr feeder::create( const std::string& name, + const std::shared_ptr& parent, std::shared_ptr& client, const multiplexing::muxer_filter& read_filters, const multiplexing::muxer_filter& write_filters) { std::shared_ptr ret( - new feeder(name, client, read_filters, write_filters)); + new feeder(name, parent, client, read_filters, write_filters)); ret->_start_stat_timer(); ret->_read_from_muxer(); @@ -63,11 +65,13 @@ std::shared_ptr feeder::create( * Constructor. * * @param[in] name Name. + * @param[in] parent Engine relying muxers. * @param[in] client Client stream. * @param[in] read_filters Read filters. * @param[in] write_filters Write filters. */ feeder::feeder(const std::string& name, + const std::shared_ptr& parent, std::shared_ptr& client, const multiplexing::muxer_filter& read_filters, const multiplexing::muxer_filter& write_filters) @@ -75,13 +79,16 @@ feeder::feeder(const std::string& name, _state{state::running}, _client(std::move(client)), _muxer(multiplexing::muxer::create(name, + parent, std::move(read_filters), std::move(write_filters), false)), _stat_timer(pool::io_context()), _read_from_stream_timer(pool::io_context()), _io_context(pool::io_context_ptr()) { - DEBUG(fmt::format("CONSTRUCTOR feeder {:p} {} - muxer: {:p}", static_cast(this), name, static_cast(_muxer.get()))); + DEBUG(fmt::format("CONSTRUCTOR feeder {:p} {} - muxer: {:p}", + static_cast(this), name, + static_cast(_muxer.get()))); if (!_client) throw msg_fmt("could not process '{}' with no client stream", _name); @@ -260,6 +267,7 @@ void feeder::_ack_event_to_muxer(unsigned count) noexcept { void feeder::stop() { std::unique_lock l(_protect); _stop_no_lock(); + DEBUG(fmt::format("STOP feeder {:p}", static_cast(this))); } /** diff --git a/broker/core/test/processing/feeder.cc b/broker/core/test/processing/feeder.cc index ae7e5406e2e..b0ce60ec0da 100644 --- a/broker/core/test/processing/feeder.cc +++ b/broker/core/test/processing/feeder.cc @@ -61,7 +61,8 @@ class TestFeeder : public ::testing::Test { multiplexing::muxer_filter read_filters; multiplexing::muxer_filter write_filters; _feeder = - feeder::create("test-feeder", client, read_filters, write_filters); + feeder::create("test-feeder", multiplexing::engine::instance_ptr(), + client, read_filters, write_filters); } void TearDown() override { From 5963f43cfc3d5a879b705273c18ee02bc4b60b6d Mon Sep 17 00:00:00 2001 From: David Boucher Date: Wed, 18 Oct 2023 12:14:39 +0200 Subject: [PATCH 42/84] fix(ci) --- .github/workflows/package-collect.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/package-collect.yml b/.github/workflows/package-collect.yml index 5cc4391c837..560704334da 100644 --- a/.github/workflows/package-collect.yml +++ b/.github/workflows/package-collect.yml @@ -88,7 +88,7 @@ jobs: sudo $CMAKE \ -G "Ninja" \ - -DDEBUG_ROBOT \ + -DDEBUG_ROBOT=ON \ -DWITH_TESTING=OFF \ -DWITH_BENCH=ON \ -DWITH_MODULE_SIMU=OFF \ From 350b1327b891961de893fcd2d43e6920123c815b Mon Sep 17 00:00:00 2001 From: David Boucher Date: Wed, 18 Oct 2023 13:54:13 +0200 Subject: [PATCH 43/84] fix(broker): mysql_connection finish() may finish too late --- broker/core/sql/src/mysql_connection.cc | 21 ++++++++++++++++++--- tests/migration/migration.robot | 18 +++++++++--------- 2 files changed, 27 insertions(+), 12 deletions(-) diff --git a/broker/core/sql/src/mysql_connection.cc b/broker/core/sql/src/mysql_connection.cc index 704d85d40d5..387e50f92ce 100644 --- a/broker/core/sql/src/mysql_connection.cc +++ b/broker/core/sql/src/mysql_connection.cc @@ -19,6 +19,7 @@ #include "com/centreon/broker/config/applier/init.hh" #include "com/centreon/broker/log_v2.hh" +#include "com/centreon/broker/misc/misc.hh" #include "com/centreon/broker/sql/mysql_manager.hh" #include "com/centreon/exceptions/msg_fmt.hh" @@ -1051,6 +1052,7 @@ void mysql_connection::_process_while_empty_task( if (_tasks_list.empty()) { _state = finished; + _start_condition.notify_all(); } else { tasks_list.swap(_tasks_list); lock.unlock(); @@ -1087,6 +1089,8 @@ mysql_connection::mysql_connection(const database_config& db_cfg, _last_stats{std::time(nullptr)}, _qps(db_cfg.get_queries_per_transaction()), _category(db_cfg.get_category()) { + DEBUG(fmt::format("CONSTRUCTOR mysql_connection {:p}", + static_cast(this))); std::unique_lock lck(_start_m); SPDLOG_LOGGER_INFO(log_v2::sql(), "mysql_connection: starting connection {:p} to {}", @@ -1117,6 +1121,8 @@ mysql_connection::~mysql_connection() { finish(); stats::center::instance().remove_connection(_proto_stats); _thread->join(); + DEBUG(fmt::format("DESTRUCTOR mysql_connection {:p}", + static_cast(this))); } void mysql_connection::_push(std::unique_ptr&& q) { @@ -1186,10 +1192,19 @@ void mysql_connection::run_statement_and_get_result( std::move(promise))); } +/** + * @brief Stop the mysql_connection and waits for it to be completly stopped. + */ void mysql_connection::finish() { - std::lock_guard lock(_tasks_m); - _finish_asked = true; - _tasks_condition.notify_all(); + { + std::lock_guard lock(_tasks_m); + _finish_asked = true; + _tasks_condition.notify_all(); + } + { + std::unique_lock lock(_start_m); + _start_condition.wait(lock, [this] { return _state == finished; }); + } } bool mysql_connection::fetch_row(mysql_result& result) { diff --git a/tests/migration/migration.robot b/tests/migration/migration.robot index 342cc8dfff2..77d6d9cb269 100644 --- a/tests/migration/migration.robot +++ b/tests/migration/migration.robot @@ -34,10 +34,10 @@ MIGRATION Start Engine ${contentCentral} Create List SQL: processing service status event - ${result} Find In Log With Timeout ${centralLog} ${start} ${contentCentral} 200 - Should Be True ${result} No service status processed by the sql output for 200s + ${result} Find In Log With Timeout ${centralLog} ${start} ${contentCentral} 60 + Should Be True ${result} No service status processed by the sql output for 60s ${contentRRD} Create List RRD: output::write - ${result} Find In Log With Timeout ${rrdLog} ${start} ${contentRRD} 30 + ${result} Find In Log With Timeout ${rrdLog} ${start} ${contentRRD} 60 Should Be True ${result} No metric sent to rrd cbd for 30s Config Broker Sql Output central unified_sql @@ -51,8 +51,8 @@ MIGRATION Sleep 2s ${contentCentral} Create List SQL: processing service status event - ${result} Find In Log With Timeout ${centralLog} ${start} ${contentCentral} 200 - Should Be True ${result} No service status processed by the unified_sql output for 200s + ${result} Find In Log With Timeout ${centralLog} ${start} ${contentCentral} 60 + Should Be True ${result} No service status processed by the unified_sql output for 60s ${contentRRD} Create List RRD: output::write ${result} Find In Log With Timeout ${rrdLog} ${start} ${contentRRD} 30 Should Be True ${result} No metric sent to rrd cbd by unified_sql for 30s @@ -72,8 +72,8 @@ MIGRATION Sleep 2s ${contentCentral} Create List status check result output: - ${result} Find In Log With Timeout ${centralLog} ${start} ${contentCentral} 200 - Should Be True ${result} No pb service status processed by the unified_sql output with BBDO3 for 200s + ${result} Find In Log With Timeout ${centralLog} ${start} ${contentCentral} 60 + Should Be True ${result} No pb service status processed by the unified_sql output with BBDO3 for 60s ${contentRRD} Create List RRD: output::write ${result} Find In Log With Timeout ${rrdLog} ${start} ${contentRRD} 30 Should Be True ${result} No metric sent to rrd cbd by unified_sql for 30s @@ -93,8 +93,8 @@ MIGRATION Sleep 2s ${contentCentral} Create List SQL: processing service status event - ${result} Find In Log With Timeout ${centralLog} ${start} ${contentCentral} 200 - Should Be True ${result} No service status processed by the unified_sql output for 200s + ${result} Find In Log With Timeout ${centralLog} ${start} ${contentCentral} 60 + Should Be True ${result} No service status processed by the unified_sql output for 60s ${contentRRD} Create List RRD: output::write ${result} Find In Log With Timeout ${rrdLog} ${start} ${contentRRD} 30 Should Be True ${result} No metric sent to rrd cbd by unified_sql for 30s From 0f553418b73115dd8715cccf5001e72dd92118d3 Mon Sep 17 00:00:00 2001 From: David Boucher Date: Wed, 18 Oct 2023 16:31:21 +0200 Subject: [PATCH 44/84] fix(broker/mysql_connection): issue when the connection thread is stopped --- .../centreon/broker/multiplexing/engine.hh | 2 +- .../com/centreon/broker/multiplexing/muxer.hh | 1 + broker/core/multiplexing/src/engine.cc | 2 +- broker/core/multiplexing/src/muxer.cc | 9 ++++++- .../centreon/broker/sql/mysql_connection.hh | 3 ++- broker/core/sql/src/mysql_connection.cc | 26 +++++++++++++------ broker/core/sql/src/mysql_manager.cc | 2 +- broker/core/src/processing/feeder.cc | 4 +-- tests/broker/sql.robot | 1 - 9 files changed, 34 insertions(+), 16 deletions(-) diff --git a/broker/core/multiplexing/inc/com/centreon/broker/multiplexing/engine.hh b/broker/core/multiplexing/inc/com/centreon/broker/multiplexing/engine.hh index 0a0fd8e2f97..21d6d7cb984 100644 --- a/broker/core/multiplexing/inc/com/centreon/broker/multiplexing/engine.hh +++ b/broker/core/multiplexing/inc/com/centreon/broker/multiplexing/engine.hh @@ -112,7 +112,7 @@ class engine : public std::enable_shared_from_this { void start(); void stop(); void subscribe(muxer* subscriber); - void unsubscribe(const muxer* subscriber); + void unsubscribe_muxer(const muxer* subscriber); }; } // namespace multiplexing diff --git a/broker/core/multiplexing/inc/com/centreon/broker/multiplexing/muxer.hh b/broker/core/multiplexing/inc/com/centreon/broker/multiplexing/muxer.hh index 1c78e495243..21a75f8db3e 100644 --- a/broker/core/multiplexing/inc/com/centreon/broker/multiplexing/muxer.hh +++ b/broker/core/multiplexing/inc/com/centreon/broker/multiplexing/muxer.hh @@ -124,6 +124,7 @@ class muxer : public io::stream { void set_read_filter(const muxer_filter& w_filter); void set_write_filter(const muxer_filter& w_filter); void clear_read_handler(); + void unsubscribe(); }; /** diff --git a/broker/core/multiplexing/src/engine.cc b/broker/core/multiplexing/src/engine.cc index dc2c6abf25a..44b369cf817 100644 --- a/broker/core/multiplexing/src/engine.cc +++ b/broker/core/multiplexing/src/engine.cc @@ -263,7 +263,7 @@ void engine::subscribe(muxer* subscriber) { * * @param[in] subscriber Subscriber. */ -void engine::unsubscribe(const muxer* subscriber) { +void engine::unsubscribe_muxer(const muxer* subscriber) { std::lock_guard l(_engine_m); for (auto it = _muxers.begin(); it != _muxers.end(); ++it) { if (*it == subscriber) { diff --git a/broker/core/multiplexing/src/muxer.cc b/broker/core/multiplexing/src/muxer.cc index 3594ad09890..6651e331512 100644 --- a/broker/core/multiplexing/src/muxer.cc +++ b/broker/core/multiplexing/src/muxer.cc @@ -196,7 +196,7 @@ std::shared_ptr muxer::create(std::string name, */ muxer::~muxer() noexcept { stats::center::instance().unregister_muxer(_name); - _engine->unsubscribe(this); + unsubscribe(); std::lock_guard lock(_mutex); SPDLOG_LOGGER_INFO(log_v2::core(), "Destroying muxer {}: number of events in the queue: {}", @@ -747,3 +747,10 @@ void muxer::clear_read_handler() { std::unique_lock lock(_mutex); _read_handler = nullptr; } + +/** + * @brief Unsubscribe this muxer from the parent engine. + */ +void muxer::unsubscribe() { + _engine->unsubscribe_muxer(this); +} diff --git a/broker/core/sql/inc/com/centreon/broker/sql/mysql_connection.hh b/broker/core/sql/inc/com/centreon/broker/sql/mysql_connection.hh index 090a95ae363..c3a0b8b196b 100644 --- a/broker/core/sql/inc/com/centreon/broker/sql/mysql_connection.hh +++ b/broker/core/sql/inc/com/centreon/broker/sql/mysql_connection.hh @@ -144,6 +144,7 @@ class mysql_connection { std::list>& tasks_list); inline void set_need_to_commit() { _need_commit = true; } + void _finish(); public: /**************************************************************************/ @@ -177,7 +178,6 @@ class mysql_connection { stmt, std::move(promise), type)); } - void finish(); bool fetch_row(database::mysql_result& result); mysql_bind_mapping get_stmt_mapping(int stmt_id) const; bool match_config(database_config const& db_cfg) const; @@ -198,6 +198,7 @@ class mysql_connection { if (!_error.is_active()) _error.set_message(fmt, args...); } + void stop(); }; CCB_END() diff --git a/broker/core/sql/src/mysql_connection.cc b/broker/core/sql/src/mysql_connection.cc index 387e50f92ce..1e813e2ca0c 100644 --- a/broker/core/sql/src/mysql_connection.cc +++ b/broker/core/sql/src/mysql_connection.cc @@ -890,7 +890,7 @@ void mysql_connection::_run() { SPDLOG_LOGGER_ERROR(log_v2::sql(), "SQL: Reconnection failed."); reconnect_failed_logged = true; } else if (config::applier::mode == config::applier::finished) { - finish(); + _finish(); /* We avoid deadlocks in case of broker termination and database * error */ _send_exceptions_to_task_futures(tasks_list); @@ -910,6 +910,8 @@ void mysql_connection::_run() { } } _clear_connection(); + _state = finished; + _start_condition.notify_all(); mysql_thread_end(); log_v2::core()->trace("mysql connection main loop finished."); } @@ -1118,7 +1120,7 @@ mysql_connection::mysql_connection(const database_config& db_cfg, mysql_connection::~mysql_connection() { SPDLOG_LOGGER_INFO(log_v2::sql(), "mysql_connection {:p}: finished", static_cast(this)); - finish(); + stop(); stats::center::instance().remove_connection(_proto_stats); _thread->join(); DEBUG(fmt::format("DESTRUCTOR mysql_connection {:p}", @@ -1192,15 +1194,23 @@ void mysql_connection::run_statement_and_get_result( std::move(promise))); } +/** + * @brief Asks the mysql_connection main thread to be stopped. It doesn't wait + * for it to happen. If you want to wait, call stop(). + */ +void mysql_connection::_finish() { + std::lock_guard lock(_tasks_m); + _finish_asked = true; + _tasks_condition.notify_all(); +} + /** * @brief Stop the mysql_connection and waits for it to be completly stopped. + * This function mustn't be called from the mysql_connection main thread + * or we'll have a deadlock. */ -void mysql_connection::finish() { - { - std::lock_guard lock(_tasks_m); - _finish_asked = true; - _tasks_condition.notify_all(); - } +void mysql_connection::stop() { + _finish(); { std::unique_lock lock(_start_m); _start_condition.wait(lock, [this] { return _state == finished; }); diff --git a/broker/core/sql/src/mysql_manager.cc b/broker/core/sql/src/mysql_manager.cc index de2fe4a94d1..dfbeb878d5b 100644 --- a/broker/core/sql/src/mysql_manager.cc +++ b/broker/core/sql/src/mysql_manager.cc @@ -143,7 +143,7 @@ void mysql_manager::clear() { for (std::shared_ptr& conn : _connection) { if (!conn.unique() && !conn->is_finish_asked()) try { - conn->finish(); + conn->stop(); } catch (const std::exception& e) { log_v2::sql()->info("mysql_manager: Unable to stop a connection: {}", e.what()); diff --git a/broker/core/src/processing/feeder.cc b/broker/core/src/processing/feeder.cc index fe99685294b..fb2bbdb0cc8 100644 --- a/broker/core/src/processing/feeder.cc +++ b/broker/core/src/processing/feeder.cc @@ -108,7 +108,7 @@ feeder::~feeder() { static_cast(this)); stop(); - multiplexing::engine::instance_ptr()->unsubscribe(_muxer.get()); + _muxer->unsubscribe(); DEBUG(fmt::format("DESTRUCTOR feeder {:p}", static_cast(this))); } @@ -285,7 +285,7 @@ void feeder::_stop_no_lock() { set_state("disconnected"); // muxer should not receive events - multiplexing::engine::instance_ptr()->unsubscribe(_muxer.get()); + _muxer->unsubscribe(); _stat_timer.cancel(); _read_from_stream_timer.cancel(); diff --git a/tests/broker/sql.robot b/tests/broker/sql.robot index 8cc3180504f..348565a73ff 100644 --- a/tests/broker/sql.robot +++ b/tests/broker/sql.robot @@ -289,7 +289,6 @@ BDBU1 Config Broker central Config Broker Sql Output central unified_sql Config Broker rrd - Config Broker module # We replace the usual centreon_storage database by centreon to make the wanted error Broker Config Output Set central central-broker-unified-sql db_name centreon Broker Config Log central sql trace From 692e322b9b6fc05afb8efc91b99e938c98f0c38b Mon Sep 17 00:00:00 2001 From: David Boucher Date: Wed, 18 Oct 2023 17:47:17 +0200 Subject: [PATCH 45/84] fix(tests/bam) --- tests/bam/boolean_rules.robot | 45 +++++++++++++++++------------------ 1 file changed, 22 insertions(+), 23 deletions(-) diff --git a/tests/bam/boolean_rules.robot b/tests/bam/boolean_rules.robot index fbb0ce46aa3..f3bc3444b59 100644 --- a/tests/bam/boolean_rules.robot +++ b/tests/bam/boolean_rules.robot @@ -239,35 +239,17 @@ BABOOORREL ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} A message telling check_for_external_commands() should be available. # 302 is set to critical => {host_16 service_302} {IS} {OK} is then False - Repeat Keyword - ... 3 times - ... Process Service Check Result - ... host_16 - ... service_302 - ... 2 - ... output critical for service_302 + Process Service Result Hard host_16 service_302 2 output critical for service_302 ${result} Check Service Status With Timeout host_16 service_302 2 30 HARD Should Be True ${result} The service (host_16,service_302) is not CRITICAL/HARD as expected # 303 is set to critical => {host_16 service_303} {IS} {OK} is then False - Repeat Keyword - ... 3 times - ... Process Service Check Result - ... host_16 - ... service_303 - ... 2 - ... output critical for service_303 + Process Service Result Hard host_16 service_303 2 output critical for service_303 ${result} Check Service Status With Timeout host_16 service_303 2 30 HARD Should Be True ${result} The service (host_16,service_303) is not CRITICAL/HARD as expected # 304 is set to ok => {host_16 service_304} {IS} {OK} is then True - Repeat Keyword - ... 3 times - ... Process Service Check Result - ... host_16 - ... service_304 - ... 0 - ... output ok for service_304 + Process Service Result Hard host_16 service_304 0 output ok for service_304 ${result} Check Service Status With Timeout host_16 service_304 0 30 HARD Should Be True ${result} The service (host_16,service_304) is not OK/HARD as expected @@ -279,13 +261,17 @@ BABOOORREL ... ${id_bool} ... {host_16 service_302} {IS} {OK} {OR} {host_16 service_304} {IS} {OK} - Restart Engine + Reload Engine Reload Broker # Let's wait for the external command check start ${content} Create List check_for_external_commands() ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} A message telling check_for_external_commands() should be available. + + Process Service Result Hard host_16 service_302 2 output ok for service_302 + Process Service Result Hard host_16 service_304 0 output ok for service_304 + ${result} Check Ba Status With Timeout boolean-ba 0 30 Dump Ba On Error ${result} ${id_ba__sid[0]} Should Be True ${result} The 'boolean-ba' BA is not OK as expected @@ -294,9 +280,12 @@ BABOOORREL ... ${id_bool} ... {host_16 service_302} {IS} {OK} {OR} {host_16 service_303} {IS} {OK} - Restart Engine + Reload Engine Reload Broker + Process Service Result Hard host_16 service_302 2 output critical for service_302 + Process Service Result Hard host_16 service_303 2 output critical for service_303 + # Let's wait for the external command check start ${content} Create List check_for_external_commands() ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 @@ -393,3 +382,13 @@ Dump Ba On Error Save Logs Dump Ba 51001 ${ba_id} failed/${Test Name}/ba_${ba_id}.dot END + +Process Service Result Hard + [Arguments] ${host} ${svc} ${state} ${output} + Repeat Keyword + ... 3 times + ... Process Service Check Result + ... ${host} + ... ${svc} + ... ${state} + ... ${output} From 9a94bc8815745bdc1978cb89d2ec64c1cf47b944 Mon Sep 17 00:00:00 2001 From: David Boucher Date: Wed, 18 Oct 2023 18:24:54 +0200 Subject: [PATCH 46/84] fix(tests): reverse-connection, db cleanup added --- tests/broker-engine/reverse-connection.robot | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/broker-engine/reverse-connection.robot b/tests/broker-engine/reverse-connection.robot index 9072ed6a9ca..1e691332705 100644 --- a/tests/broker-engine/reverse-connection.robot +++ b/tests/broker-engine/reverse-connection.robot @@ -3,6 +3,7 @@ Documentation Centreon Broker and Engine communication with or without com Resource ../resources/resources.robot Library Process +Library DatabaseLibrary Library OperatingSystem Library DateTime Library String @@ -160,6 +161,7 @@ BRCTSMN BRCTSMNS [Documentation] Broker connected to map with neb and storage filters [Tags] broker map reverse connection + Clear Metrics Config Engine ${1} Config Broker rrd Config Broker central_map @@ -184,7 +186,7 @@ BRCTSMNS # Let's wait for the external command check start ${content} Create List check_for_external_commands() ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 - Should Be True ${result} A message telling check_for_external_commands() should be available. + Should Be True ${result} A message about check_for_external_commands() should be available. # pb_service pb_host pb_service_status pb_host_status pb_metric pb_status pb_index_mapping ${expected_events} Create List 65563 65566 65565 65568 196617 196618 196619 ${categories} Create List 1 3 From c721d2196161f348a92f73b73a4cc59561a7cfc6 Mon Sep 17 00:00:00 2001 From: David Boucher Date: Wed, 18 Oct 2023 23:19:47 +0200 Subject: [PATCH 47/84] fix(ci): DEBUG_ROBOT set to OFF --- .github/workflows/package-collect.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/package-collect.yml b/.github/workflows/package-collect.yml index 560704334da..9a7d3eb8a24 100644 --- a/.github/workflows/package-collect.yml +++ b/.github/workflows/package-collect.yml @@ -88,7 +88,7 @@ jobs: sudo $CMAKE \ -G "Ninja" \ - -DDEBUG_ROBOT=ON \ + -DDEBUG_ROBOT=OFF \ -DWITH_TESTING=OFF \ -DWITH_BENCH=ON \ -DWITH_MODULE_SIMU=OFF \ From 4a193148853810df60bfcdc655b83e61c4f2019f Mon Sep 17 00:00:00 2001 From: David Boucher Date: Thu, 19 Oct 2023 12:43:28 +0200 Subject: [PATCH 48/84] wip(tests): on bench --- tests/broker-engine/bench.robot | 5 ++--- tests/resources/Bench.py | 6 +----- tests/resources/Common.py | 25 +++++++++++++++++++++++++ 3 files changed, 28 insertions(+), 8 deletions(-) diff --git a/tests/broker-engine/bench.robot b/tests/broker-engine/bench.robot index 18e6010f80a..699ca66372c 100644 --- a/tests/broker-engine/bench.robot +++ b/tests/broker-engine/bench.robot @@ -178,13 +178,12 @@ BENCH_1000STATUS_100${suffixe} Start Broker Start Engine ${connected} Wait For Connections 5669 100 - Should Be True ${connected} No 100 engine to broker connections + Should Be True ${connected} 100 engines should be connected to broker + ${result} Wait For Listen On Range 50001 50100 centengine 60 ${content} Create List check_for_external_commands ${result} Find In Log With Timeout ${ENGINE_LOG}/config99/centengine.log ${start} ${content} 60 Should Be True ${result} No check for external commands executed for 1mn. - Sleep 5 - ${broker_stat_before} Get Broker Process Stat 51001 ${engine_stat_before} Get Engine Process Stat 50001 diff --git a/tests/resources/Bench.py b/tests/resources/Bench.py index 8eab0da08e2..3962aab12f8 100644 --- a/tests/resources/Bench.py +++ b/tests/resources/Bench.py @@ -161,11 +161,6 @@ def store_result_in_unqlite(file_path: str, test_name: str, broker_or_engine: s version = version[0:version.rfind(".")] + ".x" row['origin'] = version - # rev_name is like ~* - rev_name_dev_branch = re.compile( - r'[0-9a-f]+\s(dev[\w\.]+).*') - remote_rev_name_dev_branch = re.compile( - r'[0-9a-f]+\sremotes/origin/(dev[\w\.]+).*') # git branch and commit try: repo = Repo(os.getcwd()) @@ -179,6 +174,7 @@ def store_result_in_unqlite(file_path: str, test_name: str, broker_or_engine: s else: row['commit'] = repo.head.commit.hexsha row['t'] = time.time() + row['branch'] = repo.head.name db = UnQLite(file_path) benchs = db.collection( f'collectbench_{test_name}_{broker_or_engine}_{bench_event_result["id"]}') diff --git a/tests/resources/Common.py b/tests/resources/Common.py index 1abc12b72b9..b183da760f5 100644 --- a/tests/resources/Common.py +++ b/tests/resources/Common.py @@ -76,6 +76,31 @@ def wait_for_connections(port: int, nb: int, timeout: int = 60): return False +def wait_for_listen_on_range(port1: int, port2: int, prog: str, timeout: int = 30): + port1 = int(port1) + port2 = int(port2) + rng = range(port1, port2 + 1) + limit = time.time() + timeout + r = re.compile(rf"^LISTEN [0-9]+\s+[0-9]+\s+\[::1\]:([0-9]+)\s+.*{prog}") + size = port2 - port1 + 1 + + def ok(l): + m = r.match(l) + if m: + value = int(m.group(1)) + if int(m.group(1)) in rng: + return True + return False + + while time.time() < limit: + out = getoutput("ss -plant") + lst = out.split('\n') + listen_port = list(filter(ok, lst)) + if len(listen_port) >= size: + return True + return False + + def get_date(d: str): """Generates a date from a string. This string can be just a timestamp or a date in iso format From 6641f0db66d65496d0d47721e035f69f64adbb24 Mon Sep 17 00:00:00 2001 From: David Boucher Date: Thu, 19 Oct 2023 13:42:22 +0200 Subject: [PATCH 49/84] enh(broker): shared_from_this no more used --- .../centreon/broker/multiplexing/engine.hh | 34 +++++++++---------- broker/core/multiplexing/src/engine.cc | 2 +- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/broker/core/multiplexing/inc/com/centreon/broker/multiplexing/engine.hh b/broker/core/multiplexing/inc/com/centreon/broker/multiplexing/engine.hh index 21d6d7cb984..89af33422fa 100644 --- a/broker/core/multiplexing/inc/com/centreon/broker/multiplexing/engine.hh +++ b/broker/core/multiplexing/inc/com/centreon/broker/multiplexing/engine.hh @@ -1,20 +1,20 @@ /* -** Copyright 2009-2012,2015,2019-2021 Centreon -** -** Licensed under the Apache License, Version 2.0 (the "License"); -** you may not use this file except in compliance with the License. -** You may obtain a copy of the License at -** -** http://www.apache.org/licenses/LICENSE-2.0 -** -** Unless required by applicable law or agreed to in writing, software -** distributed under the License is distributed on an "AS IS" BASIS, -** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -** See the License for the specific language governing permissions and -** limitations under the License. -** -** For more information : contact@centreon.com -*/ + * Copyright 2009-2012,2015,2019-2021 Centreon + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * For more information : contact@centreon.com + */ #ifndef CCB_MULTIPLEXING_ENGINE_HH #define CCB_MULTIPLEXING_ENGINE_HH @@ -63,7 +63,7 @@ class callback_caller; * * @see muxer */ -class engine : public std::enable_shared_from_this { +class engine { static std::mutex _load_m; static std::shared_ptr _instance; diff --git a/broker/core/multiplexing/src/engine.cc b/broker/core/multiplexing/src/engine.cc index 44b369cf817..95ba63cd266 100644 --- a/broker/core/multiplexing/src/engine.cc +++ b/broker/core/multiplexing/src/engine.cc @@ -384,7 +384,7 @@ bool engine::_send_to_subscribers(send_to_mux_callback_type&& callback) { // it will be destroyed at the end of the scope of this function and at the // end of lambdas posted cb = std::make_shared(std::move(callback), - shared_from_this()); + _instance); last_muxer = *_muxers.rbegin(); if (_muxers.size() > 1) { /* Since the sending is parallelized, we use the thread pool for this From 073b315ae9770070cf061ac33d980409c5c8658b Mon Sep 17 00:00:00 2001 From: David Boucher Date: Thu, 19 Oct 2023 13:42:52 +0200 Subject: [PATCH 50/84] tests(bam): bam_pb has more checks --- tests/bam/bam_pb.robot | 46 ++++++++++++++++++++++++++++----- tests/bam/boolean_rules.robot | 7 ----- tests/resources/resources.robot | 8 ++++++ 3 files changed, 48 insertions(+), 13 deletions(-) diff --git a/tests/bam/bam_pb.robot b/tests/bam/bam_pb.robot index 2528393c0ce..a347bcdfed5 100644 --- a/tests/bam/bam_pb.robot +++ b/tests/bam/bam_pb.robot @@ -24,7 +24,7 @@ BAWORST BAM Init @{svc} Set Variable ${{ [("host_16", "service_314"), ("host_16", "service_303")] }} - Create Ba With Services test worst ${svc} + ${ba__svc} Create Ba With Services test worst ${svc} Start Broker ${start} Get Current Date Start Engine @@ -35,6 +35,7 @@ BAWORST Should Be True ${result} A message telling check_for_external_commands() should be available. ${result} Check Ba Status With Timeout test 0 60 + Dump Ba On Error ${result} ${ba__svc[0]} Should Be True ${result} The BA test is not OK as expected ${result} Check Ba Output With Timeout @@ -51,6 +52,7 @@ BAWORST # The BA should become unknown ${result} Check Ba Status With Timeout test 3 60 + Dump Ba On Error ${result} ${ba__svc[0]} Should Be True ${result} The BA test is not UNKNOWN as expected ${result} Check Ba Output With Timeout @@ -67,6 +69,7 @@ BAWORST # The BA should become warning ${result} Check Ba Status With Timeout test 1 60 + Dump Ba On Error ${result} ${ba__svc[0]} Should Be True ${result} The BA test is not WARNING as expected ${result} Check Ba Output With Timeout @@ -83,6 +86,7 @@ BAWORST # The BA should become critical ${result} Check Ba Status With Timeout test 2 60 + Dump Ba On Error ${result} ${ba__svc[0]} Should Be True ${result} The BA test is not CRITICAL as expected Connect To Database pymysql ${DBNameConf} ${DBUser} ${DBPass} ${DBHost} ${DBPort} @@ -104,7 +108,7 @@ BABEST_SERVICE_CRITICAL BAM Init @{svc} Set Variable ${{ [("host_16", "service_314"), ("host_16", "service_303")] }} - Create Ba With Services test best ${svc} + ${ba__svc} Create Ba With Services test best ${svc} # Command of service_314 is set to critical ${cmd_1} Get Command Id 314 Log To Console service_314 has command id ${cmd_1} @@ -118,6 +122,7 @@ BABEST_SERVICE_CRITICAL Should Be True ${result} A message telling check_for_external_commands() should be available. ${result} Check Ba Status With Timeout test 0 60 + Dump Ba On Error ${result} ${ba__svc[0]} Should Be True ${result} The BA test is not OK as expected ${result} Check Ba Output With Timeout @@ -135,6 +140,7 @@ BABEST_SERVICE_CRITICAL # The BA should remain OK Sleep 2s ${result} Check Ba Status With Timeout test 0 60 + Dump Ba On Error ${result} ${ba__svc[0]} Should Be True ${result} The BA test is not OK as expected ${result} Check Ba Output With Timeout ... test @@ -150,6 +156,7 @@ BABEST_SERVICE_CRITICAL # The BA should become warning ${result} Check Ba Status With Timeout test 3 60 + Dump Ba On Error ${result} ${ba__svc[0]} Should Be True ${result} The BA test is not UNKNOWN as expected ${result} Check Ba Output With Timeout ... test @@ -165,6 +172,7 @@ BABEST_SERVICE_CRITICAL # The BA should become warning ${result} Check Ba Status With Timeout test 1 60 + Dump Ba On Error ${result} ${ba__svc[0]} Should Be True ${result} The BA test is not WARNING as expected ${result} Check Ba Output With Timeout ... test @@ -180,6 +188,7 @@ BABEST_SERVICE_CRITICAL # The BA should become critical ${result} Check Ba Status With Timeout test 2 60 + Dump Ba On Error ${result} ${ba__svc[0]} Should Be True ${result} The BA test is not CRITICAL as expected ${result} Check Ba Output With Timeout ... test @@ -195,6 +204,7 @@ BABEST_SERVICE_CRITICAL # The BA should become OK ${result} Check Ba Status With Timeout test 0 60 + Dump Ba On Error ${result} ${ba__svc[0]} Should Be True ${result} The BA test is not OK as expected [Teardown] Run Keywords Stop Engine AND Kindly Stop Broker @@ -227,6 +237,7 @@ BA_IMPACT_2KPI_SERVICES ${result} Check Service Status With Timeout host_16 service_302 2 60 HARD Should Be True ${result} The service (host_16,service_302) is not CRITICAL as expected ${result} Check Ba Status With Timeout test 0 60 + Dump Ba On Error ${result} ${id_ba__sid[0]} Should Be True ${result} The BA test is not OK as expected ${result} Check Ba Output With Timeout ... test @@ -244,6 +255,7 @@ BA_IMPACT_2KPI_SERVICES ${result} Check Service Status With Timeout host_16 service_303 1 60 HARD Should Be True ${result} The service (host_16,service_303) is not WARNING as expected ${result} Check Ba Status With Timeout test 1 60 + Dump Ba On Error ${result} ${id_ba__sid[0]} Should Be True ${result} The BA ba_1 is not WARNING as expected ${result} Check Ba Output With Timeout ... test @@ -269,6 +281,7 @@ BA_IMPACT_2KPI_SERVICES ${result} Check Service Status With Timeout host_16 service_303 2 60 HARD Should Be True ${result} The service (host_16,service_303) is not CRITICAL as expected ${result} Check Ba Status With Timeout test 2 60 + Dump Ba On Error ${result} ${id_ba__sid[0]} Should Be True ${result} The BA ba_1 is not CRITICAL as expected ${result} Check Ba Output With Timeout ... test @@ -281,6 +294,7 @@ BA_IMPACT_2KPI_SERVICES ${result} Check Service Status With Timeout host_16 service_302 0 60 HARD Should Be True ${result} The service (host_16,service_302) is not OK as expected ${result} Check Ba Status With Timeout test 0 60 + Dump Ba On Error ${result} ${id_ba__sid[0]} Should Be True ${result} The BA ba_1 is not OK as expected ${result} Check Ba Output With Timeout ... test @@ -308,6 +322,7 @@ BA_IMPACT_2KPI_SERVICES ${result} Check Service Status With Timeout host_16 service_303 1 60 HARD Should Be True ${result} The service (host_16,service_303) is not WARNING as expected ${result} Check Ba Status With Timeout test 0 60 + Dump Ba On Error ${result} ${id_ba__sid[0]} Should Be True ${result} The BA test is not OK as expected ${result} Check Ba Output With Timeout ... test @@ -339,6 +354,7 @@ BA_RATIO_PERCENT_BA_SERVICE Should Be True ${result} A message telling check_for_external_commands() should be available. ${result} Check Ba Status With Timeout test 0 60 + Dump Ba On Error ${result} ${id_ba__sid[0]} Should Be True ${result} The BA test is not OK as expected ${result} Check Ba Output With Timeout ... test @@ -358,6 +374,7 @@ BA_RATIO_PERCENT_BA_SERVICE Should Be True ${result} The service (host_16,service_302) is not CRITICAL as expected Sleep 2s ${result} Check Ba Status With Timeout test 0 60 + Dump Ba On Error ${result} ${id_ba__sid[0]} Should Be True ${result} The BA test is not OK as expected ${result} Check Ba Output With Timeout ... test @@ -385,6 +402,7 @@ BA_RATIO_PERCENT_BA_SERVICE ${result} Check Service Status With Timeout host_16 service_303 2 30 HARD Should Be True ${result} The service (host_16,service_303) is not CRITICAL as expected ${result} Check Ba Status With Timeout test 1 30 + Dump Ba On Error ${result} ${id_ba__sid[0]} Should Be True ${result} The BA test is not WARNING as expected ${result} Check Ba Output With Timeout ... test @@ -417,8 +435,10 @@ BA_RATIO_PERCENT_BA_SERVICE ${result} Check Service Status With Timeout host_16 service_314 2 30 HARD Should Be True ${result} The service (host_16,service_314) is not CRITICAL as expected ${result} Check Ba Status With Timeout test_child 2 30 + Dump Ba On Error ${result} ${id_ba__sid[0]} Should Be True ${result} The BA test_child is not CRITICAL as expected ${result} Check Ba Status With Timeout test 2 30 + Dump Ba On Error ${result} ${id_ba__sid[0]} Should Be True ${result} The BA test is not CRITICAL as expected ${result} Check Ba Output With Timeout ... test @@ -450,6 +470,7 @@ BA_RATIO_NUMBER_BA_SERVICE Should Be True ${result} A message telling check_for_external_commands() should be available. ${result} Check Ba Status With Timeout test 0 60 + Dump Ba On Error ${result} ${id_ba__sid[0]} Should Be True ${result} The BA test is not OK as expected ${result} Check Ba Output With Timeout ... test @@ -469,6 +490,7 @@ BA_RATIO_NUMBER_BA_SERVICE Should Be True ${result} The service (host_16,service_302) is not CRITICAL as expected ${result} Check Ba Status With Timeout test 0 60 + Dump Ba On Error ${result} ${id_ba__sid[0]} Should Be True ${result} The BA test is not OK as expected ${result} Check Ba Output With Timeout @@ -497,6 +519,7 @@ BA_RATIO_NUMBER_BA_SERVICE ${result} Check Service Status With Timeout host_16 service_303 2 30 HARD Should Be True ${result} The service (host_16,service_303) is not CRITICAL as expected ${result} Check Ba Status With Timeout test 1 60 + Dump Ba On Error ${result} ${id_ba__sid[0]} Should Be True ${result} The test BA is not in WARNING as expected ${result} Check Ba Output With Timeout ... test @@ -533,8 +556,10 @@ BA_RATIO_NUMBER_BA_SERVICE ${result} Check Service Status With Timeout host_16 service_314 2 30 HARD Should Be True ${result} The service (host_16,service_314) is not CRITICAL as expected ${result} Check Ba Status With Timeout test_child 2 30 + Dump Ba On Error ${result} ${id_ba__sid[0]} Should Be True ${result} The BA test_child is not CRITICAL as expected ${result} Check Ba Status With Timeout test 2 60 + Dump Ba On Error ${result} ${id_ba__sid[0]} Should Be True ${result} The BA test is not CRITICAL as expected ${result} Check Ba Output With Timeout ... test @@ -589,6 +614,7 @@ BA_BOOL_KPI # Schedule Forced Svc Check _Module_BAM_1 ba_1 ${result} Check Ba Status With Timeout test 2 30 + Dump Ba On Error ${result} ${id_ba__sid[0]} Should Be True ${result} The BA test is not CRITICAL as expected [Teardown] Run Keywords Stop Engine AND Kindly Stop Broker @@ -598,7 +624,7 @@ BEPB_DIMENSION_BV_EVENT [Tags] broker engine protobuf bam bbdo BAM Init - Create Ba test worst 100 100 + ${id_ba__sid} Create Ba test worst 100 100 Remove File /tmp/all_lua_event.log @@ -632,7 +658,7 @@ BEPB_DIMENSION_BA_EVENT Remove File /tmp/all_lua_event.log @{svc} Set Variable ${{ [("host_16", "service_314")] }} - Create Ba With Services test worst ${svc} + ${id_ba__sid} Create Ba With Services test worst ${svc} Broker Config Add Lua Output central test-protobuf ${SCRIPTS}test-log-all-event.lua @@ -666,7 +692,7 @@ BEPB_DIMENSION_BA_BV_RELATION_EVENT Clear Db mod_bam_reporting_relations_ba_bv @{svc} Set Variable ${{ [("host_16", "service_314")] }} - Create Ba With Services test worst ${svc} + ${id_ba__sid} Create Ba With Services test worst ${svc} Broker Config Add Lua Output central test-protobuf ${SCRIPTS}test-log-all-event.lua @@ -700,7 +726,7 @@ BEPB_DIMENSION_TIMEPERIOD BAM Init @{svc} Set Variable ${{ [("host_16", "service_314")] }} - Create Ba With Services test worst ${svc} + ${id_ba__sid} Create Ba With Services test worst ${svc} Remove File /tmp/all_lua_event.log @@ -927,6 +953,7 @@ BA_RATIO_NUMBER_BA_4_SERVICE # all serv ok => ba ok ${result} Check Ba Status With Timeout test 0 60 + Dump Ba On Error ${result} ${id_ba__sid[0]} Should Be True ${result} The BA test is not OK as expected # one serv critical => ba warning @@ -940,6 +967,7 @@ BA_RATIO_NUMBER_BA_4_SERVICE ${result} Check Service Status With Timeout host_16 service_302 2 30 HARD Should Be True ${result} The service (host_16,service_302) is not CRITICAL as expected ${result} Check Ba Status With Timeout test 1 30 + Dump Ba On Error ${result} ${id_ba__sid[0]} Should Be True ${result} The BA test is not WARNING as expected # two services critical => ba ok @@ -953,6 +981,7 @@ BA_RATIO_NUMBER_BA_4_SERVICE ${result} Check Service Status With Timeout host_16 service_303 2 30 HARD Should Be True ${result} The service (host_16,service_303) is not CRITICAL as expected ${result} Check Ba Status With Timeout test 2 30 + Dump Ba On Error ${result} ${id_ba__sid[0]} Should Be True ${result} The BA test is not CRITICAL as expected # all serv ok => ba ok @@ -963,6 +992,7 @@ BA_RATIO_NUMBER_BA_4_SERVICE ${result} Check Service Status With Timeout host_16 service_303 0 30 HARD Should Be True ${result} The service (host_16,service_303) is not OK as expected ${result} Check Ba Status With Timeout test 0 30 + Dump Ba On Error ${result} ${id_ba__sid[0]} Should Be True ${result} The BA test is not OK as expected [Teardown] Run Keywords Stop Engine AND Kindly Stop Broker @@ -988,6 +1018,7 @@ BA_RATIO_PERCENT_BA_4_SERVICE # all serv ok => ba ok ${result} Check Ba Status With Timeout test 0 60 + Dump Ba On Error ${result} ${id_ba__sid[0]} Should Be True ${result} The BA test is not OK as expected # one serv critical => ba warning @@ -1001,6 +1032,7 @@ BA_RATIO_PERCENT_BA_4_SERVICE ${result} Check Service Status With Timeout host_16 service_302 2 30 HARD Should Be True ${result} The service (host_16,service_302) is not CRITICAL as expected ${result} Check Ba Status With Timeout test 1 30 + Dump Ba On Error ${result} ${id_ba__sid[0]} Should Be True ${result} The BA test is not WARNING as expected # two services critical => ba ok @@ -1014,6 +1046,7 @@ BA_RATIO_PERCENT_BA_4_SERVICE ${result} Check Service Status With Timeout host_16 service_303 2 30 HARD Should Be True ${result} The service (host_16,service_303) is not CRITICAL as expected ${result} Check Ba Status With Timeout test 2 30 + Dump Ba On Error ${result} ${id_ba__sid[0]} Should Be True ${result} The BA test is not CRITICAL as expected # all serv ok => ba ok @@ -1024,6 +1057,7 @@ BA_RATIO_PERCENT_BA_4_SERVICE ${result} Check Service Status With Timeout host_16 service_303 0 30 HARD Should Be True ${result} The service (host_16,service_303) is not OK as expected ${result} Check Ba Status With Timeout test 0 30 + Dump Ba On Error ${result} ${id_ba__sid[0]} Should Be True ${result} The BA test is not OK as expected [Teardown] Run Keywords Stop Engine AND Kindly Stop Broker diff --git a/tests/bam/boolean_rules.robot b/tests/bam/boolean_rules.robot index f3bc3444b59..b3593aae954 100644 --- a/tests/bam/boolean_rules.robot +++ b/tests/bam/boolean_rules.robot @@ -376,13 +376,6 @@ BAM Setup Execute SQL String ALTER TABLE mod_bam_reporting_ba_events AUTO_INCREMENT = 1 Execute SQL String SET GLOBAL FOREIGN_KEY_CHECKS=1 -Dump Ba On Error - [Arguments] ${result} ${ba_id} - IF not ${result} - Save Logs - Dump Ba 51001 ${ba_id} failed/${Test Name}/ba_${ba_id}.dot - END - Process Service Result Hard [Arguments] ${host} ${svc} ${state} ${output} Repeat Keyword diff --git a/tests/resources/resources.robot b/tests/resources/resources.robot index ea1209d7558..dd26d6d5335 100644 --- a/tests/resources/resources.robot +++ b/tests/resources/resources.robot @@ -319,3 +319,11 @@ Clear Metrics Execute SQL String DELETE FROM metrics Execute SQL String DELETE FROM index_data Execute SQL String DELETE FROM data_bin + +Dump Ba On Error + [Arguments] ${result} ${ba_id} + IF not ${result} + Save Logs + Dump Ba 51001 ${ba_id} failed/${Test Name}/ba_${ba_id}.dot + END + From 40b128a936be7f81aac6d06f30b091bd152f3ac6 Mon Sep 17 00:00:00 2001 From: David Boucher Date: Thu, 19 Oct 2023 14:32:59 +0200 Subject: [PATCH 51/84] fix(tests) --- tests/bam/bam_pb.robot | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tests/bam/bam_pb.robot b/tests/bam/bam_pb.robot index a347bcdfed5..2de6e953729 100644 --- a/tests/bam/bam_pb.robot +++ b/tests/bam/bam_pb.robot @@ -855,9 +855,7 @@ BEPB_BA_DURATION_EVENT ... SELECT start_time, end_time, duration, sla_duration, timeperiod_is_default FROM mod_bam_reporting_ba_events_durations WHERE ba_event_id = 1 Sleep 1s Log To Console ${output} - IF ${output} and len(${output}) >= 1 and len(${output[0]}) >= 5 - BREAK - END + IF "${output}" != "()" BREAK END Should Be True ${output[0][2]} == ${output[0][1]} - ${output[0][0]} @@ -891,7 +889,7 @@ BEPB_DIMENSION_BA_TIMEPERIOD_RELATION ${output} Query ... SELECT ba_id FROM mod_bam_reporting_relations_ba_timeperiods WHERE ba_id=1 and timeperiod_id=732 and is_default=0 Sleep 1s - IF len("""${output}""") > 5 BREAK + IF "${output}" != "()" BREAK END Should Be True From af86f64876aa93e99a4f9d64be57ed5cb5dd5d05 Mon Sep 17 00:00:00 2001 From: David Boucher Date: Thu, 19 Oct 2023 18:02:56 +0200 Subject: [PATCH 52/84] fix(tests) --- tests/broker-engine/bench.robot | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/broker-engine/bench.robot b/tests/broker-engine/bench.robot index 699ca66372c..e22907ae8a1 100644 --- a/tests/broker-engine/bench.robot +++ b/tests/broker-engine/bench.robot @@ -47,7 +47,7 @@ BENCH_${nb_check}STATUS ${broker_stat_before} Get Broker Process Stat 51001 ${engine_stat_before} Get Engine Process Stat 50001 - Process Service Check Result host_1 service_1 1 warning config0 1 ${nb_check} + Process Service Check Result host_1 service_1 1 warning config0 0 ${nb_check} Send Bench 1 50001 ${bench_data} Get Last Bench Result With Timeout ${rrdLog} 1 central-rrd-master-output 60 ${broker_stat_after} Get Broker Process Stat 51001 @@ -115,7 +115,7 @@ BENCH_${nb_check}STATUS_TRACES ${broker_stat_before} Get Broker Process Stat 51001 ${engine_stat_before} Get Engine Process Stat 50001 - Process Service Check Result host_1 service_1 1 warning config0 1 ${nb_check} + Process Service Check Result host_1 service_1 1 warning config0 0 ${nb_check} Send Bench 1 50001 ${bench_data} Get Last Bench Result With Timeout ${rrdLog} 1 central-rrd-master-output 60 ${broker_stat_after} Get Broker Process Stat 51001 @@ -199,7 +199,7 @@ BENCH_1000STATUS_100${suffixe} ... 1 ... warning ... config${poller_index} - ... 1 + ... 0 ... 100 IF ${poller_index} == 1 Send Bench 1 50001 END From 6647e3544ed90f63fe5eb034ab9b76a4fa21389f Mon Sep 17 00:00:00 2001 From: David Boucher Date: Thu, 19 Oct 2023 22:12:38 +0200 Subject: [PATCH 53/84] enh(broker): test_robot not always enabled --- broker/core/inc/com/centreon/broker/misc/misc.hh | 4 +++- broker/core/src/misc/misc.cc | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/broker/core/inc/com/centreon/broker/misc/misc.hh b/broker/core/inc/com/centreon/broker/misc/misc.hh index 56675451ca0..26907f3379c 100644 --- a/broker/core/inc/com/centreon/broker/misc/misc.hh +++ b/broker/core/inc/com/centreon/broker/misc/misc.hh @@ -36,11 +36,13 @@ std::string dump_filters(const multiplexing::muxer_filter& filters); std::list parse_perfdata(uint32_t host_id, uint32_t service_id, const char* str); +#if DEBUG_ROBOT void debug(const std::string& content); +#endif } // namespace misc #if DEBUG_ROBOT -#define DEBUG(content) misc::debug(content) +#define DEBUG(content) misc::debug(content) #else #define DEBUG(content) #endif diff --git a/broker/core/src/misc/misc.cc b/broker/core/src/misc/misc.cc index 35e1afb3d9a..811140f82df 100644 --- a/broker/core/src/misc/misc.cc +++ b/broker/core/src/misc/misc.cc @@ -189,6 +189,7 @@ std::string misc::dump_filters(const multiplexing::muxer_filter& filters) { return ret; } +#if DEBUG_ROBOT void misc::debug(const std::string& content) { int p = getpid(); std::string filename{fmt::format("failed/{}.log", p)}; @@ -203,3 +204,4 @@ void misc::debug(const std::string& content) { fclose(f); } } +#endif From c32bbc7963b89124fbbb378838c2a69e782aa4d5 Mon Sep 17 00:00:00 2001 From: David Boucher Date: Thu, 19 Oct 2023 22:17:11 +0200 Subject: [PATCH 54/84] fix(broker): unused header removed --- broker/core/src/misc/filesystem.cc | 1 - 1 file changed, 1 deletion(-) diff --git a/broker/core/src/misc/filesystem.cc b/broker/core/src/misc/filesystem.cc index 461193ccb7a..8b9c5658e83 100644 --- a/broker/core/src/misc/filesystem.cc +++ b/broker/core/src/misc/filesystem.cc @@ -18,7 +18,6 @@ #include "com/centreon/broker/misc/filesystem.hh" #include -#include #include #include #include From 05c73f103d8feb82ca0491a7f5f3f33d7b572e4c Mon Sep 17 00:00:00 2001 From: David Boucher Date: Fri, 20 Oct 2023 10:11:25 +0200 Subject: [PATCH 55/84] cleanup(tests/broker): robot simplified and one mutex unused removed --- .../centreon/broker/multiplexing/engine.hh | 1 - tests/bam/boolean_rules.robot | 40 +++---------------- 2 files changed, 5 insertions(+), 36 deletions(-) diff --git a/broker/core/multiplexing/inc/com/centreon/broker/multiplexing/engine.hh b/broker/core/multiplexing/inc/com/centreon/broker/multiplexing/engine.hh index 89af33422fa..a85b0fe9a27 100644 --- a/broker/core/multiplexing/inc/com/centreon/broker/multiplexing/engine.hh +++ b/broker/core/multiplexing/inc/com/centreon/broker/multiplexing/engine.hh @@ -83,7 +83,6 @@ class engine { // Subscriber. std::vector _muxers; - std::mutex _muxers_m; // Statistics. EngineStats* _stats; diff --git a/tests/bam/boolean_rules.robot b/tests/bam/boolean_rules.robot index b3593aae954..b7e370a03dc 100644 --- a/tests/bam/boolean_rules.robot +++ b/tests/bam/boolean_rules.robot @@ -64,13 +64,7 @@ BABOO FOR ${i} IN RANGE 10 Log To Console @@@@@@@@@@@@@@ Step ${i} @@@@@@@@@@@@@@ # 302 is set to critical => the two ba become critical - Repeat Keyword - ... 3 times - ... Process Service Check Result - ... host_16 - ... service_302 - ... 2 - ... output critical for service_302 + Process Service Result Hard host_16 service_302 2 output critical for service_302 ${result} Check Service Resource Status With Timeout host_16 service_302 2 30 HARD Should Be True ${result} The service (host_16:service_302) should be CRITICAL. @@ -134,13 +128,7 @@ BABOOOR # 303 is unknown but since the boolean operator is OR, if 302 result is true, we should have already a result. # 302 is set to critical => the two ba become critical - Repeat Keyword - ... 3 times - ... Process Service Check Result - ... host_16 - ... service_302 - ... 2 - ... output critical for service_302 + Process Service Result Hard host_16 service_302 2 output critical for service_302 ${result} Check Ba Status With Timeout boolean-ba 2 30 Dump Ba On Error ${result} ${id_ba__sid[0]} @@ -187,13 +175,7 @@ BABOOAND # 303 is unknown but since the boolean operator is AND, if 302 result is false, we should have already a result. # 302 is set to critical => the two ba become critical - Repeat Keyword - ... 3 times - ... Process Service Check Result - ... host_16 - ... service_302 - ... 2 - ... output critical for service_302 + Process Service Result Hard host_16 service_302 2 output critical for service_302 ${result} Check Ba Status With Timeout boolean-ba 2 30 Dump Ba On Error ${result} ${id_ba__sid[0]} @@ -335,26 +317,14 @@ BABOOCOMPL ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} A message telling check_for_external_commands() should be available. FOR ${i} IN RANGE ${1} ${21} - Repeat Keyword - ... 3 times - ... Process Service Check Result - ... host_1 - ... service_${i} - ... 2 - ... output critical for service_${i} + Process Service Result Hard host_1 service_${i} 2 output critical for service_${i} END FOR ${i} IN RANGE ${1} ${21} ${2} ${result} Check Ba Status With Timeout boolean-ba 2 30 Dump Ba On Error ${result} ${id_ba__sid[0]} Should Be True ${result} Step${i}: The 'boolean-ba' BA is not CRITICAL as expected - Repeat Keyword - ... 3 times - ... Process Service Check Result - ... host_1 - ... service_${i} - ... 0 - ... output ok for service_${i} + Process Service Result Hard host_1 service_${i} 0 output ok for service_${i} END ${result} Check Ba Status With Timeout boolean-ba 0 30 From 60ebea38e37f6f47bbcbb87080d77a6faaf8ff46 Mon Sep 17 00:00:00 2001 From: David Boucher Date: Fri, 20 Oct 2023 12:09:46 +0200 Subject: [PATCH 56/84] fix(broker): coding style fixed --- .../inc/com/centreon/broker/cache/global_cache.hh | 2 +- .../inc/com/centreon/broker/multiplexing/engine.hh | 4 ++-- broker/core/multiplexing/src/engine.cc | 13 +++++++------ broker/core/multiplexing/src/muxer.cc | 2 +- cmake.sh | 12 +++++++++--- 5 files changed, 20 insertions(+), 13 deletions(-) diff --git a/broker/core/inc/com/centreon/broker/cache/global_cache.hh b/broker/core/inc/com/centreon/broker/cache/global_cache.hh index f2df3b33c24..e28ab1523bd 100644 --- a/broker/core/inc/com/centreon/broker/cache/global_cache.hh +++ b/broker/core/inc/com/centreon/broker/cache/global_cache.hh @@ -150,7 +150,7 @@ class global_cache : public std::enable_shared_from_this { void allocation_exception_handler(); - virtual void managed_map(bool create){}; + virtual void managed_map(bool create) {} public: using pointer = std::shared_ptr; diff --git a/broker/core/multiplexing/inc/com/centreon/broker/multiplexing/engine.hh b/broker/core/multiplexing/inc/com/centreon/broker/multiplexing/engine.hh index a85b0fe9a27..7c53c44547b 100644 --- a/broker/core/multiplexing/inc/com/centreon/broker/multiplexing/engine.hh +++ b/broker/core/multiplexing/inc/com/centreon/broker/multiplexing/engine.hh @@ -82,7 +82,7 @@ class engine { std::deque> _kiew; // Subscriber. - std::vector _muxers; + std::vector> _muxers; // Statistics. EngineStats* _stats; @@ -110,7 +110,7 @@ class engine { void publish(const std::deque>& to_publish); void start(); void stop(); - void subscribe(muxer* subscriber); + void subscribe(std::shared_ptr& subscriber); void unsubscribe_muxer(const muxer* subscriber); }; } // namespace multiplexing diff --git a/broker/core/multiplexing/src/engine.cc b/broker/core/multiplexing/src/engine.cc index 95ba63cd266..1baafea0772 100644 --- a/broker/core/multiplexing/src/engine.cc +++ b/broker/core/multiplexing/src/engine.cc @@ -245,12 +245,12 @@ void engine::stop() { * * @param[in] subscriber A muxer. */ -void engine::subscribe(muxer* subscriber) { +void engine::subscribe(std::shared_ptr& subscriber) { log_v2::config()->debug("engine: muxer {} subscribes to engine", subscriber->name()); std::lock_guard l(_engine_m); for (auto& m : _muxers) - if (m == subscriber) { + if (m.lock() == subscriber) { log_v2::config()->debug("engine: muxer {} already subscribed", subscriber->name()); return; @@ -266,7 +266,8 @@ void engine::subscribe(muxer* subscriber) { void engine::unsubscribe_muxer(const muxer* subscriber) { std::lock_guard l(_engine_m); for (auto it = _muxers.begin(); it != _muxers.end(); ++it) { - if (*it == subscriber) { + auto m = it->lock(); + if (m.get() == subscriber) { log_v2::config()->debug("engine: muxer {} unsubscribes to engine", subscriber->name()); _muxers.erase(it); @@ -363,7 +364,7 @@ bool engine::_send_to_subscribers(send_to_mux_callback_type&& callback) { // Process all queued events. std::shared_ptr>> kiew; - muxer* last_muxer; + std::shared_ptr last_muxer; std::shared_ptr cb; { std::lock_guard lck(_engine_m); @@ -385,7 +386,7 @@ bool engine::_send_to_subscribers(send_to_mux_callback_type&& callback) { // end of lambdas posted cb = std::make_shared(std::move(callback), _instance); - last_muxer = *_muxers.rbegin(); + last_muxer = _muxers.rbegin()->lock(); if (_muxers.size() > 1) { /* Since the sending is parallelized, we use the thread pool for this * purpose except for the last muxer where we use this thread. */ @@ -396,7 +397,7 @@ bool engine::_send_to_subscribers(send_to_mux_callback_type&& callback) { /* We use the thread pool for the muxers from the first one to the * second to last */ for (auto it = _muxers.begin(); it != it_last; ++it) { - pool::io_context().post([kiew, m = *it, cb]() { + pool::io_context().post([kiew, m = it->lock(), cb]() { try { m->publish(*kiew); } // pool threads protection diff --git a/broker/core/multiplexing/src/muxer.cc b/broker/core/multiplexing/src/muxer.cc index 6651e331512..6f431bd17e3 100644 --- a/broker/core/multiplexing/src/muxer.cc +++ b/broker/core/multiplexing/src/muxer.cc @@ -187,7 +187,7 @@ std::shared_ptr muxer::create(std::string name, } } - parent->subscribe(retval.get()); + parent->subscribe(retval); return retval; } diff --git a/cmake.sh b/cmake.sh index 27a10eee337..abe31ea7605 100755 --- a/cmake.sh +++ b/cmake.sh @@ -11,6 +11,7 @@ This program build Centreon-broker -fcr|--force-conan-rebuild : rebuild conan data -ng : C++17 standard -clang : Compilation with clang++ + -dr : Debug robot enabled -h|--help : help EOF } @@ -33,6 +34,7 @@ CXX=g++ LIBCXX=libstdc++11 WITH_CLANG=OFF EE= +DR= for i in "$@" do @@ -47,6 +49,10 @@ do STD="gnu17" shift ;; + -dr) + echo "DEBUG_ROBOT enabled" + DR="-DDEBUG_ROBOT=ON" + shift -r|--release) echo "Release build" BUILD_TYPE="Release" @@ -322,9 +328,9 @@ else fi if [[ "$maj" == "Raspbian" ]] ; then - CC=$CC CXX=$CXX CXXFLAGS="-Wall -Wextra" $cmake -DWITH_CLANG=$WITH_CLANG -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DWITH_TESTING=On -DWITH_MODULE_SIMU=On -DWITH_BENCH=On -DWITH_CREATE_FILES=OFF $NG $* .. + CC=$CC CXX=$CXX CXXFLAGS="-Wall -Wextra" $cmake $DR -DWITH_CLANG=$WITH_CLANG -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DWITH_TESTING=On -DWITH_MODULE_SIMU=On -DWITH_BENCH=On -DWITH_CREATE_FILES=OFF $NG $* .. elif [[ "$maj" == "Debian" ]] ; then - CC=$CC CXX=$CXX CXXFLAGS="-Wall -Wextra" $cmake -DWITH_CLANG=$WITH_CLANG -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DWITH_USER_BROKER=centreon-broker -DWITH_USER_ENGINE=centreon-engine -DWITH_GROUP_BROKER=centreon-broker -DWITH_GROUP_ENGINE=centreon-engine -DWITH_TESTING=On -DWITH_PREFIX_LIB_CLIB=/usr/lib64/ -DWITH_MODULE_SIMU=On -DWITH_BENCH=On -DWITH_CREATE_FILES=OFF -DWITH_CONF=OFF $NG $* .. + CC=$CC CXX=$CXX CXXFLAGS="-Wall -Wextra" $cmake $DR -DWITH_CLANG=$WITH_CLANG -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DWITH_USER_BROKER=centreon-broker -DWITH_USER_ENGINE=centreon-engine -DWITH_GROUP_BROKER=centreon-broker -DWITH_GROUP_ENGINE=centreon-engine -DWITH_TESTING=On -DWITH_PREFIX_LIB_CLIB=/usr/lib64/ -DWITH_MODULE_SIMU=On -DWITH_BENCH=On -DWITH_CREATE_FILES=OFF -DWITH_CONF=OFF $NG $* .. else - CC=$CC CXX=$CXX CXXFLAGS="-Wall -Wextra" $cmake -DDEBUG_ROBOT=On -DWITH_CLANG=$WITH_CLANG -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DWITH_USER_BROKER=centreon-broker -DWITH_USER_ENGINE=centreon-engine -DWITH_GROUP_BROKER=centreon-broker -DWITH_GROUP_ENGINE=centreon-engine -DWITH_TESTING=On -DWITH_MODULE_SIMU=On -DWITH_BENCH=On -DWITH_CREATE_FILES=OFF -DWITH_CONF=OFF $NG $* .. + CC=$CC CXX=$CXX CXXFLAGS="-Wall -Wextra" $cmake $DR -DWITH_CLANG=$WITH_CLANG -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DWITH_USER_BROKER=centreon-broker -DWITH_USER_ENGINE=centreon-engine -DWITH_GROUP_BROKER=centreon-broker -DWITH_GROUP_ENGINE=centreon-engine -DWITH_TESTING=On -DWITH_MODULE_SIMU=On -DWITH_BENCH=On -DWITH_CREATE_FILES=OFF -DWITH_CONF=OFF $NG $* .. fi From 86e6642c87648f29c0c6d1c7168b2e2f4540a04b Mon Sep 17 00:00:00 2001 From: David Boucher Date: Fri, 20 Oct 2023 12:10:58 +0200 Subject: [PATCH 57/84] enh(tests): new keyword applied everywhere --- tests/bam/bam_pb.robot | 122 ++++++---------------- tests/bam/boolean_rules.robot | 10 -- tests/bam/inherited_downtime.robot | 12 +-- tests/bam/pb_inherited_downtime.robot | 12 +-- tests/broker-engine/acknowledgement.robot | 8 +- tests/broker-engine/muxer_filter.robot | 4 +- tests/broker-engine/output-tables.robot | 2 +- tests/broker-engine/victoria.robot | 8 +- tests/resources/resources.robot | 9 ++ 9 files changed, 63 insertions(+), 124 deletions(-) diff --git a/tests/bam/bam_pb.robot b/tests/bam/bam_pb.robot index 2de6e953729..955ba341f11 100644 --- a/tests/bam/bam_pb.robot +++ b/tests/bam/bam_pb.robot @@ -45,7 +45,7 @@ BAWORST Should Be True ${result} The BA test has not the expected output # KPI set to unknown - Repeat Keyword 3 times Process Service Check Result host_16 service_303 3 output unknown for 303 + Process Service Result Hard host_16 service_303 3 output unknown for 303 ${result} Check Service Status With Timeout host_16 service_303 3 60 HARD Should Be True ${result} The service (host_16,service_303) is not UNKNOWN as expected @@ -62,7 +62,7 @@ BAWORST Should Be True ${result} The BA test has not the expected output # KPI set to warning - Repeat Keyword 3 times Process Service Check Result host_16 service_303 1 output warning for 303 + Process Service Result Hard host_16 service_303 1 output warning for 303 ${result} Check Service Status With Timeout host_16 service_303 1 60 HARD Should Be True ${result} The service (host_16,service_303) is not WARNING as expected @@ -79,7 +79,7 @@ BAWORST Should Be True ${result} The BA test has not the expected output # KPI set to critical - Repeat Keyword 3 times Process Service Check Result host_16 service_314 2 output critical for 314 + Process Service Result Hard host_16 service_314 2 output critical for 314 ${result} Check Service Status With Timeout host_16 service_314 2 60 HARD Should Be True ${result} The service (host_16,service_314) is not CRITICAL as expected @@ -132,7 +132,7 @@ BABEST_SERVICE_CRITICAL Should Be True ${result} The BA test has not the expected output # KPI set to critical - Repeat Keyword 3 times Process Service Check Result host_16 service_314 2 output critical for 314 + Process Service Result Hard host_16 service_314 2 output critical for 314 ${result} Check Service Status With Timeout host_16 service_314 2 60 HARD Should Be True ${result} The service (host_16,service_314) is not CRITICAL as expected @@ -149,7 +149,7 @@ BABEST_SERVICE_CRITICAL Should Be True ${result} The BA test has not the expected output # KPI set to unknown - Repeat Keyword 3 times Process Service Check Result host_16 service_303 3 output unknown for 303 + Process Service Result Hard host_16 service_303 3 output unknown for 303 ${result} Check Service Status With Timeout host_16 service_303 3 60 HARD Should Be True ${result} The service (host_16,service_303) is not UNKNOWN as expected @@ -165,7 +165,7 @@ BABEST_SERVICE_CRITICAL Should Be True ${result} The BA test has not the expected output # KPI set to warning - Repeat Keyword 3 times Process Service Check Result host_16 service_303 1 output warning for 303 + Process Service Result Hard host_16 service_303 1 output warning for 303 ${result} Check Service Status With Timeout host_16 service_303 1 60 HARD Should Be True ${result} The service (host_16,service_303) is not WARNING as expected @@ -181,7 +181,7 @@ BABEST_SERVICE_CRITICAL Should Be True ${result} The BA test has not the expected output # KPI set to critical - Repeat Keyword 3 times Process Service Check Result host_16 service_303 2 output critical for 303 + Process Service Result Hard host_16 service_303 2 output critical for 303 ${result} Check Service Status With Timeout host_16 service_303 2 60 HARD Should Be True ${result} The service (host_16,service_303) is not CRITICAL as expected @@ -227,13 +227,7 @@ BA_IMPACT_2KPI_SERVICES Should Be True ${result} A message telling check_for_external_commands() should be available. # service_302 critical service_303 warning => ba warning 30% - Repeat Keyword - ... 3 times - ... Process Service Check Result - ... host_16 - ... service_302 - ... 2 - ... output critical for service_302 + Process Service Result Hard host_16 service_302 2 output critical for service_302 ${result} Check Service Status With Timeout host_16 service_302 2 60 HARD Should Be True ${result} The service (host_16,service_302) is not CRITICAL as expected ${result} Check Ba Status With Timeout test 0 60 @@ -245,13 +239,7 @@ BA_IMPACT_2KPI_SERVICES ... 60 Should Be True ${result} The BA test has not the expected output - Repeat Keyword - ... 3 times - ... Process Service Check Result - ... host_16 - ... service_303 - ... 1 - ... output warning for service_303 + Process Service Result Hard host_16 service_303 1 output warning for service_303 ${result} Check Service Status With Timeout host_16 service_303 1 60 HARD Should Be True ${result} The service (host_16,service_303) is not WARNING as expected ${result} Check Ba Status With Timeout test 1 60 @@ -264,16 +252,12 @@ BA_IMPACT_2KPI_SERVICES Should Be True ${result} The BA test has not the expected output # service_302 critical service_303 critical => ba critical 80% - Repeat Keyword - ... 3 times - ... Process Service Check Result + Process Service Result Hard ... host_16 ... service_302 ... 2 ... output critical for service_302 - Repeat Keyword - ... 3 times - ... Process Service Check Result + Process Service Result Hard ... host_16 ... service_303 ... 2 @@ -303,16 +287,12 @@ BA_IMPACT_2KPI_SERVICES Should Be True ${result} The BA test has not the expected output # both warning => ba ok - Repeat Keyword - ... 3 times - ... Process Service Check Result + Process Service Result Hard ... host_16 ... service_302 ... 1 ... output warning for service_302 - Repeat Keyword - ... 3 times - ... Process Service Check Result + Process Service Result Hard ... host_16 ... service_303 ... 1 @@ -363,9 +343,7 @@ BA_RATIO_PERCENT_BA_SERVICE Should Be True ${result} The BA test has not the expected output # one serv critical => ba ok - Repeat Keyword - ... 3 times - ... Process Service Check Result + Process Service Result Hard ... host_16 ... service_302 ... 2 @@ -383,16 +361,12 @@ BA_RATIO_PERCENT_BA_SERVICE Should Be True ${result} The BA test has not the expected output # two serv critical => ba warning - Repeat Keyword - ... 3 times - ... Process Service Check Result + Process Service Result Hard ... host_16 ... service_302 ... 2 ... output critical for service_302 - Repeat Keyword - ... 3 times - ... Process Service Check Result + Process Service Result Hard ... host_16 ... service_303 ... 2 @@ -411,23 +385,17 @@ BA_RATIO_PERCENT_BA_SERVICE Should Be True ${result} The BA test has not the expected output # two serv critical and child ba critical => mother ba critical - Repeat Keyword - ... 3 times - ... Process Service Check Result + Process Service Result Hard ... host_16 ... service_302 ... 2 ... output critical for service_302 - Repeat Keyword - ... 3 times - ... Process Service Check Result + Process Service Result Hard ... host_16 ... service_303 ... 2 ... output critical for service_303 - Repeat Keyword - ... 3 times - ... Process Service Check Result + Process Service Result Hard ... host_16 ... service_314 ... 2 @@ -479,9 +447,7 @@ BA_RATIO_NUMBER_BA_SERVICE Should Be True ${result} The BA test has not the expected output # One service CRITICAL => The BA is still OK - Repeat Keyword - ... 3 times - ... Process Service Check Result + Process Service Result Hard ... host_16 ... service_302 ... 2 @@ -500,16 +466,12 @@ BA_RATIO_NUMBER_BA_SERVICE Should Be True ${result} The BA test has not the expected output # Two services CRITICAL => The BA passes to WARNING - Repeat Keyword - ... 3 times - ... Process Service Check Result + Process Service Result Hard ... host_16 ... service_302 ... 2 ... output critical for service_302 - Repeat Keyword - ... 3 times - ... Process Service Check Result + Process Service Result Hard ... host_16 ... service_303 ... 2 @@ -528,23 +490,17 @@ BA_RATIO_NUMBER_BA_SERVICE Should Be True ${result} The BA test has not the expected output # Two services CRITICAL and also the child BA => The mother BA passes to CRITICAL - Repeat Keyword - ... 3 times - ... Process Service Check Result + Process Service Result Hard ... host_16 ... service_302 ... 2 ... output critical for service_302 - Repeat Keyword - ... 3 times - ... Process Service Check Result + Process Service Result Hard ... host_16 ... service_303 ... 2 ... output critical for service_303 - Repeat Keyword - ... 3 times - ... Process Service Check Result + Process Service Result Hard ... host_16 ... service_314 ... 2 @@ -590,16 +546,12 @@ BA_BOOL_KPI Should Be True ${result} A message telling check_for_external_commands() should be available. # 302 warning and 303 critical => ba critical - Repeat Keyword - ... 3 times - ... Process Service Check Result + Process Service Result Hard ... host_16 ... service_302 ... 1 ... output warning for service_302 - Repeat Keyword - ... 3 times - ... Process Service Check Result + Process Service Result Hard ... host_16 ... service_303 ... 2 @@ -798,7 +750,7 @@ BEPB_KPI_STATUS ${start} Get Current Date result_format=epoch # KPI set to critical - Repeat Keyword 3 times Process Service Check Result host_16 service_314 2 output critical for 314 + Process Service Result Hard host_16 service_314 2 output critical for 314 ${result} Check Service Status With Timeout host_16 service_314 2 60 HARD Should Be True ${result} The service (host_16,service_314) is not CRITICAL as expected @@ -841,7 +793,7 @@ BEPB_BA_DURATION_EVENT # KPI set to critical # as GetCurrent Date floor milliseconds to upper or lower integer, we substract 1s ${start_event} get_round_current_date - Repeat Keyword 3 times Process Service Check Result host_16 service_314 2 output critical for 314 + Process Service Result Hard host_16 service_314 2 output critical for 314 ${result} Check Service Status With Timeout host_16 service_314 2 60 HARD Should Be True ${result} The service (host_16,service_314) is not CRITICAL as expected Sleep 2s @@ -955,9 +907,7 @@ BA_RATIO_NUMBER_BA_4_SERVICE Should Be True ${result} The BA test is not OK as expected # one serv critical => ba warning - Repeat Keyword - ... 3 times - ... Process Service Check Result + Process Service Result Hard ... host_16 ... service_302 ... 2 @@ -969,9 +919,7 @@ BA_RATIO_NUMBER_BA_4_SERVICE Should Be True ${result} The BA test is not WARNING as expected # two services critical => ba ok - Repeat Keyword - ... 3 times - ... Process Service Check Result + Process Service Result Hard ... host_16 ... service_303 ... 2 @@ -1020,9 +968,7 @@ BA_RATIO_PERCENT_BA_4_SERVICE Should Be True ${result} The BA test is not OK as expected # one serv critical => ba warning - Repeat Keyword - ... 3 times - ... Process Service Check Result + Process Service Result Hard ... host_16 ... service_302 ... 2 @@ -1034,9 +980,7 @@ BA_RATIO_PERCENT_BA_4_SERVICE Should Be True ${result} The BA test is not WARNING as expected # two services critical => ba ok - Repeat Keyword - ... 3 times - ... Process Service Check Result + Process Service Result Hard ... host_16 ... service_303 ... 2 diff --git a/tests/bam/boolean_rules.robot b/tests/bam/boolean_rules.robot index b7e370a03dc..db052e6141a 100644 --- a/tests/bam/boolean_rules.robot +++ b/tests/bam/boolean_rules.robot @@ -345,13 +345,3 @@ BAM Setup Execute SQL String DELETE FROM mod_bam_reporting_ba_events Execute SQL String ALTER TABLE mod_bam_reporting_ba_events AUTO_INCREMENT = 1 Execute SQL String SET GLOBAL FOREIGN_KEY_CHECKS=1 - -Process Service Result Hard - [Arguments] ${host} ${svc} ${state} ${output} - Repeat Keyword - ... 3 times - ... Process Service Check Result - ... ${host} - ... ${svc} - ... ${state} - ... ${output} diff --git a/tests/bam/inherited_downtime.robot b/tests/bam/inherited_downtime.robot index ca78940d61a..169ff24d32a 100644 --- a/tests/bam/inherited_downtime.robot +++ b/tests/bam/inherited_downtime.robot @@ -47,7 +47,7 @@ BEBAMIDT1 ... An Initial service state on service (50, 1000) should be raised before we can start external commands. # KPI set to critical - Repeat Keyword 3 times Process Service Check Result host_16 service_314 2 output critical for 314 + Process Service Result Hard host_16 service_314 2 output critical for service_314 ${result} Check Service Status With Timeout host_16 service_314 2 60 HARD Should Be True ${result} The service (host_16,service_314) is not CRITICAL as expected @@ -107,7 +107,7 @@ BEBAMIDT2 ... An Initial service state on service (50, 1000) should be raised before we can start external commands. # KPI set to critical - Repeat Keyword 3 times Process Service Check Result host_16 service_314 2 output critical for 314 + Process Service Result Hard host_16 service_314 2 output critical for service_314 ${result} Check Service Status With Timeout host_16 service_314 2 60 Should Be True ${result} The service (host_16,service_314) is not CRITICAL as expected @@ -209,12 +209,12 @@ BEBAMIGNDT1 ... An Initial service state on service (50, 1000) should be raised before we can start external commands. # KPI set to ok - Repeat Keyword 3 times Process Service Check Result host_16 service_313 0 output critical for 313 + Process Service Result Hard host_16 service_313 0 output critical for service_313 ${result} Check Service Status With Timeout host_16 service_313 0 60 Should Be True ${result} The service (host_16,service_313) is not OK as expected # KPI set to critical - Repeat Keyword 3 times Process Service Check Result host_16 service_314 2 output critical for 314 + Process Service Result Hard host_16 service_314 2 output critical for service_314 ${result} Check Service Status With Timeout host_16 service_314 2 60 Should Be True ${result} The service (host_16,service_314) is not CRITICAL as expected @@ -308,12 +308,12 @@ BEBAMIGNDT2 ... An Initial service state on service (50, 1000) should be raised before we can start external commands. # KPI set to ok - Repeat Keyword 3 times Process Service Check Result host_16 service_313 0 output critical for 313 + Process Service Result Hard host_16 service_313 0 output critical for service_313 ${result} Check Service Status With Timeout host_16 service_313 0 60 Should Be True ${result} The service (host_16,service_313) is not OK as expected # KPI set to critical - Repeat Keyword 3 times Process Service Check Result host_16 service_314 2 output critical for 314 + Process Service Result Hard host_16 service_314 2 output critical for 314 ${result} Check Service Status With Timeout host_16 service_314 2 60 Should Be True ${result} The service (host_16,service_314) is not CRITICAL as expected diff --git a/tests/bam/pb_inherited_downtime.robot b/tests/bam/pb_inherited_downtime.robot index a1092027bb6..c717e75c25c 100644 --- a/tests/bam/pb_inherited_downtime.robot +++ b/tests/bam/pb_inherited_downtime.robot @@ -48,7 +48,7 @@ BEBAMIDTU1 ... An Initial service state on service (50, 1000) should be raised before we can start external commands. # KPI set to critical - Repeat Keyword 3 times Process Service Check Result host_16 service_314 2 output critical for 314 + Process Service Result Hard host_16 service_314 2 output critical for 314 ${result} Check Service Status With Timeout host_16 service_314 2 60 HARD Should Be True ${result} The service (host_16,service_314) is not CRITICAL as expected @@ -111,7 +111,7 @@ BEBAMIDTU2 ... An Initial service state on service (50, 1000) should be raised before we can start external commands. # KPI set to critical - Repeat Keyword 3 times Process Service Check Result host_16 service_314 2 output critical for 314 + Process Service Result Hard host_16 service_314 2 output critical for 314 ${result} Check Service Status With Timeout host_16 service_314 2 60 Should Be True ${result} The service (host_16,service_314) is not CRITICAL as expected @@ -213,12 +213,12 @@ BEBAMIGNDTU1 ... An Initial service state on service (50, 1000) should be raised before we can start external commands. # KPI set to ok - Repeat Keyword 3 times Process Service Check Result host_16 service_313 0 output critical for 313 + Process Service Result Hard host_16 service_313 0 output critical for 313 ${result} Check Service Status With Timeout host_16 service_313 0 60 Should Be True ${result} The service (host_16,service_313) is not OK as expected # KPI set to critical - Repeat Keyword 3 times Process Service Check Result host_16 service_314 2 output critical for 314 + Process Service Result Hard host_16 service_314 2 output critical for 314 ${result} Check Service Status With Timeout host_16 service_314 2 60 Should Be True ${result} The service (host_16,service_314) is not CRITICAL as expected @@ -316,12 +316,12 @@ BEBAMIGNDTU2 ... An Initial service state on service (50, 1000) should be raised before we can start external commands. # KPI set to ok - Repeat Keyword 3 times Process Service Check Result host_16 service_313 0 output critical for 313 + Process Service Result Hard host_16 service_313 0 output critical for 313 ${result} Check Service Status With Timeout host_16 service_313 0 60 Should Be True ${result} The service (host_16,service_313) is not OK as expected # KPI set to critical - Repeat Keyword 3 times Process Service Check Result host_16 service_314 2 output critical for 314 + Process Service Result Hard host_16 service_314 2 output critical for 314 ${result} Check Service Status With Timeout host_16 service_314 2 60 Should Be True ${result} The service (host_16,service_314) is not CRITICAL as expected diff --git a/tests/broker-engine/acknowledgement.robot b/tests/broker-engine/acknowledgement.robot index 4f3303cda61..48d73ca86a1 100644 --- a/tests/broker-engine/acknowledgement.robot +++ b/tests/broker-engine/acknowledgement.robot @@ -51,7 +51,7 @@ BEACK1 Should Be True ${ack_id} > 0 No acknowledgement on service (1, 1). # Service_1 is set back to OK. - Repeat Keyword 3 times Process Service Check Result host_1 service_1 0 (1;1) is OK + Process Service Result Hard host_1 service_1 0 (1;1) is OK ${result} Check Service Status With Timeout host_1 service_1 ${0} 60 HARD Should Be True ${result} Service (1;1) should be OK HARD @@ -92,7 +92,7 @@ BEACK2 Should Be True ${ack_id} > 0 No acknowledgement on service (1, 1). # Service_1 is set back to OK. - Repeat Keyword 3 times Process Service Check Result host_1 service_1 0 (1;1) is OK + Process Service Result Hard host_1 service_1 0 (1;1) is OK ${result} Check Service Resource Status With Timeout host_1 service_1 ${0} 60 HARD Should Be True ${result} Service (1;1) should be OK HARD @@ -213,7 +213,7 @@ BEACK5 Should Be True ${ack_id} > 0 No acknowledgement on service (1, 1). # Service_1 is set to WARNING. - Repeat Keyword 3 times Process Service Check Result host_1 service_1 1 (1;1) is WARNING + Process Service Result Hard host_1 service_1 1 (1;1) is WARNING ${result} Check Service Status With Timeout host_1 service_1 ${1} 60 HARD Should Be True ${result} Service (1;1) should be WARNING HARD @@ -261,7 +261,7 @@ BEACK6 Should Be True ${ack_id} > 0 No acknowledgement on service (1, 1). # Service_1 is set to WARNING. - Repeat Keyword 3 times Process Service Check Result host_1 service_1 1 (1;1) is WARNING + Process Service Result Hard host_1 service_1 1 (1;1) is WARNING ${result} Check Service Status With Timeout host_1 service_1 ${1} 60 HARD Should Be True ${result} Service (1;1) should be WARNING HARD diff --git a/tests/broker-engine/muxer_filter.robot b/tests/broker-engine/muxer_filter.robot index 9be543fcacd..b0e68db00da 100644 --- a/tests/broker-engine/muxer_filter.robot +++ b/tests/broker-engine/muxer_filter.robot @@ -148,7 +148,7 @@ BAM_STREAM_FILTER Should Be True ${result} A message telling check_for_external_commands() should be available. # KPI set to critical - Repeat Keyword 3 times Process Service Check Result host_16 service_314 2 output critical for 314 + Process Service Result Hard host_16 service_314 2 output critical for 314 ${result} Check Service Status With Timeout host_16 service_314 2 60 HARD Should Be True ${result} The service (host_16,service_314) is not CRITICAL as expected @@ -231,7 +231,7 @@ UNIFIED_SQL_FILTER Should Be True ${result} A message telling check_for_external_commands() should be available. # one service set to critical in order to have some events - Repeat Keyword 3 times Process Service Check Result host_16 service_314 2 output critical for 314 + Process Service Result Hard host_16 service_314 2 output critical for 314 ${result} Check Service Status With Timeout host_16 service_314 2 60 HARD Should Be True ${result} The service (host_16,service_314) is not CRITICAL as expected diff --git a/tests/broker-engine/output-tables.robot b/tests/broker-engine/output-tables.robot index 12218f27fab..0e444fe943a 100644 --- a/tests/broker-engine/output-tables.robot +++ b/tests/broker-engine/output-tables.robot @@ -212,7 +212,7 @@ BE_NOTIF_OVERFLOW ... An Initial host state on host_16 should be raised before we can start our external commands. Set Svc Notification Number host_16 service_314 40000 - Repeat Keyword 3 times Process Service Check Result host_16 service_314 2 output critical for 314 + Process Service Result Hard host_16 service_314 2 output critical for 314 ${result} Check Service Status With Timeout host_16 service_314 2 30 Should Be True ${result} The service (host_16,service_314) is not CRITICAL as expected diff --git a/tests/broker-engine/victoria.robot b/tests/broker-engine/victoria.robot index 2bf7d70d402..91f339cf874 100644 --- a/tests/broker-engine/victoria.robot +++ b/tests/broker-engine/victoria.robot @@ -133,9 +133,7 @@ VICT_ONE_CHECK_STATUS # service warning ${start} Get Round Current Date - Repeat Keyword - ... 3 times - ... Process Service Check Result + Process Service Result Hard ... host_16 ... service_314 ... 1 @@ -169,9 +167,7 @@ VICT_ONE_CHECK_STATUS # service critical ${start} Get Round Current Date - Repeat Keyword - ... 3 times - ... Process Service Check Result + Process Service Result Hard ... host_16 ... service_314 ... 2 diff --git a/tests/resources/resources.robot b/tests/resources/resources.robot index dd26d6d5335..52f2cce2010 100644 --- a/tests/resources/resources.robot +++ b/tests/resources/resources.robot @@ -327,3 +327,12 @@ Dump Ba On Error Dump Ba 51001 ${ba_id} failed/${Test Name}/ba_${ba_id}.dot END +Process Service Result Hard + [Arguments] ${host} ${svc} ${state} ${output} + Repeat Keyword + ... 3 times + ... Process Service Check Result + ... ${host} + ... ${svc} + ... ${state} + ... ${output} From 8383e5e80ce25242803bb3a73477bc199ea0f53b Mon Sep 17 00:00:00 2001 From: David Boucher Date: Fri, 20 Oct 2023 12:28:29 +0200 Subject: [PATCH 58/84] fix(cmake) --- cmake.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmake.sh b/cmake.sh index abe31ea7605..25e8810197e 100755 --- a/cmake.sh +++ b/cmake.sh @@ -49,10 +49,11 @@ do STD="gnu17" shift ;; - -dr) + -dr|--debug-robot) echo "DEBUG_ROBOT enabled" DR="-DDEBUG_ROBOT=ON" shift + ;; -r|--release) echo "Release build" BUILD_TYPE="Release" From 8e0982f80ce2013dad8772ad4d2062967d54d938 Mon Sep 17 00:00:00 2001 From: David Boucher Date: Fri, 20 Oct 2023 18:06:09 +0200 Subject: [PATCH 59/84] fix(broker): muxer/engine again --- .../inc/com/centreon/broker/multiplexing/engine.hh | 2 +- broker/core/multiplexing/src/engine.cc | 13 +++++++------ broker/core/src/config/applier/init.cc | 2 +- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/broker/core/multiplexing/inc/com/centreon/broker/multiplexing/engine.hh b/broker/core/multiplexing/inc/com/centreon/broker/multiplexing/engine.hh index 7c53c44547b..74c0daf9edb 100644 --- a/broker/core/multiplexing/inc/com/centreon/broker/multiplexing/engine.hh +++ b/broker/core/multiplexing/inc/com/centreon/broker/multiplexing/engine.hh @@ -82,7 +82,7 @@ class engine { std::deque> _kiew; // Subscriber. - std::vector> _muxers; + std::vector> _muxers; // Statistics. EngineStats* _stats; diff --git a/broker/core/multiplexing/src/engine.cc b/broker/core/multiplexing/src/engine.cc index 1baafea0772..af48fab53c3 100644 --- a/broker/core/multiplexing/src/engine.cc +++ b/broker/core/multiplexing/src/engine.cc @@ -250,7 +250,7 @@ void engine::subscribe(std::shared_ptr& subscriber) { subscriber->name()); std::lock_guard l(_engine_m); for (auto& m : _muxers) - if (m.lock() == subscriber) { + if (m == subscriber) { log_v2::config()->debug("engine: muxer {} already subscribed", subscriber->name()); return; @@ -266,8 +266,7 @@ void engine::subscribe(std::shared_ptr& subscriber) { void engine::unsubscribe_muxer(const muxer* subscriber) { std::lock_guard l(_engine_m); for (auto it = _muxers.begin(); it != _muxers.end(); ++it) { - auto m = it->lock(); - if (m.get() == subscriber) { + if (it->get() == subscriber) { log_v2::config()->debug("engine: muxer {} unsubscribes to engine", subscriber->name()); _muxers.erase(it); @@ -290,8 +289,10 @@ engine::engine() } engine::~engine() noexcept { - DEBUG(fmt::format("DESTRUCTOR engine {:p}", static_cast(this))); + /* Muxers should be unsubscribed before arriving here. */ + assert(_muxers.empty()); log_v2::core()->debug("core: cbd engine destroyed."); + DEBUG(fmt::format("DESTRUCTOR engine {:p}", static_cast(this))); } /** @@ -386,7 +387,7 @@ bool engine::_send_to_subscribers(send_to_mux_callback_type&& callback) { // end of lambdas posted cb = std::make_shared(std::move(callback), _instance); - last_muxer = _muxers.rbegin()->lock(); + last_muxer = *_muxers.rbegin(); if (_muxers.size() > 1) { /* Since the sending is parallelized, we use the thread pool for this * purpose except for the last muxer where we use this thread. */ @@ -397,7 +398,7 @@ bool engine::_send_to_subscribers(send_to_mux_callback_type&& callback) { /* We use the thread pool for the muxers from the first one to the * second to last */ for (auto it = _muxers.begin(); it != it_last; ++it) { - pool::io_context().post([kiew, m = it->lock(), cb]() { + pool::io_context().post([kiew, m = *it, cb]() { try { m->publish(*kiew); } // pool threads protection diff --git a/broker/core/src/config/applier/init.cc b/broker/core/src/config/applier/init.cc index 1990ffa10f7..1ce7e7afea1 100644 --- a/broker/core/src/config/applier/init.cc +++ b/broker/core/src/config/applier/init.cc @@ -70,9 +70,9 @@ void config::applier::init(size_t n_thread, mysql_manager::load(); config::applier::state::load(); file::disk_accessor::load(event_queues_total_size); - multiplexing::engine::load(); io::protocols::load(); io::events::load(); + multiplexing::engine::load(); config::applier::endpoint::load(); mode = initialized; } From dd9109a8a9fe05b0798c7ec71bb1134d21462b4b Mon Sep 17 00:00:00 2001 From: David Boucher Date: Fri, 20 Oct 2023 18:06:55 +0200 Subject: [PATCH 60/84] fix(tests): an issue when the tuple is empty fixed --- tests/resources/Common.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/resources/Common.py b/tests/resources/Common.py index b183da760f5..aeb65625146 100644 --- a/tests/resources/Common.py +++ b/tests/resources/Common.py @@ -770,7 +770,7 @@ def check_ba_status_with_timeout(ba_name: str, status: int, timeout: int): f"SELECT * FROM mod_bam WHERE name='{ba_name}'") result = cursor.fetchall() logger.console(f"ba: {result[0]}") - if result[0]['current_status'] is not None and int(result[0]['current_status']) == int(status): + if len(result) > 0 and result[0]['current_status'] is not None and int(result[0]['current_status']) == int(status): return True time.sleep(5) return False @@ -827,7 +827,7 @@ def check_downtimes_with_timeout(nb: int, timeout: int): return False -#def check_host_downtime_with_timeout(hostname: str, enabled, timeout: int): +# def check_host_downtime_with_timeout(hostname: str, enabled, timeout: int): # limit = time.time() + timeout # while time.time() < limit: # connection = pymysql.connect(host=DB_HOST, From d7e9687245aa0c49a4a307cbee6f4c9152b3347f Mon Sep 17 00:00:00 2001 From: David Boucher Date: Fri, 20 Oct 2023 18:12:02 +0200 Subject: [PATCH 61/84] fix(cmake) --- cmake.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake.sh b/cmake.sh index 25e8810197e..f1d63abb327 100755 --- a/cmake.sh +++ b/cmake.sh @@ -322,7 +322,7 @@ cd build echo "$conan install .. --build=missing" $conan install .. --build=missing -if [[ $STD -eq 17 ]] ; then +if [[ "$STD" -eq "gnu17" ]] ; then NG="-DNG=ON" else NG="-DNG=OFF" From ed2a950026e6845f6e2ccadeed28288169c34ad8 Mon Sep 17 00:00:00 2001 From: David Boucher Date: Fri, 20 Oct 2023 18:49:57 +0200 Subject: [PATCH 62/84] fix(ci): debug_robot is back --- .github/workflows/package-collect.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/package-collect.yml b/.github/workflows/package-collect.yml index 9a7d3eb8a24..560704334da 100644 --- a/.github/workflows/package-collect.yml +++ b/.github/workflows/package-collect.yml @@ -88,7 +88,7 @@ jobs: sudo $CMAKE \ -G "Ninja" \ - -DDEBUG_ROBOT=OFF \ + -DDEBUG_ROBOT=ON \ -DWITH_TESTING=OFF \ -DWITH_BENCH=ON \ -DWITH_MODULE_SIMU=OFF \ From a5e245ac801638f2812874ff1885ef35ccd00125 Mon Sep 17 00:00:00 2001 From: David Boucher Date: Fri, 20 Oct 2023 19:38:06 +0200 Subject: [PATCH 63/84] fix(broker): another one --- .../inc/com/centreon/broker/multiplexing/engine.hh | 2 +- broker/core/multiplexing/src/engine.cc | 11 +++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/broker/core/multiplexing/inc/com/centreon/broker/multiplexing/engine.hh b/broker/core/multiplexing/inc/com/centreon/broker/multiplexing/engine.hh index 74c0daf9edb..7c53c44547b 100644 --- a/broker/core/multiplexing/inc/com/centreon/broker/multiplexing/engine.hh +++ b/broker/core/multiplexing/inc/com/centreon/broker/multiplexing/engine.hh @@ -82,7 +82,7 @@ class engine { std::deque> _kiew; // Subscriber. - std::vector> _muxers; + std::vector> _muxers; // Statistics. EngineStats* _stats; diff --git a/broker/core/multiplexing/src/engine.cc b/broker/core/multiplexing/src/engine.cc index af48fab53c3..254405a4f5f 100644 --- a/broker/core/multiplexing/src/engine.cc +++ b/broker/core/multiplexing/src/engine.cc @@ -250,7 +250,7 @@ void engine::subscribe(std::shared_ptr& subscriber) { subscriber->name()); std::lock_guard l(_engine_m); for (auto& m : _muxers) - if (m == subscriber) { + if (m.lock() == subscriber) { log_v2::config()->debug("engine: muxer {} already subscribed", subscriber->name()); return; @@ -266,7 +266,8 @@ void engine::subscribe(std::shared_ptr& subscriber) { void engine::unsubscribe_muxer(const muxer* subscriber) { std::lock_guard l(_engine_m); for (auto it = _muxers.begin(); it != _muxers.end(); ++it) { - if (it->get() == subscriber) { + auto w = it->lock(); + if (!w || w.get() == subscriber) { log_v2::config()->debug("engine: muxer {} unsubscribes to engine", subscriber->name()); _muxers.erase(it); @@ -387,7 +388,7 @@ bool engine::_send_to_subscribers(send_to_mux_callback_type&& callback) { // end of lambdas posted cb = std::make_shared(std::move(callback), _instance); - last_muxer = *_muxers.rbegin(); + last_muxer = _muxers.rbegin()->lock(); if (_muxers.size() > 1) { /* Since the sending is parallelized, we use the thread pool for this * purpose except for the last muxer where we use this thread. */ @@ -398,7 +399,9 @@ bool engine::_send_to_subscribers(send_to_mux_callback_type&& callback) { /* We use the thread pool for the muxers from the first one to the * second to last */ for (auto it = _muxers.begin(); it != it_last; ++it) { - pool::io_context().post([kiew, m = *it, cb]() { + auto s = it->lock(); + assert(s); + pool::io_context().post([kiew, m = std::move(s), cb]() { try { m->publish(*kiew); } // pool threads protection From 1208231013752bb902f8cfe486585b7e8e8052f7 Mon Sep 17 00:00:00 2001 From: David Boucher Date: Fri, 20 Oct 2023 20:20:04 +0200 Subject: [PATCH 64/84] fix(ci) --- .github/workflows/package-collect.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/package-collect.yml b/.github/workflows/package-collect.yml index 560704334da..9a7d3eb8a24 100644 --- a/.github/workflows/package-collect.yml +++ b/.github/workflows/package-collect.yml @@ -88,7 +88,7 @@ jobs: sudo $CMAKE \ -G "Ninja" \ - -DDEBUG_ROBOT=ON \ + -DDEBUG_ROBOT=OFF \ -DWITH_TESTING=OFF \ -DWITH_BENCH=ON \ -DWITH_MODULE_SIMU=OFF \ From f2483bb8749162ca43fb0134acafdf42952e0a32 Mon Sep 17 00:00:00 2001 From: David Boucher Date: Sat, 21 Oct 2023 12:29:01 +0200 Subject: [PATCH 65/84] fix(broker): bad initialization --- broker/core/src/cache/global_cache.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/broker/core/src/cache/global_cache.cc b/broker/core/src/cache/global_cache.cc index 9b9bf9de57b..65a7df2fd7f 100644 --- a/broker/core/src/cache/global_cache.cc +++ b/broker/core/src/cache/global_cache.cc @@ -36,7 +36,7 @@ inline std::string operator+(const std::string& left, std::shared_ptr global_cache::_instance; global_cache::global_cache(const std::string& file_path) - : _file_path(file_path), _file_size(0) {} + : _file_size(0), _file_path(file_path) {} global_cache::~global_cache() { if (_file) { From fc4c31de79adf1b658acde18695ac238a30f6a93 Mon Sep 17 00:00:00 2001 From: David Boucher Date: Sat, 21 Oct 2023 12:34:06 +0200 Subject: [PATCH 66/84] fix(broker): unused code removed --- broker/core/multiplexing/src/engine.cc | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/broker/core/multiplexing/src/engine.cc b/broker/core/multiplexing/src/engine.cc index 254405a4f5f..b887f535cba 100644 --- a/broker/core/multiplexing/src/engine.cc +++ b/broker/core/multiplexing/src/engine.cc @@ -399,9 +399,7 @@ bool engine::_send_to_subscribers(send_to_mux_callback_type&& callback) { /* We use the thread pool for the muxers from the first one to the * second to last */ for (auto it = _muxers.begin(); it != it_last; ++it) { - auto s = it->lock(); - assert(s); - pool::io_context().post([kiew, m = std::move(s), cb]() { + pool::io_context().post([kiew, m = it->lock(), cb]() { try { m->publish(*kiew); } // pool threads protection From 935c3cea48bf59ffa792969a742d72308d0381a0 Mon Sep 17 00:00:00 2001 From: David Boucher Date: Mon, 23 Oct 2023 10:56:46 +0200 Subject: [PATCH 67/84] Update tests/resources/Common.py Co-authored-by: NITCHEU B --- tests/resources/Common.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/tests/resources/Common.py b/tests/resources/Common.py index aeb65625146..0606ef74a62 100644 --- a/tests/resources/Common.py +++ b/tests/resources/Common.py @@ -450,10 +450,7 @@ def check_reschedule(log: str, date, content: str, retry: bool): idx = find_line_from(lines, date) r = re.compile(r".* last check at (.*) and next check at (.*)$") - if retry: - target = 60 - else: - target = 300 + target = 60 if retry else 300 for i in range(idx, len(lines)): line = lines[i] if content in line: From 76512ee00b4dc099c731e160092e0ca0b20ec0fc Mon Sep 17 00:00:00 2001 From: David Boucher Date: Mon, 23 Oct 2023 10:58:42 +0200 Subject: [PATCH 68/84] Update tests/connector_perl/connector_perl.robot Co-authored-by: NITCHEU B --- tests/connector_perl/connector_perl.robot | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/connector_perl/connector_perl.robot b/tests/connector_perl/connector_perl.robot index 00a710e60e2..9bdd4936935 100644 --- a/tests/connector_perl/connector_perl.robot +++ b/tests/connector_perl/connector_perl.robot @@ -16,7 +16,7 @@ test use connector perl exist script [Tags] connector engine Schedule Forced Host Check local_host_test_machine /tmp/test_connector_perl/rw/centengine.cmd Sleep 5 seconds we wait engine forced checks - ${search_result} check search /tmp/test_connector_perl/log/centengine.debug test.pl + ${search_result} Check Search /tmp/test_connector_perl/log/centengine.debug test.pl Should Contain ${search_result} a dummy check check not found test use connector perl unknown script From b4b0341950fca8fa7ba26f37b410f2b384bd24ef Mon Sep 17 00:00:00 2001 From: David Boucher Date: Mon, 23 Oct 2023 10:59:42 +0200 Subject: [PATCH 69/84] Update tests/connector_perl/connector_perl.robot Co-authored-by: NITCHEU B --- tests/connector_perl/connector_perl.robot | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/connector_perl/connector_perl.robot b/tests/connector_perl/connector_perl.robot index 9bdd4936935..c67aee9494a 100644 --- a/tests/connector_perl/connector_perl.robot +++ b/tests/connector_perl/connector_perl.robot @@ -24,7 +24,7 @@ test use connector perl unknown script [Tags] connector engine Schedule Forced Host Check local_host_test_machine_bad_test /tmp/test_connector_perl/rw/centengine.cmd Sleep 5 seconds we wait engine forced checks - ${search_result} check search /tmp/test_connector_perl/log/centengine.debug test_titi.pl + ${search_result} Check Search /tmp/test_connector_perl/log/centengine.debug test_titi.pl Should Contain ... ${search_result} ... Embedded Perl error: failed to open Perl file '/tmp/test_connector_perl/test_titi.pl' From b6e215c30e3929a317aa9c4a0801481550214409 Mon Sep 17 00:00:00 2001 From: David Boucher Date: Mon, 23 Oct 2023 11:02:15 +0200 Subject: [PATCH 70/84] Update tests/connector_perl/connector_perl.robot Co-authored-by: NITCHEU B --- tests/connector_perl/connector_perl.robot | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/connector_perl/connector_perl.robot b/tests/connector_perl/connector_perl.robot index c67aee9494a..e1b68a6fd39 100644 --- a/tests/connector_perl/connector_perl.robot +++ b/tests/connector_perl/connector_perl.robot @@ -40,7 +40,7 @@ test use connector perl multiple script Sleep 10 seconds we wait engine forced checks FOR ${idx} IN RANGE 2 12 ${search_str} Catenate SEPARATOR= test.pl -H 127.0.0. ${idx} - ${search_result} check search /tmp/test_connector_perl/log/centengine.debug ${search_str} + ${search_result} Check Search /tmp/test_connector_perl/log/centengine.debug ${search_str} Should Contain ${search_result} a dummy check check not found END From 77a9232fab54fc3889520909014d8210588a1a41 Mon Sep 17 00:00:00 2001 From: David Boucher Date: Mon, 23 Oct 2023 11:04:12 +0200 Subject: [PATCH 71/84] Update tests/broker/bbdo-server-client.robot Co-authored-by: NITCHEU B --- tests/broker/bbdo-server-client.robot | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/broker/bbdo-server-client.robot b/tests/broker/bbdo-server-client.robot index 2fcb7ed584a..3123a54fc60 100644 --- a/tests/broker/bbdo-server-client.robot +++ b/tests/broker/bbdo-server-client.robot @@ -399,7 +399,7 @@ Start Stop Service Sleep ${interval} ${pid1} Get Process Id b1 ${pid2} Get Process Id b2 - ${result} check connection 5670 ${pid1} ${pid2} + ${result} Check Connection 5670 ${pid1} ${pid2} Should Be True ${result} The connection between cbd central and rrd is not established. Send Signal To Process SIGTERM b1 From 6e6d8c8cb10f0cee08da886aae00c9a3b2d60066 Mon Sep 17 00:00:00 2001 From: David Boucher Date: Mon, 23 Oct 2023 11:05:23 +0200 Subject: [PATCH 72/84] Update tests/broker-engine/acknowledgement.robot Co-authored-by: NITCHEU B --- tests/broker-engine/acknowledgement.robot | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/broker-engine/acknowledgement.robot b/tests/broker-engine/acknowledgement.robot index 48d73ca86a1..a7037d1c315 100644 --- a/tests/broker-engine/acknowledgement.robot +++ b/tests/broker-engine/acknowledgement.robot @@ -97,7 +97,7 @@ BEACK2 Should Be True ${result} Service (1;1) should be OK HARD # Acknowledgement is deleted but to see this we have to check in the comments table - ${result} check acknowledgement is deleted with timeout ${ack_id} 30 + ${result} Check Acknowledgement Is Deleted With Timeout ${ack_id} 30 Should Be True ${result} Acknowledgement ${ack_id} should be deleted. BEACK3 From 14080ec4ac7798f7829026cc61addfb14b6ae2d3 Mon Sep 17 00:00:00 2001 From: David Boucher Date: Mon, 23 Oct 2023 11:06:13 +0200 Subject: [PATCH 73/84] Update tests/broker-engine/acknowledgement.robot Co-authored-by: NITCHEU B --- tests/broker-engine/acknowledgement.robot | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/broker-engine/acknowledgement.robot b/tests/broker-engine/acknowledgement.robot index a7037d1c315..1a6ba4a1128 100644 --- a/tests/broker-engine/acknowledgement.robot +++ b/tests/broker-engine/acknowledgement.robot @@ -135,7 +135,7 @@ BEACK3 Remove Service Acknowledgement host_1 service_1 # Acknowledgement is deleted but this time, both of comments and acknowledgements tables have the deletion_time column filled - ${result} check acknowledgement is deleted with timeout ${ack_id} 30 BOTH + ${result} Check Acknowledgement Is Deleted With Timeout ${ack_id} 30 BOTH Should Be True ${result} Acknowledgement ${ack_id} should be deleted. BEACK4 From 0b58fe096868e7d721c51f982d9c2c11a9d3e585 Mon Sep 17 00:00:00 2001 From: David Boucher Date: Mon, 23 Oct 2023 11:07:35 +0200 Subject: [PATCH 74/84] Update tests/broker-engine/acknowledgement.robot Co-authored-by: NITCHEU B --- tests/broker-engine/acknowledgement.robot | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/broker-engine/acknowledgement.robot b/tests/broker-engine/acknowledgement.robot index 1a6ba4a1128..d128d7205db 100644 --- a/tests/broker-engine/acknowledgement.robot +++ b/tests/broker-engine/acknowledgement.robot @@ -174,7 +174,7 @@ BEACK4 Remove Service Acknowledgement host_1 service_1 # Acknowledgement is deleted but this time, both of comments and acknowledgements tables have the deletion_time column filled - ${result} check acknowledgement is deleted with timeout ${ack_id} 30 BOTH + ${result} Check Acknowledgement Is Deleted With Timeout ${ack_id} 30 BOTH Should Be True ${result} Acknowledgement ${ack_id} should be deleted. BEACK5 From 1054662e03822dbea4352c3ac4a54166b1cf15f4 Mon Sep 17 00:00:00 2001 From: David Boucher Date: Mon, 23 Oct 2023 11:08:10 +0200 Subject: [PATCH 75/84] Update tests/broker-engine/acknowledgement.robot Co-authored-by: NITCHEU B --- tests/broker-engine/acknowledgement.robot | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/broker-engine/acknowledgement.robot b/tests/broker-engine/acknowledgement.robot index d128d7205db..f2f336e4b9b 100644 --- a/tests/broker-engine/acknowledgement.robot +++ b/tests/broker-engine/acknowledgement.robot @@ -218,7 +218,7 @@ BEACK5 Should Be True ${result} Service (1;1) should be WARNING HARD # Acknowledgement is not deleted. - ${result} check acknowledgement is deleted with timeout ${ack_id} 10 + ${result} Check Acknowledgement Is Deleted With Timeout ${ack_id} 10 Should Be True ${result}==${False} Acknowledgement ${ack_id} should not be deleted. Remove Service Acknowledgement host_1 service_1 From 933d755c3d3713a44a1aa8ed1db2104b7b9bc49b Mon Sep 17 00:00:00 2001 From: David Boucher Date: Mon, 23 Oct 2023 11:34:39 +0200 Subject: [PATCH 76/84] cleanup(broker) --- .../inc/com/centreon/broker/multiplexing/engine.hh | 2 +- broker/core/multiplexing/src/engine.cc | 2 +- broker/core/src/processing/feeder.cc | 3 --- 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/broker/core/multiplexing/inc/com/centreon/broker/multiplexing/engine.hh b/broker/core/multiplexing/inc/com/centreon/broker/multiplexing/engine.hh index 7c53c44547b..75ec3e96869 100644 --- a/broker/core/multiplexing/inc/com/centreon/broker/multiplexing/engine.hh +++ b/broker/core/multiplexing/inc/com/centreon/broker/multiplexing/engine.hh @@ -110,7 +110,7 @@ class engine { void publish(const std::deque>& to_publish); void start(); void stop(); - void subscribe(std::shared_ptr& subscriber); + void subscribe(const std::shared_ptr& subscriber); void unsubscribe_muxer(const muxer* subscriber); }; } // namespace multiplexing diff --git a/broker/core/multiplexing/src/engine.cc b/broker/core/multiplexing/src/engine.cc index b887f535cba..40e93461ebe 100644 --- a/broker/core/multiplexing/src/engine.cc +++ b/broker/core/multiplexing/src/engine.cc @@ -245,7 +245,7 @@ void engine::stop() { * * @param[in] subscriber A muxer. */ -void engine::subscribe(std::shared_ptr& subscriber) { +void engine::subscribe(const std::shared_ptr& subscriber) { log_v2::config()->debug("engine: muxer {} subscribes to engine", subscriber->name()); std::lock_guard l(_engine_m); diff --git a/broker/core/src/processing/feeder.cc b/broker/core/src/processing/feeder.cc index fb2bbdb0cc8..58f16effedf 100644 --- a/broker/core/src/processing/feeder.cc +++ b/broker/core/src/processing/feeder.cc @@ -103,12 +103,9 @@ feeder::feeder(const std::string& name, * Destructor. */ feeder::~feeder() { - stop(); SPDLOG_LOGGER_DEBUG(log_v2::core(), "destroy feeder {}, {:p}", get_name(), static_cast(this)); stop(); - - _muxer->unsubscribe(); DEBUG(fmt::format("DESTRUCTOR feeder {:p}", static_cast(this))); } From 7d38b08f64dddd5ea658e2448a0bd91515c555f5 Mon Sep 17 00:00:00 2001 From: David Boucher Date: Mon, 23 Oct 2023 11:35:41 +0200 Subject: [PATCH 77/84] Update tests/broker-engine/acknowledgement.robot Co-authored-by: NITCHEU B --- tests/broker-engine/acknowledgement.robot | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/broker-engine/acknowledgement.robot b/tests/broker-engine/acknowledgement.robot index f2f336e4b9b..1344d35a770 100644 --- a/tests/broker-engine/acknowledgement.robot +++ b/tests/broker-engine/acknowledgement.robot @@ -224,7 +224,7 @@ BEACK5 Remove Service Acknowledgement host_1 service_1 # Acknowledgement is deleted but this time, both of comments and acknowledgements tables have the deletion_time column filled - ${result} check acknowledgement is deleted with timeout ${ack_id} 30 BOTH + ${result} Check Acknowledgement Is Deleted With Timeout ${ack_id} 30 BOTH Should Be True ${result} Acknowledgement ${ack_id} should be deleted. BEACK6 From df0aabda3296883537ad58bf1706270b9c2fa43d Mon Sep 17 00:00:00 2001 From: David Boucher Date: Mon, 23 Oct 2023 11:36:25 +0200 Subject: [PATCH 78/84] Update tests/broker-engine/acknowledgement.robot Co-authored-by: NITCHEU B --- tests/broker-engine/acknowledgement.robot | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/broker-engine/acknowledgement.robot b/tests/broker-engine/acknowledgement.robot index 1344d35a770..381a40379ea 100644 --- a/tests/broker-engine/acknowledgement.robot +++ b/tests/broker-engine/acknowledgement.robot @@ -266,7 +266,7 @@ BEACK6 Should Be True ${result} Service (1;1) should be WARNING HARD # Acknowledgement is not deleted. - ${result} check acknowledgement is deleted with timeout ${ack_id} 10 + ${result} Check Acknowledgement Is Deleted With Timeout ${ack_id} 10 Should Be True ${result}==${False} Acknowledgement ${ack_id} should not be deleted. Remove Service Acknowledgement host_1 service_1 From fcb93c4f7d1f67b0d0b7be58e93ba16550f2087d Mon Sep 17 00:00:00 2001 From: David Boucher Date: Mon, 23 Oct 2023 11:36:56 +0200 Subject: [PATCH 79/84] Update tests/broker-engine/acknowledgement.robot Co-authored-by: NITCHEU B --- tests/broker-engine/acknowledgement.robot | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/broker-engine/acknowledgement.robot b/tests/broker-engine/acknowledgement.robot index 381a40379ea..7593b8e9553 100644 --- a/tests/broker-engine/acknowledgement.robot +++ b/tests/broker-engine/acknowledgement.robot @@ -272,5 +272,5 @@ BEACK6 Remove Service Acknowledgement host_1 service_1 # Acknowledgement is deleted but this time, both of comments and acknowledgements tables have the deletion_time column filled - ${result} check acknowledgement is deleted with timeout ${ack_id} 30 BOTH + ${result} Check Acknowledgement Is Deleted With Timeout ${ack_id} 30 BOTH Should Be True ${result} Acknowledgement ${ack_id} should be deleted. From 0c0daa73294b692868351a0edce986fedf350bcb Mon Sep 17 00:00:00 2001 From: David Boucher Date: Mon, 23 Oct 2023 11:40:42 +0200 Subject: [PATCH 80/84] cleanup(robot) --- tests/broker-engine/log-v2_engine.robot | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/broker-engine/log-v2_engine.robot b/tests/broker-engine/log-v2_engine.robot index 811d8d2e435..7518722994f 100644 --- a/tests/broker-engine/log-v2_engine.robot +++ b/tests/broker-engine/log-v2_engine.robot @@ -33,7 +33,7 @@ LOGV2EB1 ${start} Get Current Date exclude_millis=yes ${time_stamp} Convert Date ${start} epoch exclude_millis=yes - ${time_stamp2} evaluate int(${time_stamp}) + ${time_stamp2} Evaluate int(${time_stamp}) Sleep 1s Start Broker @@ -80,7 +80,7 @@ LOGV2EBU1 ${start} Get Current Date exclude_millis=yes ${time_stamp} Convert Date ${start} epoch exclude_millis=yes - ${time_stamp2} evaluate int(${time_stamp}) + ${time_stamp2} Evaluate int(${time_stamp}) Sleep 1s Start Broker @@ -124,7 +124,7 @@ LOGV2DB1 ${start} Get Current Date exclude_millis=yes ${time_stamp} Convert Date ${start} epoch exclude_millis=yes - ${time_stamp2} evaluate int(${time_stamp}) + ${time_stamp2} Evaluate int(${time_stamp}) Sleep 1s Start Broker @@ -170,7 +170,7 @@ LOGV2DB2 ${start} Get Current Date exclude_millis=yes ${time_stamp} Convert Date ${start} epoch exclude_millis=yes - ${time_stamp2} evaluate int(${time_stamp}) + ${time_stamp2} Evaluate int(${time_stamp}) Sleep 1s Start Broker Start Engine @@ -215,7 +215,7 @@ LOGV2EB2 ${start} Get Current Date exclude_millis=yes ${time_stamp} Convert Date ${start} epoch exclude_millis=yes - ${time_stamp2} evaluate int(${time_stamp}) + ${time_stamp2} Evaluate int(${time_stamp}) Sleep 1s Start Broker @@ -263,7 +263,7 @@ LOGV2EBU2 ${start} Get Current Date exclude_millis=yes ${time_stamp} Convert Date ${start} epoch exclude_millis=yes - ${time_stamp2} evaluate int(${time_stamp}) + ${time_stamp2} Evaluate int(${time_stamp}) Sleep 1s Start Broker From 220e4007357a48b401ce974eece7f95a419ffbeb Mon Sep 17 00:00:00 2001 From: David Boucher Date: Mon, 23 Oct 2023 11:43:32 +0200 Subject: [PATCH 81/84] Update tests/broker-engine/log-v2_engine.robot Co-authored-by: NITCHEU B --- tests/broker-engine/log-v2_engine.robot | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/broker-engine/log-v2_engine.robot b/tests/broker-engine/log-v2_engine.robot index 7518722994f..10080d754a6 100644 --- a/tests/broker-engine/log-v2_engine.robot +++ b/tests/broker-engine/log-v2_engine.robot @@ -430,7 +430,7 @@ LOGV2FE2 Sleep 2m - ${res} check engine logs are duplicated ${engineLog0} ${start} + ${res} Check Engine Logs Are Duplicated ${engineLog0} ${start} Should Be True ${res} one or other log are not duplicate in logsfile Stop Engine Kindly Stop Broker From 946a914531af99f6ee64ccde94f6e397d288b324 Mon Sep 17 00:00:00 2001 From: David Boucher Date: Mon, 23 Oct 2023 11:53:38 +0200 Subject: [PATCH 82/84] cleanup(tests) --- tests/broker-engine/acknowledgement.robot | 2 +- tests/broker-engine/downtimes.robot | 20 +++++++++---------- tests/broker-engine/tags.robot | 16 +++++++-------- tests/broker/bbdo-server-client-ko.robot | 2 +- .../broker/bbdo-server-client-reversed.robot | 2 +- tests/severities/severities.robot | 16 +++++++-------- 6 files changed, 29 insertions(+), 29 deletions(-) diff --git a/tests/broker-engine/acknowledgement.robot b/tests/broker-engine/acknowledgement.robot index 7593b8e9553..060fea9e893 100644 --- a/tests/broker-engine/acknowledgement.robot +++ b/tests/broker-engine/acknowledgement.robot @@ -56,7 +56,7 @@ BEACK1 Should Be True ${result} Service (1;1) should be OK HARD # Acknowledgement is deleted but to see this we have to check in the comments table - ${result} check acknowledgement is deleted with timeout ${ack_id} 30 + ${result} Check Acknowledgement Is Deleted With Timeout ${ack_id} 30 Should Be True ${result} Acknowledgement ${ack_id} should be deleted. BEACK2 diff --git a/tests/broker-engine/downtimes.robot b/tests/broker-engine/downtimes.robot index 8d41f5d73b1..e415ee67144 100644 --- a/tests/broker-engine/downtimes.robot +++ b/tests/broker-engine/downtimes.robot @@ -61,7 +61,7 @@ BEDTMASS1 Schedule Host Downtime ${2} ${host2} ${3600} END - ${result} check number of downtimes ${1050} ${start} ${60} + ${result} Check Number Of Downtimes ${1050} ${start} ${60} Should Be True ${result} We should have 1050 downtimes enabled. # It's time to delete downtimes @@ -74,7 +74,7 @@ BEDTMASS1 Delete Host Downtimes ${2} ${host2} END - ${result} check number of downtimes ${0} ${start} ${60} + ${result} Check Number Of Downtimes ${0} ${start} ${60} Should Be True ${result} We should have no downtime enabled. Stop Engine @@ -117,7 +117,7 @@ BEDTMASS2 Schedule Host Downtime ${2} ${host2} ${3600} END - ${result} check number of downtimes ${1050} ${start} ${60} + ${result} Check Number Of Downtimes ${1050} ${start} ${60} Should Be True ${result} We should have 1050 downtimes enabled. # It's time to delete downtimes @@ -130,7 +130,7 @@ BEDTMASS2 Delete Host Downtimes ${2} ${host2} END - ${result} check number of downtimes ${0} ${start} ${60} + ${result} Check Number Of Downtimes ${0} ${start} ${60} Should Be True ${result} We should have no downtime enabled. Stop Engine @@ -159,7 +159,7 @@ BEDTSVCREN1 # It's time to schedule a downtime Schedule Service Downtime host_1 service_1 ${3600} - ${result} check number of downtimes ${1} ${start} ${60} + ${result} Check Number Of Downtimes ${1} ${start} ${60} Should Be True ${result} We should have 1 downtime enabled. # Let's rename the service service_1 @@ -173,7 +173,7 @@ BEDTSVCREN1 Delete Service Downtime Full ${0} host_1 toto_1 - ${result} check number of downtimes ${0} ${start} ${60} + ${result} Check Number Of Downtimes ${0} ${start} ${60} Should Be True ${result} We should have no downtime enabled. Stop Engine @@ -202,12 +202,12 @@ BEDTSVCFIXED # It's time to schedule a downtime Schedule Service Downtime host_1 service_1 ${3600} - ${result} check number of downtimes ${1} ${start} ${60} + ${result} Check Number Of Downtimes ${1} ${start} ${60} Should Be True ${result} We should have 1 downtime enabled. Delete Service Downtime Full ${0} host_1 service_1 - ${result} check number of downtimes ${0} ${start} ${60} + ${result} Check Number Of Downtimes ${0} ${start} ${60} Should Be True ${result} We should have no downtime enabled. Stop Engine @@ -237,13 +237,13 @@ BEDTHOSTFIXED # It's time to schedule downtimes Schedule Host Fixed Downtime ${0} host_1 ${3600} - ${result} check number of downtimes ${21} ${start} ${60} + ${result} Check Number Of Downtimes ${21} ${start} ${60} Should Be True ${result} We should have 21 downtimes (1 host + 20 services) enabled. # It's time to delete downtimes Delete Host Downtimes ${0} host_1 - ${result} check number of downtimes ${0} ${start} ${60} + ${result} Check Number Of Downtimes ${0} ${start} ${60} Should Be True ${result} We should have no downtime enabled. Stop Engine diff --git a/tests/broker-engine/tags.robot b/tests/broker-engine/tags.robot index b84328d2809..20b3f85a5b4 100644 --- a/tests/broker-engine/tags.robot +++ b/tests/broker-engine/tags.robot @@ -38,9 +38,9 @@ BETAG1 ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} A message telling check_for_external_commands() should be available. - ${result} check tag With Timeout tag20 3 30 + ${result} Check Tag With Timeout tag20 3 30 Should Be True ${result} tag20 should be of type 3 - ${result} check tag With Timeout tag1 0 30 + ${result} Check Tag With Timeout tag1 0 30 Should Be True ${result} tag1 should be of type 0 Stop Engine Kindly Stop Broker @@ -67,9 +67,9 @@ BETAG2 ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} A message telling check_for_external_commands() should be available. - ${result} check tag With Timeout tag20 3 30 + ${result} Check Tag With Timeout tag20 3 30 Should Be True ${result} tag20 should be of type 3 - ${result} check tag With Timeout tag1 0 30 + ${result} Check Tag With Timeout tag1 0 30 Should Be True ${result} tag1 should be of type 0 Stop Engine Kindly Stop Broker @@ -99,9 +99,9 @@ BEUTAG1 ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} A message telling check_for_external_commands() should be available. - ${result} check tag With Timeout tag20 3 30 + ${result} Check Tag With Timeout tag20 3 30 Should Be True ${result} tag20 should be of type 3 - ${result} check tag With Timeout tag1 0 30 + ${result} Check Tag With Timeout tag1 0 30 Should Be True ${result} tag1 should be of type 0 Stop Engine Kindly Stop Broker @@ -179,9 +179,9 @@ BEUTAG3 ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} A message telling check_for_external_commands() should be available. - ${result} check tag With Timeout tag20 3 30 + ${result} Check Tag With Timeout tag20 3 30 Should Be True ${result} tag20 should be of type 3 - ${result} check tag With Timeout tag1 0 30 + ${result} Check Tag With Timeout tag1 0 30 Should Be True ${result} tag1 should be of type 0 Stop Engine Kindly Stop Broker diff --git a/tests/broker/bbdo-server-client-ko.robot b/tests/broker/bbdo-server-client-ko.robot index 29a42824adf..4ca415075d2 100644 --- a/tests/broker/bbdo-server-client-ko.robot +++ b/tests/broker/bbdo-server-client-ko.robot @@ -73,7 +73,7 @@ Start Stop Service Sleep ${interval} ${pid1} Get Process Id b1 ${pid2} Get Process Id b2 - ${result} check connection 5670 ${pid1} ${pid2} + ${result} Check Connection 5670 ${pid1} ${pid2} Should Be True ${result} The connection between cbd central and rrd is not established. Send Signal To Process SIGTERM b1 diff --git a/tests/broker/bbdo-server-client-reversed.robot b/tests/broker/bbdo-server-client-reversed.robot index 3f38ef69562..482f8ef1c97 100644 --- a/tests/broker/bbdo-server-client-reversed.robot +++ b/tests/broker/bbdo-server-client-reversed.robot @@ -279,7 +279,7 @@ Start Stop Service Sleep ${interval} ${pid1} Get Process Id b1 ${pid2} Get Process Id b2 - ${result} check connection 5670 ${pid1} ${pid2} + ${result} Check Connection 5670 ${pid1} ${pid2} Should Be True ${result} The connection between cbd central and rrd is not established. Send Signal To Process SIGTERM b1 diff --git a/tests/severities/severities.robot b/tests/severities/severities.robot index b2997f7588f..cb616e9151a 100644 --- a/tests/severities/severities.robot +++ b/tests/severities/severities.robot @@ -33,9 +33,9 @@ BESEV1 ${start} Get Current Date Start Broker Start Engine - ${result} check severity With Timeout severity20 5 1 30 + ${result} Check Severity With Timeout severity20 5 1 30 Should Be True ${result} severity20 should be of level 5 with icon_id 1 - ${result} check severity With Timeout severity1 1 5 30 + ${result} Check Severity With Timeout severity1 1 5 30 Should Be True ${result} severity1 should be of level 1 with icon_id 5 Stop Engine Kindly Stop Broker @@ -57,9 +57,9 @@ BESEV2 Start Engine Sleep 1s Start Broker - ${result} check severity With Timeout severity20 5 1 30 + ${result} Check Severity With Timeout severity20 5 1 30 Should Be True ${result} severity20 should be of level 5 with icon_id 1 - ${result} check severity With Timeout severity1 1 5 30 + ${result} Check Severity With Timeout severity1 1 5 30 Should Be True ${result} severity1 should be of level 1 with icon_id 5 Stop Engine Kindly Stop Broker @@ -84,9 +84,9 @@ BEUSEV1 ${start} Get Current Date Start Broker Start Engine - ${result} check severity With Timeout severity20 5 1 30 + ${result} Check Severity With Timeout severity20 5 1 30 Should Be True ${result} severity20 should be of level 5 with icon_id 1 - ${result} check severity With Timeout severity1 1 5 30 + ${result} Check Severity With Timeout severity1 1 5 30 Should Be True ${result} severity1 should be of level 1 with icon_id 5 Stop Engine Kindly Stop Broker @@ -112,9 +112,9 @@ BEUSEV2 Start Engine Sleep 1s Start Broker - ${result} check severity With Timeout severity20 5 1 30 + ${result} Check Severity With Timeout severity20 5 1 30 Should Be True ${result} severity20 should be of level 5 with icon_id 1 - ${result} check severity With Timeout severity1 1 5 30 + ${result} Check Severity With Timeout severity1 1 5 30 Should Be True ${result} severity1 should be of level 1 with icon_id 5 Stop Engine Kindly Stop Broker From 1d04c74213af8d3582e13fb729cde9ed9d43b73d Mon Sep 17 00:00:00 2001 From: David Boucher Date: Mon, 23 Oct 2023 12:10:18 +0200 Subject: [PATCH 83/84] cleanup(robot) --- tests/bam/bam_pb.robot | 2 +- tests/bam/pb_inherited_downtime.robot | 2 +- tests/broker-engine/anomaly-detection.robot | 2 +- tests/broker-engine/bench.robot | 2 +- tests/broker-engine/external-commands2.robot | 4 +- tests/broker-engine/hostgroups.robot | 4 +- tests/broker-engine/muxer_filter.robot | 4 +- tests/broker-engine/output-tables.robot | 38 +++++++++---------- .../broker-engine/retention-duplicates.robot | 10 ++--- tests/broker-engine/services-increased.robot | 2 +- tests/broker/sql.robot | 4 +- tests/engine/forced_checks.robot | 14 +++---- 12 files changed, 44 insertions(+), 44 deletions(-) diff --git a/tests/bam/bam_pb.robot b/tests/bam/bam_pb.robot index 955ba341f11..8ca5d43f345 100644 --- a/tests/bam/bam_pb.robot +++ b/tests/bam/bam_pb.robot @@ -792,7 +792,7 @@ BEPB_BA_DURATION_EVENT # KPI set to critical # as GetCurrent Date floor milliseconds to upper or lower integer, we substract 1s - ${start_event} get_round_current_date + ${start_event} Get Round Current Date Process Service Result Hard host_16 service_314 2 output critical for 314 ${result} Check Service Status With Timeout host_16 service_314 2 60 HARD Should Be True ${result} The service (host_16,service_314) is not CRITICAL as expected diff --git a/tests/bam/pb_inherited_downtime.robot b/tests/bam/pb_inherited_downtime.robot index c717e75c25c..358ca110d07 100644 --- a/tests/bam/pb_inherited_downtime.robot +++ b/tests/bam/pb_inherited_downtime.robot @@ -146,7 +146,7 @@ BEBAMIDTU2 END # There are still two downtimes: the one on the ba and the one on the kpi. - ${result} Number Of Downtimes is 2 60 + ${result} Number Of Downtimes Is 2 60 Should Be True ${result} We should only have only two downtimes # The downtime is deleted diff --git a/tests/broker-engine/anomaly-detection.robot b/tests/broker-engine/anomaly-detection.robot index cfc38ab2fbf..7236b3fb87f 100644 --- a/tests/broker-engine/anomaly-detection.robot +++ b/tests/broker-engine/anomaly-detection.robot @@ -189,7 +189,7 @@ AOUTLU1 Stop Engine Kindly Stop Broker ${lst} Create List 1 0 4 - ${result} Check Types in resources ${lst} + ${result} Check Types In Resources ${lst} Should Be True ... ${result} ... The table 'resources' should contain rows of types SERVICE, HOST and ANOMALY_DETECTION. diff --git a/tests/broker-engine/bench.robot b/tests/broker-engine/bench.robot index e22907ae8a1..66dc30aa930 100644 --- a/tests/broker-engine/bench.robot +++ b/tests/broker-engine/bench.robot @@ -212,7 +212,7 @@ BENCH_1000STATUS_100${suffixe} ${diff_engine} Diff Process Stat ${engine_stat_after} ${engine_stat_before} ${content} Create List pb service (100, 2000) status 1 type 1 check result output: <> - ${result} Find In Log With Timeout with Line ${centralLog} ${start_check} ${content} 240 + ${result} Find In Log With Timeout With Line ${centralLog} ${start_check} ${content} 240 Should Be True ${result[0]} No check check result received. ${date_last_check_received} Extract Date From Log ${result[1][0]} ${all_check_delay} Subtract Date From Date ${date_last_check_received} ${start_check} diff --git a/tests/broker-engine/external-commands2.robot b/tests/broker-engine/external-commands2.robot index 3f21e613738..57ab3bfc9f9 100644 --- a/tests/broker-engine/external-commands2.robot +++ b/tests/broker-engine/external-commands2.robot @@ -1416,8 +1416,8 @@ BESERVCHECK Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort} Execute SQL String UPDATE services set command_line='toto', next_check=0 where service_id=1 and host_id=1 Schedule Forced Svc Check host_1 service_1 - ${command_param} get_command_service_param 1 - ${result} check_service_check_with_timeout + ${command_param} Get Command Service Param 1 + ${result} Check Service Check With Timeout ... host_1 ... service_1 ... 30 diff --git a/tests/broker-engine/hostgroups.robot b/tests/broker-engine/hostgroups.robot index a04c1d0ebdd..d225e02e266 100644 --- a/tests/broker-engine/hostgroups.robot +++ b/tests/broker-engine/hostgroups.robot @@ -143,7 +143,7 @@ EBNHGU3 Reload Broker Reload Engine - ${result} Check Number of relations between hostgroup and hosts 1 12 30 + ${result} Check Number Of Relations Between Hosgroup And Hosts 1 12 30 Should Be True ${result} We should have 12 hosts members of host 1. Config Engine Remove Cfg File ${0} hostgroups.cfg @@ -151,7 +151,7 @@ EBNHGU3 Sleep 3s Reload Broker Reload Engine - ${result} Check Number of relations between hostgroup and hosts 1 9 30 + ${result} Check Number Of Relations Between Hosgroup And Hosts 1 9 30 Should Be True ${result} We should have 12 hosts members of host 1. Stop Engine diff --git a/tests/broker-engine/muxer_filter.robot b/tests/broker-engine/muxer_filter.robot index b0e68db00da..c4e8f83ecf1 100644 --- a/tests/broker-engine/muxer_filter.robot +++ b/tests/broker-engine/muxer_filter.robot @@ -308,7 +308,7 @@ CBD_RELOAD_AND_FILTERS # We check that output filters to rrd are set to "storage" ${content} Create List rrd event of type .* rejected by write filter - ${result} Find Regex In Log with Timeout ${centralLog} ${start2} ${content} 120 + ${result} Find Regex In Log With Timeout ${centralLog} ${start2} ${content} 120 Should Be True ${result} No event rejected by the rrd output whereas only storage category is enabled. Log To Console Third configuration: all events are sent. @@ -411,7 +411,7 @@ CBD_RELOAD_AND_FILTERS_WITH_OPR # We check that output filters to rrd are set to "storage" ${content} Create List rrd event of type .* rejected by write filter - ${result} Find Regex In Log with Timeout ${centralLog} ${start2} ${content} 120 + ${result} Find Regex In Log With Timeout ${centralLog} ${start2} ${content} 120 Should Be True ${result} No event rejected by the rrd output whereas only storage category is enabled. Log To Console Third configuration: all events are sent. diff --git a/tests/broker-engine/output-tables.robot b/tests/broker-engine/output-tables.robot index 0e444fe943a..bd5d8096ee0 100644 --- a/tests/broker-engine/output-tables.robot +++ b/tests/broker-engine/output-tables.robot @@ -116,38 +116,38 @@ BEINSTANCESTATUS ${content} Create List check_for_external_commands ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} No check for external commands executed for 1mn. - ${result} check_field_db_value + ${result} Check Field Db Value ... SELECT global_host_event_handler FROM instances WHERE instance_id=1 ... command_1 ... 30 Should Be True ${result} global_host_event_handler not updated. - ${result} check_field_db_value + ${result} Check Field Db Value ... SELECT global_service_event_handler FROM instances WHERE instance_id=1 ... command_2 ... 2 Should Be True ${result} global_service_event_handler not updated. - ${result} check_field_db_value SELECT flap_detection FROM instances WHERE instance_id=1 ${1} 3 + ${result} Check Field Db Value SELECT flap_detection FROM instances WHERE instance_id=1 ${1} 3 Should Be True ${result} flap_detection not updated. - ${result} check_field_db_value SELECT notifications FROM instances WHERE instance_id=1 ${0} 3 + ${result} Check Field Db Value SELECT notifications FROM instances WHERE instance_id=1 ${0} 3 Should Be True ${result} notifications not updated. - ${result} check_field_db_value SELECT active_host_checks FROM instances WHERE instance_id=1 ${0} 3 + ${result} Check Field Db Value SELECT active_host_checks FROM instances WHERE instance_id=1 ${0} 3 Should Be True ${result} active_host_checks not updated. - ${result} check_field_db_value SELECT active_service_checks FROM instances WHERE instance_id=1 ${0} 3 + ${result} Check Field Db Value SELECT active_service_checks FROM instances WHERE instance_id=1 ${0} 3 Should Be True ${result} active_service_checks not updated. - ${result} check_field_db_value SELECT check_hosts_freshness FROM instances WHERE instance_id=1 ${0} 3 + ${result} Check Field Db Value SELECT check_hosts_freshness FROM instances WHERE instance_id=1 ${0} 3 Should Be True ${result} check_hosts_freshness not updated. - ${result} check_field_db_value + ${result} Check Field Db Value ... SELECT check_services_freshness FROM instances WHERE instance_id=1 ... ${1} ... 3 Should Be True ${result} check_services_freshness not updated. - ${result} check_field_db_value SELECT obsess_over_hosts FROM instances WHERE instance_id=1 ${1} 3 + ${result} Check Field Db Value SELECT obsess_over_hosts FROM instances WHERE instance_id=1 ${1} 3 Should Be True ${result} obsess_over_hosts not updated. - ${result} check_field_db_value SELECT obsess_over_services FROM instances WHERE instance_id=1 ${1} 3 + ${result} Check Field Db Value SELECT obsess_over_services FROM instances WHERE instance_id=1 ${1} 3 Should Be True ${result} obsess_over_services not updated. - ${result} check_field_db_value SELECT passive_host_checks FROM instances WHERE instance_id=1 ${0} 3 + ${result} Check Field Db Value SELECT passive_host_checks FROM instances WHERE instance_id=1 ${0} 3 Should Be True ${result} passive_host_checks not updated. - ${result} check_field_db_value SELECT passive_service_checks FROM instances WHERE instance_id=1 ${0} 3 + ${result} Check Field Db Value SELECT passive_service_checks FROM instances WHERE instance_id=1 ${0} 3 Should Be True ${result} passive_service_checks not updated. Stop Engine Kindly Stop Broker @@ -167,22 +167,22 @@ BEINSTANCE Execute SQL String DELETE FROM instances #as GetCurrent Date floor milliseconds to upper or lower integer, we substract 1s - ${start} get_round_current_date + ${start} Get Round Current Date Start Broker Start Engine ${engine_pid} Get Engine Pid e0 - ${result} check_field_db_value SELECT pid FROM instances WHERE instance_id=1 ${engine_pid} 30 + ${result} Check Field Db Value SELECT pid FROM instances WHERE instance_id=1 ${engine_pid} 30 Should Be True ${result} no correct engine pid in instances table. - ${result} check_field_db_value SELECT engine FROM instances WHERE instance_id=1 Centreon Engine 3 + ${result} Check Field Db Value SELECT engine FROM instances WHERE instance_id=1 Centreon Engine 3 Should Be True ${result} no correct engine in instances table. - ${result} check_field_db_value SELECT running FROM instances WHERE instance_id=1 ${1} 3 + ${result} Check Field Db Value SELECT running FROM instances WHERE instance_id=1 ${1} 3 Should Be True ${result} no correct running in instances table. - ${result} check_field_db_value SELECT name FROM instances WHERE instance_id=1 Poller0 3 + ${result} Check Field Db Value SELECT name FROM instances WHERE instance_id=1 Poller0 3 Should Be True ${result} no correct name in instances table. - ${result} check_field_db_value SELECT end_time FROM instances WHERE instance_id=1 ${0} 3 + ${result} Check Field Db Value SELECT end_time FROM instances WHERE instance_id=1 ${0} 3 Should Be True ${result} no correct end_time in instances table. @{bdd_start_time} Query SELECT start_time FROM instances WHERE instance_id=1 - ${now} get_round_current_date + ${now} Get Round Current Date Should Be True ... ${start} <= ${bdd_start_time[0][0]} and ${bdd_start_time[0][0]} <= ${now} ... sg=no correct start_time in instances table. diff --git a/tests/broker-engine/retention-duplicates.robot b/tests/broker-engine/retention-duplicates.robot index 844d0a688d1..1c6292abd1c 100644 --- a/tests/broker-engine/retention-duplicates.robot +++ b/tests/broker-engine/retention-duplicates.robot @@ -327,7 +327,7 @@ BERDUC3U2 ${start} Get Round Current Date # Let's wait for a first service status. ${content} Create List SQL: pb service .* status .* type .* check result output - ${result} Find Regex In Log with Timeout ${centralLog} ${start} ${content} 60 + ${result} Find Regex In Log With Timeout ${centralLog} ${start} ${content} 60 Should Be True ${result[0]} We did not get any pb service status for 60s ${result} Check Connections @@ -387,11 +387,11 @@ BERDUCA300 Should Be True ${result} Broker should receive a pb stop message from engine. ${content} Create List send acknowledgement for [0-9]+ events - ${result} Find Regex in Log with Timeout ${centralLog} ${start} ${content} 30 + ${result} Find Regex In Log With Timeout ${centralLog} ${start} ${content} 30 Should Be True ${result[0]} Broker should send an ack for handled events. ${content} Create List BBDO: received acknowledgement for [0-9]+ events before finishing - ${result} Find Regex in Log with Timeout ${moduleLog0} ${start} ${content} 30 + ${result} Find Regex In Log With Timeout ${moduleLog0} ${start} ${content} 30 Should Be True ${result[0]} Engine should receive an ack for handled events from broker. Kindly Stop Broker @@ -440,11 +440,11 @@ BERDUCA301 Should Be True ${result} Broker should receive a pb stop message from engine. ${content} Create List send pb acknowledgement for [0-9]+ events - ${result} Find Regex in Log with Timeout ${centralLog} ${start} ${content} 30 + ${result} Find Regex In Log With Timeout ${centralLog} ${start} ${content} 30 Should Be True ${result[0]} Broker should send an ack for handled events. ${content} Create List BBDO: received acknowledgement for [0-9]+ events before finishing - ${result} Find Regex in Log with Timeout ${moduleLog0} ${start} ${content} 30 + ${result} Find Regex In Log With Timeout ${moduleLog0} ${start} ${content} 30 Should Be True ${result[0]} Engine should receive an ack for handled events from broker. Kindly Stop Broker diff --git a/tests/broker-engine/services-increased.robot b/tests/broker-engine/services-increased.robot index 6226a4ddd97..01184db2e1e 100644 --- a/tests/broker-engine/services-increased.robot +++ b/tests/broker-engine/services-increased.robot @@ -85,7 +85,7 @@ Service_increased_huge_check_interval Start Broker Start Engine # Start Checkers - ${result} Check host status host_1 4 1 False + ${result} Check Host Status host_1 4 1 False Should Be True ${result} host_1 should be pending ${content} Create List INITIAL HOST STATE: host_1; diff --git a/tests/broker/sql.robot b/tests/broker/sql.robot index 348565a73ff..5f26e434d0d 100644 --- a/tests/broker/sql.robot +++ b/tests/broker/sql.robot @@ -297,7 +297,7 @@ BDBU1 ${start} Get Current Date Start Broker ${content} Create List Table 'centreon\..*' doesn't exist - ${result} Find Regex In Log with timeout ${centralLog} ${start} ${content} 60 + ${result} Find Regex In Log With Timeout ${centralLog} ${start} ${content} 60 Should Be True ${result} A message about some missing tables in 'centreon' database should appear Kindly Stop Broker END @@ -363,7 +363,7 @@ BDBU10 ${start} Get Current Date Start Broker ${content} Create List mysql_connection 0x[0-9a-f]* : commit - ${result} Find Regex In Log with timeout ${centralLog} ${start} ${content} 40 + ${result} Find Regex In Log With Timeout ${centralLog} ${start} ${content} 40 Should Be True ${result[0]} Log concerning a commit (connection ok) is missing. Kindly Stop Broker diff --git a/tests/engine/forced_checks.robot b/tests/engine/forced_checks.robot index b103b50b5cb..61b2f2e606d 100644 --- a/tests/engine/forced_checks.robot +++ b/tests/engine/forced_checks.robot @@ -33,7 +33,7 @@ EFHC1 ${start} Get Current Date Start Engine Start Broker - ${result} Check host status host_1 4 1 False + ${result} Check Host Status host_1 4 1 False Should Be True ${result} host_1 should be pending ${content} Create List INITIAL HOST STATE: host_1; @@ -57,7 +57,7 @@ EFHC1 ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} Message about SCHEDULE FORCED CHECK and HOST ALERT should be available in log. - ${result} Check host status host_1 1 1 False + ${result} Check Host Status host_1 1 1 False Should Be True ${result} host_1 should be down/hard Stop Engine Kindly Stop Broker @@ -100,7 +100,7 @@ EFHC2 ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} Message about SCHEDULE FORCED CHECK and HOST ALERT should be available in log. - ${result} Check host status host_1 1 1 False + ${result} Check Host Status host_1 1 1 False Should Be True ${result} host_1 should be down/hard Stop Engine Kindly Stop Broker @@ -129,7 +129,7 @@ EFHCU1 ${start} Get Current Date Start Engine Start Broker - ${result} Check host status host_1 4 1 True + ${result} Check Host Status host_1 4 1 True Should Be True ${result} host_1 should be pending ${content} Create List INITIAL HOST STATE: host_1; ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 @@ -152,7 +152,7 @@ EFHCU1 ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} Message about SCHEDULE FORCED CHECK and HOST ALERT should be available in log. - ${result} Check host status host_1 1 1 True + ${result} Check Host Status host_1 1 1 True Should Be True ${result} host_1 should be down/hard Stop Engine Kindly Stop Broker @@ -180,7 +180,7 @@ EFHCU2 ${start} Get Current Date Start Engine Start Broker - ${result} Check host status host_1 4 1 True + ${result} Check Host Status host_1 4 1 True Should Be True ${result} host_1 should be pending ${content} Create List INITIAL HOST STATE: host_1; ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 @@ -203,7 +203,7 @@ EFHCU2 ${result} Find In Log With Timeout ${engineLog0} ${start} ${content} 60 Should Be True ${result} Message about SCHEDULE FORCED CHECK and HOST ALERT should be available in log. - ${result} Check host status host_1 1 1 True + ${result} Check Host Status host_1 1 1 True Should Be True ${result} host_1 should be down/hard Stop Engine Kindly Stop Broker From e72d791d776a81cc0c7c4d15ebde9145079f656b Mon Sep 17 00:00:00 2001 From: David Boucher Date: Mon, 23 Oct 2023 12:11:43 +0200 Subject: [PATCH 84/84] fix(robot): typo --- tests/broker-engine/hostgroups.robot | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/broker-engine/hostgroups.robot b/tests/broker-engine/hostgroups.robot index d225e02e266..4b2eeb53f9d 100644 --- a/tests/broker-engine/hostgroups.robot +++ b/tests/broker-engine/hostgroups.robot @@ -143,7 +143,7 @@ EBNHGU3 Reload Broker Reload Engine - ${result} Check Number Of Relations Between Hosgroup And Hosts 1 12 30 + ${result} Check Number Of Relations Between Hostgroup And Hosts 1 12 30 Should Be True ${result} We should have 12 hosts members of host 1. Config Engine Remove Cfg File ${0} hostgroups.cfg @@ -151,7 +151,7 @@ EBNHGU3 Sleep 3s Reload Broker Reload Engine - ${result} Check Number Of Relations Between Hosgroup And Hosts 1 9 30 + ${result} Check Number Of Relations Between Hostgroup And Hosts 1 9 30 Should Be True ${result} We should have 12 hosts members of host 1. Stop Engine