From 99921245f01c82939aefe6f2d9874f251266d271 Mon Sep 17 00:00:00 2001 From: Julia Kartseva Date: Sat, 4 Apr 2020 23:56:00 -0700 Subject: [PATCH] vmtest: update root fs, whitelist sk_{assign|lookup} test 1. Update mkrootfs.sh building root fs - Remove /etc/fstab from root fs and mount each fs type separately in S10-mount script. - devtmpfs can be already mounted prior to S10-mount execution so make it opt-out. This addresses [0]. - set -eux for scripts 2. Add iproute2 to root fs and whitelist sk_assign test. Addresses [1][2]. Update INDEX file with 2020-09-27 version. [0] https://github.com/libbpf/libbpf/pull/145#issuecomment-609673493 [1] https://github.com/libbpf/libbpf/pull/144 [2] https://github.com/libbpf/libbpf/pull/145 --- travis-ci/vmtest/configs/INDEX | 2 +- .../vmtest/configs/blacklist/BLACKLIST-latest | 2 -- travis-ci/vmtest/mkrootfs.sh | 30 ++++++++++++------- travis-ci/vmtest/run.sh | 2 +- 4 files changed, 22 insertions(+), 14 deletions(-) diff --git a/travis-ci/vmtest/configs/INDEX b/travis-ci/vmtest/configs/INDEX index 3439ef4..dc6f341 100644 --- a/travis-ci/vmtest/configs/INDEX +++ b/travis-ci/vmtest/configs/INDEX @@ -1,5 +1,5 @@ INDEX https://libbpf-vmtest.s3-us-west-1.amazonaws.com/x86_64/INDEX -libbpf-vmtest-rootfs-2020.03.11.tar.zst https://libbpf-vmtest.s3-us-west-1.amazonaws.com/x86_64/libbpf-vmtest-rootfs-2020.03.11.tar.zst +libbpf-vmtest-rootfs-2020.09.27.tar.zst https://libbpf-vmtest.s3-us-west-1.amazonaws.com/x86_64/libbpf-vmtest-rootfs-2020.09.27.tar.zst vmlinux-4.9.0.zst https://libbpf-vmtest.s3-us-west-1.amazonaws.com/x86_64/vmlinux-4.9.0.zst vmlinux-5.5.0-rc6.zst https://libbpf-vmtest.s3-us-west-1.amazonaws.com/x86_64/vmlinux-5.5.0-rc6.zst vmlinux-5.5.0.zst https://libbpf-vmtest.s3-us-west-1.amazonaws.com/x86_64/vmlinux-5.5.0.zst diff --git a/travis-ci/vmtest/configs/blacklist/BLACKLIST-latest b/travis-ci/vmtest/configs/blacklist/BLACKLIST-latest index 897f6ab..d95008a 100644 --- a/travis-ci/vmtest/configs/blacklist/BLACKLIST-latest +++ b/travis-ci/vmtest/configs/blacklist/BLACKLIST-latest @@ -1,7 +1,5 @@ # TEMPORARILY DISABLED send_signal # flaky test_lsm # semi-working -sk_assign # needs better setup in Travis CI -sk_lookup core_reloc # temporary test breakage bpf_verif_scale # clang regression diff --git a/travis-ci/vmtest/mkrootfs.sh b/travis-ci/vmtest/mkrootfs.sh index 6928240..be43b44 100755 --- a/travis-ci/vmtest/mkrootfs.sh +++ b/travis-ci/vmtest/mkrootfs.sh @@ -81,6 +81,7 @@ packages=( binutils elfutils glibc + iproute2 # selftests test_verifier dependencies. libcap ) @@ -101,15 +102,6 @@ rm -rf "$root/usr/share/{doc,help,man,texinfo}" chroot "${root}" /bin/busybox --install -cat > "$root/etc/fstab" << "EOF" -dev /dev devtmpfs rw,nosuid 0 0 -proc /proc proc rw,nosuid,nodev,noexec 0 0 -sys /sys sysfs rw,nosuid,nodev,noexec 0 0 -debugfs /sys/kernel/debug debugfs mode=755,realtime 0 0 -bpffs /sys/fs/bpf bpf realtime 0 0 -EOF -chmod 644 "$root/etc/fstab" - cat > "$root/etc/inittab" << "EOF" ::sysinit:/etc/init.d/rcS ::ctrlaltdel:/sbin/reboot @@ -123,13 +115,29 @@ mkdir -m 755 "$root/etc/init.d" "$root/etc/rcS.d" cat > "$root/etc/rcS.d/S10-mount" << "EOF" #!/bin/sh -/bin/mount -a +set -eux + +/bin/mount proc /proc -t proc + +# Mount devtmpfs if not mounted +if [[ -z $(/bin/mount -l -t devtmpfs) ]]; then + /bin/mount devtmpfs /dev -t devtmpfs +fi + +/bin/mount sysfs /sys -t sysfs +/bin/mount bpffs /sys/fs/bpf -t bpf +/bin/mount debugfs /sys/kernel/debug -t debugfs + +echo 'Listing currently mounted file systems' +/bin/mount EOF chmod 755 "$root/etc/rcS.d/S10-mount" cat > "$root/etc/rcS.d/S40-network" << "EOF" #!/bin/sh +set -eux + ip link set lo up EOF chmod 755 "$root/etc/rcS.d/S40-network" @@ -137,6 +145,8 @@ chmod 755 "$root/etc/rcS.d/S40-network" cat > "$root/etc/init.d/rcS" << "EOF" #!/bin/sh +set -eux + for path in /etc/rcS.d/S*; do [ -x "$path" ] && "$path" done diff --git a/travis-ci/vmtest/run.sh b/travis-ci/vmtest/run.sh index 4538d1a..323690a 100755 --- a/travis-ci/vmtest/run.sh +++ b/travis-ci/vmtest/run.sh @@ -411,7 +411,7 @@ if [[ ! -z SETUPCMD ]]; then if [[ -v BUILDDIR ]]; then kernel='latest'; fi setup_envvars="export KERNEL=${kernel}" setup_script=$(printf "#!/bin/sh -set -e +set -eux echo 'Running setup commands' %s