#!/usr/bin/env bash # End-to-end test harness for the malware-analysis skills package. # # Proves the host-side tooling works on realistic fixtures: the Python # scripts every skill depends on, plus the detection rules the skills # ship as examples. No malware is involved — fixtures are synthetic # (tests/make_pe.py builds a benign PE that only calls ExitProcess). # # Usage: bash tests/run.sh # Exit 0 = all required checks pass. Optional tool checks (pefile, yara, # sigma, olevba) are skipped with a note when the tool is absent, so the # harness runs on a bare box and does more when deps are installed. set -u cd "$(dirname "$0")/.." ROOT=$(pwd) PY=python3 [ -x .venv/bin/python ] && PY=.venv/bin/python mkdir -p tests/out pass=0; fail=0; skip=0 ok() { echo " ok $1"; pass=$((pass+1)); } bad() { echo " FAIL $1"; fail=$((fail+1)); } skipm(){ echo " skip $1"; skip=$((skip+1)); } have() { command -v "$1" >/dev/null 2>&1; } pyhas(){ $PY -c "import $1" >/dev/null 2>&1; } # assert: