This directory contains test scripts and Docker configurations for testing devboost on different platforms.
./tests/run-tests.shThis builds the script and runs all available tests.
# Bash 3.x compatibility tests
./tests/run-tests.sh test-bash3-compat.sh
# Bash 3.x runtime tests
./tests/run-tests.sh test-bash3-runtime.sh
# Or run directly
./tests/test-bash3-compat.sh
./tests/test-bash3-runtime.sh./tests/test-macos.shThis creates a temporary home directory and runs tests without affecting your actual configuration.
Test on a specific distribution:
./tests/test-linux.sh ubuntu
./tests/test-linux.sh debian
./tests/test-linux.sh fedora
./tests/test-linux.sh archTest on all distributions:
./tests/test-linux.sh all- macOS (obviously)
- bash
- The script will create a temporary test environment
- Docker or Podman installed and running
- macOS: Podman will be auto-installed via Homebrew if neither Docker nor Podman is available
- Linux: Podman will be auto-installed via system package manager if neither Docker nor Podman is available
- Sufficient disk space for container images
- Network connection to download base images
- sudo access (if podman needs to be installed on Linux)
- Homebrew (if running on macOS and podman needs to be installed)
- ✅ Plan mode (
devboost plan) - ✅ Apply mode with dry-run (
devboost apply --dry-run) - ✅ Doctor mode (
devboost doctor) - ✅ Script syntax validation
- ✅ Config file parsing
- ✅ Bash 3.x compatibility (no associative arrays)
- ✅ Bash 3.x runtime tests (script runs with bash 3.2+)
- ✅ No bash 4+ features (mapfile, readarray, case conversion, etc.)
- ✅ Ubuntu/Debian (apt package manager)
- ✅ Fedora (dnf package manager)
⚠️ Arch Linux (pacman package manager) - Skipped on ARM64 systems (official image limitation)- ✅ macOS (Homebrew package manager)
The Docker images are built from:
Dockerfile.ubuntu- Ubuntu 26.04Dockerfile.debian- Debian TrixieDockerfile.fedora- Fedora LatestDockerfile.arch- Arch Linux Latest
Each image includes:
- Basic dependencies (curl, git, sudo, bash)
- A test user with sudo privileges
- The built devboost.sh script
You can also run interactive tests using docker-compose (requires Docker):
# Build and run a specific distribution
cd tests/docker
docker-compose build ubuntu
docker-compose run --rm ubuntu
# Inside the container:
/tmp/devboost.sh plan
/tmp/devboost.sh apply --dry-run
/tmp/devboost.sh doctorNote: docker-compose requires Docker. For Podman, use the test script directly (./tests/test-linux.sh [distro]) or use podman-compose if available.
Arch Linux on ARM64:
- The official Arch Linux Docker image doesn't support ARM64 architecture
- Tests will automatically skip Arch on ARM64 systems (e.g., Apple Silicon Macs)
- Arch tests should be run on x86_64 systems
For more thorough macOS testing, you can use a separate test user:
# Create a test user (requires admin)
sudo dscl . -create /Users/testdevboost
sudo dscl . -create /Users/testdevboost UserShell /bin/bash
sudo dscl . -create /Users/testdevboost RealName "Test User"
sudo dscl . -create /Users/testdevboost UniqueID 1001
sudo dscl . -create /Users/testdevboost PrimaryGroupID 20
sudo dscl . -create /Users/testdevboost NFSHomeDirectory /Users/testdevboost
sudo createhomedir -c -u testdevboost
# Switch to test user
su - testdevboost
# Run tests
cd /path/to/devboost
./devboost.sh applyThese test scripts are designed to be run in CI/CD pipelines:
# Example GitHub Actions workflow
- name: Test Linux
run: ./tests/test-linux.sh all
- name: Test macOS
run: ./tests/test-macos.shImage build fails:
- Ensure Docker/Podman is running:
docker infoorpodman info - Check disk space:
docker system dforpodman system df - Try pulling base images manually:
docker pull ubuntu:26.04orpodman pull ubuntu:26.04
Permission denied:
- For Docker: Ensure your user is in the docker group (Linux)
- For Podman: Usually works without special permissions (rootless)
- On macOS, Docker Desktop should handle permissions
Podman installation:
- The script will attempt to install podman automatically if neither docker nor podman is available
- macOS: Installs via Homebrew (
brew install podman) and automatically initializes the podman machine - Linux: Requires sudo access and a supported Linux distribution (Ubuntu/Debian, Fedora/RHEL, Arch)
- After installation, podman machine is automatically started on macOS
Temporary directory issues:
- The script uses
mktempwhich should work on macOS - If issues occur, check
/tmppermissions
Home directory conflicts:
- The test uses a temporary directory, so it shouldn't conflict
- If you see issues, check that
$TEST_HOMEis actually temporary
The test framework (test_common.sh) provides:
- Assertion functions:
test_assert,test_assert_eq,test_assert_ne,test_assert_contains,test_assert_not_contains,test_assert_exit_code - Test suite functions:
test_suite_start,test_suite_end - Utility functions:
test_get_bash_version,test_is_bash3,test_find_bash3
Example test:
#!/usr/bin/env bash
source tests/test_common.sh
test_suite_start "My Test Suite"
test_assert "Something is true" "[[ 1 -eq 1 ]]"
test_assert_eq "Values match" "expected" "actual"
test_assert_contains "Output contains text" "$output" "expected text"
test_suite_endTo add a new test:
- Create a new test file:
tests/test-<name>.sh - Source
test_common.shfor assertion functions - Use
test_suite_startandtest_suite_endfor output formatting - Add test logic using assertion functions
- Make the script executable:
chmod +x tests/test-<name>.sh - Update this README with the new test
- Ensure tests are idempotent (can run multiple times)
- Document any new requirements