summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2015-11-24 15:02:20 +0100
committerLennart Poettering <lennart@poettering.net>2015-11-24 15:02:20 +0100
commit8c191eecd403e1759789b70fb0b7283fd22c2b32 (patch)
tree01feb9633f679e6c33fd07acfed5bc038bfe316f /test
parente3d85eeae2eba1e4e995cb6d6e84ce295bc1704d (diff)
parent6f9d3b08cf3e50d3903282d2ce36244bb86c7b7c (diff)
Merge pull request #1957 from zonque/qemu-test
test: make QEMU tests work on Semaphore
Diffstat (limited to 'test')
-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 ]]
}