diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-10-25 10:56:32 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-25 10:56:32 +0100 |
commit | 733c60e01a4c7de619bc5e77bd89c9525b38b31e (patch) | |
tree | 9c299ede84a1918e54249386c9f0a4325d5fadab | |
parent | 12a513a3fe6d416f352efa581933e4469f8a4c67 (diff) | |
parent | 43ceedc68fe92ffaeb2f5f3bb41087744018e110 (diff) | |
download | rspamd-733c60e01a4c7de619bc5e77bd89c9525b38b31e.tar.gz rspamd-733c60e01a4c7de619bc5e77bd89c9525b38b31e.zip |
Merge pull request #2610 from citrin/functional-test-fix
Fix test case: Cases.210 Clickhouse.001
-rw-r--r-- | .drone.yml | 2 | ||||
-rw-r--r-- | test/functional/cases/210_clickhouse/001_migration.robot | 3 | ||||
-rw-r--r-- | test/functional/cases/210_clickhouse/clickhouse.py | 2 | ||||
-rw-r--r-- | test/functional/configs/clickhouse-config.xml | 2 | ||||
-rw-r--r-- | test/functional/lib/rspamd.py | 7 |
5 files changed, 12 insertions, 4 deletions
diff --git a/.drone.yml b/.drone.yml index 047a9b39d..ff1328300 100644 --- a/.drone.yml +++ b/.drone.yml @@ -94,7 +94,7 @@ pipeline: # use umask to create world-writable files so nobody can write to *.gcda files created by root - umask 0000 - set +e - - RSPAMD_INSTALLROOT=/rspamd/install robot --exclude isbroken $CI_WORKSPACE/test/functional/cases; EXIT_CODE=$? + - RSPAMD_INSTALLROOT=/rspamd/install robot --removekeywords wuks --exclude isbroken $CI_WORKSPACE/test/functional/cases; EXIT_CODE=$? - set -e # upload test results to nginx frontent using WebDAV PUT - > diff --git a/test/functional/cases/210_clickhouse/001_migration.robot b/test/functional/cases/210_clickhouse/001_migration.robot index c2db5b3ec..bf6d48084 100644 --- a/test/functional/cases/210_clickhouse/001_migration.robot +++ b/test/functional/cases/210_clickhouse/001_migration.robot @@ -11,6 +11,7 @@ Test Teardown Clickhosue Teardown *** Variables *** ${CONFIG} ${TESTDIR}/configs/clickhouse.conf ${RSPAMD_SCOPE} Suite +${CLICKHOUSE_PORT} ${18123} *** Test Cases *** Initial schema @@ -68,7 +69,7 @@ Clickhouse Setup ${result} = Run Process clickhouse-server --daemon --config-file\=${TMPDIR}/clickhouse-config.xml --pid-file\=${TMPDIR}/clickhouse.pid Run Keyword If ${result.rc} != 0 Log ${result.stderr} Should Be Equal As Integers ${result.rc} 0 - Wait Until Keyword Succeeds 5 sec 1 sec Check Pidfile ${TMPDIR}/clickhouse.pid timeout=5 sec + Wait Until Keyword Succeeds 5 sec 50 ms TCP Connect localhost ${CLICKHOUSE_PORT} Set Suite Variable ${TMPDIR} ${TMPDIR} diff --git a/test/functional/cases/210_clickhouse/clickhouse.py b/test/functional/cases/210_clickhouse/clickhouse.py index 4e95eadf6..f5e4646cd 100644 --- a/test/functional/cases/210_clickhouse/clickhouse.py +++ b/test/functional/cases/210_clickhouse/clickhouse.py @@ -8,7 +8,7 @@ __client = None class Client: def __init__(self): - self.port = 18123 + self.port = BuiltIn().get_variable_value('${CLICKHOUSE_PORT}', default=18123) def get_query_string(self): return "http://localhost:%d/?default_format=JSONEachRow" % (self.port) diff --git a/test/functional/configs/clickhouse-config.xml b/test/functional/configs/clickhouse-config.xml index 10530a580..b210748ba 100644 --- a/test/functional/configs/clickhouse-config.xml +++ b/test/functional/configs/clickhouse-config.xml @@ -10,7 +10,7 @@ <!-- <console>1</console> --> <!-- Default behavior is autodetection (log to console if not daemon mode and is tty) --> </logger> <!--display_name>production</display_name--> <!-- It is the name that will be shown in the client --> - <http_port>18123</http_port> + <http_port>${CLICKHOUSE_PORT}</http_port> <tcp_port>19000</tcp_port> <!-- For HTTPS and SSL over native protocol. --> diff --git a/test/functional/lib/rspamd.py b/test/functional/lib/rspamd.py index e4462c18c..6fc1c0e67 100644 --- a/test/functional/lib/rspamd.py +++ b/test/functional/lib/rspamd.py @@ -160,8 +160,15 @@ def spamc(addr, port, filename): return r.decode('utf-8') def TCP_Connect(addr, port): + """Attempts to open a TCP connection to specified address:port + + Example: + | Wait Until Keyword Succeeds | 5s | 10ms | TCP Connect | localhost | 8080 | + """ s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) + s.settimeout(5) # seconds s.connect((addr, port)) + s.close() def update_dictionary(a, b): a.update(b) |