#!/usr/bin/env bash # Needs: python3, curl (live part), ../venv with pyspf+dnspython (setup.sh installs them). set -uo pipefail cd "$(dirname "$0")"; PY=../venv/bin/python rm -rf recorded; mkdir recorded { python3 --version; $PY -c "import spf,dns;print('pyspf', spf.__version__)"; $PY -m pip list 2>/dev/null | grep -i dnspython; date -u +"run date (UTC): %Y-%m-%d"; } > recorded/00-versions.txt # fixture (synthetic zone, RFC 5737/2606 example addresses and .test names) python3 spfcount.py company.test zone-before.json > recorded/01-count-before.txt for ip in 198.51.100.5 203.0.113.70 203.0.113.140 192.0.2.150 192.0.2.200 192.0.2.10 8.8.8.8; do $PY pyspf_eval.py zone-before.json company.test $ip; done > recorded/02-pyspf-before.txt python3 spfcount.py company.test zone-after-trim.json > recorded/03-count-after-trim.txt for ip in 198.51.100.5 203.0.113.70 203.0.113.140 192.0.2.150 192.0.2.10 8.8.8.8; do $PY pyspf_eval.py zone-after-trim.json company.test $ip; done > recorded/04-pyspf-after-trim.txt python3 spfcount.py company.test zone-after-flatten.json > recorded/05-count-after-flatten.txt for ip in 198.51.100.5 203.0.113.70 203.0.113.140 192.0.2.150 192.0.2.10 8.8.8.8; do $PY pyspf_eval.py zone-after-flatten.json company.test $ip; done > recorded/06-pyspf-after-flatten.txt # live snapshot over DNS-over-HTTPS (changes over time; example only) for d in github.com atlassian.com; do echo "### $d"; python3 spfcount.py $d; done > recorded/07-live-snapshot.txt 2>&1