summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xtest/TEST-01-BASIC/test.sh7
-rw-r--r--test/test-functions15
2 files changed, 17 insertions, 5 deletions
diff --git a/test/TEST-01-BASIC/test.sh b/test/TEST-01-BASIC/test.sh
index f93ea934fb..6ad2f3402b 100755
--- a/test/TEST-01-BASIC/test.sh
+++ b/test/TEST-01-BASIC/test.sh
@@ -61,6 +61,13 @@ EOF
)
setup_nspawn_root
+ # mask some services that we do not want to run in these tests
+ ln -s /dev/null $initdir/etc/systemd/system/systemd-hwdb-update.service
+ ln -s /dev/null $initdir/etc/systemd/system/systemd-journal-catalog-update.service
+ ln -s /dev/null $initdir/etc/systemd/system/systemd-networkd.service
+ ln -s /dev/null $initdir/etc/systemd/system/systemd-networkd.socket
+ ln -s /dev/null $initdir/etc/systemd/system/systemd-resolved.service
+
ddebug "umount $TESTDIR/root"
umount $TESTDIR/root
}
diff --git a/test/test-functions b/test/test-functions
index a794f3556e..fca163a979 100644
--- a/test/test-functions
+++ b/test/test-functions
@@ -71,8 +71,7 @@ selinux=0 \
$KERNEL_APPEND \
"
- QEMU_OPTIONS="-machine accel=kvm:tcg \
--smp $QEMU_SMP \
+ QEMU_OPTIONS="-smp $QEMU_SMP \
-net none \
-m 512M \
-nographic \
@@ -83,6 +82,10 @@ $KERNEL_APPEND \
QEMU_OPTIONS="$QEMU_OPTIONS -initrd $INITRD"
fi
+ if [ -c /dev/kvm ]; then
+ QEMU_OPTIONS="$QEMU_OPTIONS -machine accel=kvm -enable-kvm -cpu host"
+ fi
+
( set -x
$QEMU_BIN $QEMU_OPTIONS -append "$KERNEL_APPEND" $TESTDIR/rootdisk.img ) || return 1
}
@@ -145,12 +148,12 @@ install_missing_libraries() {
create_empty_image() {
rm -f "$TESTDIR/rootdisk.img"
# Create the blank file to use as a root filesystem
- dd if=/dev/null of="$TESTDIR/rootdisk.img" bs=1M seek=300
+ dd if=/dev/null of="$TESTDIR/rootdisk.img" bs=1M seek=400
LOOPDEV=$(losetup --show -P -f $TESTDIR/rootdisk.img)
[ -b "$LOOPDEV" ] || return 1
echo "LOOPDEV=$LOOPDEV" >> $STATEFILE
sfdisk "$LOOPDEV" <<EOF
-,290M
+,390M
,
EOF
@@ -1131,7 +1134,9 @@ inst_libdir_file() {
}
check_nspawn() {
- [[ -d /sys/fs/cgroup/systemd ]]
+ [[ -d /sys/fs/cgroup/systemd ]] && \
+ [[ -d /run/systemd/system ]] && \
+ [[ -e /lib/systemd/systemd-machined ]]
}