From 6d3c127cfa30065f1f789b2a9392d53989601ad8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20De=20Keersmaeker?= <francois.dekeersmaeker@uclouvain.be> Date: Sun, 13 Oct 2024 21:46:25 +0200 Subject: [PATCH] CI: updated paths in scripts --- .ci_scripts/native-build/add_nft_rules.sh | 25 ++++++++++------------- .ci_scripts/native-build/run_cppcheck.sh | 4 ++-- .ci_scripts/native-build/run_exec.sh | 2 +- .ci_scripts/native-build/run_tests.sh | 6 +++--- src/parsers | 2 +- 5 files changed, 18 insertions(+), 21 deletions(-) diff --git a/.ci_scripts/native-build/add_nft_rules.sh b/.ci_scripts/native-build/add_nft_rules.sh index 498850c..8a89bd6 100755 --- a/.ci_scripts/native-build/add_nft_rules.sh +++ b/.ci_scripts/native-build/add_nft_rules.sh @@ -1,19 +1,16 @@ +# CONSTANTS EXITCODE=0 -for nft_script in $GITHUB_WORKSPACE/test/device/firewall.nft -do - # Flush the ruleset before next device - sudo nft flush ruleset - # Try adding the ruleset - sudo nft -f "$nft_script" - # If the exit code is not 0, set EXITCODE to 1 - if [[ $? -ne 0 ]] - then - EXITCODE=1 - fi -done +# Flush the ruleset before next device +sudo nft flush ruleset +# Try adding the ruleset +sudo nft -f test/device/firewall.nft +# If the exit code is not 0, set EXITCODE to 1 +if [[ $? -ne 0 ]] +then + EXITCODE=1 +fi -# Cleanup: Flush the ruleset sudo nft flush ruleset -exit $EXITCODE +exit $EXITCODE \ No newline at end of file diff --git a/.ci_scripts/native-build/run_cppcheck.sh b/.ci_scripts/native-build/run_cppcheck.sh index 4cfd707..077ad8c 100755 --- a/.ci_scripts/native-build/run_cppcheck.sh +++ b/.ci_scripts/native-build/run_cppcheck.sh @@ -1,8 +1,8 @@ EXITCODE=0 -PARSERS_DIR="$GITHUB_WORKSPACE/src/parsers" +PARSERS_DIR="src/parsers" # Pattern matching on all source files -for file in $(find "$GITHUB_WORKSPACE"/include "$GITHUB_WORKSPACE"/src "$GITHUB_WORKSPACE"/test "$PARSERS_DIR"/include "$PARSERS_DIR"/src "$PARSERS_DIR"/test -name *.h -o -name *.c) +for file in $(find include src test "$PARSERS_DIR"/include "$PARSERS_DIR"/src "$PARSERS_DIR"/test -name *.h -o -name *.c) do if [[ "$file" != *"/hashmap.c" ]] then diff --git a/.ci_scripts/native-build/run_exec.sh b/.ci_scripts/native-build/run_exec.sh index 0a93f4f..cb4ae7d 100755 --- a/.ci_scripts/native-build/run_exec.sh +++ b/.ci_scripts/native-build/run_exec.sh @@ -2,7 +2,7 @@ # Constants TIMEOUT=5 # seconds -BIN_DIR="$GITHUB_WORKSPACE/bin" +BIN_DIR="bin" # Ensure globbing expands to an empty list if no matches are found shopt -s nullglob diff --git a/.ci_scripts/native-build/run_tests.sh b/.ci_scripts/native-build/run_tests.sh index e911e16..fd95ee1 100755 --- a/.ci_scripts/native-build/run_tests.sh +++ b/.ci_scripts/native-build/run_tests.sh @@ -1,9 +1,9 @@ EXITCODE=0 -PARSERS_DIR="$GITHUB_WORKSPACE/src/parsers" -VALGRIND_SUPP="$GITHUB_WORKSPACE/.ci_scripts/native-build/valgrind.supp" +PARSERS_DIR="src/parsers" +VALGRIND_SUPP=".ci_scripts/native-build/valgrind.supp" PREFIX="" -for file in "$GITHUB_WORKSPACE"/bin/test/* "$PARSERS_DIR"/bin/test/* +for file in bin/test/* "$PARSERS_DIR"/bin/test/* do if [[ "$file" == *"rule_utils-test" ]] then diff --git a/src/parsers b/src/parsers index 0ef0b31..f57c3b1 160000 --- a/src/parsers +++ b/src/parsers @@ -1 +1 @@ -Subproject commit 0ef0b310bc56c35c8ca4134956326190d9b73a51 +Subproject commit f57c3b1dcb246d667cf473a7907407e38e22f13c -- GitLab