mirror of
https://github.com/netdata/libbpf.git
synced 2026-04-05 08:09:07 +08:00
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:
committed by
Andrii Nakryiko
parent
9a424bea42
commit
ef4785f065
@@ -97,10 +97,7 @@ rm -rf "$root/var/lib/pacman/sync/"
|
|||||||
"$root/usr/lib/libgfortran."* \
|
"$root/usr/lib/libgfortran."* \
|
||||||
"$root/usr/lib/libgo."*
|
"$root/usr/lib/libgo."*
|
||||||
# We don't need any documentation.
|
# We don't need any documentation.
|
||||||
rm -rf "$root/usr/share/doc" \
|
rm -rf "$root/usr/share/{doc,help,man,texinfo}"
|
||||||
"$root/usr/share/help" \
|
|
||||||
"$root/usr/share/man" \
|
|
||||||
"$root/usr/share/texinfo"
|
|
||||||
|
|
||||||
chroot "${root}" /bin/busybox --install
|
chroot "${root}" /bin/busybox --install
|
||||||
|
|
||||||
@@ -123,18 +120,23 @@ EOF
|
|||||||
chmod 644 "$root/etc/inittab"
|
chmod 644 "$root/etc/inittab"
|
||||||
|
|
||||||
mkdir -m 755 "$root/etc/init.d" "$root/etc/rcS.d"
|
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
|
#!/bin/sh
|
||||||
|
|
||||||
ip link set lo up
|
ip link set lo up
|
||||||
EOF
|
EOF
|
||||||
chmod 755 "$root/etc/rcS.d/S40network"
|
chmod 755 "$root/etc/rcS.d/S40-network"
|
||||||
|
|
||||||
cat > "$root/etc/init.d/rcS" << "EOF"
|
cat > "$root/etc/init.d/rcS" << "EOF"
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
/bin/mount -a
|
|
||||||
|
|
||||||
for path in /etc/rcS.d/S*; do
|
for path in /etc/rcS.d/S*; do
|
||||||
[ -x "$path" ] && "$path"
|
[ -x "$path" ] && "$path"
|
||||||
done
|
done
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ test_progs() {
|
|||||||
test_maps() {
|
test_maps() {
|
||||||
echo TEST_MAPS
|
echo TEST_MAPS
|
||||||
# Allow failing on older kernels.
|
# Allow failing on older kernels.
|
||||||
./test_maps || [ ${KERNEL} != 'LATEST' ]
|
./test_maps
|
||||||
}
|
}
|
||||||
|
|
||||||
test_verifier() {
|
test_verifier() {
|
||||||
@@ -31,13 +31,9 @@ fi
|
|||||||
|
|
||||||
cd libbpf/selftests/bpf
|
cd libbpf/selftests/bpf
|
||||||
|
|
||||||
set +e
|
test_progs
|
||||||
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
|
|
||||||
|
|
||||||
exit $exitcode
|
if [[ "${KERNEL}" == 'latest' ]]; then
|
||||||
|
test_maps
|
||||||
|
test_verifier
|
||||||
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user