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:
authorAndris Zeila <andris.zeila@zabbix.com>2018-10-22 16:47:57 +0300
committerAndris Zeila <andris.zeila@zabbix.com>2018-10-22 16:47:57 +0300
commit144aba4ef52f1a34b89a9a5b572a928525ae8cb4 (patch)
tree2447b2f63ed2532cad6948acb73cc8daf9f3cda9 /tests/zabbix_server/preprocessor
parent88b9d1d04859b4d6ab71205d9d115ae4850a2b91 (diff)
........S. [ZBXNEXT-4724] added throttling preprocessing steps
Diffstat (limited to 'tests/zabbix_server/preprocessor')
-rw-r--r--tests/zabbix_server/preprocessor/zbx_item_preproc.c2
-rw-r--r--tests/zabbix_server/preprocessor/zbx_item_preproc.yaml132
2 files changed, 123 insertions, 11 deletions
diff --git a/tests/zabbix_server/preprocessor/zbx_item_preproc.c b/tests/zabbix_server/preprocessor/zbx_item_preproc.c
index d375d046a2a..1c9db5a4057 100644
--- a/tests/zabbix_server/preprocessor/zbx_item_preproc.c
+++ b/tests/zabbix_server/preprocessor/zbx_item_preproc.c
@@ -187,7 +187,7 @@ void zbx_mock_test_entry(void **state)
else
{
if (ZBX_VARIANT_NONE != history_value.type)
- fail_msg("expected empty value, but got %s", zbx_variant_value_desc(&history_value));
+ fail_msg("expected empty history, but got %s", zbx_variant_value_desc(&history_value));
}
}
diff --git a/tests/zabbix_server/preprocessor/zbx_item_preproc.yaml b/tests/zabbix_server/preprocessor/zbx_item_preproc.yaml
index 127ccbe057b..93a2d4d01d7 100644
--- a/tests/zabbix_server/preprocessor/zbx_item_preproc.yaml
+++ b/tests/zabbix_server/preprocessor/zbx_item_preproc.yaml
@@ -569,7 +569,6 @@ in:
time: 2017-10-29 03:15:00 +03:00
data: 10
history:
- value_type: ITEM_VALUE_TYPE_FLOAT
time: 2017-10-29 03:14:00 +03:00
data: 5
step:
@@ -588,7 +587,6 @@ in:
time: 2017-10-29 03:15:00 +03:00
data: 5.5
history:
- value_type: ITEM_VALUE_TYPE_FLOAT
time: 2017-10-29 03:14:00 +03:00
data: -4.5
step:
@@ -607,7 +605,6 @@ in:
time: 2017-10-29 03:15:00 +03:00
data: 10
history:
- value_type: ITEM_VALUE_TYPE_FLOAT
time: 2017-10-29 03:14:00 +03:00
data: 10
step:
@@ -626,7 +623,6 @@ in:
time: 2017-10-29 03:15:00 +03:00
data: 0
history:
- value_type: ITEM_VALUE_TYPE_FLOAT
time: 2017-10-29 03:14:00 +03:00
data: 10
step:
@@ -644,7 +640,6 @@ in:
time: 2017-10-29 03:15:00 +03:00
data: 1.5
history:
- value_type: ITEM_VALUE_TYPE_FLOAT
time: 2017-10-29 03:14:00 +03:00
data: 0
step:
@@ -663,7 +658,6 @@ in:
time: 2017-10-29 03:15:00 +03:00
data: 1
history:
- value_type: ITEM_VALUE_TYPE_FLOAT
time: 2017-10-29 03:14:50 +03:00
data: 2
step:
@@ -681,7 +675,6 @@ in:
time: 2017-10-29 03:15:00 +03:00
data: 2
history:
- value_type: ITEM_VALUE_TYPE_FLOAT
time: 2017-10-29 03:15:10 +03:00
data: 1
step:
@@ -699,7 +692,6 @@ in:
time: 2017-10-29 03:15:00 +03:00
data: 2
history:
- value_type: ITEM_VALUE_TYPE_FLOAT
time: 2017-10-29 03:14:50 +03:00
data: 1
step:
@@ -718,7 +710,6 @@ in:
time: 2017-10-29 03:15:00 +03:00
data: 3
history:
- value_type: ITEM_VALUE_TYPE_UINT64
time: 2017-10-29 03:14:50 +03:00
data: 2
step:
@@ -737,7 +728,6 @@ in:
time: 2017-10-29 03:15:00 +03:00
data: 3
history:
- value_type: ITEM_VALUE_TYPE_UINT64
time: 2017-10-29 03:14:59 +03:00
data: 2
step:
@@ -1305,6 +1295,128 @@ in:
out:
return: SUCCEED
value: value:123
+---
+test case: throttle(1, 123)
+in:
+ value:
+ value_type: ITEM_VALUE_TYPE_STR
+ time: 2017-10-29 03:15:00 +03:00
+ data: 123
+ history:
+ time: 2017-10-29 03:14:00 +03:00
+ data: 1
+ step:
+ type: ZBX_PREPROC_THROTTLE_VALUE
+out:
+ return: SUCCEED
+ value: 123
+ history:
+ time: 2017-10-29 03:15:00 +03:00
+ data: 123
+---
+test case: throttle(, 123)
+in:
+ value:
+ value_type: ITEM_VALUE_TYPE_STR
+ time: 2017-10-29 03:15:00 +03:00
+ data: 123
+ step:
+ type: ZBX_PREPROC_THROTTLE_VALUE
+out:
+ return: SUCCEED
+ value: 123
+ history:
+ time: 2017-10-29 03:15:00 +03:00
+ data: 123
+---
+test case: throttle(123, 123)
+in:
+ value:
+ value_type: ITEM_VALUE_TYPE_STR
+ time: 2017-10-29 03:15:00 +03:00
+ data: 123
+ history:
+ time: 2017-10-29 03:14:00 +03:00
+ data: 123
+ step:
+ type: ZBX_PREPROC_THROTTLE_VALUE
+out:
+ return: SUCCEED
+ history:
+ time: 2017-10-29 03:14:00 +03:00
+ data: 123
+---
+test case: throttle_timed(, abc)
+in:
+ value:
+ value_type: ITEM_VALUE_TYPE_STR
+ time: 2017-10-29 03:15:00 +03:00
+ data: abc
+ step:
+ type: ZBX_PREPROC_THROTTLE_TIMED_VALUE
+ params: 1m
+out:
+ return: SUCCEED
+ value: abc
+ history:
+ time: 2017-10-29 03:15:00 +03:00
+ data: abc
+---
+test case: throttle_timed(xyz, abc)
+in:
+ value:
+ value_type: ITEM_VALUE_TYPE_STR
+ time: 2017-10-29 03:15:00 +03:00
+ data: abc
+ history:
+ time: 2017-10-29 03:14:30 +03:00
+ data: xyz
+ step:
+ type: ZBX_PREPROC_THROTTLE_TIMED_VALUE
+ params: 1m
+out:
+ return: SUCCEED
+ value: abc
+ history:
+ time: 2017-10-29 03:15:00 +03:00
+ data: abc
+---
+test case: throttle_timed(abc, abc, 30s)
+in:
+ value:
+ value_type: ITEM_VALUE_TYPE_STR
+ time: 2017-10-29 03:15:00 +03:00
+ data: abc
+ history:
+ time: 2017-10-29 03:14:30 +03:00
+ data: abc
+ step:
+ type: ZBX_PREPROC_THROTTLE_TIMED_VALUE
+ params: 1m
+out:
+ return: SUCCEED
+ history:
+ time: 2017-10-29 03:14:30 +03:00
+ data: abc
+---
+test case: throttle_timed(abc, abc, 1m)
+in:
+ value:
+ value_type: ITEM_VALUE_TYPE_STR
+ time: 2017-10-29 03:15:00 +03:00
+ data: abc
+ history:
+ time: 2017-10-29 03:14:00 +03:00
+ data: abc
+ step:
+ type: ZBX_PREPROC_THROTTLE_TIMED_VALUE
+ params: 1m
+out:
+ return: SUCCEED
+ value: abc
+ history:
+ time: 2017-10-29 03:15:00 +03:00
+ data: abc
...