aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorAndrew Lewis <nerf@judo.za.org>2017-03-10 16:23:23 +0200
committerAndrew Lewis <nerf@judo.za.org>2017-03-10 16:23:23 +0200
commit6bd2691f9c6da12fd9f423a688db0144de12b9e3 (patch)
tree1233b9125936728c7d4f46753da56c1c7836a6df /test
parentf2a51ef07aebfe49a71c883b95e548909c7f5e40 (diff)
downloadrspamd-6bd2691f9c6da12fd9f423a688db0144de12b9e3.tar.gz
rspamd-6bd2691f9c6da12fd9f423a688db0144de12b9e3.zip
[Test] Fix F-Prot/ClamAV test stability
Diffstat (limited to 'test')
-rw-r--r--test/functional/cases/160_antivirus.robot2
-rwxr-xr-xtest/functional/util/dummy_clam.py4
-rwxr-xr-xtest/functional/util/dummy_fprot.py4
3 files changed, 10 insertions, 0 deletions
diff --git a/test/functional/cases/160_antivirus.robot b/test/functional/cases/160_antivirus.robot
index f3604b2fe..98c7a4a2a 100644
--- a/test/functional/cases/160_antivirus.robot
+++ b/test/functional/cases/160_antivirus.robot
@@ -73,8 +73,10 @@ Run Dummy Clam
[Arguments] ${port} ${found}=
Wait For Port ${SOCK_STREAM} ${LOCAL_ADDR} ${port}
${result} = Start Process ${TESTDIR}/util/dummy_clam.py ${port} ${found}
+ Wait Until Created /tmp/dummy_clamav.pid
Run Dummy Fprot
[Arguments] ${port} ${found}=
Wait For Port ${SOCK_STREAM} ${LOCAL_ADDR} ${port}
${result} = Start Process ${TESTDIR}/util/dummy_fprot.py ${port} ${found}
+ Wait Until Created /tmp/dummy_fprot.pid
diff --git a/test/functional/util/dummy_clam.py b/test/functional/util/dummy_clam.py
index 8c68889a9..8ef6ef476 100755
--- a/test/functional/util/dummy_clam.py
+++ b/test/functional/util/dummy_clam.py
@@ -1,5 +1,7 @@
#!/usr/bin/env python
+PID = "/tmp/dummy_clamav.pid"
+
import os
import sys
try:
@@ -10,6 +12,7 @@ except:
class MyTCPHandler(socketserver.BaseRequestHandler):
def handle(self):
+ os.remove(PID)
self.data = self.request.recv(1024).strip()
if self.server.foundvirus:
self.request.sendall(b"stream: Eicar-Test-Signature FOUND\0")
@@ -40,6 +43,7 @@ if __name__ == "__main__":
server.foundvirus = foundvirus
server.server_bind()
server.server_activate()
+ open(PID, 'w').close()
server.handle_request()
server.server_close()
os.exit(0)
diff --git a/test/functional/util/dummy_fprot.py b/test/functional/util/dummy_fprot.py
index 01e7e578b..64e086241 100755
--- a/test/functional/util/dummy_fprot.py
+++ b/test/functional/util/dummy_fprot.py
@@ -1,5 +1,7 @@
#!/usr/bin/env python
+PID = "/tmp/dummy_fprot.pid"
+
import os
import sys
try:
@@ -10,6 +12,7 @@ except:
class MyTCPHandler(socketserver.BaseRequestHandler):
def handle(self):
+ os.remove(PID)
self.data = self.request.recv(1024).strip()
if self.server.foundvirus:
self.request.sendall(b"1 <infected: EICAR_Test_File> FOO\n")
@@ -40,6 +43,7 @@ if __name__ == "__main__":
server.foundvirus = foundvirus
server.server_bind()
server.server_activate()
+ open(PID, 'w').close()
server.handle_request()
server.server_close()
os.exit(0)