Add tests for grml-debootstrap
authorUlrich Dangel <uli@spamt.net>
Mon, 17 May 2010 11:13:40 +0000 (13:13 +0200)
committerUlrich Dangel <uli@spamt.net>
Mon, 17 May 2010 11:13:40 +0000 (13:13 +0200)
grml-debootstrap/deploy.sh [new file with mode: 0644]
grml-debootstrap/runit.sh [new file with mode: 0755]

diff --git a/grml-debootstrap/deploy.sh b/grml-debootstrap/deploy.sh
new file mode 100644 (file)
index 0000000..d939827
--- /dev/null
@@ -0,0 +1,13 @@
+#!/bin/zsh
+
+. /etc/grml/autoconfig.functions
+
+STATUS=$(getbootparam status)
+sfdisk /dev/sda <<EOF
+0 88 0x0c
+;
+EOF
+
+
+yes y | grml2usb --force --fat16 --bootoptions="netscript=$STATUS/DONE" /live/image /dev/sda1
+shutdown -h now
diff --git a/grml-debootstrap/runit.sh b/grml-debootstrap/runit.sh
new file mode 100755 (executable)
index 0000000..411a341
--- /dev/null
@@ -0,0 +1,28 @@
+#!/bin/sh
+
+. $FRAMEWORK
+
+CMDLINE="$CMDLINE_COMMON noprompt netscript=$URL_PREFIX:$COMMON_PORT/deploy.sh status=$URL_PREFIX:$STATUS_PORT/"
+IMAGE=$(tempfile -d /dev/shm)
+KVM_PARAMS="-hda $IMAGE"
+TIMEOUT_TIME=180
+TEST_NAME=grml-debootstrap
+BAILOUT_CMD='rm -f $IMAGE ; kill -9 $TEST_PID 2>/dev/null'
+
+# create sample image file
+dd if=/dev/zero of=$IMAGE bs=1024 count=712000 2>/dev/null
+
+# run the test (will create a bootable device
+run_test
+timeout
+wait $KVM_PID
+
+# start second kvm
+kvm -vnc :0 -hda $IMAGE  &
+TEST_PID=$!
+
+
+wait $SERVER_PID
+kill -9 $TEST_PID
+rm -f $IMAGE
+