Browse Source

Merge pull request #2610 from citrin/functional-test-fix

Fix test case: Cases.210 Clickhouse.001
tags/1.8.2
Vsevolod Stakhov 5 years ago
parent
commit
733c60e01a
No account linked to committer's email address

+ 1
- 1
.drone.yml View File

@@ -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
- >

+ 2
- 1
test/functional/cases/210_clickhouse/001_migration.robot View File

@@ -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}



+ 1
- 1
test/functional/cases/210_clickhouse/clickhouse.py View File

@@ -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)

+ 1
- 1
test/functional/configs/clickhouse-config.xml View File

@@ -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. -->

+ 7
- 0
test/functional/lib/rspamd.py View File

@@ -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)

Loading…
Cancel
Save