Skip to content
Open
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
29a2e9c
Add default shell to all actions
mozzieongit Dec 1, 2025
81e1dd2
Fix setup and start action inputs
mozzieongit Dec 1, 2025
969bfc2
Add build profile option
mozzieongit Dec 1, 2025
153a64e
Simplify default value
mozzieongit Dec 1, 2025
17ffd24
Make build-profile an env variable and add binaries to PATH
mozzieongit Dec 2, 2025
b9db3f4
Build both debug and release builds
mozzieongit Dec 2, 2025
a304705
Print fancy errors for GitHub
mozzieongit Dec 2, 2025
3a3ee4e
Fix unbound stub-zone target to use the secondary NSD
mozzieongit Dec 2, 2025
d0cb01f
Add some more env setup tests
mozzieongit Dec 2, 2025
b3bb499
Merge branch 'main' into system-testing-act
mozzieongit Dec 11, 2025
811315e
Deduplicate example test job
mozzieongit Dec 11, 2025
bcae0e1
Use quotes around variables
mozzieongit Dec 11, 2025
3ede626
Fix defaults run shell syntax
mozzieongit Dec 11, 2025
7e72ecd
Only tar the binaries instead of the whole target directory
mozzieongit Jan 19, 2026
a5212a9
Write debug output of env management script to file
mozzieongit Jan 19, 2026
ebf7fe3
Add Dockerfile for building the cascade test runner image
mozzieongit Jan 30, 2026
848fdd6
Add act-wrapper script building the container and running act with th…
mozzieongit Jan 30, 2026
09f3cf8
Move test helper scripts
mozzieongit Jan 30, 2026
ba25d39
Remove build step and artifact server use
mozzieongit Jan 30, 2026
b5fecf6
Add action to select the cascade build profile in the workflow
mozzieongit Jan 30, 2026
4c4460a
Also output config files on test failure
mozzieongit Jan 30, 2026
f4c90b5
Remove build profile from setup and use
mozzieongit Jan 30, 2026
4d0de14
Output which file is used by example tests
mozzieongit Jan 30, 2026
0488e1e
Remove unused download or build action
mozzieongit Jan 30, 2026
a6cba60
Remove unnecessary os matrix item
mozzieongit Jan 30, 2026
6013983
Add check for lingering containers
mozzieongit Jan 30, 2026
07289f0
Add script to fetch default configuration options
mozzieongit Jan 30, 2026
a91025c
Use helper script to get policy path
mozzieongit Jan 30, 2026
78e57f2
Remove leftover mention of artifact names
mozzieongit Jan 30, 2026
4bece7b
Update system tests workflow file docs header
mozzieongit Jan 30, 2026
d29071d
Update system tests documentation
mozzieongit Jan 30, 2026
adf124f
Write all stderr of test env management script to file
mozzieongit Jan 30, 2026
5f16db9
Ignore act exit code in wrapper script
mozzieongit Jan 30, 2026
421be99
Merge branch 'main' into system-testing-act
mozzieongit Jan 30, 2026
7428bb7
Move load-zonefile test to separate action
mozzieongit Jan 30, 2026
6f33853
Remove obsolete comment
mozzieongit Jan 30, 2026
9e0213a
Add test action template
mozzieongit Jan 30, 2026
7f6d27d
Add integration test generation script
mozzieongit Jan 30, 2026
7e9338f
Fix docker image for workspace crates
mozzieongit Jan 30, 2026
f018173
Do not overwrite existing tests
mozzieongit Jan 30, 2026
217ca05
Document creating a test with the helper script
mozzieongit Jan 30, 2026
4055ab3
Fixup load zone test name
mozzieongit Jan 30, 2026
731016f
Document existence of default policy
mozzieongit Jan 30, 2026
bc34808
Clean up zone loader test
mozzieongit Jan 30, 2026
71c34f5
Also list listening sockets on failure
mozzieongit Jan 30, 2026
ee2c10b
Document DOCKER_HOST with Podman
mozzieongit Feb 2, 2026
d3f1571
Fix management script nsd-control arguments
mozzieongit Feb 2, 2026
caed205
Move cascade build into act-wrapper to make use of cargo incremental …
mozzieongit Feb 2, 2026
049821c
Merge branch 'main' into system-testing-act
mozzieongit Feb 2, 2026
1008cbe
Add transfer command to load-zonefile test
mozzieongit Feb 2, 2026
ebdd0f1
Update changelog
mozzieongit Feb 2, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 47 additions & 3 deletions .github/actions/download-or-build/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
# https://docs.github.com/en/actions/tutorials/create-actions/create-a-composite-action#creating-a-composite-action-within-the-same-repository
name: 'Download the artifact or build from source if failed'
description: 'Fetch or, if failed, build the binaries'
defaults:
shell: bash --noprofile --norc -eo pipefail -x {0}
inputs:
artifact-name:
description: 'The name of the artifact to fetch and unpack (it must contain the target.tar file)'
Expand All @@ -26,10 +28,52 @@ runs:
# due to 'continue-on-error: true' above the conclusion/status will
# always be success, but we can check for failure using the outcome key
if: ${{ steps.download_binaries.outcome == 'failure' }}
run: cargo build
run: |
case "${{ env.build-profile }}" in
debug)
cargo build
;;
release)
cargo build --release
;;
*) exit 1
esac
- name: Build dnst from keyset branch
if: ${{ steps.download_binaries.outcome == 'failure' }}
run: cargo install --git https://github.com/nlnetlabs/dnst --branch keyset --root "$GITHUB_WORKSPACE/target/dnst" --locked --bin=dnst
run: |
case "${{ env.build-profile }}" in
debug)
cargo install --debug --git https://github.com/nlnetlabs/dnst --branch keyset --root "$GITHUB_WORKSPACE/target/dnst" --locked --bin=dnst
;;
release)
cargo install --git https://github.com/nlnetlabs/dnst --branch keyset --root "$GITHUB_WORKSPACE/target/dnst" --locked --bin=dnst
;;
*) exit 1
esac
- name: Add cascade to PATH
run: |
case "${{ env.build-profile }}" in
debug)
[[ -x "$GITHUB_WORKSPACE/target/debug/cascaded" ]] # Sanity check
echo "$GITHUB_WORKSPACE/target/debug" >> "$GITHUB_PATH"
;;
release)
[[ -x "$GITHUB_WORKSPACE/target/release/cascaded" ]] # Sanity check
echo "$GITHUB_WORKSPACE/target/release" >> "$GITHUB_PATH"
;;
*) exit 1
esac
- name: Add dnst to PATH
# https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-commands#example-of-adding-a-system-path
run: echo "$GITHUB_WORKSPACE/target/dnst/bin" >> "$GITHUB_PATH"
run: |
case "${{ env.build-profile }}" in
debug)
[[ -x "$GITHUB_WORKSPACE/target/dnst/debug/bin/dnst" ]] # Sanity check
echo "$GITHUB_WORKSPACE/target/dnst/debug/bin" >> "$GITHUB_PATH"
;;
release)
[[ -x "$GITHUB_WORKSPACE/target/dnst/release/bin/dnst" ]] # Sanity check
echo "$GITHUB_WORKSPACE/target/dnst/release/bin" >> "$GITHUB_PATH"
;;
*) exit 1
esac
2 changes: 2 additions & 0 deletions .github/actions/prepare-systest-env/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
# https://docs.github.com/en/actions/tutorials/create-actions/create-a-composite-action#creating-a-composite-action-within-the-same-repository
name: 'Prepare the system/integration test environment'
description: 'Setup the environment, and fetch or build the binaries'
defaults:
shell: bash --noprofile --norc -eo pipefail -x {0}
inputs:
artifact-name:
description: 'The name of the artifact to fetch and unpack (it must contain the target.tar file)'
Expand Down
6 changes: 4 additions & 2 deletions .github/actions/print-logfiles/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,17 @@
# https://docs.github.com/en/actions/tutorials/create-actions/create-a-composite-action#creating-a-composite-action-within-the-same-repository
name: 'Print logfiles'
description: 'Print the nameserver logfiles'
defaults:
shell: bash --noprofile --norc -eo pipefail -x {0}
inputs:
nameserver-dir:
description: 'The base directory of the nameserver log files'
required: false
default: ${{ format('{0}/nameservers', github.workspace) }}
default: ${{ github.workspace }}/nameservers
cascade-dir:
description: 'The cascade base directory containing the log files'
required: false
default: ${{ format('{0}/cascade-dir', github.workspace) }}
default: ${{ github.workspace }}/cascade-dir
runs:
using: "composite"
steps:
Expand Down
30 changes: 12 additions & 18 deletions .github/actions/setup-and-start-cascade/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,24 @@
# https://docs.github.com/en/actions/tutorials/create-actions/create-a-composite-action#creating-a-composite-action-within-the-same-repository
name: 'Setup and start cascade'
description: 'Setup and start the cascade daemon'
defaults:
shell: bash --noprofile --norc -eo pipefail -x {0}
inputs:
cascade-dir:
description: 'The name of the artifact to fetch and unpack (it must contain the target.tar file)'
required: true
required: false
default: ${{ github.workspace }}/cascade-dir
runs:
using: "composite"
steps:
- name: Start cascade with a working-directory-local config
run: |
# Variant 1: Just using absolute paths
mkdir -p cascade-dir/policies
cascade_dir="$PWD/cascade-dir"
# We need to create a custom config for cascade because the default paths are not available/permitted in this environment
./target/debug/cascade template config | \
./scripts/sed-config-dirs.sh "${cascade_dir}" | tee "${cascade_dir}/config.toml" >&2
./target/debug/cascade template policy > "${cascade_dir}/policies/default.toml"
./target/debug/cascaded --config "${cascade_dir}/config.toml" --state "${cascade_dir}/state.db" --daemonize &>"${cascade_dir}/cascade-startup.log"
CASCADE_DIR=${{ inputs.cascade-dir }}
BUILD_PROFILE=${{ env.build-profile }}

# Variant 2: Using cd to change directories and using relative paths (beware of Cascade --daemonize changing the current working directory to '/')
# mkdir -p cascade-dir/policies
# cd cascade-dir
# # We need to create a custom config for cascade because the default paths are not available/permitted in this environment
# ../target/debug/cascade template config | \
# ../scripts/sed-config-dirs.sh > config.toml
# cat config.toml >&2
# ../target/debug/cascade template policy > policies/default.toml
# ../target/debug/cascaded --config config.toml --state "$GITHUB_WORKSPACE/cascade-dir/state.db" --daemonize &>cascade-startup.log
mkdir -p "${CASCADE_DIR}/policies"
# We need to create a custom config for cascade because the default paths are not available/permitted in this environment
cascade template config | \
"${GITHUB_WORKSPACE}/scripts/sed-config-dirs.sh" "${BUILD_PROFILE}" "${CASCADE_DIR}" | tee "${CASCADE_DIR}/config.toml" >&2
cascade template policy > "${CASCADE_DIR}/policies/default.toml"
cascaded --config "${CASCADE_DIR}/config.toml" --state "${CASCADE_DIR}/state.db" --daemonize &>"${CASCADE_DIR}/cascade-startup.log"
56 changes: 43 additions & 13 deletions .github/workflows/system-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
# matrix:
# os: [ubuntu-latest]
# rust: [stable] # see build job
# # env:
# # build-profile: release # uncomment this to run this test with a release build
# steps:
# - name: Checkout repository
# uses: actions/checkout@v4
Expand All @@ -32,7 +34,7 @@
# # artifact-name: ${{ format('cascade_{0}_{1}_{2}', github.sha, matrix.os, matrix.rust) }}
# - name: Setup and start the cascade daemon
# uses: ./.github/actions/setup-and-start-cascade
# - run: target/debug/cascade --version
# - run: cascade --version
# ### RUN YOUR TESTS HERE
# # # Optional, the container gets cleaned up anyway (at least in act)
# # - name: Stop the setup
Expand All @@ -53,6 +55,7 @@ env:
# Set this assignment to your choosing to set the cargo build verbosity
CARGO_TERM_VERBOSE: ${{ github.actor != 'nektos/act' }}
# CARGO_TERM_VERBOSE: true
build-profile: debug

defaults:
run:
Expand All @@ -78,7 +81,7 @@ jobs:
compression-level: 0
build:
# First build the project for once for all systems to deduplicate work
# in the later tests
# in the later tests. This builds both the release and debug build.
name: Build the project for use by the later tests
needs: check-for-artifact-server
runs-on: ${{ matrix.os }}
Expand All @@ -93,12 +96,18 @@ jobs:
- name: Checkout repository
if: needs.check-for-artifact-server.outputs.status == 'success'
uses: actions/checkout@v4
- name: Build Cascade
- name: Build Cascade (debug)
if: needs.check-for-artifact-server.outputs.status == 'success'
run: cargo build
- name: Build dnst from keyset branch
- name: Build Cascade (release)
if: needs.check-for-artifact-server.outputs.status == 'success'
run: cargo install --git https://github.com/nlnetlabs/dnst --branch keyset --root target/dnst --locked --bin=dnst
run: cargo build --release
- name: Build dnst from keyset branch (debug)
if: needs.check-for-artifact-server.outputs.status == 'success'
run: cargo install --debug --git https://github.com/nlnetlabs/dnst --branch keyset --root target/dnst/debug --locked --bin=dnst
- name: Build dnst from keyset branch (release)
if: needs.check-for-artifact-server.outputs.status == 'success'
run: cargo install --git https://github.com/nlnetlabs/dnst --branch keyset --root target/dnst/release --locked --bin=dnst
- name: Tar built binaries to preserve permissions
if: needs.check-for-artifact-server.outputs.status == 'success'
run: tar -cf target.tar target
Expand All @@ -118,8 +127,28 @@ jobs:
# Optional. Default is '6'
compression-level: 1

test-release-version:
name: Example test with prepare environment and cascade --version (release)
runs-on: ${{ matrix.os }}
needs: build
strategy:
matrix:
os: [ubuntu-latest]
rust: [stable] # see build job
env:
build-profile: release
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Prepare the system test environment
uses: ./.github/actions/prepare-systest-env
with:
artifact-name: ${{ format('cascade_{0}_{1}_{2}', github.sha, matrix.os, matrix.rust) }}
- run: target/release/cascade --version
- run: cascade --version

test-version:
name: Example test with prepare environment and cascade --version
name: Example test with prepare environment and cascade --version (debug)
runs-on: ${{ matrix.os }}
needs: build

Expand All @@ -134,10 +163,7 @@ jobs:
uses: ./.github/actions/prepare-systest-env
with:
artifact-name: ${{ format('cascade_{0}_{1}_{2}', github.sha, matrix.os, matrix.rust) }}
- run: target/debug/cascade --version
# # Optional, the container gets cleaned up anyway (at least in act)
# - name: Stop the setup
# run: scripts/manage-test-environment.sh stop
- run: cascade --version

add-zone-query:
name: Add a zone, query the zone
Expand All @@ -154,17 +180,21 @@ jobs:
uses: ./.github/actions/prepare-systest-env
with:
artifact-name: ${{ format('cascade_{0}_{1}_{2}', github.sha, matrix.os, matrix.rust) }}
- run: target/debug/cascade --version
# - name: Only download/build the binaries without setting up the test environment
# uses: ./.github/actions/download-or-build
# with:
# artifact-name: ${{ format('cascade_{0}_{1}_{2}', github.sha, matrix.os, matrix.rust) }}
- run: cascade --version
- name: Setup and start the cascade daemon
uses: ./.github/actions/setup-and-start-cascade
- name: Add a zone
run: |
target/debug/cascade zone add --policy default --source 127.0.0.1:1055 example.test
cascade zone add --policy default --source 127.0.0.1:1055 example.test
- name: Check zone status
run: |
timeout=10 # seconds
start=$(date +%s)
until target/debug/cascade zone status example.test | grep -q "Published zone available"; do
until cascade zone status example.test | grep -q "Published zone available"; do
if (($(date +%s) > (start + timeout))); then
echo "timeout: zone status did not report published zone available" >&2
exit 1
Expand Down
10 changes: 9 additions & 1 deletion TESTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,12 @@ of text printed you can:
using `unbuffer` from the `expect` package; left as an excercise for the
user)

### Miscellaneous notes

- By default, tests are run using a debug build for both Cascade and dnst.
- This can be changed per test using the `build-profile` environment variable.
- `cascade`, `cascaded`, and `dnst` are added to the `$PATH`.

### Example test job

```yml
Expand All @@ -141,6 +147,8 @@ of text printed you can:
matrix:
os: [ubuntu-latest]
rust: [stable] # see build job
# env:
# build-profile: release # uncomment this to run this test with a release build
steps:
- name: Checkout repository
uses: actions/checkout@v4
Expand All @@ -154,7 +162,7 @@ of text printed you can:
# artifact-name: ${{ format('cascade_{0}_{1}_{2}', github.sha, matrix.os, matrix.rust) }}
- name: Setup and start the cascade daemon
uses: ./.github/actions/setup-and-start-cascade
- run: target/debug/cascade --version
- run: cascade --version
### RUN YOUR TESTS HERE
# # Optional, the container gets cleaned up anyway (at least in act)
# - name: Stop the setup
Expand Down
28 changes: 19 additions & 9 deletions scripts/sed-config-dirs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,19 @@ set -u

usage() {
cat <<EOF >&2
Usage: ${0} [path]
Usage: ${0} <build-profile> [path]

'sed' the cascade config to have all options point to subdirectories of
a single directory—The path argument, or if not provided, the current working
directory, by default.

'dnst' is configured to be in '\${GITHUB_WORKSPACE}/target/dnst/bin/dnst'.
'dnst' is configured to be in '\${GITHUB_WORKSPACE}/target/dnst/<build-profile>/bin/dnst'.


Arguments:
path The base directory to put all cascade config into. If <path>
is a relative path, it is converted to an absolute one.
build-profile The build profile for the test (debug or release).
path The base directory to put all cascade config into. If <path>
is a relative path, it is converted to an absolute one.

Options:
-h, --help Print this help text
Expand All @@ -34,13 +35,22 @@ if [[ "${1-}" =~ ^-h|--help$ ]]; then
exit
fi

_build_profile=${1-}
_path=${2-}

if ! [[ "${_build_profile}" =~ ^debug|release$ ]]; then
echo "Build profile argument MUST be either debug or release." >&2
usage
exit 1
fi

# The base dir must be an absolute path
if [[ -n "${1-}" ]]; then
if [[ -n "${_path}" ]]; then
# A very naive check, but sufficient for our use case
if [[ "$1" == /* ]]; then
_base_dir=$1
if [[ "${_path}" == /* ]]; then
_base_dir=${_path}
else
_base_dir=$(realpath -- "$1")
_base_dir=$(realpath -- "${_path}")
fi
else
_base_dir=$PWD
Expand All @@ -52,6 +62,6 @@ sed -e "s_^policy-dir.*_policy-dir = \"${_base_dir}/policies\"_" \
-e "s_^kmip-credentials-store-path.*_kmip-credentials-store-path = \"${_base_dir}/kmip/credentials.db\"_" \
-e "s_^kmip-server-state-dir.*_kmip-server-state-dir = \"${_base_dir}/kmip\"_" \
-e "s_^keys-dir.*_keys-dir = \"${_base_dir}/keys\"_" \
-e "s_^dnst-binary-path.*_dnst-binary-path = \"${GITHUB_WORKSPACE}/target/dnst/bin/dnst\"_" \
-e "s_^dnst-binary-path.*_dnst-binary-path = \"${GITHUB_WORKSPACE}/target/dnst/${_build_profile}/bin/dnst\"_" \
-e 's_^log-level.*_log-level = "debug"_' \
-e "s_^log-target.*_log-target = { type = \"file\", path = \"${_base_dir}/cascade.log\" }_"