diff options
author | Dmitrijs Goloscapovs <dmitrijs.goloscapovs@zabbix.com> | 2021-05-07 10:46:13 +0300 |
---|---|---|
committer | Dmitrijs Goloscapovs <dmitrijs.goloscapovs@zabbix.com> | 2021-05-07 10:46:13 +0300 |
commit | 42036f98c37f8cfe6f945ccdb15e3da5118fe90b (patch) | |
tree | 511c4eb6d40c4817148195a4a45b8fa4d4643fc7 /tests/libs/zbxeval | |
parent | 72a1333026bbe002da23ed93486bd2ea94ffd397 (diff) | |
parent | 0059d93568dc0b5bfb0618720a3706ffa06878e7 (diff) |
........S. [ZBXNEXT-6544] fixed merge conflict
Diffstat (limited to 'tests/libs/zbxeval')
-rw-r--r-- | tests/libs/zbxeval/zbx_eval_execute.yaml | 539 |
1 files changed, 539 insertions, 0 deletions
diff --git a/tests/libs/zbxeval/zbx_eval_execute.yaml b/tests/libs/zbxeval/zbx_eval_execute.yaml index 030e78bccd5..9c75bfc7555 100644 --- a/tests/libs/zbxeval/zbx_eval_execute.yaml +++ b/tests/libs/zbxeval/zbx_eval_execute.yaml @@ -1442,4 +1442,543 @@ in: out: result: SUCCEED value: 'Heyo Heyo' +--- +test case: Expression 'sqrt(64)' +in: + rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR] + expression: 'sqrt(64)' +out: + result: SUCCEED + value: 8 +--- +test case: Expression 'sqrt(2.5)' +in: + rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR] + expression: 'sqrt(2.5)' +out: + result: SUCCEED + value: 1.5811388300841898 +--- +test case: Expression 'sqrt(0)' +in: + rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR] + expression: 'sqrt(0)' +out: + result: SUCCEED + value: 0 +--- +test case: Expression 'sqrt(-1)' +in: + rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR] + expression: 'sqrt(-1)' +out: + result: FAIL +--- +test case: Expression 'abs(3.5)' +in: + rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR] + expression: 'abs(3.5)' +out: + result: SUCCEED + value: 3.5 +--- +test case: Expression 'abs(-3.5)' +in: + rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR] + expression: 'abs(-3.5)' +out: + result: SUCCEED + value: 3.5 +--- +test case: Expression 'cbrt(64)' +in: + rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR] + expression: 'cbrt(64)' +out: + result: SUCCEED + value: 4 +--- +test case: Expression 'cbrt(63)' +in: + rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR] + expression: 'cbrt(63)' +out: + result: SUCCEED + value: 3.9790572078963922 +--- +test case: Expression 'cbrt(2.5)' +in: + rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR] + expression: 'cbrt(2.5)' +out: + result: SUCCEED + value: 1.3572088082974532 +--- +test case: Expression 'ceil(2)' +in: + rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR] + expression: 'ceil(2)' +out: + result: SUCCEED + value: 2 +--- +test case: Expression 'ceil(2.5)' +in: + rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR] + expression: 'ceil(2.5)' +out: + result: SUCCEED + value: 3 +--- +test case: Expression 'ceil(-2.5)' +in: + rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR] + expression: 'ceil(-2.5)' +out: + result: SUCCEED + value: -2 +--- +test case: Expression 'e()' +in: + rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR] + expression: 'e()' +out: + result: SUCCEED + value: 2.7182818284590451 +--- +test case: Expression 'e(1)' +in: + rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR] + expression: 'e(1)' +out: + result: FAIL +--- +test case: Expression 'exp(2)' +in: + rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR] + expression: 'exp(2)' +out: + result: SUCCEED + value: 7.38905609893065 +--- +test case: Expression 'exp(2.5)' +in: + rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR] + expression: 'exp(2.5)' +out: + result: SUCCEED + value: 12.182493960703473 +--- +test case: Expression 'expm1(2)' +in: + rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR] + expression: 'expm1(2)' +out: + result: SUCCEED + value: 6.38905609893065 +--- +test case: Expression 'expm1(2.5)' +in: + rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR] + expression: 'expm1(2.5)' +out: + result: SUCCEED + value: 11.182493960703473 +--- +test case: Expression 'expm1(expm1(2))' +in: + rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR] + expression: 'expm1(expm1(2))' +out: + result: SUCCEED + value: 594.29441538075378 +--- +test case: Expression 'floor(2.6)' +in: + rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR] + expression: 'floor(2.6)' +out: + result: SUCCEED + value: 2 +--- +test case: Expression 'floor(2)' +in: + rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR] + expression: 'floor(2)' +out: + result: SUCCEED + value: 2 +--- +test case: Expression 'floor(-2.8)' +in: + rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR] + expression: 'floor(-2.8)' +out: + result: SUCCEED + value: -3 +--- +test case: Expression 'log(2)' +in: + rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR] + expression: 'log(2)' +out: + result: SUCCEED + value: 0.69314718055994529 +--- +test case: Expression 'log(2.5)' +in: + rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR] + expression: 'log(2.5)' +out: + result: SUCCEED + value: 0.91629073187415511 +--- +test case: Expression 'log(0)' +in: + rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR] + expression: 'log(0)' +out: + result: FAIL + value: 0 +--- +test case: Expression 'log10(5)' +in: + rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR] + expression: 'log10(5)' +out: + result: SUCCEED + value: 0.69897000433601886 +--- +test case: Expression 'log10(0)' +in: + rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR] + expression: 'log10(0)' +out: + result: FAIL + value: 0 +--- +test case: Expression 'log10(2.5)' +in: + rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR] + expression: 'log10(2.5)' +out: + result: SUCCEED + value: 0.3979400086720376 +--- +test case: Expression 'pi()' +in: + rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR] + expression: 'pi()' +out: + result: SUCCEED + value: 3.1415926535897931 +--- +test case: Expression 'pi(1)' +in: + rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR] + expression: 'pi(1)' +out: + result: FAIL +--- +test case: Expression 'power(2,3)' +in: + rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR] + expression: 'power(2,3)' +out: + result: SUCCEED + value: 8 +--- +test case: Expression 'power(2,2.5)' +in: + rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR] + expression: 'power(2,2.5)' +out: + result: SUCCEED + value: 5.6568542494923806 +--- +test case: Expression 'power(2.5,2.5)' +in: + rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR] + expression: 'power(2.5,2.5)' +out: + result: SUCCEED + value: 9.8821176880261863 +--- +test case: Expression 'round(2.5482,2)' +in: + rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR] + expression: 'round(2.5482,2)' +out: + result: SUCCEED + value: 2.55 +--- +test case: Expression 'round(2.5482,0)' +in: + rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR] + expression: 'round(2.5482,0)' +out: + result: SUCCEED + value: 3 +--- +test case: Expression 'round(2.5482,-1)' +in: + rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR] + expression: 'round(2.5482,-1)' +out: + result: FAIL +--- +test case: Expression 'round(2.5482,1.5)' +in: + rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR] + expression: 'round(2.5482,1.5)' +out: + result: FAIL +--- +test case: Expression 'signum(-2)' +in: + rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR] + expression: 'signum(-2)' +out: + result: SUCCEED + value: -1 +--- +test case: Expression 'signum(2)' +in: + rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR] + expression: 'signum(2)' +out: + result: SUCCEED + value: 1 +--- +test case: Expression 'signum(2.5)' +in: + rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR] + expression: 'signum(2.5)' +out: + result: SUCCEED + value: 1 +--- +test case: Expression 'signum(0)' +in: + rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR] + expression: 'signum(0)' +out: + result: SUCCEED + value: 0 +--- +test case: Expression 'truncate(2.5482,2)' +in: + rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR] + expression: 'truncate(2.5482,2)' +out: + result: SUCCEED + value: 2.54 +--- +test case: Expression 'truncate(2.5482,0)' +in: + rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR] + expression: 'truncate(2.5482,0)' +out: + result: SUCCEED + value: 2 +--- +test case: Expression 'truncate(2.5482,-1)' +in: + rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR] + expression: 'truncate(2.5482,-1)' +out: + result: FAIL +--- +test case: Expression 'truncate(2.5482,1.5)' +in: + rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR] + expression: 'truncate(2.5482,1.5)' +out: + result: FAIL +--- +test case: Expression 'acos(0.5)' +in: + rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR] + expression: 'acos(0.5)' +out: + result: SUCCEED + value: 1.0471975511965979 +--- +test case: Expression 'asin(0.5)' +in: + rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR] + expression: 'asin(0.5)' +out: + result: SUCCEED + value: 0.52359877559829893 +--- +test case: Expression 'atan(1)' +in: + rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR] + expression: 'atan(1)' +out: + result: SUCCEED + value: 0.78539816339744828 +--- +test case: Expression 'atan2(3,2)' +in: + rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR] + expression: 'atan2(3,2)' +out: + result: SUCCEED + value: 0.982793723247329 +--- +test case: Expression 'atan2(3,2.5)' +in: + rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR] + expression: 'atan2(3,2.5)' +out: + result: SUCCEED + value: 0.87605805059819342 +--- +test case: Expression 'atan2(0,0)' +in: + rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR] + expression: 'atan2(0,0)' +out: + result: FAIL +--- +test case: Expression 'cos(1)' +in: + rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR] + expression: 'cos(1)' +out: + result: SUCCEED + value: 0.54030230586813977 +--- +test case: Expression 'cosh(1)' +in: + rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR] + expression: 'cosh(1)' +out: + result: SUCCEED + value: 1.5430806348152437 +--- +test case: Expression 'cot(1)' +in: + rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR] + expression: 'cot(1)' +out: + result: SUCCEED + value: 0.64209261593433076 +--- +test case: Expression 'cot(0)' +in: + rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR] + expression: 'cot(0)' +out: + result: FAIL +--- +test case: Expression 'degrees(1)' +in: + rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR] + expression: 'degrees(1)' +out: + result: SUCCEED + value: 57.295779513082323 +--- +test case: Expression 'radians(1)' +in: + rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR] + expression: 'radians(1)' +out: + result: SUCCEED + value: 0.017453292519943295 +--- +test case: Expression 'sin(1)' +in: + rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR] + expression: 'sin(1)' +out: + result: SUCCEED + value: 0.8414709848078965 +--- +test case: Expression 'sinh(1)' +in: + rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR] + expression: 'sinh(1)' +out: + result: SUCCEED + value: 1.1752011936438014 +--- +test case: Expression 'tan(1)' +in: + rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR] + expression: 'tan(1)' +out: + result: SUCCEED + value: 1.5574077246549023 +--- +test case: Expression 'mod(5,2)' +in: + rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR] + expression: 'mod(5,2)' +out: + result: SUCCEED + value: 1 +--- +test case: Expression 'mod(5.5,2)' +in: + rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR] + expression: 'mod(5.5,2)' +out: + result: SUCCEED + value: 1.5 +--- +test case: Expression 'mod(-5,-2)' +in: + rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR] + expression: 'mod(-5,-2)' +out: + result: SUCCEED + value: -1 +--- +test case: Expression 'mod(-5.5,2)' +in: + rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR] + expression: 'mod(-5.5,2)' +out: + result: SUCCEED + value: -1.5 +--- +test case: Expression 'mod(-5.5,0)' +in: + rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR] + expression: 'mod(-5.5,0)' +out: + result: FAIL +--- +test case: Expression 'mod(123,6.253)' +in: + rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR] + expression: 'mod(123,6.253)' +out: + result: SUCCEED + value: 4.1929999999999978 +--- +test case: Expression 'rand(1)' +in: + rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR] + expression: 'rand(1)' +out: + result: FAIL +--- +test case: Expression 'power(10,400)' +in: + rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR] + expression: 'power(10,400)' +out: + result: FAIL +--- +test case: Expression 'power(10,300)*power(10,300)' +in: + rules: [ZBX_EVAL_PARSE_FUNCTION,ZBX_EVAL_PARSE_GROUP,ZBX_EVAL_PARSE_VAR] + expression: 'power(10,300)*power(10,300)' +out: + result: FAIL ... |