diff options
| author | Sergey V. Lobanov <svlobanov@users.noreply.github.com> | 2025-09-06 22:59:45 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-09-06 22:59:45 +0300 |
| commit | a1ea24c51af8f911cd776338cc19c0c9e4df27fa (patch) | |
| tree | 4275da3278f5f7c22fb8431310f80617d352a5bf /.github/workflows | |
| parent | 5b876695127bafde4a35dd037831f7fe5f665dca (diff) | |
| parent | c1529bcf0f788ee61097a818fff3a8e27d473e61 (diff) | |
| download | accel-ppp-a1ea24c51af8f911cd776338cc19c0c9e4df27fa.tar.gz accel-ppp-a1ea24c51af8f911cd776338cc19c0c9e4df27fa.zip | |
Merge pull request #256 from svlobanov/asan-ubsan
ci: add tests execution with asan and ubsan
Diffstat (limited to '.github/workflows')
| -rw-r--r-- | .github/workflows/run-tests-asan-ubsan.yml | 75 |
1 files changed, 75 insertions, 0 deletions
diff --git a/.github/workflows/run-tests-asan-ubsan.yml b/.github/workflows/run-tests-asan-ubsan.yml new file mode 100644 index 00000000..81fa2fb0 --- /dev/null +++ b/.github/workflows/run-tests-asan-ubsan.yml @@ -0,0 +1,75 @@ +name: Run tests with ASAN and UBSAN + +on: + workflow_dispatch: + pull_request: + push: + branches: + - master + +jobs: + Test-in-GH-ASAN-UBSAN: + strategy: + fail-fast: false + matrix: + include: + - distro: "ubuntu-latest" + sanitizer: "address" + env_name: "ASAN_OPTIONS" + env_value: "abort_on_error=1:detect_leaks=1:print_stacktrace=1" + - distro: "ubuntu-latest" + sanitizer: "undefined" + env_name: "UBSAN_OPTIONS" + env_value: "print_stacktrace=1" + + runs-on: ${{ matrix.distro }} + steps: + - name: Install build tools (using apt) + run: > + sudo apt update && + NEEDRESTART_SUSPEND=1 DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true sudo -E apt -y install + git build-essential cmake gcc linux-headers-`uname -r` + libpcre2-dev libssl-dev liblua5.1-0-dev kmod python3-pip + iproute2 ppp pppoe isc-dhcp-client + + - name: Install testing tools (using pip) + run: > + sudo apt -y install python3-pytest python3-pytest-dependency python3-pytest-order || + sudo pip3 install pytest pytest-dependency pytest-order || + sudo pip3 install --break-system-packages pytest pytest-dependency pytest-order + + - name: Check out repository code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: mkdir build + run: mkdir build + + - name: cmake (with ${{ matrix.sanitizer }}) + working-directory: ./build + run: > + CFLAGS="-fsanitize=${{ matrix.sanitizer }} -fno-sanitize-recover=all -fno-omit-frame-pointer -O2 -g" + LDFLAGS="-fsanitize=${{ matrix.sanitizer }}" + cmake -DBUILD_IPOE_DRIVER=TRUE -DBUILD_VLAN_MON_DRIVER=TRUE -DCMAKE_INSTALL_PREFIX=/usr + -DKDIR=/usr/src/linux-headers-`uname -r` + -DLUA=TRUE -DSHAPER=TRUE -DRADIUS=TRUE .. + + - name: make && make install + working-directory: ./build + run: make && sudo make install + + - name: Insert and check kernel modules (ipoe and vlan-mon) + # if: ${{ false }} + run: | + sudo insmod build/drivers/vlan_mon/driver/vlan_mon.ko + sudo insmod build/drivers/ipoe/driver/ipoe.ko + lsmod | grep ipoe + lsmod | grep vlan_mon + + - name: Run tests + timeout-minutes: 5 + working-directory: ./tests + env: + ${{ matrix.env_name }}: ${{ matrix.env_value }} + run: sudo -E python3 -m pytest -Wall --order-dependencies -v
\ No newline at end of file |
