Skip to content

Commit e09ae3c

Browse files
committed
EICAR signature name has changed + change 20 seconds to 25 to match different envs
1 parent 42a072e commit e09ae3c

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

.github/workflows/tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@ jobs:
4242
sudo freshclam --verbose
4343
sudo systemctl restart clamav-daemon.service
4444
45-
- name: Wait for 20 seconds until clamd socket becomes available
45+
- name: Wait for 25 seconds until clamd socket becomes available
4646
run: |
47-
secs=20
47+
secs=25
4848
while [[ $secs -gt 0 ]] && ! [[ -f "/var/run/clamav/clamd.ctl" ]];
4949
do
5050
echo -ne "$secs\033[0K\r"

src/tests/test_api.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
mine = (stat.S_IREAD | stat.S_IWRITE)
1212
other = stat.S_IROTH
1313
execute = (stat.S_IEXEC | stat.S_IXOTH)
14+
EICAR_SIG_NAME = "Win.Test.EICAR_HDB-1"
1415

1516

1617
@contextmanager
@@ -42,7 +43,7 @@ def test_scan(self):
4243
f.write(clamd.EICAR)
4344
f.flush()
4445
os.fchmod(f.fileno(), (mine | other))
45-
expected = {f.name: ('FOUND', 'Eicar-Test-Signature')}
46+
expected = {f.name: ('FOUND', EICAR_SIG_NAME)}
4647

4748
assert self.cd.scan(f.name) == expected
4849

@@ -51,7 +52,7 @@ def test_unicode_scan(self):
5152
f.write(clamd.EICAR)
5253
f.flush()
5354
os.fchmod(f.fileno(), (mine | other))
54-
expected = {f.name: ('FOUND', 'Eicar-Test-Signature')}
55+
expected = {f.name: ('FOUND', EICAR_SIG_NAME)}
5556

5657
assert self.cd.scan(f.name) == expected
5758

@@ -62,13 +63,13 @@ def test_multiscan(self):
6263
with open(os.path.join(d, "file" + str(i)), 'wb') as f:
6364
f.write(clamd.EICAR)
6465
os.fchmod(f.fileno(), (mine | other))
65-
expected[f.name] = ('FOUND', 'Eicar-Test-Signature')
66+
expected[f.name] = ('FOUND', EICAR_SIG_NAME)
6667
os.chmod(d, (mine | other | execute))
6768

6869
assert self.cd.multiscan(d) == expected
6970

7071
def test_instream(self):
71-
expected = {'stream': ('FOUND', 'Eicar-Test-Signature')}
72+
expected = {'stream': ('FOUND', EICAR_SIG_NAME)}
7273
assert self.cd.instream(BytesIO(clamd.EICAR)) == expected
7374

7475
def test_insteam_success(self):
@@ -79,7 +80,7 @@ def test_fdscan(self):
7980
f.write(clamd.EICAR)
8081
f.flush()
8182
os.fchmod(f.fileno(), (mine | other))
82-
expected = {f.name: ('FOUND', 'Eicar-Test-Signature')}
83+
expected = {f.name: ('FOUND', EICAR_SIG_NAME)}
8384

8485
assert self.cd.fdscan(f.name) == expected
8586

0 commit comments

Comments
 (0)