From 711c84aef86796bc37fe47c520b3aa2d62a67ad1 Mon Sep 17 00:00:00 2001 From: Andrei Lascu Date: Wed, 10 Apr 2024 13:39:57 +0100 Subject: [PATCH] Fix CI not failing Unfortunately, when we moved calling the underlying CHERI instance via `script` (in #93), we omitted to ensure that the return code for the underlying tests was properly returned to the testing script it's being called from. This means we had some underlying silent failures in our CI. We attempt to fix them here, and to ensure future CI checks fail appropriately. --- .buildbot.sh | 6 +++--- cap_build.c => hybrid/cap_build.c | 5 +++-- tests/run_tests.sh | 6 +++--- 3 files changed, 9 insertions(+), 8 deletions(-) rename cap_build.c => hybrid/cap_build.c (99%) diff --git a/.buildbot.sh b/.buildbot.sh index 0318cb7..fd8dee4 100755 --- a/.buildbot.sh +++ b/.buildbot.sh @@ -50,7 +50,7 @@ args=( ) export BUILDBOT_PLATFORM=riscv64-purecap args=${args[@]} -script -O /dev/null -c "python3 tests/run_cheri_examples.py $args" +script -O /dev/null -ec "python3 tests/run_cheri_examples.py $args" echo "Running tests for 'morello-hybrid' using QEMU..." args=( @@ -66,7 +66,7 @@ args=( ) export BUILDBOT_PLATFORM=morello-hybrid args=${args[@]} -script -O /dev/null -c "python3 tests/run_cheri_examples.py $args" +script -O /dev/null -ec "python3 tests/run_cheri_examples.py $args" echo "Running tests for 'morello-purecap' using QEMU..." args=( @@ -82,4 +82,4 @@ args=( ) export BUILDBOT_PLATFORM=morello-purecap args=${args[@]} -script -O /dev/null -c "python3 tests/run_cheri_examples.py $args" +script -O /dev/null -ec "python3 tests/run_cheri_examples.py $args" diff --git a/cap_build.c b/hybrid/cap_build.c similarity index 99% rename from cap_build.c rename to hybrid/cap_build.c index 294b743..b16ac50 100644 --- a/cap_build.c +++ b/hybrid/cap_build.c @@ -15,12 +15,13 @@ // from the first argument --- which differentiates `cheri_address_set` and // `cheri_cap_build`. -#include "cheriintrin.h" -#include "include/common.h" #include #include #include +#include "../include/common.h" +#include "cheriintrin.h" + int main() { // This example relies on morello-specific symbols, so we won't run diff --git a/tests/run_tests.sh b/tests/run_tests.sh index 049f1d2..e45f1e8 100755 --- a/tests/run_tests.sh +++ b/tests/run_tests.sh @@ -84,14 +84,14 @@ elif [ "$1" = "morello-hybrid" ]; then run to_fail hybrid/compartment_examples/inter_comp_call/malicious_compartments inter_comp_call-secure-redirect_clr run to_fail hybrid/compartment_examples/inter_comp_call/malicious_compartments inter_comp_call-secure-update_ddc # Tests that should pass - run OK . cap_build run OK compare_platforms compare_platforms_overflow - run OK hybrid/ddc_compartment_switching ddc_compartment_switching + run OK example_allocators/compartment_alloc main run OK hybrid basic_ddc + run OK hybrid cap_build run OK hybrid/compartment_examples/inter_comp_call/base main run OK hybrid/compartment_examples/inter_comp_call/malicious_compartments inter_comp_call-secure + run OK hybrid/ddc_compartment_switching ddc_compartment_switching run OK syscall-restrict syscall-restrict - run OK example_allocators/compartment_alloc main else echo "$1 not recognised." exit 1