@@ -23,16 +23,6 @@ Multi Setup | |||
Multi Teardown | |||
Rspamd Teardown | |||
${http_pid} = Get File /tmp/dummy_http.pid | |||
Shutdown Process With Children ${http_pid} | |||
${https_pid} = Get File /tmp/dummy_https.pid | |||
Shutdown Process With Children ${https_pid} | |||
Redis Teardown | |||
Run Dummy Http | |||
${result} = Start Process ${RSPAMD_TESTDIR}/util/dummy_http.py | |||
Wait Until Created /tmp/dummy_http.pid | |||
Run Dummy Https | |||
${result} = Start Process ${RSPAMD_TESTDIR}/util/dummy_https.py ${RSPAMD_TESTDIR}/util/server.pem | |||
Wait Until Created /tmp/dummy_https.pid | |||
Dummy Http Teardown | |||
Dummy Https Teardown | |||
Redis Teardown |
@@ -264,10 +264,5 @@ Settings Setup | |||
Settings Teardown | |||
Rspamd Teardown | |||
${http_pid} = Get File /tmp/dummy_http.pid | |||
Shutdown Process With Children ${http_pid} | |||
Dummy Http Teardown | |||
Remove Files /tmp/bayes.spam.sqlite3 /tmp/bayes.ham.sqlite3 | |||
Run Dummy Http | |||
${result} = Start Process ${RSPAMD_TESTDIR}/util/dummy_http.py | |||
Wait Until Created /tmp/dummy_http.pid |
@@ -42,15 +42,8 @@ Rspamadm test Setup | |||
Run Redis | |||
Rspamadm test Teardown | |||
${http_pid} = Get File /tmp/dummy_http.pid | |||
Shutdown Process With Children ${http_pid} | |||
Remove file /tmp/dummy_http.pid | |||
Shutdown Process With Children ${REDIS_PID} | |||
Run Dummy Http | |||
[Arguments] | |||
${result} = Start Process ${RSPAMD_TESTDIR}/util/dummy_http.py | |||
Wait Until Created /tmp/dummy_http.pid | |||
Dummy Http Teardown | |||
Prepare temp directory | |||
[Arguments] ${CONFIG} |
@@ -31,13 +31,5 @@ Urlredirector Setup | |||
Urlredirector Teardown | |||
Rspamd Redis Teardown | |||
#Stop Dummy Http | |||
Dummy Http Teardown | |||
Terminate All Processes kill=True | |||
Stop Dummy Http | |||
${http_pid} = Get File /tmp/dummy_http.pid | |||
Shutdown Process With Children ${http_pid} | |||
Run Dummy Http | |||
${result} = Start Process ${RSPAMD_TESTDIR}/util/dummy_http.py | |||
Wait Until Created /tmp/dummy_http.pid |
@@ -45,16 +45,17 @@ HTTP timeout | |||
Expect Symbols HTTP_ERROR HTTP_ERROR HTTP_CORO_DNS_ERROR HTTP_CORO_ERROR method_post | |||
# FIXME: where is "IO timeout" | |||
HTTP empty response | |||
Scan File ${MESSAGE} Url=/empty Method=get | |||
... Settings={symbols_enabled = [SIMPLE_HTTP_TEST]} | |||
Expect Symbols HTTP_ERROR HTTP_ERROR HTTP_CORO_DNS_ERROR HTTP_CORO_ERROR method_get | |||
# FIXME: where is "IO read error: unexpected EOF" | |||
Scan File ${MESSAGE} Url=/empty Method=post | |||
... Settings={symbols_enabled = [SIMPLE_HTTP_TEST]} | |||
Expect Symbols HTTP_ERROR HTTP_ERROR HTTP_CORO_DNS_ERROR HTTP_CORO_ERROR method_post | |||
# FIXME: where is "IO read error: unexpected EOF" | |||
# Broken as dummy server is now not so dummy, not sure what is expected to be tested here | |||
#HTTP empty response | |||
# Scan File ${MESSAGE} Url=/empty Method=get | |||
# ... Settings={symbols_enabled = [SIMPLE_HTTP_TEST]} | |||
# Expect Symbols HTTP_ERROR HTTP_ERROR HTTP_CORO_DNS_ERROR HTTP_CORO_ERROR method_get | |||
# # FIXME: where is "IO read error: unexpected EOF" | |||
# | |||
# Scan File ${MESSAGE} Url=/empty Method=post | |||
# ... Settings={symbols_enabled = [SIMPLE_HTTP_TEST]} | |||
# Expect Symbols HTTP_ERROR HTTP_ERROR HTTP_CORO_DNS_ERROR HTTP_CORO_ERROR method_post | |||
# # FIXME: where is "IO read error: unexpected EOF" | |||
SSL Large HTTP request | |||
Scan File ${MESSAGE} | |||
@@ -68,16 +69,6 @@ Http Setup | |||
Rspamd Setup | |||
Http Teardown | |||
${http_pid} = Get File /tmp/dummy_http.pid | |||
Shutdown Process With Children ${http_pid} | |||
${https_pid} = Get File /tmp/dummy_https.pid | |||
Shutdown Process With Children ${https_pid} | |||
Rspamd Teardown | |||
Run Dummy Http | |||
${result} = Start Process ${RSPAMD_TESTDIR}/util/dummy_http.py | |||
Wait Until Created /tmp/dummy_http.pid | |||
Run Dummy Https | |||
${result} = Start Process ${RSPAMD_TESTDIR}/util/dummy_https.py ${RSPAMD_TESTDIR}/util/server.pem | |||
Wait Until Created /tmp/dummy_https.pid | |||
Dummy Http Teardown | |||
Dummy Https Teardown |
@@ -55,17 +55,10 @@ Servers Setup | |||
Rspamd Setup | |||
Servers Teardown | |||
${http_pid} = Get File /tmp/dummy_http.pid | |||
Shutdown Process With Children ${http_pid} | |||
${ssl_pid} = Get File /tmp/dummy_ssl.pid | |||
Shutdown Process With Children ${ssl_pid} | |||
Dummy Http Teardown | |||
Dummy Https Teardown | |||
Rspamd Teardown | |||
Run Dummy Http | |||
[Arguments] | |||
${result} = Start Process ${RSPAMD_TESTDIR}/util/dummy_http.py | |||
Wait Until Created /tmp/dummy_http.pid timeout=2 second | |||
Run Dummy Ssl | |||
[Arguments] | |||
${result} = Start Process ${RSPAMD_TESTDIR}/util/dummy_ssl.py ${RSPAMD_TESTDIR}/util/server.pem |
@@ -31,22 +31,23 @@ def save_run_results(directory, filenames): | |||
current_directory = os.getcwd() | |||
suite_name = BuiltIn().get_variable_value("${SUITE_NAME}") | |||
test_name = BuiltIn().get_variable_value("${TEST NAME}") | |||
onlyfiles = [f for f in os.listdir(directory) if os.path.isfile(os.path.join(directory, f))] | |||
logger.debug('%s content before cleanup: %s' % (directory, onlyfiles)) | |||
if test_name is None: | |||
# this is suite-level tear down | |||
destination_directory = "%s/robot-save/%s" % (current_directory, suite_name) | |||
else: | |||
destination_directory = "%s/robot-save/%s/%s" % (current_directory, suite_name, test_name) | |||
if not os.path.isdir(destination_directory): | |||
os.makedirs(destination_directory) | |||
for file in filenames.split(' '): | |||
source_file = "%s/%s" % (directory, file) | |||
logger.debug('check if we can save %s' % source_file) | |||
if os.path.isfile(source_file): | |||
logger.debug('found %s, save it' % file) | |||
shutil.copy(source_file, "%s/%s" % (destination_directory, file)) | |||
shutil.copy(source_file, "%s/robot-save/%s.last" % (current_directory, file)) | |||
if os.path.exists(directory): | |||
onlyfiles = [f for f in os.listdir(directory) if os.path.isfile(os.path.join(directory, f))] | |||
logger.debug('%s content before cleanup: %s' % (directory, onlyfiles)) | |||
if test_name is None: | |||
# this is suite-level tear down | |||
destination_directory = "%s/robot-save/%s" % (current_directory, suite_name) | |||
else: | |||
destination_directory = "%s/robot-save/%s/%s" % (current_directory, suite_name, test_name) | |||
if not os.path.isdir(destination_directory): | |||
os.makedirs(destination_directory) | |||
for file in filenames.split(' '): | |||
source_file = "%s/%s" % (directory, file) | |||
logger.debug('check if we can save %s' % source_file) | |||
if os.path.isfile(source_file): | |||
logger.debug('found %s, save it' % file) | |||
shutil.copy(source_file, "%s/%s" % (destination_directory, file)) | |||
shutil.copy(source_file, "%s/robot-save/%s.last" % (current_directory, file)) | |||
def encode_filename(filename): | |||
return "".join(['%%%0X' % ord(b) for b in filename]) | |||
@@ -340,3 +341,7 @@ def collect_lua_coverage(): | |||
logger.info("%s merged into %s" % (", ".join(input_files), LUA_STATSFILE)) | |||
else: | |||
logger.info("no *.luacov.stats.out files found in %s" % tmp_dir) | |||
def file_exists(file): | |||
return os.path.isfile(file) |
@@ -323,3 +323,27 @@ Sync Fuzzy Storage | |||
... fuzzy_sync | |||
Log ${result.stdout} | |||
Sleep 0.1s Try give fuzzy storage time to sync | |||
Run Dummy Http | |||
${fileExists} = File Exists /tmp/dummy_http.pid | |||
${http_pid} = Run Keyword If ${fileExists} is True Get File /tmp/dummy_http.pid | |||
Run Keyword If ${fileExists} is True Shutdown Process With Children ${http_pid} | |||
${result} = Start Process ${RSPAMD_TESTDIR}/util/dummy_http.py -pf /tmp/dummy_http.pid | |||
Wait Until Created /tmp/dummy_http.pid timeout=2 second | |||
Run Dummy Https | |||
${fileExists} = File Exists /tmp/dummy_https.pid | |||
${http_pid} = Run Keyword If ${fileExists} is True Get File /tmp/dummy_https.pid | |||
Run Keyword If ${fileExists} is True Shutdown Process With Children ${http_pid} | |||
${result} = Start Process ${RSPAMD_TESTDIR}/util/dummy_http.py | |||
... -c ${RSPAMD_TESTDIR}/util/server.pem -k ${RSPAMD_TESTDIR}/util/server.pem | |||
... -pf /tmp/dummy_https.pid -p 18081 | |||
Wait Until Created /tmp/dummy_https.pid timeout=2 second | |||
Dummy Http Teardown | |||
${http_pid} = Get File /tmp/dummy_http.pid | |||
Shutdown Process With Children ${http_pid} | |||
Dummy Https Teardown | |||
${https_pid} = Get File /tmp/dummy_https.pid | |||
Shutdown Process With Children ${https_pid} |
@@ -22,6 +22,10 @@ class MainHandler(tornado.web.RequestHandler): | |||
yield tornado.gen.sleep(4) | |||
self.set_header("Content-Type", "text/plain") | |||
self.write("") | |||
elif path == '/request': | |||
# Return a string 'hello world' | |||
self.set_header("Content-Type", "text/plain") | |||
self.write("hello world") | |||
elif path == '/map-simple': | |||
# Return a string 'hello map' | |||
self.set_header("Content-Type", "text/plain") | |||
@@ -51,6 +55,10 @@ class MainHandler(tornado.web.RequestHandler): | |||
elif path == '/error_403': | |||
# Return a 403 HTTP error | |||
raise tornado.web.HTTPError(403) | |||
elif path == '/request': | |||
# Return a string 'hello post' | |||
self.set_header("Content-Type", "text/plain") | |||
self.write("hello post") | |||
elif path == '/timeout': | |||
# Wait for 4 seconds before returning an empty reply | |||
yield tornado.gen.sleep(4) |