Skip to content

Migrate test_xsk.sh in test_progs #8820

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
27c7945
adding ci files
Apr 21, 2025
ac129a6
selftests/bpf: Integrate test_xsk.c to test_progs framework
bastien-curutchet Feb 18, 2025
21ce829
selftests/bpf: test_xsk: Add xsk_verbose()
bastien-curutchet Mar 19, 2025
3b6973a
selftests/bpf: test_xsk: Split xskxceiver
bastien-curutchet Mar 18, 2025
e2c440b
selftests/bpf: test_xsk: Initialize bitmap before use
bastien-curutchet Mar 18, 2025
c93dc07
selftests/bpf: test_xsk: Fix memory leaks
bastien-curutchet Mar 18, 2025
1b4b68d
selftests/bpf: test_xsk: Wrap test clean-up in functions
bastien-curutchet Mar 19, 2025
12dd2ac
selftests/bpf: test_xsk: Release resources when swap fails
bastien-curutchet Mar 19, 2025
8681114
selftests/bpf: test_xsk: Wrap ksft_*() behind macros
bastien-curutchet Mar 18, 2025
a22c967
selftests/bpf: test_xsk: Abstract log behaviour
bastien-curutchet Feb 25, 2025
f93b8a7
selftests/bpf: test_xsk: Add return value to init_iface()
bastien-curutchet Mar 18, 2025
d745013
selftests/bpf: test_xsk: Don't exit immediately when xsk_attach fails
bastien-curutchet Mar 18, 2025
5c3f484
selftests/bpf: test_xsk: Don't exit immediately when gettimeofday fails
bastien-curutchet Mar 18, 2025
cc57939
selftests/bpf: test_xsk: Don't exit immediately when workers fail
bastien-curutchet Mar 19, 2025
a7781c6
selftests/bpf: test_xsk: Don't exit immediately if validate_traffic f…
bastien-curutchet Mar 5, 2025
905d32d
selftests/bpf: test_xsk: Don't exit immediately on allocation failures
bastien-curutchet Mar 5, 2025
b09fa78
selftests/bpf: test_xsk: Isolate flaky tests
bastien-curutchet Mar 4, 2025
dfec309
selftests/bpf: test_xsk: Integrate test_xsk.c to test_progs framework
bastien-curutchet Feb 26, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions .github/actions/veristat_baseline_compare/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: 'run-veristat'
description: 'Run veristat benchmark'
inputs:
veristat_output:
description: 'Veristat output filepath'
required: true
baseline_name:
description: 'Veristat baseline cache name'
required: true
runs:
using: "composite"
steps:
- uses: actions/upload-artifact@v4
with:
name: ${{ inputs.baseline_name }}
if-no-files-found: error
path: ${{ github.workspace }}/${{ inputs.veristat_output }}

# For pull request:
# - get baseline log from cache
# - compare it to current run
- if: ${{ github.event_name == 'pull_request' }}
uses: actions/cache/restore@v4
with:
key: ${{ inputs.baseline_name }}-${{ github.base_ref }}
restore-keys: |
${{ inputs.baseline_name }}-
path: '${{ github.workspace }}/${{ inputs.baseline_name }}'

- if: ${{ github.event_name == 'pull_request' }}
name: Show veristat comparison
shell: bash
run: ./.github/scripts/compare-veristat-results.sh
env:
BASELINE_PATH: ${{ github.workspace }}/${{ inputs.baseline_name }}
VERISTAT_OUTPUT: ${{ inputs.veristat_output }}

# For push: just put baseline log to cache
- if: ${{ github.event_name == 'push' }}
shell: bash
run: |
mv "${{ github.workspace }}/${{ inputs.veristat_output }}" \
"${{ github.workspace }}/${{ inputs.baseline_name }}"
- if: ${{ github.event_name == 'push' }}
uses: actions/cache/save@v4
with:
key: ${{ inputs.baseline_name }}-${{ github.ref_name }}-${{ github.run_id }}
path: '${{ github.workspace }}/${{ inputs.baseline_name }}'
18 changes: 18 additions & 0 deletions .github/scripts/compare-veristat-results.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash

if [[ ! -f "${BASELINE_PATH}" ]]; then
echo "# No ${BASELINE_PATH} available" >> "${GITHUB_STEP_SUMMARY}"

echo "No ${BASELINE_PATH} available"
echo "Printing veristat results"
cat "${VERISTAT_OUTPUT}"

exit
fi

selftests/bpf/veristat \
--output-format csv \
--emit file,prog,verdict,states \
--compare "${BASELINE_PATH}" "${VERISTAT_OUTPUT}" > compare.csv

python3 ./.github/scripts/veristat_compare.py compare.csv
30 changes: 30 additions & 0 deletions .github/scripts/download-gcc-bpf.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/bin/bash

set -euo pipefail

GCC_BPF_RELEASE_GH_REPO=$1
INSTALL_DIR=$(realpath $2)

cd /tmp

tag=$(gh release list -L 1 -R ${GCC_BPF_RELEASE_GH_REPO} --json tagName -q .[].tagName)
if [[ -z "$tag" ]]; then
echo "Could not find latest GCC BPF release at ${GCC_BPF_RELEASE_GH_REPO}"
exit 1
fi

url="https://github.com/${GCC_BPF_RELEASE_GH_REPO}/releases/download/${tag}/${tag}.tar.zst"
echo "Downloading $url"
wget -q "$url"

tarball=${tag}.tar.zst
dir=$(tar tf $tarball | head -1 || true)

echo "Extracting $tarball ..."
tar -I zstd -xf $tarball && rm -f $tarball

rm -rf $INSTALL_DIR
mv -v $dir $INSTALL_DIR

cd -

Loading
Loading