Blame 0028-TEST-03-USR-MOUNT-change-test-to-use-a-seperate-disk.patch

Harald Hoyer 2d3fda
From a128f03b305aebdce6a99a6b027c17ed58a1648e Mon Sep 17 00:00:00 2001
Harald Hoyer 2d3fda
From: Harald Hoyer <harald@redhat.com>
Harald Hoyer 2d3fda
Date: Tue, 3 Jul 2012 18:21:54 +0200
Harald Hoyer 2d3fda
Subject: [PATCH] TEST-03-USR-MOUNT: change test to use a seperate disk
Harald Hoyer 2d3fda
Harald Hoyer 2d3fda
---
Harald Hoyer 2d3fda
 test/TEST-03-USR-MOUNT/create-root.sh |   14 ++++++++++++--
Harald Hoyer 2d3fda
 test/TEST-03-USR-MOUNT/fstab          |    2 +-
Harald Hoyer 2d3fda
 test/TEST-03-USR-MOUNT/test-init.sh   |    2 +-
Harald Hoyer 2d3fda
 test/TEST-03-USR-MOUNT/test.sh        |    8 ++++++--
Harald Hoyer 2d3fda
 4 files changed, 20 insertions(+), 6 deletions(-)
Harald Hoyer 2d3fda
Harald Hoyer 2d3fda
diff --git a/test/TEST-03-USR-MOUNT/create-root.sh b/test/TEST-03-USR-MOUNT/create-root.sh
Harald Hoyer 2d3fda
index 6662bca..9a3e561 100755
Harald Hoyer 2d3fda
--- a/test/TEST-03-USR-MOUNT/create-root.sh
Harald Hoyer 2d3fda
+++ b/test/TEST-03-USR-MOUNT/create-root.sh
Harald Hoyer 2d3fda
@@ -12,13 +12,23 @@ sfdisk -C 5120 -H 2 -S 32 -L /dev/sda <
Harald Hoyer 2d3fda
 ,
Harald Hoyer 2d3fda
 EOF
Harald Hoyer 2d3fda
 
Harald Hoyer 2d3fda
+sfdisk -C 5120 -H 2 -S 32 -L /dev/sdb <
Harald Hoyer 2d3fda
+,16
Harald Hoyer 2d3fda
+,
Harald Hoyer 2d3fda
+EOF
Harald Hoyer 2d3fda
+
Harald Hoyer 2d3fda
+
Harald Hoyer 2d3fda
 mkfs.btrfs -L dracut /dev/sda2
Harald Hoyer 2d3fda
+mkfs.btrfs -L dracutusr /dev/sdb2
Harald Hoyer 2d3fda
 btrfs device scan /dev/sda2
Harald Hoyer 2d3fda
+btrfs device scan /dev/sdb2
Harald Hoyer 2d3fda
 mkdir -p /root
Harald Hoyer 2d3fda
 mount -t btrfs /dev/sda2 /root
Harald Hoyer 2d3fda
-btrfs subvolume create /root/usr
Harald Hoyer 2d3fda
 [ -d /root/usr ] || mkdir /root/usr
Harald Hoyer 2d3fda
-mount -t btrfs -o subvol=usr /dev/sda2 /root/usr
Harald Hoyer 2d3fda
+mount -t btrfs /dev/sdb2 /root/usr
Harald Hoyer 2d3fda
+btrfs subvolume create /root/usr/usr
Harald Hoyer 2d3fda
+umount /root/usr
Harald Hoyer 2d3fda
+mount -t btrfs -o subvol=usr /dev/sdb2 /root/usr
Harald Hoyer 2d3fda
 cp -a -t /root /source/*
Harald Hoyer 2d3fda
 mkdir -p /root/run
Harald Hoyer 2d3fda
 umount /root/usr
Harald Hoyer 2d3fda
diff --git a/test/TEST-03-USR-MOUNT/fstab b/test/TEST-03-USR-MOUNT/fstab
Harald Hoyer 2d3fda
index 0e0a0e0..0cc3370 100644
Harald Hoyer 2d3fda
--- a/test/TEST-03-USR-MOUNT/fstab
Harald Hoyer 2d3fda
+++ b/test/TEST-03-USR-MOUNT/fstab
Harald Hoyer 2d3fda
@@ -1,2 +1,2 @@
Harald Hoyer 2d3fda
 /dev/sda2	/                       btrfs   defaults         0 0
Harald Hoyer 2d3fda
-/dev/sda2	/usr                    btrfs   subvol=usr,ro    0 0
Harald Hoyer 2d3fda
+/dev/sdb2	/usr                    btrfs   subvol=usr,ro    0 0
Harald Hoyer 2d3fda
diff --git a/test/TEST-03-USR-MOUNT/test-init.sh b/test/TEST-03-USR-MOUNT/test-init.sh
Harald Hoyer 2d3fda
index 494313b..63520ab 100755
Harald Hoyer 2d3fda
--- a/test/TEST-03-USR-MOUNT/test-init.sh
Harald Hoyer 2d3fda
+++ b/test/TEST-03-USR-MOUNT/test-init.sh
Harald Hoyer 2d3fda
@@ -14,7 +14,7 @@ ismounted() {
Harald Hoyer 2d3fda
 }
Harald Hoyer 2d3fda
 
Harald Hoyer 2d3fda
 if ismounted /usr; then
Harald Hoyer 2d3fda
-    echo "dracut-root-block-success" >/dev/sdb
Harald Hoyer 2d3fda
+    echo "dracut-root-block-success" >/dev/sdc
Harald Hoyer 2d3fda
 fi
Harald Hoyer 2d3fda
 export TERM=linux
Harald Hoyer 2d3fda
 export PS1='initramfs-test:\w\$ '
Harald Hoyer 2d3fda
diff --git a/test/TEST-03-USR-MOUNT/test.sh b/test/TEST-03-USR-MOUNT/test.sh
Harald Hoyer 2d3fda
index 34a120f..d966c3c 100755
Harald Hoyer 2d3fda
--- a/test/TEST-03-USR-MOUNT/test.sh
Harald Hoyer 2d3fda
+++ b/test/TEST-03-USR-MOUNT/test.sh
Harald Hoyer 2d3fda
@@ -16,7 +16,8 @@ client_run() {
Harald Hoyer 2d3fda
     dd if=/dev/zero of=$TESTDIR/result bs=1M count=1
Harald Hoyer 2d3fda
     $testdir/run-qemu \
Harald Hoyer 2d3fda
 	-hda $TESTDIR/root.btrfs \
Harald Hoyer 2d3fda
-	-hdb $TESTDIR/result \
Harald Hoyer 2d3fda
+	-hdb $TESTDIR/usr.btrfs \
Harald Hoyer 2d3fda
+	-hdc $TESTDIR/result \
Harald Hoyer 2d3fda
 	-m 256M -nographic \
Harald Hoyer 2d3fda
 	-net none -kernel /boot/vmlinuz-$KVERSION \
Harald Hoyer 2d3fda
 	-watchdog ib700 -watchdog-action poweroff \
Harald Hoyer 2d3fda
@@ -37,7 +38,7 @@ client_run() {
Harald Hoyer 2d3fda
 }
Harald Hoyer 2d3fda
 
Harald Hoyer 2d3fda
 test_run() {
Harald Hoyer 2d3fda
-    client_run "no option specified, should fail" && return 1
Harald Hoyer 2d3fda
+    client_run "no option specified" || return 1
Harald Hoyer 2d3fda
     client_run "readonly root" "ro" || return 1
Harald Hoyer 2d3fda
     client_run "writeable root" "rw" || return 1
Harald Hoyer 2d3fda
     return 0
Harald Hoyer 2d3fda
@@ -45,8 +46,10 @@ test_run() {
Harald Hoyer 2d3fda
 
Harald Hoyer 2d3fda
 test_setup() {
Harald Hoyer 2d3fda
     rm -f $TESTDIR/root.btrfs
Harald Hoyer 2d3fda
+    rm -f $TESTDIR/usr.btrfs
Harald Hoyer 2d3fda
     # Create the blank file to use as a root filesystem
Harald Hoyer 2d3fda
     dd if=/dev/null of=$TESTDIR/root.btrfs bs=1M seek=160
Harald Hoyer 2d3fda
+    dd if=/dev/null of=$TESTDIR/usr.btrfs bs=1M seek=160
Harald Hoyer 2d3fda
 
Harald Hoyer 2d3fda
     kernel=$KVERSION
Harald Hoyer 2d3fda
     # Create what will eventually be our root filesystem onto an overlay
Harald Hoyer 2d3fda
@@ -100,6 +103,7 @@ test_setup() {
Harald Hoyer 2d3fda
 
Harald Hoyer 2d3fda
     $testdir/run-qemu \
Harald Hoyer 2d3fda
 	-hda $TESTDIR/root.btrfs \
Harald Hoyer 2d3fda
+	-hdb $TESTDIR/usr.btrfs \
Harald Hoyer 2d3fda
 	-m 256M -nographic -net none \
Harald Hoyer 2d3fda
 	-kernel "/boot/vmlinuz-$kernel" \
Harald Hoyer 2d3fda
 	-append "root=/dev/dracut/root rw rootfstype=btrfs quiet console=ttyS0,115200n81 selinux=0" \