From a453ffb7ea98291ea900bc5a691980681ae05400 Mon Sep 17 00:00:00 2001 From: Ihor Solodrai Date: Wed, 6 Nov 2024 16:53:58 -0800 Subject: [PATCH] ci: add a vmtest step for setting up selftests run Signed-off-by: Ihor Solodrai --- .../build-selftests/build_selftests.sh | 10 ++--- .github/actions/vmtest/action.yml | 37 ++++++++++++++++++- 2 files changed, 38 insertions(+), 9 deletions(-) diff --git a/.github/actions/build-selftests/build_selftests.sh b/.github/actions/build-selftests/build_selftests.sh index aa8095d..3b46b77 100755 --- a/.github/actions/build-selftests/build_selftests.sh +++ b/.github/actions/build-selftests/build_selftests.sh @@ -8,8 +8,6 @@ source ${THISDIR}/helpers.sh foldable start prepare_selftests "Building selftests" -LIBBPF_PATH="${REPO_ROOT}" - llvm_latest_version() { echo "19" } @@ -50,11 +48,9 @@ make \ -C "${REPO_ROOT}/${REPO_PATH}/tools/testing/selftests/bpf" \ -j $((4*$(nproc))) > /dev/null cd - -mkdir ${LIBBPF_PATH}/selftests + +mkdir ${GITHUB_WORKSPACE}/selftests cp -R "${REPO_ROOT}/${REPO_PATH}/tools/testing/selftests/bpf" \ - ${LIBBPF_PATH}/selftests -cd ${LIBBPF_PATH} -rm selftests/bpf/.gitignore -git add selftests + ${GITHUB_WORKSPACE}/selftests foldable end prepare_selftests diff --git a/.github/actions/vmtest/action.yml b/.github/actions/vmtest/action.yml index 20d04ed..00f9a84 100644 --- a/.github/actions/vmtest/action.yml +++ b/.github/actions/vmtest/action.yml @@ -99,14 +99,47 @@ runs: repo-path: '.kernel' kernel: ${{ inputs.kernel }} llvm-version: ${{ inputs.llvm-version }} + + - name: Prepare to run selftests + env: + ALLOWLIST_FILE: /tmp/allowlist + DENYLIST_FILE: /tmp/denylist + KERNEL: ${{ inputs.kernel }} + SELFTESTS_BPF: ${{ github.workspace }}/selftests/bpf + VMTEST_CONFIGS: ${{ github.workspace }}/ci/vmtest/configs + shell: bash + run: | + cat "${SELFTESTS_BPF}/ALLOWLIST" \ + "${SELFTESTS_BPF}/ALLOWLIST.${ARCH}" \ + "${VMTEST_CONFIGS}/ALLOWLIST" \ + "${VMTEST_CONFIGS}/ALLOWLIST-${KERNEL}" \ + "${VMTEST_CONFIGS}/ALLOWLIST-${KERNEL}.${ARCH}" \ + 2> /dev/null > "${ALLOWLIST_FILE}" || true + + cat "${SELFTESTS_BPF}/DENYLIST" \ + "${SELFTESTS_BPF}/DENYLIST.${ARCH}" \ + "${VMTEST_CONFIGS}/DENYLIST" \ + "${VMTEST_CONFIGS}/DENYLIST-${KERNEL}" \ + "${VMTEST_CONFIGS}/DENYLIST-${KERNEL}.${ARCH}" \ + 2> /dev/null > "${DENYLIST_FILE}" || true + + if [[ "${{ inputs.kernel }}" == "4.9.0" ]]; then + echo "KERNEL_TEST=test_progs_no_alu32" >> $GITHUB_ENV + elif [[ "${{ inputs.kernel }}" == "5.5.0" ]]; then + echo "KERNEL_TEST=test_progs test_progs_no_alu32" >> $GITHUB_ENV + fi + # 4. Run selftest via vmtest tool (https://github.com/danobi/vmtest) - name: Run selftests env: + ALLOWLIST_FILE: /tmp/allowlist + DENYLIST_FILE: /tmp/denylist KERNEL: ${{ inputs.kernel }} + VMLINUX: ${{ github.workspace }}/vmlinux uses: theihor/libbpf-ci/run-vmtest@run-vmtest-v2 with: arch: ${{ inputs.arch }} kbuild-output: ${{ github.workspace }}/.kernel kernel-root: ${{ github.workspace }}/.kernel - img: '' # this is a required action input currently, but actually is not used - vmlinuz: ${{ github.workspace }}/vmlinux + kernel-test: ${{ env.KERNEL_TEST }} + vmlinuz: ${{ inputs.arch }}/vmlinuz-${{ inputs.kernel }}