aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArmin Kuster <akuster808@gmail.com>2019-03-30 13:22:40 -0700
committerArmin Kuster <akuster808@gmail.com>2019-03-31 10:37:09 -0700
commit00f00d28971355a1a5ce9d38b617adfd991104bd (patch)
tree8d2b796bd65a887d1a49fec6f1d2bbac18d528af
parent6d3aa03272b9472bd8e48baf4f45b78c09715f38 (diff)
downloadmeta-security-00f00d28971355a1a5ce9d38b617adfd991104bd.tar.gz
meta-security-00f00d28971355a1a5ce9d38b617adfd991104bd.tar.bz2
meta-security-00f00d28971355a1a5ce9d38b617adfd991104bd.zip
clamav: add basic runtime tests
Signed-off-by: Armin Kuster <akuster808@gmail.com>
-rw-r--r--lib/oeqa/runtime/cases/clamav.py38
1 files changed, 38 insertions, 0 deletions
diff --git a/lib/oeqa/runtime/cases/clamav.py b/lib/oeqa/runtime/cases/clamav.py
new file mode 100644
index 0000000..fc77330
--- /dev/null
+++ b/lib/oeqa/runtime/cases/clamav.py
@@ -0,0 +1,38 @@
+# Copyright (C) 2019 Armin Kuster <akuster808@gmail.com>
+#
+import re
+
+from oeqa.runtime.case import OERuntimeTestCase
+from oeqa.core.decorator.depends import OETestDepends
+from oeqa.runtime.decorator.package import OEHasPackage
+
+
+class ClamavTest(OERuntimeTestCase):
+
+ @OEHasPackage(['clamav'])
+ @OETestDepends(['ssh.SSHTest.test_ssh'])
+ def test_freshclam_help(self):
+ status, output = self.target.run('freshclam --help ')
+ msg = ('freshclam --hlep command does not work as expected. ',
+ 'Status and output:%s and %s' % (status, output))
+ self.assertEqual(status, 0, msg = msg)
+
+ @OETestDepends(['clamav.ClamavTest.test_freshclam_help'])
+ def test_freshclam_download(self):
+ status, output = self.target.run('freshclam --show-progress')
+ match = re.search('Database updated', output)
+ #match = re.search('main.cvd is up to date', output)
+ if not match:
+ msg = ('freshclam : DB dowbload failed. '
+ 'Status and output:%s and %s' % (status, output))
+ self.assertEqual(status, 1, msg = msg)
+
+ @OETestDepends(['clamav.ClamavTest.test_freshclam_download'])
+ def test_freshclam_check_mirrors(self):
+ status, output = self.target.run('freshclam --list-mirrors')
+ match = re.search('Failures: 0', output)
+ if not match:
+ msg = ('freshclam --list-mirrors: failed. '
+ 'Status and output:%s and %s' % (status, output))
+ self.assertEqual(status, 1, msg = msg)
+