Skip to content

Commit

Permalink
fix(tests): Centreon keywords prefixed with Ctn
Browse files Browse the repository at this point in the history
REFS: MON-21351
  • Loading branch information
bouda1 authored Mar 6, 2024
1 parent f2645fe commit f9f2195
Show file tree
Hide file tree
Showing 63 changed files with 8,126 additions and 8,126 deletions.
714 changes: 357 additions & 357 deletions tests/bam/bam_pb.robot

Large diffs are not rendered by default.

538 changes: 269 additions & 269 deletions tests/bam/boolean_rules.robot

Large diffs are not rendered by default.

298 changes: 149 additions & 149 deletions tests/bam/inherited_downtime.robot

Large diffs are not rendered by default.

310 changes: 155 additions & 155 deletions tests/bam/pb_inherited_downtime.robot

Large diffs are not rendered by default.

28 changes: 14 additions & 14 deletions tests/broker-database/dedicated-connection.robot
Original file line number Diff line number Diff line change
Expand Up @@ -3,38 +3,38 @@ Documentation Centreon Broker data_bin and logs dedicated connections
Resource ../resources/import.resource

Suite Setup Clean Before Suite
Suite Teardown Clean After Suite
Test Setup Stop Processes
Test Teardown Stop Engine Broker And Save Logs only_central=True
Suite Setup Ctn Clean Before Suite
Suite Teardown Ctn Clean After Suite
Test Setup Ctn Stop Processes
Test Teardown Ctn Stop Engine Broker And Save Logs only_central=True


*** Test Cases ***
DEDICATED_DB_CONNECTION_${nb_conn}_${store_in_data_bin}
[Documentation] count database connection
[Tags] broker database
Config Broker central
Broker Config Log central sql debug
Config Broker Sql Output central unified_sql
Ctn Config Broker central
Ctn Broker Config Log central sql debug
Ctn 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 ${nb_conn}
Broker Config Output Set central central-broker-unified-sql store_in_data_bin ${store_in_data_bin}
Ctn Broker Config Output Set central central-broker-unified-sql db_host 127.0.0.1
Ctn Broker Config Output Set central central-broker-unified-sql connections_count ${nb_conn}
Ctn Broker Config Output Set central central-broker-unified-sql store_in_data_bin ${store_in_data_bin}

${start} Get Current Date
Start Broker only_central=${True}
Ctn Start Broker only_central=${True}
${content} Create List unified sql: stream class instanciation
${result} Find In Log With Timeout ${centralLog} ${start} ${content} 60
${result} Ctn 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} Ctn Find In Log With Timeout ${centralLog} ${start} ${content} 5
Should Be True ${result} No dedicated message
END

${connected} Wait For Connections 3306 ${nb_conn_expected}
${connected} Ctn Wait For Connections 3306 ${nb_conn_expected}
Should Be True ${connected} no ${nb_conn_expected} connections found

Examples: nb_conn nb_conn_expected store_in_data_bin --
Expand Down
206 changes: 103 additions & 103 deletions tests/broker-database/networkFailure.robot
Original file line number Diff line number Diff line change
Expand Up @@ -3,193 +3,193 @@ Documentation Centreon Broker database connection failure
Resource ../resources/import.resource

Suite Setup Clean Before Suite
Suite Teardown Clean After Suite
Test Setup Stop Processes
Suite Setup Ctn Clean Before Suite
Suite Teardown Ctn Clean After Suite
Test Setup Ctn Stop Processes


*** Test Cases ***
NetworkDbFail1
[Documentation] network failure test between broker and database (shutting down connection for 100ms)
[Tags] broker database network
Network Failure interval=100ms
Ctn Network Failure interval=100ms

NetworkDbFail2
[Documentation] network failure test between broker and database (shutting down connection for 1s)
[Tags] broker database network
Network Failure interval=1s
Ctn Network Failure interval=1s

NetworkDbFail3
[Documentation] network failure test between broker and database (shutting down connection for 10s)
[Tags] broker database network
Network Failure interval=10s
Ctn Network Failure interval=10s

NetworkDbFail4
[Documentation] network failure test between broker and database (shutting down connection for 30s)
[Tags] broker database network
Network Failure interval=30s
Ctn Network Failure interval=30s

NetworkDbFail5
[Documentation] network failure test between broker and database (shutting down connection for 60s)
[Tags] broker database network
Network Failure interval=1m
Ctn Network Failure interval=1m

NetworkDBFail6
[Documentation] network failure test between broker and database: we wait for the connection to be established and then we shut down the connection for 60s
[Tags] broker database network unstable
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-perfdata db_host 127.0.0.1
Broker Config Output Set central central-broker-master-perfdata connections_count 5
Broker Config Log central sql trace
Config Broker rrd
Config Broker module
Ctn Config Engine ${1}
Ctn Config Broker central
Ctn Broker Config Output Set central central-broker-master-sql db_host 127.0.0.1
Ctn Broker Config Output Set central central-broker-master-sql connections_count 5
Ctn Broker Config Output Set central central-broker-master-perfdata db_host 127.0.0.1
Ctn Broker Config Output Set central central-broker-master-perfdata connections_count 5
Ctn Broker Config Log central sql trace
Ctn Config Broker rrd
Ctn Config Broker module
${start} Get Current Date
Start Broker
Start Engine
${result} Check Connections
Ctn Start Broker
Ctn Start engine
${result} Ctn 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
${result} Ctn 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
Ctn Disable Eth Connection On Port port=3306
Sleep 1m
Reset Eth Connection
Ctn Reset Eth Connection
${content} Create List 0 events acknowledged
${result} Find In Log With Timeout ${centralLog} ${start} ${content} 40
Stop Engine
Kindly Stop Broker
${result} Ctn Find In Log With Timeout ${centralLog} ${start} ${content} 40
Ctn Stop engine
Ctn Kindly Stop Broker

NetworkDBFailU6
[Documentation] network failure test between broker and database: we wait for the connection to be established and then we shut down the connection for 60s (with unified_sql)
[Tags] broker database network unified_sql unstable
Reset Eth Connection
Config Engine ${1}
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 Log central sql trace
Config Broker rrd
Config Broker module
Ctn Reset Eth Connection
Ctn Config Engine ${1}
Ctn Config Broker central
Ctn Config Broker Sql Output central unified_sql
Ctn Broker Config Output Set central central-broker-unified-sql db_host 127.0.0.1
Ctn Broker Config Output Set central central-broker-unified-sql connections_count 5
Ctn Broker Config Log central sql trace
Ctn Config Broker rrd
Ctn Config Broker module
${start} Get Current Date
Start Broker
Start Engine
${result} Check Connections
Ctn Start Broker
Ctn Start engine
${result} Ctn 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
${result} Ctn 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
Ctn 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
Ctn Reset Eth Connection
${content} Create List 0 events acknowledged
${result} Find In Log With Timeout ${centralLog} ${start} ${content} 40
Stop Engine
Kindly Stop Broker
${result} Ctn Find In Log With Timeout ${centralLog} ${start} ${content} 40
Ctn Stop engine
Ctn Kindly Stop Broker

NetworkDBFail7
[Documentation] network failure test between broker and database: we wait for the connection to be established and then we shut down the connection for 60s
[Tags] broker database network
Config Engine ${1}
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-perfdata db_host 127.0.0.1
Broker Config Output Set central central-broker-master-perfdata connections_count 5
Broker Config Log central sql trace
Config Broker rrd
Config Broker module
Ctn Config Engine ${1}
Ctn Config Broker central
Ctn Reset Eth Connection
Ctn Broker Config Output Set central central-broker-master-sql db_host 127.0.0.1
Ctn Broker Config Output Set central central-broker-master-sql connections_count 5
Ctn Broker Config Output Set central central-broker-master-perfdata db_host 127.0.0.1
Ctn Broker Config Output Set central central-broker-master-perfdata connections_count 5
Ctn Broker Config Log central sql trace
Ctn Config Broker rrd
Ctn Config Broker module
${start} Get Current Date
Start Broker
Start Engine
${result} Check Connections
Ctn Start Broker
Ctn Start engine
${result} Ctn 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
${result} Ctn 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
Ctn Disable Eth Connection On Port port=3306
Sleep 10s
Reset Eth Connection
Ctn Reset Eth Connection
Sleep 10s
END
${content} Create List 0 events acknowledged
${result} Find In Log With Timeout ${centralLog} ${start} ${content} 60
${result} Ctn 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
Ctn Stop engine
Ctn Kindly Stop Broker

NetworkDBFailU7
[Documentation] network failure test between broker and database: we wait for the connection to be established and then we shut down the connection for 60s (with unified_sql)
[Tags] broker database network unified_sql
Reset Eth Connection
Config Engine ${1}
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 Log central sql trace
Config Broker rrd
Config Broker module
Ctn Reset Eth Connection
Ctn Config Engine ${1}
Ctn Config Broker central
Ctn Config Broker Sql Output central unified_sql
Ctn Broker Config Output Set central central-broker-unified-sql db_host 127.0.0.1
Ctn Broker Config Output Set central central-broker-unified-sql connections_count 5
Ctn Broker Config Log central sql trace
Ctn Config Broker rrd
Ctn Config Broker module
${start} Get Current Date
Start Broker
Start Engine
${result} Check Connections
Ctn Start Broker
Ctn Start engine
${result} Ctn 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
${result} Ctn 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
Ctn Disable Eth Connection On Port port=3306
Sleep 10s
Reset Eth Connection
Ctn Reset Eth Connection
Sleep 10s
END
${content} Create List 0 events acknowledged
${result} Find In Log With Timeout ${centralLog} ${start} ${content} 60
${result} Ctn 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
Ctn Stop engine
Ctn Kindly Stop Broker


*** Keywords ***
Disable Sleep Enable
Ctn Disable Sleep Enable
[Arguments] ${interval}
Disable Eth Connection On Port port=3306
Ctn Disable Eth Connection On Port port=3306
Sleep ${interval}
Reset Eth Connection
Ctn Reset Eth Connection

Network Failure
Ctn Network Failure
[Arguments] ${interval}
Reset Eth Connection
Config Engine ${1}
Config Broker module
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-perfdata db_host 127.0.0.1
Broker Config Output Set central central-broker-master-perfdata connections_count 10
Broker Config Log central sql trace
Broker Config Source Log central true
Ctn Reset Eth Connection
Ctn Config Engine ${1}
Ctn Config Broker module
Ctn Config Broker rrd
Ctn Config Broker central
Ctn Broker Config Output Set central central-broker-master-sql db_host 127.0.0.1
Ctn Broker Config Output Set central central-broker-master-sql connections_count 10
Ctn Broker Config Output Set central central-broker-master-perfdata db_host 127.0.0.1
Ctn Broker Config Output Set central central-broker-master-perfdata connections_count 10
Ctn Broker Config Log central sql trace
Ctn Broker Config Source Log central true
${start} Get Current Date
Start Broker
Start Engine
Ctn Start Broker
Ctn Start engine
${content} Create List SQL: performing mysql_ping
${result} Find In Log With Timeout ${centralLog} ${start} ${content} 120
${result} Ctn 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}
Ctn 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
${result} Ctn Find Regex In Log With Timeout ${centralLog} ${end} ${content} 80
Should Be True
... ${result[0]}
... timeout after network to be restablished (network failure duration : ${interval})
Kindly Stop Broker
Stop Engine
Ctn Kindly Stop Broker
Ctn Stop engine
Loading

3 comments on commit f9f2195

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Robot Results

✅ Passed ❌ Failed ⏭️ Skipped Total Pass % ⏱️ Duration
8 2 0 10 80.00 0s

Failed Tests

Name Message ⏱️ Duration Suite
BRRDRM1 index_id=6292 Data before RRD rebuild contain index_id % 3. The expected average is 100 if modulo==0, 75 if modulo==1, 0 if modulo==2 . 0.000 s Rrd
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 . 0.000 s Rrd

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Robot Results

✅ Passed ❌ Failed ⏭️ Skipped Total Pass % ⏱️ Duration
8 2 0 10 80.00 0s

Failed Tests

Name Message ⏱️ Duration Suite
BRRDRM1 index_id=6369 Data before RRD rebuild contain index_id % 3. The expected average is 100 if modulo==0, 75 if modulo==1, 0 if modulo==2 . 0.000 s Rrd
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 . 0.000 s Rrd

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Robot Results

✅ Passed ❌ Failed ⏭️ Skipped Total Pass % ⏱️ Duration
8 2 0 10 80.00 0s

Failed Tests

Name Message ⏱️ Duration Suite
BRRDRM1 index_id=6643 Data before RRD rebuild contain index_id % 3. The expected average is 100 if modulo==0, 75 if modulo==1, 0 if modulo==2 . 0.000 s Rrd
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 . 0.000 s Rrd

Please sign in to comment.