Skip to content

Commit 8a2749d

Browse files
author
Kernel Patches Daemon
committed
adding ci files
1 parent d54d06a commit 8a2749d

File tree

12 files changed

+6143
-18
lines changed

12 files changed

+6143
-18
lines changed

.github/actions/vmtest/action.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: 'vmtest'
2+
description: 'Build + run vmtest'
3+
inputs:
4+
arch:
5+
description: 'what arch to test'
6+
required: true
7+
default: 'x86_64'
8+
runs:
9+
using: "composite"
10+
steps:
11+
# 1. Setup environment
12+
- name: Setup build environment
13+
uses: libbpf/ci/setup-build-env@master
14+
# 2. Build
15+
- name: Build kernel image
16+
shell: bash
17+
run: ${GITHUB_ACTION_PATH}/build.sh ${{ inputs.arch }}
18+
- name: Build selftests
19+
shell: bash
20+
run: ${GITHUB_ACTION_PATH}/build_selftests.sh
21+
env:
22+
VMLINUX_BTF: ${{ github.workspace }}/vmlinux
23+
# 3. Test
24+
- name: Prepare rootfs
25+
uses: libbpf/ci/prepare-rootfs@master
26+
with:
27+
project-name: 'libbpf'
28+
arch: ${{ inputs.arch }}
29+
kernel-root: '.'
30+
- name: Run selftests
31+
uses: libbpf/ci/run-qemu@master
32+
with:
33+
arch: ${{ inputs.arch}}
34+
img: '/tmp/root.img'
35+
vmlinuz: '${{ github.workspace }}/vmlinuz'

.github/actions/vmtest/build.sh

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/bin/bash
2+
3+
set -euo pipefail
4+
5+
ARCH="$1"
6+
7+
THISDIR="$(cd $(dirname $0) && pwd)"
8+
9+
source "${THISDIR}"/helpers.sh
10+
11+
travis_fold start build_kernel "Building kernel"
12+
13+
cp ${GITHUB_WORKSPACE}/travis-ci/vmtest/configs/config-latest.${ARCH} .config
14+
15+
make -j $((4*$(nproc))) olddefconfig all > /dev/null
16+
17+
travis_fold end build_kernel
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
#!/bin/bash
2+
3+
set -euo pipefail
4+
5+
THISDIR="$(cd $(dirname $0) && pwd)"
6+
7+
source "${THISDIR}"/helpers.sh
8+
9+
travis_fold start prepare_selftests "Building selftests"
10+
11+
LLVM_VER=15
12+
LIBBPF_PATH="${REPO_ROOT}"
13+
14+
PREPARE_SELFTESTS_SCRIPT=${THISDIR}/prepare_selftests-${KERNEL}.sh
15+
if [ -f "${PREPARE_SELFTESTS_SCRIPT}" ]; then
16+
(cd "${REPO_ROOT}/${REPO_PATH}/tools/testing/selftests/bpf" && ${PREPARE_SELFTESTS_SCRIPT})
17+
fi
18+
19+
if [[ "${KERNEL}" = 'LATEST' ]]; then
20+
VMLINUX_H=
21+
else
22+
VMLINUX_H=${THISDIR}/vmlinux.h
23+
fi
24+
25+
cd ${REPO_ROOT}/${REPO_PATH}
26+
make \
27+
CLANG=clang-${LLVM_VER} \
28+
LLC=llc-${LLVM_VER} \
29+
LLVM_STRIP=llvm-strip-${LLVM_VER} \
30+
VMLINUX_BTF="${VMLINUX_BTF}" \
31+
VMLINUX_H="${VMLINUX_H}" \
32+
-C "${REPO_ROOT}/${REPO_PATH}/tools/testing/selftests/bpf" \
33+
-j $((4*$(nproc))) > /dev/null
34+
cd -
35+
mkdir "${LIBBPF_PATH}"/selftests
36+
cp -R "${REPO_ROOT}/${REPO_PATH}/tools/testing/selftests/bpf" \
37+
"${LIBBPF_PATH}"/selftests
38+
cd "${LIBBPF_PATH}"
39+
rm selftests/bpf/.gitignore
40+
git add selftests
41+
42+
travis_fold end prepare_selftests

.github/actions/vmtest/helpers.sh

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# $1 - start or end
2+
# $2 - fold identifier, no spaces
3+
# $3 - fold section description
4+
travis_fold() {
5+
local YELLOW='\033[1;33m'
6+
local NOCOLOR='\033[0m'
7+
if [ -z ${GITHUB_WORKFLOW+x} ]; then
8+
echo travis_fold:$1:$2
9+
if [ ! -z "${3:-}" ]; then
10+
echo -e "${YELLOW}$3${NOCOLOR}"
11+
fi
12+
echo
13+
else
14+
if [ $1 = "start" ]; then
15+
line="::group::$2"
16+
if [ ! -z "${3:-}" ]; then
17+
line="$line - ${YELLOW}$3${NOCOLOR}"
18+
fi
19+
else
20+
line="::endgroup::"
21+
fi
22+
echo -e "$line"
23+
fi
24+
}
25+
26+
__print() {
27+
local TITLE=""
28+
if [[ -n $2 ]]; then
29+
TITLE=" title=$2"
30+
fi
31+
echo "::$1${TITLE}::$3"
32+
}
33+
34+
# $1 - title
35+
# $2 - message
36+
print_error() {
37+
__print error $1 $2
38+
}
39+
40+
# $1 - title
41+
# $2 - message
42+
print_notice() {
43+
__print notice $1 $2
44+
}

.github/workflows/test.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: bpf-ci
2+
3+
on:
4+
pull_request:
5+
6+
concurrency:
7+
group: ci-test-${{ github.head_ref }}
8+
cancel-in-progress: true
9+
10+
jobs:
11+
VM_Test:
12+
runs-on: ${{ matrix.runs_on }}
13+
name: Kernel ${{ matrix.kernel }} on ${{ matrix.runs_on }} + selftests
14+
timeout-minutes: 100
15+
strategy:
16+
fail-fast: false
17+
matrix:
18+
include:
19+
- kernel: 'LATEST'
20+
runs_on: ubuntu-latest
21+
arch: 'x86_64'
22+
- kernel: 'LATEST'
23+
runs_on: z15
24+
arch: 's390x'
25+
env:
26+
AUTHOR_EMAIL: "$(git log -1 --pretty=\"%aE\")"
27+
KERNEL: LATEST
28+
REPO_ROOT: ${{ github.workspace }}
29+
REPO_PATH: ""
30+
steps:
31+
- uses: actions/checkout@v2
32+
- if: ${{ github.repository != 'kernel-patches/bpf' && github.repository != 'kernel-patches/bpf-rc' }}
33+
name: Download bpf-next tree
34+
uses: libbpf/ci/get-linux-source@master
35+
with:
36+
dest: '.kernel'
37+
- if: ${{ github.repository != 'kernel-patches/bpf' && github.repository != 'kernel-patches/bpf-rc' }}
38+
name: Move linux source in place
39+
shell: bash
40+
run: |
41+
rm -rf .kernel/.git
42+
cp -rf .kernel/. .
43+
rm -rf .kernel
44+
- uses: libbpf/ci/patch-kernel@master
45+
with:
46+
patches-root: '${{ github.workspace }}/travis-ci/diffs'
47+
repo-root: '${{ github.workspace }}'
48+
- uses: ./.github/actions/vmtest
49+
with:
50+
arch: ${{ matrix.arch }}

README

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +0,0 @@
1-
Linux kernel
2-
============
3-
4-
There are several guides for kernel developers and users. These guides can
5-
be rendered in a number of formats, like HTML and PDF. Please read
6-
Documentation/admin-guide/README.rst first.
7-
8-
In order to build the documentation, use ``make htmldocs`` or
9-
``make pdfdocs``. The formatted documentation can also be read online at:
10-
11-
https://www.kernel.org/doc/html/latest/
12-
13-
There are various text files in the Documentation/ subdirectory,
14-
several of them using the Restructured Text markup notation.
15-
16-
Please read the Documentation/process/changes.rst file, as it contains the
17-
requirements for building and running the kernel, and information about
18-
the problems which may result by upgrading your kernel.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# TEMPORARY
2+
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# TEMPORARY
2+
atomics # attach(add): actual -524 <= expected 0 (trampoline)
3+
bpf_iter_setsockopt # JIT does not support calling kernel function (kfunc)
4+
bloom_filter_map # failed to find kernel BTF type ID of '__x64_sys_getpgid': -3 (?)
5+
bpf_tcp_ca # JIT does not support calling kernel function (kfunc)
6+
bpf_loop # attaches to __x64_sys_nanosleep
7+
bpf_mod_race # BPF trampoline
8+
bpf_nf # JIT does not support calling kernel function
9+
core_read_macros # unknown func bpf_probe_read#4 (overlapping)
10+
d_path # failed to auto-attach program 'prog_stat': -524 (trampoline)
11+
dummy_st_ops # test_run unexpected error: -524 (errno 524) (trampoline)
12+
fentry_fexit # fentry attach failed: -524 (trampoline)
13+
fentry_test # fentry_first_attach unexpected error: -524 (trampoline)
14+
fexit_bpf2bpf # freplace_attach_trace unexpected error: -524 (trampoline)
15+
fexit_sleep # fexit_skel_load fexit skeleton failed (trampoline)
16+
fexit_stress # fexit attach failed prog 0 failed: -524 (trampoline)
17+
fexit_test # fexit_first_attach unexpected error: -524 (trampoline)
18+
get_func_args_test # trampoline
19+
get_func_ip_test # get_func_ip_test__attach unexpected error: -524 (trampoline)
20+
get_stack_raw_tp # user_stack corrupted user stack (no backchain userspace)
21+
kfree_skb # attach fentry unexpected error: -524 (trampoline)
22+
kfunc_call # 'bpf_prog_active': not found in kernel BTF (?)
23+
ksyms_module # test_ksyms_module__open_and_load unexpected error: -9 (?)
24+
ksyms_module_libbpf # JIT does not support calling kernel function (kfunc)
25+
ksyms_module_lskel # test_ksyms_module_lskel__open_and_load unexpected error: -9 (?)
26+
modify_return # modify_return attach failed: -524 (trampoline)
27+
module_attach # skel_attach skeleton attach failed: -524 (trampoline)
28+
kprobe_multi_test # relies on fentry
29+
netcnt # failed to load BPF skeleton 'netcnt_prog': -7 (?)
30+
probe_user # check_kprobe_res wrong kprobe res from probe read (?)
31+
recursion # skel_attach unexpected error: -524 (trampoline)
32+
ringbuf # skel_load skeleton load failed (?)
33+
sk_assign # Can't read on server: Invalid argument (?)
34+
sk_lookup # endianness problem
35+
sk_storage_tracing # test_sk_storage_tracing__attach unexpected error: -524 (trampoline)
36+
skc_to_unix_sock # could not attach BPF object unexpected error: -524 (trampoline)
37+
socket_cookie # prog_attach unexpected error: -524 (trampoline)
38+
stacktrace_build_id # compare_map_keys stackid_hmap vs. stackmap err -2 errno 2 (?)
39+
tailcalls # tail_calls are not allowed in non-JITed programs with bpf-to-bpf calls (?)
40+
task_local_storage # failed to auto-attach program 'trace_exit_creds': -524 (trampoline)
41+
test_bpffs # bpffs test failed 255 (iterator)
42+
test_bprm_opts # failed to auto-attach program 'secure_exec': -524 (trampoline)
43+
test_ima # failed to auto-attach program 'ima': -524 (trampoline)
44+
test_local_storage # failed to auto-attach program 'unlink_hook': -524 (trampoline)
45+
test_lsm # failed to find kernel BTF type ID of '__x64_sys_setdomainname': -3 (?)
46+
test_overhead # attach_fentry unexpected error: -524 (trampoline)
47+
test_profiler # unknown func bpf_probe_read_str#45 (overlapping)
48+
timer # failed to auto-attach program 'test1': -524 (trampoline)
49+
timer_crash # trampoline
50+
timer_mim # failed to auto-attach program 'test1': -524 (trampoline)
51+
trace_ext # failed to auto-attach program 'test_pkt_md_access_new': -524 (trampoline)
52+
trace_printk # trace_printk__load unexpected error: -2 (errno 2) (?)
53+
trace_vprintk # trace_vprintk__open_and_load unexpected error: -9 (?)
54+
trampoline_count # prog 'prog1': failed to attach: ERROR: strerror_r(-524)=22 (trampoline)
55+
verif_stats # trace_vprintk__open_and_load unexpected error: -9 (?)
56+
vmlinux # failed to auto-attach program 'handle__fentry': -524 (trampoline)
57+
xdp_adjust_tail # case-128 err 0 errno 28 retval 1 size 128 expect-size 3520 (?)
58+
xdp_bonding # failed to auto-attach program 'trace_on_entry': -524 (trampoline)
59+
xdp_bpf2bpf # failed to auto-attach program 'trace_on_entry': -524 (trampoline)
60+
map_kptr # failed to open_and_load program: -524 (trampoline)
61+
bpf_cookie # failed to open_and_load program: -524 (trampoline)
62+
xdp_do_redirect # prog_run_max_size unexpected error: -22 (errno 22)
63+
send_signal # intermittently fails to receive signal
64+
select_reuseport # intermittently fails on new s390x setup

0 commit comments

Comments
 (0)