Subject: | Tests fail if clamd is running and CLAMAV_SOCKET_NAME is not set |
On a debian/wheezy system with a running clamd (installed from package) the t/01-clamscan.t test fails:
$ perl5.22.1 -Mblib t/01-clamscan.t
[warn] Action methods (upload, upload_detailed) found defined in your application class, TestApp. This is deprecated, please move them into a Root controller.
1..6
# To real scan test, set ENV CLAMAV_SOCKET_NAME or CLAMAV_SOCKET_HOST and CLAMAV_SOCKET_HOST.
[info] VIRUS not found.
ok 1 - Request
ok 2 - Upload ok
not ok 3 - Scan ok
# Failed test 'Scan ok'
# at t/01-clamscan.t line 41.
[info] VIRUS not found.
ok 4 - Request
ok 5 - Upload ok
not ok 6 - Scan ok
# Failed test 'Scan ok'
# at t/01-clamscan.t line 68.
# Looks like you failed 2 tests of 6.
However, if I define the environment variable, it passes:
$ env CLAMAV_SOCKET_NAME=/var/run/clamav/clamd.ctl perl5.22.1 -Mblib t/01-clamscan.t
[warn] Action methods (upload, upload_detailed) found defined in your application class, TestApp. This is deprecated, please move them into a Root controller.
1..6
[info] VIRUS not found.
ok 1 - Request
ok 2 - Upload ok
ok 3 - Scan ok
[info] VIRUS not found.
ok 4 - Request
ok 5 - Upload ok
ok 6 - Scan ok