enroll/tests.sh

25 lines
469 B
Bash
Raw Normal View History

2025-12-15 11:04:54 +11:00
#!/bin/bash
2025-12-15 11:29:19 +11:00
set -eo pipefail
# Pytests
2025-12-15 11:04:54 +11:00
poetry run pytest -vvvv --cov=enroll --cov-report=term-missing --disable-warnings
2025-12-15 11:29:19 +11:00
BUNDLE_DIR="/tmp/bundle"
ANSIBLE_DIR="/tmp/ansible"
rm -rf "${BUNDLE_DIR}" "${ANSIBLE_DIR}"
# Generate data
poetry run \
2025-12-16 20:48:08 +11:00
enroll single-shot \
2025-12-15 11:29:19 +11:00
--harvest "${BUNDLE_DIR}" \
--out "${ANSIBLE_DIR}"
builtin cd "${ANSIBLE_DIR}"
2025-12-15 11:29:19 +11:00
# Lint
ansible-lint "${ANSIBLE_DIR}"
2025-12-15 11:04:54 +11:00
2025-12-15 11:29:19 +11:00
# Run
2025-12-15 11:57:33 +11:00
ansible-playbook playbook.yml -i "localhost," -c local --check --diff