diff mbox series

[ovs-dev,v3,1/2] github: Combine ASAN and UBSAN runs.

Message ID 167828863147.885480.13095064024409589366.stgit@ebuild.local
State Rejected
Headers show
Series [ovs-dev,v3,1/2] github: Combine ASAN and UBSAN runs. | expand

Checks

Context Check Description
ovsrobot/apply-robot success apply and check: success
ovsrobot/intel-ovs-compilation success test: success
ovsrobot/github-robot-_Build_and_Test success github build: passed

Commit Message

Eelco Chaudron March 8, 2023, 3:18 p.m. UTC
Combine the ASAN and UBSAN tests into a single sanitizer run.

Signed-off-by: Eelco Chaudron <echaudro@redhat.com>
---

v2: Introduction of this patch in the patch set.
v3: Moved Ubuntu test image upgrade to second patch.

 .ci/linux-build.sh                   |   14 +++++---------
 .github/workflows/build-and-test.yml |    8 ++------
 2 files changed, 7 insertions(+), 15 deletions(-)

Comments

Simon Horman March 9, 2023, 1:25 p.m. UTC | #1
On Wed, Mar 08, 2023 at 04:18:02PM +0100, Eelco Chaudron wrote:
> Combine the ASAN and UBSAN tests into a single sanitizer run.
> 
> Signed-off-by: Eelco Chaudron <echaudro@redhat.com>

Reviewed-by: Simon Horman <simon.horman@corigine.com>
diff mbox series

Patch

diff --git a/.ci/linux-build.sh b/.ci/linux-build.sh
index 10021fddb..6394a8137 100755
--- a/.ci/linux-build.sh
+++ b/.ci/linux-build.sh
@@ -148,17 +148,13 @@  else
     CFLAGS_FOR_OVS="${CFLAGS_FOR_OVS} ${SPARSE_FLAGS}"
 fi
 
-if [ "$ASAN" ]; then
-    # This will override default option configured in tests/atlocal.in.
+if [ "$SANITIZERS" ]; then
+    # This will override the default ASAN_OPTIONS configured in
+    # tests/atlocal.in, however, it will use the defined UBSAN_OPTIONS.
     export ASAN_OPTIONS='detect_leaks=1'
     CFLAGS_ASAN="-fno-omit-frame-pointer -fno-common -fsanitize=address"
-    CFLAGS_FOR_OVS="${CFLAGS_FOR_OVS} ${CFLAGS_ASAN}"
-fi
-
-if [ "$UBSAN" ]; then
-    # Use the default options configured in tests/atlocal.in, in UBSAN_OPTIONS.
-    CFLAGS_UBSAN="-fno-omit-frame-pointer -fno-common -fsanitize=undefined"
-    CFLAGS_FOR_OVS="${CFLAGS_FOR_OVS} ${CFLAGS_UBSAN}"
+    CFLAGS_UBSAN="-fsanitize=undefined"
+    CFLAGS_FOR_OVS="${CFLAGS_FOR_OVS} ${CFLAGS_ASAN} ${CFLAGS_UBSAN}"
 fi
 
 OPTS="${EXTRA_OPTS} ${OPTS} $*"
diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml
index 82675b973..9f518ff01 100644
--- a/.github/workflows/build-and-test.yml
+++ b/.github/workflows/build-and-test.yml
@@ -9,14 +9,13 @@  jobs:
         automake libtool gcc bc libjemalloc2 libjemalloc-dev    \
         libssl-dev llvm-dev libelf-dev libnuma-dev libpcap-dev  \
         ninja-build selinux-policy-dev libbpf-dev
-      ASAN:        ${{ matrix.asan }}
-      UBSAN:       ${{ matrix.ubsan }}
       CC:          ${{ matrix.compiler }}
       DPDK:        ${{ matrix.dpdk }}
       DPDK_SHARED: ${{ matrix.dpdk_shared }}
       LIBS:        ${{ matrix.libs }}
       M32:         ${{ matrix.m32 }}
       OPTS:        ${{ matrix.opts }}
+      SANITIZERS:  ${{ matrix.sanitizers }}
       TESTSUITE:   ${{ matrix.testsuite }}
 
     name: linux ${{ join(matrix.*, ' ') }}
@@ -36,10 +35,7 @@  jobs:
             testsuite:    test
           - compiler:     clang
             testsuite:    test
-            asan:         asan
-          - compiler:     clang
-            testsuite:    test
-            ubsan:        ubsan
+            sanitizers:   sanitizers
 
           - compiler:     gcc
             testsuite:    test