summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2021-06-04 14:40:44 -0400
committerKent Overstreet <kent.overstreet@gmail.com>2021-06-04 23:59:59 -0400
commitf10b9f3ddda25d006bc50b6c1cebe49f42bb617f (patch)
tree38adc863f49e44ff01782de82beb08fc779eb497
parent51275f2bc38ab66c850c6834cccaa60fe2117603 (diff)
Assorted minor improvements
- in the VM image, mask exim4, drop ATA over ethernet packages - they're breaking standard networking startup - config-nr-cpus now defaults to the host number of processors, instead of 6 - xfstests.sh: run make ourself instead of using require-make, we don't need make install to be run and it adds ~5 seconds to startup time. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
-rw-r--r--lib/parse-test.sh2
-rw-r--r--lib/rc-local.service24
-rwxr-xr-xlib/testrunner6
-rw-r--r--lib/testrunner.service12
-rw-r--r--lib/testrunner.wrapper (renamed from lib/rc.local)0
-rwxr-xr-xroot_image14
-rw-r--r--tests/xfstests.sh11
7 files changed, 28 insertions, 41 deletions
diff --git a/lib/parse-test.sh b/lib/parse-test.sh
index 7db560b..f642dde 100644
--- a/lib/parse-test.sh
+++ b/lib/parse-test.sh
@@ -1,7 +1,7 @@
parse_test_deps()
{
- ktest_cpus="6"
+ ktest_cpus=$(grep -c '^processor' /proc/cpuinfo)
ktest_mem=""
ktest_timeout=""
ktest_kernel_append=()
diff --git a/lib/rc-local.service b/lib/rc-local.service
deleted file mode 100644
index 6541169..0000000
--- a/lib/rc-local.service
+++ /dev/null
@@ -1,24 +0,0 @@
-# SPDX-License-Identifier: LGPL-2.1+
-#
-# This file is part of systemd.
-#
-# systemd is free software; you can redistribute it and/or modify it
-# under the terms of the GNU Lesser General Public License as published by
-# the Free Software Foundation; either version 2.1 of the License, or
-# (at your option) any later version.
-
-# This unit gets pulled automatically into multi-user.target by
-# systemd-rc-local-generator if /etc/rc.local is executable.
-[Unit]
-Description=/etc/rc.local Compatibility
-Documentation=man:systemd-rc-local-generator(8)
-ConditionFileIsExecutable=/etc/rc.local
-After=network.target
-
-[Service]
-Type=forking
-ExecStart=/etc/rc.local start
-TimeoutSec=0
-RemainAfterExit=yes
-GuessMainPID=no
-IgnoreSIGPIPE=true
diff --git a/lib/testrunner b/lib/testrunner
index 03e84ef..d6fbeb7 100755
--- a/lib/testrunner
+++ b/lib/testrunner
@@ -88,8 +88,6 @@ if compgen -G "$ktest_tmp/*.deb" > /dev/null; then
fi
fi
-j=$(($(grep -c '^processor' /proc/cpuinfo) * 2))
-
for i in "${ktest_make_install[@]}"; do
pushd "/host/$i" > /dev/null
if [[ -f autogen.sh && ! -f configure ]]; then
@@ -98,8 +96,8 @@ for i in "${ktest_make_install[@]}"; do
if [[ -f configure && ! -f Makefile ]]; then
run_quiet "configure $(basename $i)" ./configure
fi
- run_quiet "building $(basename $i)" make -j $j
- run_quiet "installing $(basename $i)" make -j $j install
+ run_quiet "building $(basename $i)" make -j $ktest_cpus
+ run_quiet "installing $(basename $i)" make -j $ktest_cpus install
popd > /dev/null
done
diff --git a/lib/testrunner.service b/lib/testrunner.service
new file mode 100644
index 0000000..d14d670
--- /dev/null
+++ b/lib/testrunner.service
@@ -0,0 +1,12 @@
+[Unit]
+Description=ktest testrunner
+ConditionFileIsExecutable=/sbin/testrunner.wrapper
+After=multi-user.target
+
+[Service]
+Type=forking
+ExecStart=/sbin/testrunner.wrapper
+TimeoutSec=0
+RemainAfterExit=yes
+GuessMainPID=no
+IgnoreSIGPIPE=no
diff --git a/lib/rc.local b/lib/testrunner.wrapper
index f5da5b4..f5da5b4 100644
--- a/lib/rc.local
+++ b/lib/testrunner.wrapper
diff --git a/root_image b/root_image
index 07333ed..c4a2bb5 100755
--- a/root_image
+++ b/root_image
@@ -76,7 +76,7 @@ PACKAGES=(kexec-tools less psmisc openssh-server \
autoconf automake autopoint bison \
pkg-config libtool-bin \
gdb strace ltrace linux-perf blktrace sysstat \
- hdparm btrfs-progs mdadm lvm2 aoetools vblade \
+ hdparm btrfs-progs mdadm lvm2 \
bc attr gawk acl rsync git)
# stress testing:
@@ -102,9 +102,6 @@ PACKAGES+=(nfs-kernel-server)
# nbd testing
PACKAGES+=(nbd-client nbd-server)
-# iscsi testing
-PACKAGES+=(targetcli-fb open-iscsi)
-
# dm testing:
PACKAGES+=(cryptsetup)
@@ -123,6 +120,7 @@ SYSTEMD_MASK=(dev-hvc0.device \
getty-static.service \
avahi-daemon.service \
crond.service \
+ exim4.service \
kdump.service \
hdparm.service \
cdrom.mount \
@@ -153,9 +151,10 @@ _chroot()
update_files()
{
install -m0644 "$ktest_dir/lib/fstab" "$MNT/etc/fstab"
- install -m0755 "$ktest_dir/lib/rc.local" "$MNT/etc/rc.local"
- install -m0755 "$ktest_dir/lib/rc-local.service" "$MNT/lib/systemd/system/rc-local.service"
- rm -f "$MNT/lib/systemd/system/rc-local.service.d/debian.conf"
+ install -m0755 "$ktest_dir/lib/testrunner.wrapper" "$MNT/sbin/testrunner.wrapper"
+ install -m0644 "$ktest_dir/lib/testrunner.service" "$MNT/lib/systemd/system/testrunner.service"
+
+ ln -sf /lib/systemd/system/testrunner.service "$MNT/etc/systemd/system/multi-user.target.wants"
touch "$MNT/etc/resolv.conf"
chmod 644 "$MNT/etc/resolv.conf"
@@ -205,6 +204,7 @@ ZZ
# Use most recent version of perf installed, instead of failing if it
# doesn't match the kernel version:
+ mkdir -p "$MNT/usr/local/bin"
install -m0755 "$ktest_dir/lib/perf" "$MNT/usr/local/bin/perf"
}
diff --git a/tests/xfstests.sh b/tests/xfstests.sh
index 5d61fc2..b7e4f1d 100644
--- a/tests/xfstests.sh
+++ b/tests/xfstests.sh
@@ -3,7 +3,6 @@
require-lib test-libs.sh
require-git https://git.kernel.org/pub/scm/fs/xfs/xfstests-dev.git xfstests
-require-make xfstests
require-kernel-config FAULT_INJECTION,FAULT_INJECTION_DEBUG_FS,FAIL_MAKE_REQUEST
require-kernel-config MD,BLK_DEV_DM,DM_FLAKEY,DM_SNAPSHOT,DM_LOG_WRITES
@@ -21,7 +20,7 @@ config-timeout 7200
list_tests()
{
- (cd "/ktest/tests/xfstests/tests"; echo generic/???)
+ (cd "$ktest_dir/tests/xfstests/tests"; echo generic/???)
}
run_xfstests()
@@ -35,20 +34,20 @@ TEST_DIR=/mnt/test
SCRATCH_DEV=/dev/sdc
SCRATCH_MNT=/mnt/scratch
LOGWRITES_DEV=/dev/sdd
-RESULT_BASE=/ktest-out/xfstests-results
+RESULT_BASE=/ktest-out/xfstests
LOGGER_PROG=true
EOF
useradd -m fsgqa || true
useradd -g fsgqa 123456-fsgqa || true
- rm -rf /ktest-out/xfstests-results
+ rm -rf /ktest-out/xfstests
mkdir -p /mnt/test /mnt/scratch
wipefs -af /dev/sdb
- if [ -z ${MKFS_OPTIONS+x} ]; then
+ if [[ -z ${MKFS_OPTIONS+x} ]]; then
MKFS_OPTIONS=""
fi
@@ -58,5 +57,7 @@ EOF
cd "$ktest_dir/tests/xfstests"
+ run_quiet "building $(basename $i)" make -j $ktest_cpus
+
./check "$@"
}