瀏覽代碼

[Test] Relax controller errors check

tags/1.7.0
Andrew Lewis 6 年之前
父節點
當前提交
fea677fcbf
共有 2 個檔案被更改,包括 1 行新增24 行删除
  1. 0
    23
      test/functional/lib/rspamd.py
  2. 1
    1
      test/functional/lib/rspamd.robot

+ 0
- 23
test/functional/lib/rspamd.py 查看文件

@@ -24,29 +24,6 @@ try:
except:
import httplib

ignore_message = [
re.compile("^cannot load controller stats from .*/stats\\.ucl: No such file or directory$"),
re.compile("^regexp module enabled, but no rules are defined$"),
re.compile("^cannot find dependency on symbol FREEMAIL_FROM$"),
re.compile("^cannot find dependency on symbol FREEMAIL_REPLYTO$"),
re.compile("^cannot register delayed condition for DMARC_POLICY_ALLOW$"),
re.compile("^failed to scan: Socket error detected: Connection refused$"),
]

def Check_Errors_JSON(j):
d = demjson.decode(j, strict=True)
assert type(d) is list, j
e = []
for c in d:
filtered = False
for r in ignore_message:
if r.match(c['message']):
filtered = True
break
if not filtered:
e.append(c)
assert len(e) == 0, str(e)

def Check_JSON(j):
d = demjson.decode(j, strict=True)
assert len(d) > 0

+ 1
- 1
test/functional/lib/rspamd.robot 查看文件

@@ -6,8 +6,8 @@ Library Process
*** Keywords ***
Check Controller Errors
@{result} = HTTP GET ${LOCAL_ADDR} ${PORT_CONTROLLER} /errors
Check Errors JSON @{result}[1]
Should Be Equal As Integers @{result}[0] 200
Log @{result}[1]

Check Pidfile
[Arguments] ${pidfile}

Loading…
取消
儲存