File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -12,6 +12,9 @@ TEST_SCAN_DIR="/tmp/lmd-test-scan"
1212setup () {
1313 source /opt/tests/helpers/reset-lmd.sh
1414 mkdir -p " $TEST_SCAN_DIR "
15+
16+ # Force MD5 mode — eicar.com is only in MD5 sigs; SHA-NI auto-selects sha256
17+ lmd_set_config scan_hashtype md5
1518}
1619
1720teardown () {
Original file line number Diff line number Diff line change @@ -13,6 +13,10 @@ setup() {
1313 source /opt/tests/helpers/reset-lmd.sh
1414 mkdir -p " $TEST_SCAN_DIR "
1515
16+ # Force single worker — multi-worker HEX has a non-deterministic race
17+ # where one worker's output is empty (2/3 instead of 3/3 on Rocky 9)
18+ lmd_set_config scan_workers 1
19+
1620 # Install test HEX signature for eval(base64_decode(
1721 echo " 6576616c286261736536345f6465636f646528:test.hex.php.1" > " $LMD_INSTALL /sigs/custom.hex.dat"
1822}
Original file line number Diff line number Diff line change @@ -14,6 +14,10 @@ TEST_SCAN_DIR="/tmp/lmd-test-quar"
1414setup_file () {
1515 source /opt/tests/helpers/reset-lmd.sh
1616 mkdir -p " $TEST_SCAN_DIR "
17+
18+ # Force MD5 mode — eicar.com is only in MD5 sigs; SHA-NI auto-selects sha256
19+ lmd_set_config scan_hashtype md5
20+
1721 cp " $SAMPLES_DIR /eicar.com" " $TEST_SCAN_DIR /"
1822 maldet -a " $TEST_SCAN_DIR " || true
1923 local scanid
Original file line number Diff line number Diff line change @@ -12,6 +12,9 @@ TEST_SCAN_DIR="/tmp/lmd-test-report"
1212setup () {
1313 source /opt/tests/helpers/reset-lmd.sh
1414 mkdir -p " $TEST_SCAN_DIR "
15+
16+ # Force MD5 mode — eicar.com is only in MD5 sigs; SHA-NI auto-selects sha256
17+ lmd_set_config scan_hashtype md5
1518}
1619
1720teardown () {
Original file line number Diff line number Diff line change @@ -12,6 +12,9 @@ TEST_SCAN_DIR="/tmp/lmd-test-filelist"
1212setup () {
1313 source /opt/tests/helpers/reset-lmd.sh
1414 mkdir -p " $TEST_SCAN_DIR "
15+
16+ # Force MD5 mode — eicar.com is only in MD5 sigs; SHA-NI auto-selects sha256
17+ lmd_set_config scan_hashtype md5
1518}
1619
1720teardown () {
Original file line number Diff line number Diff line change 33load ' /usr/local/lib/bats/bats-support/load'
44load ' /usr/local/lib/bats/bats-assert/load'
55source /opt/tests/helpers/assert-scan.bash
6+ source /opt/tests/helpers/lmd-config.sh
67
78LMD_INSTALL=" /usr/local/maldetect"
89SAMPLES_DIR=" /opt/tests/samples"
@@ -11,6 +12,9 @@ TEST_SCAN_DIR="/tmp/lmd-test-purge"
1112setup () {
1213 source /opt/tests/helpers/reset-lmd.sh
1314 mkdir -p " $TEST_SCAN_DIR "
15+
16+ # Force MD5 mode — eicar.com is only in MD5 sigs; SHA-NI auto-selects sha256
17+ lmd_set_config scan_hashtype md5
1418}
1519
1620teardown () {
Original file line number Diff line number Diff line change @@ -13,6 +13,9 @@ MOCK_BIN_DIR="/tmp/lmd-mock-bins"
1313setup () {
1414 source /opt/tests/helpers/reset-lmd.sh
1515 mkdir -p " $TEST_SCAN_DIR " " $MOCK_BIN_DIR "
16+
17+ # Force MD5 mode — eicar.com is only in MD5 sigs; SHA-NI auto-selects sha256
18+ lmd_set_config scan_hashtype md5
1619 rm -f /tmp/mock-mail.log /tmp/mock-mail.body
1720 rm -f /tmp/mock-sendmail.log /tmp/mock-sendmail.body
1821 rm -f /tmp/mock-curl.log
Original file line number Diff line number Diff line change @@ -13,6 +13,9 @@ setup() {
1313 command -v yara > /dev/null 2>&1 || command -v yr > /dev/null 2>&1 || skip " no yara or yr binary available"
1414 source /opt/tests/helpers/reset-lmd.sh
1515 mkdir -p " $TEST_SCAN_DIR "
16+
17+ # Force MD5 mode — eicar.com is only in MD5 sigs; SHA-NI auto-selects sha256
18+ lmd_set_config scan_hashtype md5
1619}
1720
1821teardown () {
Original file line number Diff line number Diff line change @@ -13,6 +13,9 @@ setup() {
1313 source /opt/tests/helpers/reset-lmd.sh
1414 mkdir -p " $TEST_SCAN_DIR "
1515
16+ # Force MD5 mode — eicar.com is only in MD5 sigs; SHA-NI auto-selects sha256
17+ lmd_set_config scan_hashtype md5
18+
1619 # Install test HEX signature for eval(base64_decode(
1720 echo " 6576616c286261736536345f6465636f646528:test.hex.php.1" > " $LMD_INSTALL /sigs/custom.hex.dat"
1821}
Original file line number Diff line number Diff line change @@ -12,6 +12,10 @@ AUDIT_LOG="/var/log/maldet/audit.log"
1212setup () {
1313 source /opt/tests/helpers/reset-lmd.sh
1414 mkdir -p " $TEST_SCAN_DIR "
15+
16+ # Force MD5 mode — eicar.com is only in MD5 sigs; SHA-NI auto-selects sha256
17+ lmd_set_config scan_hashtype md5
18+
1519 rm -f " $AUDIT_LOG "
1620 rm -f " $LMD_INSTALL /logs/event_log"
1721 touch " $LMD_INSTALL /logs/event_log"
You can’t perform that action at this time.
0 commit comments