diff options
author | Andrew Lewis <nerf@judo.za.org> | 2016-08-12 17:00:56 +0100 |
---|---|---|
committer | Andrew Lewis <nerf@judo.za.org> | 2016-08-12 17:24:30 +0100 |
commit | 188725d470dc3b9bc9ea3fbc291e05cb7623f2f4 (patch) | |
tree | 9c7918261713b32c9c0ef830f5282c1f859c0abb /test/functional/cases/121_json | |
parent | 34696a9cb11cbc8c0c969d52d57936f2ab2b2bf0 (diff) | |
download | rspamd-188725d470dc3b9bc9ea3fbc291e05cb7623f2f4.tar.gz rspamd-188725d470dc3b9bc9ea3fbc291e05cb7623f2f4.zip |
[Test] Some minor updates for tests
- Removed horrible features from test library
- Negative cases for SpamAssassin WLBLEval
- Restructured JSON tests
Diffstat (limited to 'test/functional/cases/121_json')
-rw-r--r-- | test/functional/cases/121_json/100_preresult.robot | 23 | ||||
-rw-r--r-- | test/functional/cases/121_json/101_simple.robot | 23 | ||||
-rw-r--r-- | test/functional/cases/121_json/lib.robot | 19 |
3 files changed, 65 insertions, 0 deletions
diff --git a/test/functional/cases/121_json/100_preresult.robot b/test/functional/cases/121_json/100_preresult.robot new file mode 100644 index 000000000..58682f6f5 --- /dev/null +++ b/test/functional/cases/121_json/100_preresult.robot @@ -0,0 +1,23 @@ +*** Settings *** +Suite Setup Generic Setup +Suite Teardown Generic Teardown +Library ${TESTDIR}/lib/rspamd.py +Resource lib.robot +Resource ${TESTDIR}/lib/rspamd.robot +Variables ${TESTDIR}/lib/vars.py + +*** Variables *** +${CONFIG} ${TESTDIR}/configs/lua_test.conf +${LUA_SCRIPT} ${TESTDIR}/lua/preresult.lua +${MESSAGE} ${TESTDIR}/messages/spam_message.eml +${RSPAMD_SCOPE} Suite + +*** Test Cases *** +Stat + Stat Test + +History + History Test soft reject + +Scan + Scan Test diff --git a/test/functional/cases/121_json/101_simple.robot b/test/functional/cases/121_json/101_simple.robot new file mode 100644 index 000000000..38b6ec11d --- /dev/null +++ b/test/functional/cases/121_json/101_simple.robot @@ -0,0 +1,23 @@ +*** Settings *** +Suite Setup Generic Setup +Suite Teardown Generic Teardown +Library ${TESTDIR}/lib/rspamd.py +Resource lib.robot +Resource ${TESTDIR}/lib/rspamd.robot +Variables ${TESTDIR}/lib/vars.py + +*** Variables *** +${CONFIG} ${TESTDIR}/configs/lua_test.conf +${LUA_SCRIPT} ${TESTDIR}/lua/simple.lua +${MESSAGE} ${TESTDIR}/messages/spam_message.eml +${RSPAMD_SCOPE} Suite + +*** Test Cases *** +Stat + Stat Test + +History + History Test SIMPLE_TEST + +Scan + Scan Test diff --git a/test/functional/cases/121_json/lib.robot b/test/functional/cases/121_json/lib.robot new file mode 100644 index 000000000..e558c7107 --- /dev/null +++ b/test/functional/cases/121_json/lib.robot @@ -0,0 +1,19 @@ +*** Keywords *** +Stat Test + @{result} = HTTP GET ${LOCAL_ADDR} ${PORT_CONTROLLER} /stat + Check JSON @{result}[1] + Should Be Equal As Integers @{result}[0] 200 + +History Test + [Arguments] ${rspamc_expected_result} + ${result} = Scan Message With Rspamc ${MESSAGE} + Check Rspamc ${result} ${rspamc_expected_result} + @{result} = HTTP GET ${LOCAL_ADDR} ${PORT_CONTROLLER} /history + Check JSON @{result}[1] + Should Be Equal As Integers @{result}[0] 200 + +Scan Test + ${content} = Get File ${MESSAGE} + @{result} = HTTP POST ${LOCAL_ADDR} ${PORT_NORMAL} /check ${content} + Check JSON @{result}[1] + Should Be Equal As Integers @{result}[0] 200 |