Do both builds and selftest runs as part of a single build step. This would
allow to complete CI testing faster, as builds will happen in parallel with
"Kernel LATEST + selftests" run.
Also re-enable s390x build.
Signed-off-by: Andrii Nakryiko <andriin@fb.com>
Put selftests in first stage. Put long-running LATEST build & test case first,
so that it can be better parallelized with 4.9 and 5.5.
Signed-off-by: Andrii Nakryiko <andriin@fb.com>
Make sure that libbpf sanitizes BTF properly for older kernels.
Add a stage for 4.9.0 kernel in TravisCI.
For now make test failures non-blocking by adding 4.9.0 to `allow_failures`
section.
Blacklist is copy-pasted 5.5.0 kernel blacklist.
Disable a bunch of new kernel selftests that can't succeed on 5.5 kernel.
Flatten Travis tests into a single stage to parallelize and speed them up.
Signed-off-by: Andrii Nakryiko <andriin@fb.com>
Build latest pahole from sources and not rely on hacky Ubuntu repository
approach.
Also enable tests for latest kernel that rely on pahole 1.16.
Signed-off-by: Andrii Nakryiko <andriin@fb.com>
Clean up Travis CI config, extract multi-step initializations into scripts.
Also, move kernel-building tests to happen last to not block lightweight
Debian and Ubuntu tests.
Signed-off-by: Andrii Nakryiko <andriin@fb.com>
- The previously introduced git fetch depth of bpf-next tree is not sufficient
when bpf-next tree is far ahead from libbpf checkpoint commit, so increase the
depth up to 128 max. Since 128 may be an overkill for a general case, increase
exponentially in a loop until max is reached.
- Do not fetch bpf-next twice
- Remove setup_example.sh
Run kernel selftests in vmtest with the goal to test libbpf backward
compatibility with older kernels.
The list of kernels should be specified in .travis.yml config in
`jobs` section, e.g. KERNEL=5.5.0.
Enlisted kernel releases
- 5.5.0 # built from main
- 5.5.0-rc6 # built from bpf-next
- LATEST
The kernel specified as 'LATEST' in .travis.yml is built from bpf-next kernel
tree, the rest of the kernels are downloaded from the specified in INDEX file.
The kernel sources from bpf-next are manually patched with [1] from bpf tree to
fix ranqslower build. This workaround should be removed after the patch is merged
from bpf to bpf-next tree.
Due to kernel sources being checked out the duration of the LATEST kernel test is
~30m.
bpf selftests are built from tools/testing/selftests/bpf/ of bpf-next tree with
HEAD revision set to CHECKPOINT-COMMIT specified in libbpf so selftests and
libbpf are in sync.
Currently only programs are tested with test_progs program, test_maps and
test_verifier should follow.
test_progs are run with blacklist required due to:
- some features, e.g. fentry/fexit are not supported in older kernels
- environment limitations, e.g an absence of the recent pahole in Debian
- incomplete disk image
The blacklist is passed to test_progs with -b option as specified in [2]
patch set.
Most of the preceeding tests are disabled due to incomplete disk image currenly
lacking proper networking settings.
For the LATEST kernel fome fentry/fexit tests are disabled due to pahole v1.16
is not abailible in Debian yet.
Next steps are resolving issues with blacklisted tests, enabling maps and
verifier testing, expanding the list of tested kernels.
[1] https://lore.kernel.org/bpf/908498f794661c44dca54da9e09dc0c382df6fcb.1580425879.git.hex@fb.com/t.mbox.gz
[2] https://www.spinics.net/lists/netdev/msg625192.html
A follow up of [1]
Travis CI stages use default phases when no override provided.
This leads to Coverity scan stage fail due to execuing the default
before_script: phase of VMTEST.
Fix this with an explicit override with empty value.
[1] https://github.com/libbpf/libbpf/pull/108
Extend continuous integration tests by adding testing against various kernel
versions.
The code is based on vmtest CI scripts implemented by osandov@
for drgn [1] with the following modifications:
- The downloadables are stored in Amazon S3 cloud indexed in [2]
- `--setup-cmd` command line option is added to vmtest/run.sh so
setup commands run on VM boot can be set in e.g. `.travis.yml`
- Travis build matrix [2] is introduced for VM tests so VM tests are
followed by the existing CI tests. The matrix has `KERNEL` and
`VMTEST_SETUPCMD` dimensions.
- Minor style fixes.
The vmtest extention code is located in travis-ci/vmtest and contains
`run.sh` and `setup_example.sh`
- `run.sh` is responsible for the vmtest workflow: downloading vmlinux
and rootfs image from the cloud, fs mounting, syncing libbpf sources
to the image, setting up scripts run on VM boot, starting VM using
QEMU.
`run.sh` covers more use cases than a script for a job run in TravisCI,
e.g. int can build a kernel w/ `--build` option.
- `setup_example.sh` is an example of a script run in VM which can be
modified to e.g. run actual libbpf tests. A setup script should have
executable permission.
To set up a new kernel version for a test:
1) upload vmlinuz.* and vmlinux.*\.zst to Amazon S3 store
located at [4];
2) modify INDEX [2] file.
[1] https://github.com/osandov/drgn
[2] https://libbpf-vmtest.s3-us-west-1.amazonaws.com/x86_64/INDEX
[3] https://docs.travis-ci.com/user/build-matrix
[4] https://libbpf-vmtest.s3-us-west-1.amazonaws.com/
The main reason why this is necessary is that gcc 5.x on Xenial doesn't
support ASan on s390x. Bumping the release to Bionic with gcc 7.x allows
us to build libbpf on s390x with ASan without issues.
In order to libbpf to be used in systemd some testing is required, see related
discussions in https://github.com/systemd/systemd/pull/12151 and
https://github.com/libbpf/libbpf/pull/29
The tests introduced here mirrors the tests of systemd:
For Debian: build with gcc, gcc + asan, clang, clang + asan
Debian tests use `docker` virtualization
Fror Ubuntu Xenial: build with gcc
The differences:
Install only libelf and it's dependencies.
Instead of Meson build system `make` is used, so `make` remains the preferred
method of building and `meson.build` doesn't get rooted in `libbpf`.
`travis_wait.bash` is kept as a workaround for
https://github.com/travis-ci/travis-ci/issues/9979
An example of testing UI: https://travis-ci.org/wat-ze-hex/libbpf