Updated todo
[grml-unittests.git] / lvm / deploy.sh
1 #!/bin/zsh
2
3 . /etc/grml/autoconfig.functions
4 mkdir -p /tmp/tests
5
6 STATUS=$(getbootparam status)
7 run_command() {
8     ERROR_MESSAGE="$1"
9     shift
10     $* > /tmp/output
11     [ "$?" -ne 0 ] && wget --post-file=/tmp/output.log $STATUS/FAIL
12
13 }
14
15 sfdisk /dev/sda <<EOF
16 0,10,0x8e
17 EOF
18
19 run_command "pvcreate" pvcreate /dev/sda1
20 run_command "could not create vg group" vgcreate vg /dev/sda1
21 run_command "could not create lv" lvcreate -L10M -n 01 /dev/vg
22 run_command "could not format fs" mkfs.ext3 /dev/vg/01
23 run_command "could not mount group" mount /dev/vg/01 /mnt/test
24 run_command "could not resize logical volume" lvresize -L+5M /dev/vg/01
25 run_command "could not resize filestem" resize2fs /dev/vg/01
26 wget --post-data="Run $TESTS" $STATUS/DONE