pi-hole/test
Christian König cdb990ad23
Include alpine 3.24 in tests
Signed-off-by: Christian König <github@yubiuser.dev>
2026-06-10 20:30:07 +02:00
..
_alpine_3_21.Dockerfile test: bake BATS libraries into test images at build time 2026-05-21 19:30:20 +01:00
_alpine_3_22.Dockerfile test: bake BATS libraries into test images at build time 2026-05-21 19:30:20 +01:00
_alpine_3_23.Dockerfile test: bake BATS libraries into test images at build time 2026-05-21 19:30:20 +01:00
_alpine_3_24.Dockerfile Include alpine 3.24 in tests 2026-06-10 20:30:07 +02:00
_centos_9.Dockerfile test: bake BATS libraries into test images at build time 2026-05-21 19:30:20 +01:00
_centos_10.Dockerfile test: bake BATS libraries into test images at build time 2026-05-21 19:30:20 +01:00
_debian_11.Dockerfile test: bake BATS libraries into test images at build time 2026-05-21 19:30:20 +01:00
_debian_12.Dockerfile test: bake BATS libraries into test images at build time 2026-05-21 19:30:20 +01:00
_debian_13.Dockerfile test: bake BATS libraries into test images at build time 2026-05-21 19:30:20 +01:00
_fedora_40.Dockerfile test: bake BATS libraries into test images at build time 2026-05-21 19:30:20 +01:00
_fedora_41.Dockerfile test: bake BATS libraries into test images at build time 2026-05-21 19:30:20 +01:00
_fedora_42.Dockerfile test: bake BATS libraries into test images at build time 2026-05-21 19:30:20 +01:00
_fedora_43.Dockerfile test: bake BATS libraries into test images at build time 2026-05-21 19:30:20 +01:00
_fedora_44.Dockerfile replace tox with BATS for new OSes 2026-05-21 22:29:28 +02:00
_ubuntu_20.Dockerfile test: bake BATS libraries into test images at build time 2026-05-21 19:30:20 +01:00
_ubuntu_22.Dockerfile test: bake BATS libraries into test images at build time 2026-05-21 19:30:20 +01:00
_ubuntu_24.Dockerfile test: bake BATS libraries into test images at build time 2026-05-21 19:30:20 +01:00
_ubuntu_26.Dockerfile replace tox with BATS for new OSes 2026-05-21 22:29:28 +02:00
bats_helper.bash Fix shellcheck wrning 2026-06-01 19:30:57 +02:00
README.md test: update README for BATS runner usage 2026-05-21 19:30:20 +01:00
run.sh Set BATS pretty output flag depending on the terminal 2026-06-01 19:30:57 +02:00
test_automated_install.bats Move on_failure_hook to helper file 2026-06-01 19:30:57 +02:00
test_fresh_install.bats Move on_failure_hook to helper file 2026-06-01 19:30:57 +02:00
test_gravity.bats Use bats_helper also in newly added gravity tests 2026-06-01 19:31:55 +02:00
test_installer_ftl.bats Move on_failure_hook to helper file 2026-06-01 19:30:57 +02:00
test_network.bats Move on_failure_hook to helper file 2026-06-01 19:30:57 +02:00
test_selinux.bats Move on_failure_hook to helper file 2026-06-01 19:30:57 +02:00
test_utils.bats Move on_failure_hook to helper file 2026-06-01 19:30:57 +02:00

Recommended way to run tests

The test suite is implemented with BATS and runs inside distro-specific Docker containers.

Requirements

  • Docker (with buildx support)
  • Bash shell

Run tests

From the repository root, run:

bash test/run.sh --distro debian_12

test/run.sh will:

  • Build the distro test image from test/_<distro>.Dockerfile
  • Run the mock/function BATS suite in a fresh container
  • Run the fresh-install BATS suite in a separate fresh container

Available distros

If you are unsure which distro names are valid, run:

bash test/run.sh --help

The help output includes the current list of supported distros.

Optional: override BATS library versions

test/run.sh accepts optional environment variable overrides when building test images:

  • BATS_CORE_VER
  • BATS_SUPPORT_VER
  • BATS_ASSERT_VER
  • BATS_MOCK_VER
  • BATS_FILE_VER

Example:

BATS_CORE_VER=v1.14.0 DISTRO=debian_12 bash test/run.sh