summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorDieter Plaetinck <dieter@plaetinck.be>2009-07-21 18:51:33 +0200
committerDieter Plaetinck <dieter@plaetinck.be>2009-07-21 18:51:33 +0200
commit59d9b7dfd24e53c205cff5a75057e218e781fd1a (patch)
treef80369d205401093804580e3f5f90f4a87909b10 /tests
parentf711f60ecc63dddc8fb1d62fdb4dcfa3a08fa2e2 (diff)
experimental test suite, with one test
Diffstat (limited to 'tests')
-rwxr-xr-xtests/buildtime/test-check_is_in.sh (renamed from tests/test-check_is_in.sh)0
-rwxr-xr-xtests/buildtime/test-menus.sh (renamed from tests/test-menus.sh)0
-rw-r--r--tests/runtime/automatic-lvm-dmcrypt-install-sda/install.sh2
-rw-r--r--tests/runtime/automatic-lvm-dmcrypt-install-sda/perform_test.sh20
-rw-r--r--tests/runtime/automatic-lvm-dmcrypt-install-sda/profile36
-rw-r--r--tests/runtime/automatic-lvm-dmcrypt-install-sda/setup_test.sh6
6 files changed, 64 insertions, 0 deletions
diff --git a/tests/test-check_is_in.sh b/tests/buildtime/test-check_is_in.sh
index 0d97361..0d97361 100755
--- a/tests/test-check_is_in.sh
+++ b/tests/buildtime/test-check_is_in.sh
diff --git a/tests/test-menus.sh b/tests/buildtime/test-menus.sh
index b8dd99c..b8dd99c 100755
--- a/tests/test-menus.sh
+++ b/tests/buildtime/test-menus.sh
diff --git a/tests/runtime/automatic-lvm-dmcrypt-install-sda/install.sh b/tests/runtime/automatic-lvm-dmcrypt-install-sda/install.sh
new file mode 100644
index 0000000..735824a
--- /dev/null
+++ b/tests/runtime/automatic-lvm-dmcrypt-install-sda/install.sh
@@ -0,0 +1,2 @@
+#!/bin/sh
+aif -p automatic -c /usr/share/aif/tests/runtime/automatic-lvm-dmcrypt-install-sda/profile -d \ No newline at end of file
diff --git a/tests/runtime/automatic-lvm-dmcrypt-install-sda/perform_test.sh b/tests/runtime/automatic-lvm-dmcrypt-install-sda/perform_test.sh
new file mode 100644
index 0000000..d0a20b0
--- /dev/null
+++ b/tests/runtime/automatic-lvm-dmcrypt-install-sda/perform_test.sh
@@ -0,0 +1,20 @@
+#!/bin/sh
+
+
+free -m | grep 'Swap:.*20.*' || echo 'SWAP CHECK FAILED'
+
+lvdisplay | grep -A 5 'LV Name.*/dev/mapper/cryptpool-cryptroot' | grep available || echo 'LV ROOT CHECK FAILED'
+lvdisplay | grep -A 7 'LV Name.*/dev/mapper/cryptpool-cryptroot' | grep 'LV Size.*800.00 MB' || echo 'LV ROOT CHECK FAILED'
+
+mount | grep '/dev/mapper/cryptpool-cryptroot on / type xfs (rw)' || echo 'ROOT FS CHECK FAILED'
+mount | grep '/dev/mapper/cryptpool-crypthome on /home type xfs (rw)' || echo 'HOME FS CHECK FAILED'
+
+
+for i in /etc/ / /root/ /home/ /var/
+do
+ [ -f "$i/test_file" ] || echo "TEST FAILED. NO FILE $i/test_file"
+done
+
+[ -x /usr/bin/ssh ] || echo 'PACKAGE INSTALLATION CHECK SSH FAILED'
+[ -f /sbin/mkfs.reiserfs ] && echo 'PACKAGE INSTALLATION CHECK REISERFS FAILED'
+ping -c 2 archlinux.org || echo 'PING CHECK FAILED'
diff --git a/tests/runtime/automatic-lvm-dmcrypt-install-sda/profile b/tests/runtime/automatic-lvm-dmcrypt-install-sda/profile
new file mode 100644
index 0000000..1494d3a
--- /dev/null
+++ b/tests/runtime/automatic-lvm-dmcrypt-install-sda/profile
@@ -0,0 +1,36 @@
+phase_finish=(msg_report grub_hack)
+
+
+SOURCE=cd
+FILE_URL=file:///src/core/pkg
+SYNC_URL=
+
+RUNTIME_REPOSITORIES=
+RUNTIME_PACKAGES=
+
+# packages to install
+TARGET_GROUPS=base
+TARGET_PACKAGES_EXCLUDE='reiserfsprogs'
+TARGET_PACKAGES=openssh
+
+worker_configure_system () {
+ sed -i 's/filesystems/usbinput keymap encrypt lvm2 filesystems/' $var_TARGET_DIR/etc/mkinitcpio.conf
+}
+
+# aif code doesn't nicely update grub config automatically for lvm/dm_crypt systems yet, so we have to do it with this hack
+worker_grub_hack () {
+ sed -i 's#root=/dev/sda.*#root=/dev/mapper/cryptpool-cryptroot cryptdevice=/dev/sda2:cryptpool ro#' $var_TARGET_DIR/boot/grub/menu.lst
+}
+
+# These variables are mandatory
+
+GRUB_DEVICE=/dev/sda
+PARTITIONS='/dev/sda 40:ext2:+ *:ext4'
+BLOCKDATA='/dev/sda1 raw no_label ext2;yes;/boot;target;no_opts;no_label;no_params
+/dev/sda2 raw no_label dm_crypt;yes;no_mountpoint;target;no_opts;sda3crypt;-c_aes-xts-plain_-y_-s_512
+/dev/mapper/sda3crypt dm_crypt no_label lvm-pv;yes;no_mountpoint;target;no_opts;no_label;no_params
+/dev/mapper/sda3crypt+ lvm-pv no_label lvm-vg;yes;no_mountpoint;target;no_opts;cryptpool;/dev/mapper/sda3crypt
+/dev/mapper/cryptpool lvm-vg cryptpool lvm-lv;yes;no_mountpoint;target;no_opts;cryptswap;20M|lvm-lv;yes;no_mountpoint;target;no_opts;cryptroot;800M|lvm-lv;yes;no_mountpoint;target;no_opts;crypthome;50M
+/dev/mapper/cryptpool-cryptswap lvm-lv no-label swap;yes;no_mountpoint;target;no_opts;no_label;no_params
+/dev/mapper/cryptpool-cryptroot lvm-lv no_label xfs;yes;/;target;no_opts;no_label;no_params
+/dev/mapper/cryptpool-crypthome lvm-lv no_label xfs;yes;/home;target;no_opts;no_label;no_params'
diff --git a/tests/runtime/automatic-lvm-dmcrypt-install-sda/setup_test.sh b/tests/runtime/automatic-lvm-dmcrypt-install-sda/setup_test.sh
new file mode 100644
index 0000000..d5bc0d0
--- /dev/null
+++ b/tests/runtime/automatic-lvm-dmcrypt-install-sda/setup_test.sh
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+for i in /etc/ / /root/ /home/ /var/
+do
+ touch /mnt${i}test_file
+done