diff --git a/.ci_scripts/full-test/run_exec.sh b/.ci_scripts/full-test/run_exec.sh new file mode 100755 index 0000000000000000000000000000000000000000..0a93f4fbb6388917fdb308e55bd0d9455a44285b --- /dev/null +++ b/.ci_scripts/full-test/run_exec.sh @@ -0,0 +1,23 @@ +#!/bin/bash + +# Constants +TIMEOUT=5 # seconds +BIN_DIR="$GITHUB_WORKSPACE/bin" + +# Ensure globbing expands to an empty list if no matches are found +shopt -s nullglob + +# Execute all NFQueue executables +for EXEC in "$BIN_DIR"/* +do + if [ -f "$EXEC" ] + then + ARG="" + if [[ "$EXEC" == *"/nflog" ]] + then + ARG="100" + fi + sudo $EXEC $ARG & sleep $TIMEOUT + sudo kill $! + fi +done diff --git a/.github/workflows/full-test.yml b/.github/workflows/full-test.yml index 79bf5dce6a44d019146c27bfba3febcefc37dc32..debb40d6fc58a229f91fdd290ffd8e66292e74d9 100644 --- a/.github/workflows/full-test.yml +++ b/.github/workflows/full-test.yml @@ -1,4 +1,4 @@ -name: Translate profiles, compile, and run unit tests +name: Test the whole system on: [push] @@ -37,3 +37,6 @@ jobs: - name: Add nftables rules run: $GITHUB_WORKSPACE/.ci_scripts/full-test/add_nft_rules.sh + + - name: Run NFQueue executables + run: $GITHUB_WORKSPACE/.ci_scripts/firewall-test/run_exec.sh