diff options
author | Riku Voipio <riku.voipio@linaro.org> | 2015-05-25 14:15:32 +0300 |
---|---|---|
committer | Riku Voipio <riku.voipio@linaro.org> | 2015-05-25 15:20:25 +0300 |
commit | 01b38d58e5285238fb9dd1590b26ed3bee0efed4 (patch) | |
tree | 76f62c2b2384be5f0fc0e6b58e96f1f6e8e1b529 | |
parent | db30bce092bba759161a1e14390aaf52c9504947 (diff) |
test-guest: move to systemd
Run the guest tests under systemd, for vivid and jessie
tests.
-rwxr-xr-x | files/test-rt-tests.sh | 7 | ||||
-rw-r--r-- | files/xen-lava.conf | 11 | ||||
-rw-r--r-- | files/xen-lava.service | 11 | ||||
-rwxr-xr-x | lava/scripts/test-guest.sh | 29 | ||||
-rw-r--r-- | lava/xentest.yaml | 1 |
5 files changed, 32 insertions, 27 deletions
diff --git a/files/test-rt-tests.sh b/files/test-rt-tests.sh index bee295d..735ee08 100755 --- a/files/test-rt-tests.sh +++ b/files/test-rt-tests.sh @@ -1,3 +1,10 @@ +#!/bin/sh + +exec > /var/log/lava.log + +sleep 10 +echo 'xen-boot-1: PASS' +echo "Test hackbench on guest" /usr/bin/hackbench -l 100 -T /usr/bin/hackbench -l 100 -P /usr/bin/hackbench -l 10000 -T diff --git a/files/xen-lava.conf b/files/xen-lava.conf deleted file mode 100644 index fd49525..0000000 --- a/files/xen-lava.conf +++ /dev/null @@ -1,11 +0,0 @@ - -start on runlevel [23] -stop on runlevel [!23] -console output -script - sleep 10 - echo -e '\n\nxen-boot-1: PASS' - echo "Test hackbench on guest" - sh /root/test-rt-tests.sh - poweroff -end script diff --git a/files/xen-lava.service b/files/xen-lava.service new file mode 100644 index 0000000..b95db40 --- /dev/null +++ b/files/xen-lava.service @@ -0,0 +1,11 @@ +[Unit] +Description=Hackbench on guest + +[Service] +Type=oneshot +ExecStart=/root/test-rt-tests.sh +ExecStop=/sbin/poweroff + +[Install] +WantedBy=multi-user.target + diff --git a/lava/scripts/test-guest.sh b/lava/scripts/test-guest.sh index 4fed99d..8a9f43c 100755 --- a/lava/scripts/test-guest.sh +++ b/lava/scripts/test-guest.sh @@ -78,7 +78,7 @@ case `uname -m` in # Extract the image gunzip $ROOTFS_BUILD_FILENAME.gz IMGFILE=$ROOTFS_BUILD_FILENAME - kpartx -a -v $IMGFILE + kpartx -a -s -v $IMGFILE # Extract the zImage from the image mount /dev/mapper/loop0p1 /media dd if=/media/uImage ibs=64 skip=1 of=zImage @@ -91,7 +91,7 @@ case `uname -m` in /sbin/parted --script $IMGFILE mklabel msdos /sbin/parted --script $IMGFILE mkpart p fat32 1 50 /sbin/parted --script -- $IMGFILE mkpart p ext4 51 -0 - kpartx -a -v $IMGFILE + kpartx -a -s -v $IMGFILE mkfs.ext4 /dev/mapper/loop0p1 mkfs.ext4 /dev/mapper/loop0p2 mount /dev/mapper/loop0p2 /media @@ -102,25 +102,19 @@ esac # Prepare the image by copying usefull file -# Copy hvc0 initscript -cp $root/files/hvc0.conf /media/etc/init/hvc0.conf - # Copy hackbench cp /usr/bin/hackbench /media/usr/bin/hackbench # Copy tests cp $root/files/test-rt-tests.sh /media/root/test-rt-tests.sh -cp $root/files/xen-lava.conf /media/etc/init/xen-lava.conf - -# FIXME: Disable network for now -cp $root/files/interfaces /media/etc/network/interfaces +cp $root/files/xen-lava.service /media/etc/systemd/system/xen-lava.service +chroot /media systemctl enable xen-lava.service umount /media kpartx -d $IMGFILE - -# Create the guest loop=`losetup -f --show $IMGFILE` +# Create the guest TEST="xl-create-guest" xl -vvv create $root/files/guest1.xl check_return_pass @@ -145,15 +139,16 @@ while [ true ]; do break fi done +losetup -d $loop +partx -a -s -v $IMGFILE +mount /dev/mapper/loop0p2 /media set -e -losetup -d $loop - # Test case: check if the guest has booted TEST="xen-boot-1" -if ! grep -q "xen-boot-1:" /var/log/xen/console/guest-guest1.log; then +if ! grep -q "xen-boot-1:" /media/var/log/lava.log; then fail_test "Guest didn't boot" exit 0 else @@ -161,7 +156,11 @@ else fi # Test case: check if the guest didn't timeout -TEST="guest-hackbench" +cp /media/var/log/lava.log /var/log/xen/console/hackbench-guest-guest1.log + +umount /media +kpartx -d $IMGFILE + if [ $pass -ne 1 ]; then fail_test "Hackbench timeout" exit 0 diff --git a/lava/xentest.yaml b/lava/xentest.yaml index 5fe4edb..98c7142 100644 --- a/lava/xentest.yaml +++ b/lava/xentest.yaml @@ -25,7 +25,6 @@ run: steps: - "./lava/scripts/initialize-xen-tools.sh" - "./lava/scripts/test-guest.sh || echo \"test_guest: FAIL - return status $?\"" - - "cp /var/log/xen/console/guest-guest1.log /var/log/xen/console/hackbench-guest-guest1.log" - "python ./lava/scripts/min_max_avg_parse.py /var/log/xen/console/hackbench-guest-guest1.log 'Time:' 'Seconds'||true" - "lava-test-run-attach /var/log/xen/console/guest-guest1.log text/plain" |