Example of running Bats (TAP-compliant testing framework for Bash) in Sonobuoy diagnostic tool.
Create your own, or use pre-created .bats
tests in bats
folder.
sonobuoy gen plugin \
--name=example-bats \
--image jojojojo1234/bats-runner:0.1 \
--arg="./example1.bats" \
--arg="./example2.bats" > example-bats.yaml
Note: you can select which Bats to run. Bats to run are in bats
folder.
If you create new .bats
file/s in bats
folder make sure you build new bats-runner
Docker image (docker build -t bats-runner .
) and reference it in sonobuoy gen plugin
command afterwards.
sonobuoy run --plugin example-bats.yaml --wait
results=$(sonobuoy retrieve) && sonobuoy results $results
tar xzf $results -C ./
cat plugins/example-bats/results/global/out*
Note: Results are in TAP format.