Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/zabbix/zabbix.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'tests/zabbix_server/taskmanager/try_task_closes_problem.json')
-rw-r--r--tests/zabbix_server/taskmanager/try_task_closes_problem.json97
1 files changed, 97 insertions, 0 deletions
diff --git a/tests/zabbix_server/taskmanager/try_task_closes_problem.json b/tests/zabbix_server/taskmanager/try_task_closes_problem.json
new file mode 100644
index 00000000000..bad831d8990
--- /dev/null
+++ b/tests/zabbix_server/taskmanager/try_task_closes_problem.json
@@ -0,0 +1,97 @@
+[
+ {
+ "test_case": "successfully close the problem",
+ "tested_function": "try_task_closes_problem",
+ "in": {
+ "names": ["taskid"],
+ "values": [1]
+ },
+ "out": {
+ "names": ["return"],
+ "values": [0]
+ },
+ "db_data": {
+ "task_close_problem_events": {
+ "fields": [
+ "userid", "eventid", "objectid"
+ ],
+ "rows": [
+ [1, 1, 1]
+ ]
+ },
+ "problem": {
+ "fields": [
+ ],
+ "rows" : [
+ []
+ ]
+ }
+ },
+ "functions": {
+ "DCconfig_lock_triggers_by_triggerids": {
+ "out": {
+ "params": ["triggerids"],
+ "values": [1]
+ }
+ }
+ }
+ },
+ {
+ "test_case": "cannot find a task in the db",
+ "tested_function": "try_task_closes_problem",
+ "in": {
+ "names": ["taskid"],
+ "values": [1]
+ },
+ "out": {
+ "names": ["return"],
+ "values": [-1]
+ },
+ "db_data": {
+ "task_close_problem_events": {
+ "fields" : [
+ ],
+ "rows" : [
+ []
+ ]
+ }
+ }
+ },
+ {
+ "test_case": "fail close the problem if source trigger was not locked",
+ "tested_function": "try_task_closes_problem",
+ "in": {
+ "names": ["taskid"],
+ "values": [1]
+ },
+ "out": {
+ "names": ["return"],
+ "values": [-1]
+ },
+ "db_data": {
+ "task_close_problem_events": {
+ "fields": [
+ "userid", "eventid", "objectid"
+ ],
+ "rows": [
+ [1, 1, 1]
+ ]
+ },
+ "problem": {
+ "fields": [
+ ],
+ "rows": [
+ []
+ ]
+ }
+ },
+ "functions": {
+ "DCconfig_lock_triggers_by_triggerids": {
+ "out": {
+ "params": [],
+ "values": []
+ }
+ }
+ }
+ }
+]