vmtest: libbpf#137 follow-ups

- Run test_{maps|verifier} only with the latest kernel
- Mount run control script
- Style

Signed-off-by: Julia Kartseva (hex@fb.com)
This commit is contained in:
Julia Kartseva
2020-03-11 14:48:35 -07:00
committed by Andrii Nakryiko
parent 9a424bea42
commit ef4785f065
2 changed files with 16 additions and 18 deletions

View File

@@ -97,10 +97,7 @@ rm -rf "$root/var/lib/pacman/sync/"
"$root/usr/lib/libgfortran."* \
"$root/usr/lib/libgo."*
# We don't need any documentation.
rm -rf "$root/usr/share/doc" \
"$root/usr/share/help" \
"$root/usr/share/man" \
"$root/usr/share/texinfo"
rm -rf "$root/usr/share/{doc,help,man,texinfo}"
chroot "${root}" /bin/busybox --install
@@ -123,18 +120,23 @@ EOF
chmod 644 "$root/etc/inittab"
mkdir -m 755 "$root/etc/init.d" "$root/etc/rcS.d"
cat > "$root/etc/rcS.d/S40network" << "EOF"
cat > "$root/etc/rcS.d/S10-mount" << "EOF"
#!/bin/sh
/bin/mount -a
EOF
chmod 755 "$root/etc/rcS.d/S10-mount"
cat > "$root/etc/rcS.d/S40-network" << "EOF"
#!/bin/sh
ip link set lo up
EOF
chmod 755 "$root/etc/rcS.d/S40network"
chmod 755 "$root/etc/rcS.d/S40-network"
cat > "$root/etc/init.d/rcS" << "EOF"
#!/bin/sh
/bin/mount -a
for path in /etc/rcS.d/S*; do
[ -x "$path" ] && "$path"
done

View File

@@ -10,7 +10,7 @@ test_progs() {
test_maps() {
echo TEST_MAPS
# Allow failing on older kernels.
./test_maps || [ ${KERNEL} != 'LATEST' ]
./test_maps
}
test_verifier() {
@@ -31,13 +31,9 @@ fi
cd libbpf/selftests/bpf
set +e
exitcode=0
for test_func in test_progs test_maps test_verifier; do
${test_func}; c=$?
if [[ $c -ne 0 ]]; then
exitcode=$c
fi
done
test_progs
exit $exitcode
if [[ "${KERNEL}" == 'latest' ]]; then
test_maps
test_verifier
fi