Skip to content

Commit

Permalink
fix(Gorgone): update statistic test to use new version of databaseLib…
Browse files Browse the repository at this point in the history
…rary.

Refs:MON-144643
  • Loading branch information
Evan-Adam committed Oct 7, 2024
1 parent 83fec58 commit 1160f10
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions gorgone/tests/robot/tests/centreon/statistics.robot
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
*** Settings ***
Documentation test gorgone statistics module
Library DatabaseLibrary
Resource ${CURDIR}${/}..${/}..${/}resources${/}import.resource
Test Timeout 220s
Suite Setup Suite Setup Statistics Module
Expand All @@ -21,7 +22,7 @@ check statistic module add all centengine data in db ${communication_mode}
# we first test the module when there is no data in the table, we will test it again when
# there is data in the table to be sure the data are correctly updated.
Execute SQL String DELETE FROM nagios_stats alias=storage
Check If Not Exists In Database SELECT * FROM nagios_stats alias=storage
Check Row Count SELECT * FROM nagios_stats == 0 alias=storage assertion_message=there is still data in the nagios_stats table after the delete.

Ctn Gorgone Force Engine Statistics Retrieve
# statistics module send the GORGONE_ACTION_FINISH_OK once messages for the action module are sent.
Expand All @@ -35,7 +36,7 @@ check statistic module add all centengine data in db ${communication_mode}

# As the value we set in db are fake and hardcoded, we need to change the data before
# running again the module to be sure data are correctly updated, instead of letting the last value persist.
Query UPDATE nagios_stats SET stat_value=999; alias=storage
Execute SQL String UPDATE nagios_stats SET stat_value=999; alias=storage
${date2} Get Current Date increment=-1s
Sleep 1
Ctn Gorgone Force Engine Statistics Retrieve
Expand Down Expand Up @@ -78,7 +79,7 @@ Ctn Gorgone Check Poller Engine Stats Are Present
FOR ${stat_label} ${stat_data} IN &{data_check}

FOR ${stat_key} ${stat_value} IN &{stat_data}
Check If Exists In Database SELECT instance_id FROM nagios_stats WHERE stat_key = '${stat_key}' AND stat_value = '${stat_value}' AND stat_label = '${stat_label}' AND instance_id='${poller_id}'; alias=storage
Check Row Count SELECT instance_id FROM nagios_stats WHERE stat_key = '${stat_key}' AND stat_value = '${stat_value}' AND stat_label = '${stat_label}' AND instance_id='${poller_id}'; equal 1 alias=storage

END
END
Expand Down

0 comments on commit 1160f10

Please sign in to comment.