From 8d9bc852159e0e49c9656cc21b9f019c8748d795 Mon Sep 17 00:00:00 2001 From: David Sterba Date: Thu, 30 May 2024 19:02:15 +0200 Subject: [PATCH] btrfs-progs: ci: add workflow for UBSAN and ASAN Run tests with enabled sanitizers. There are still known problems with leaks that will make the whole fail. This needs to be fixed before the workflow can be enabled for devel or master. Signed-off-by: David Sterba --- .github/workflows/ci-sanitize.yml | 93 +++++++++++++++++++++++++++++++ 1 file changed, 93 insertions(+) create mode 100644 .github/workflows/ci-sanitize.yml diff --git a/.github/workflows/ci-sanitize.yml b/.github/workflows/ci-sanitize.yml new file mode 100644 index 00000000..4f0e3850 --- /dev/null +++ b/.github/workflows/ci-sanitize.yml @@ -0,0 +1,93 @@ +# Run tests with sanitizers enabled +# - UBSAN - undefined behaviour (default) +# - ASAN - memory leaks etc +# +# There are known problems, for now only for targeted testing + +name: Sanitizer checks +run-name: Sanitizer checks +on: + push: + branches: + - sanitize-test +jobs: + build-ubsan: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - run: uname -a + - run: sudo modprobe btrfs + - run: sudo apt-get install -y pkg-config gcc liblzo2-dev libzstd-dev libblkid-dev uuid-dev zlib1g-dev libext2fs-dev e2fsprogs libudev-dev python3-sphinx libaio-dev liburing-dev attr jq + - name: Configure + run: ./autogen.sh && ./configure --disable-documentation + - name: Make + run: make V=1 D=ubsan + - name: Tests cli + run: sudo make D=ubsan TEST_LOG=dump test-cli + - name: Tests mkfs + run: sudo make D=ubsan TEST_LOG=dump test-mkfs + - name: Tests check + run: sudo make D=ubsan TEST_LOG=dump test-check + - name: Tests check (lowmem) + run: sudo make D=ubsan TEST_LOG=dump test-check-lowmem + - name: Tests misc + run: sudo make D=ubsan TEST_LOG=dump test-misc + - name: Tests fuzz + run: sudo make D=ubsan TEST_LOG=dump test-fuzz + - name: Tests convert + run: sudo make D=ubsan TEST_LOG=dump test-convert + - name: Test internal APIs + run: make D=ubsan test-api + - name: Libbtrfsutil test + run: make D=ubsan test-libbtrfsutil + - name: Libbtrfs build test + run: make D=ubsan library-test + - name: Tests hash (correctness) + run: make D=ubsan hash-vectest && ./hash-vectest + - name: Save logs on failure + if: ${{ failure() }} + uses: actions/upload-artifact@v4 + with: + name: test-results + path: "tests/*-results.txt" + if-no-files-found: ignore + build-asan: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - run: uname -a + - run: sudo modprobe btrfs + - run: sudo apt-get install -y pkg-config gcc liblzo2-dev libzstd-dev libblkid-dev uuid-dev zlib1g-dev libext2fs-dev e2fsprogs libudev-dev python3-sphinx libaio-dev liburing-dev attr jq + - name: Configure + run: ./autogen.sh && ./configure --disable-documentation + - name: Make + run: make V=1 D=asan + - name: Tests cli + run: sudo make D=asan TEST_LOG=dump test-cli + - name: Tests mkfs + run: sudo make D=asan TEST_LOG=dump test-mkfs + - name: Tests check + run: sudo make D=asan TEST_LOG=dump test-check + - name: Tests check (lowmem) + run: sudo make D=asan TEST_LOG=dump test-check-lowmem + - name: Tests misc + run: sudo make D=asan TEST_LOG=dump test-misc + - name: Tests fuzz + run: sudo make D=asan TEST_LOG=dump test-fuzz + - name: Tests convert + run: sudo make D=asan TEST_LOG=dump test-convert + - name: Test internal APIs + run: make D=asan test-api + - name: Libbtrfsutil test + run: make D=asan test-libbtrfsutil + - name: Libbtrfs build test + run: make D=asan library-test + - name: Tests hash (correctness) + run: make D=asan hash-vectest && ./hash-vectest + - name: Save logs on failure + if: ${{ failure() }} + uses: actions/upload-artifact@v4 + with: + name: test-results + path: "tests/*-results.txt" + if-no-files-found: ignore