diff options
author | Lennart Poettering <lennart@poettering.net> | 2015-11-24 15:02:20 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2015-11-24 15:02:20 +0100 |
commit | 8c191eecd403e1759789b70fb0b7283fd22c2b32 (patch) | |
tree | 01feb9633f679e6c33fd07acfed5bc038bfe316f /test | |
parent | Merge pull request #1976 from ssahani/word3 (diff) | |
parent | test: 01-basic: mask some services that currently don't run in qemu (diff) | |
download | systemd-8c191eecd403e1759789b70fb0b7283fd22c2b32.tar.xz systemd-8c191eecd403e1759789b70fb0b7283fd22c2b32.zip |
Merge pull request #1957 from zonque/qemu-test
test: make QEMU tests work on Semaphore
Diffstat (limited to 'test')
-rwxr-xr-x | test/TEST-01-BASIC/test.sh | 7 | ||||
-rw-r--r-- | test/test-functions | 15 |
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 ]] } |