| 1 |
*** Settings *** |
| 2 |
Suite Setup Servers Setup |
| 3 |
Suite Teardown Servers Teardown |
| 4 |
Library Process |
| 5 |
Library ${RSPAMD_TESTDIR}/lib/rspamd.py |
| 6 |
Resource ${RSPAMD_TESTDIR}/lib/rspamd.robot |
| 7 |
Variables ${RSPAMD_TESTDIR}/lib/vars.py |
| 8 |
|
| 9 |
*** Variables *** |
| 10 |
${CONFIG} ${RSPAMD_TESTDIR}/configs/lua_test.conf |
| 11 |
${MESSAGE} ${RSPAMD_TESTDIR}/messages/spam_message.eml |
| 12 |
${RSPAMD_LUA_SCRIPT} ${RSPAMD_TESTDIR}/lua/tcp.lua |
| 13 |
${RSPAMD_SCOPE} Suite |
| 14 |
${RSPAMD_URL_TLD} ${RSPAMD_TESTDIR}/../lua/unit/test_tld.dat |
| 15 |
|
| 16 |
*** Test Cases *** |
| 17 |
Simple TCP request |
| 18 |
Scan File ${MESSAGE} |
| 19 |
... Settings={symbols_enabled = [SIMPLE_TCP_ASYNC_TEST]} |
| 20 |
Expect Symbol HTTP_ASYNC_RESPONSE |
| 21 |
Expect Symbol HTTP_ASYNC_RESPONSE_2 |
| 22 |
|
| 23 |
#SSL TCP request |
| 24 |
# Scan File ${MESSAGE} |
| 25 |
# ... Settings={symbols_enabled = [SIMPLE_TCP_ASYNC_SSL_TEST]} |
| 26 |
# Expect Symbol With Exact Options TCP_SSL_RESPONSE hello |
| 27 |
# Expect Symbol With Exact Options TCP_SSL_RESPONSE_2 hello |
| 28 |
|
| 29 |
#SSL Large TCP request |
| 30 |
# Scan File ${MESSAGE} |
| 31 |
# ... Settings={symbols_enabled = [LARGE_TCP_ASYNC_SSL_TEST]} |
| 32 |
# Expect Symbol TCP_SSL_LARGE |
| 33 |
# Expect Symbol TCP_SSL_LARGE_2 |
| 34 |
|
| 35 |
Sync API TCP request |
| 36 |
Scan File ${MESSAGE} |
| 37 |
... Settings={symbols_enabled = [SIMPLE_TCP_TEST]} |
| 38 |
Expect Symbol HTTP_SYNC_RESPONSE |
| 39 |
Should Contain ${SCAN_RESULT}[symbols][HTTP_SYNC_RESPONSE][options][0] hello world |
| 40 |
Should Contain ${SCAN_RESULT}[symbols][HTTP_SYNC_RESPONSE_2][options][0] hello post |
| 41 |
|
| 42 |
Sync API TCP get request |
| 43 |
#Check url /request get HTTP_SYNC_EOF_get hello world |
| 44 |
Check url /request get HTTP_SYNC_CONTENT_get hello world |
| 45 |
|
| 46 |
# Broken due to dummy_https issues, disable for now |
| 47 |
#Sync API TCP post request |
| 48 |
# Check url /request post HTTP_SYNC_EOF_post hello post |
| 49 |
# Check url /content-length post HTTP_SYNC_CONTENT_post hello post |
| 50 |
|
| 51 |
*** Keywords *** |
| 52 |
Servers Setup |
| 53 |
Run Dummy Http |
| 54 |
Run Dummy Ssl |
| 55 |
Rspamd Setup |
| 56 |
|
| 57 |
Servers Teardown |
| 58 |
Dummy Http Teardown |
| 59 |
Rspamd Teardown |
| 60 |
Teardown Dummy Ssl |
| 61 |
|
| 62 |
Run Dummy Ssl |
| 63 |
[Arguments] |
| 64 |
${result} = Start Process ${RSPAMD_TESTDIR}/util/dummy_ssl.py ${RSPAMD_TESTDIR}/util/server.pem |
| 65 |
Wait Until Created /tmp/dummy_ssl.pid timeout=2 second |
| 66 |
|
| 67 |
Teardown Dummy Ssl |
| 68 |
${ssl_pid} = Get File /tmp/dummy_ssl.pid |
| 69 |
Shutdown Process With Children ${ssl_pid} |
| 70 |
|
| 71 |
Check url |
| 72 |
[Arguments] ${url} ${method} ${expect_symbol} @{expect_options} |
| 73 |
Scan File ${MESSAGE} URL=${url} Method=${method} |
| 74 |
... Settings={symbols_enabled = [HTTP_TCP_TEST]} |
| 75 |
Expect Symbol With Exact Options ${expect_symbol} @{expect_options} |