summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorHarald Hoyer <harald@redhat.com>2010-06-09 16:41:10 +0200
committerHarald Hoyer <harald@redhat.com>2010-06-09 16:46:33 +0200
commit169f16715145fd087d61ef7fdfd7e9a3cbb68fc9 (patch)
tree9278d145a2adb8abfaca496d126c05d2360b44a5 /test
parent08e10f05f61a1d0d4ea42ee265ad843db670c81e (diff)
downloaddracut-169f16715145fd087d61ef7fdfd7e9a3cbb68fc9.tar.gz
dracut-169f16715145fd087d61ef7fdfd7e9a3cbb68fc9.tar.bz2
dracut-169f16715145fd087d61ef7fdfd7e9a3cbb68fc9.zip
iscsi: add support for multiple netroot=iscsi:
The whole netdisk concept should be reviewed though!
Diffstat (limited to 'test')
-rwxr-xr-xtest/TEST-30-ISCSI/create-root.sh12
-rw-r--r--test/TEST-30-ISCSI/targets4
-rwxr-xr-xtest/TEST-30-ISCSI/test.sh19
3 files changed, 33 insertions, 2 deletions
diff --git a/test/TEST-30-ISCSI/create-root.sh b/test/TEST-30-ISCSI/create-root.sh
index fd413470..2b7cac1a 100755
--- a/test/TEST-30-ISCSI/create-root.sh
+++ b/test/TEST-30-ISCSI/create-root.sh
@@ -3,12 +3,24 @@
for x in 64-lvm.rules 70-mdadm.rules 99-mount-rules; do
> "/etc/udev/rules.d/$x"
done
+rm /etc/lvm/lvm.conf
udevadm control --reload-rules
mke2fs -F /dev/sda && \
mkdir -p /sysroot && \
mount /dev/sda /sysroot && \
cp -a -t /sysroot /source/* && \
umount /sysroot && \
+mdadm --create /dev/md0 --run --auto=yes --level=stripe --raid-devices=2 /dev/sdc /dev/sdd && \
+mdadm -W /dev/md0 || : && \
+lvm pvcreate -ff -y /dev/md0 && \
+lvm vgcreate dracut /dev/md0 && \
+lvm lvcreate -l 100%FREE -n root dracut && \
+lvm vgchange -ay && \
+mke2fs -L sysroot /dev/dracut/root && \
+mount /dev/dracut/root /sysroot && \
+cp -a -t /sysroot /source/* && \
+umount /sysroot && \
+lvm lvchange -a n /dev/dracut/root && \
echo "dracut-root-block-created" >/dev/sdb
poweroff -f
diff --git a/test/TEST-30-ISCSI/targets b/test/TEST-30-ISCSI/targets
index e3c71143..6a6872e5 100644
--- a/test/TEST-30-ISCSI/targets
+++ b/test/TEST-30-ISCSI/targets
@@ -16,6 +16,10 @@
# extents file start length
extent0 /dev/sdb 0 20971520
+extent1 /dev/sdc 0 20971520
+extent2 /dev/sdd 0 20971520
# target flags storage netmask
target0 rw extent0 192.168.50.0/24
+target1 rw extent1 192.168.50.0/24
+target2 rw extent2 192.168.50.0/24
diff --git a/test/TEST-30-ISCSI/test.sh b/test/TEST-30-ISCSI/test.sh
index 4dbd6d67..637f264e 100755
--- a/test/TEST-30-ISCSI/test.sh
+++ b/test/TEST-30-ISCSI/test.sh
@@ -10,6 +10,7 @@ run_server() {
echo "iSCSI TEST SETUP: Starting DHCP/iSCSI server"
$testdir/run-qemu -hda server.ext2 -hdb root.ext2 -m 256M -nographic \
+ -hdc iscsidisk2.img -hdd iscsidisk3.img \
-net nic,macaddr=52:54:00:12:34:56,model=e1000 \
-net socket,listen=127.0.0.1:12345 \
-serial udp:127.0.0.1:9999 \
@@ -37,9 +38,19 @@ run_client() {
-net nic,macaddr=52:54:00:12:34:00,model=e1000 \
-net socket,connect=127.0.0.1:12345 \
-kernel /boot/vmlinuz-$KVERSION \
+ -append "root=LABEL=sysroot ip=192.168.50.101::192.168.50.1:255.255.255.0:iscsi-1:eth0:off netroot=iscsi:192.168.50.1::::iqn.2009-06.dracut:target1 netroot=iscsi:192.168.50.1::::iqn.2009-06.dracut:target2 rw quiet rd_retry=5 rdinitdebug rdinfo rdnetdebug console=ttyS0,115200n81 selinux=0 $DEBUGFAIL" \
+ -initrd initramfs.testing
+ grep -m 1 -q iscsi-OK client.img || return 1
+
+
+ $testdir/run-qemu -hda client.img -m 256M -nographic \
+ -net nic,macaddr=52:54:00:12:34:00,model=e1000 \
+ -net socket,connect=127.0.0.1:12345 \
+ -kernel /boot/vmlinuz-$KVERSION \
-append "root=dhcp rw quiet rd_retry=5 rdinitdebug rdinfo rdnetdebug console=ttyS0,115200n81 selinux=0 $DEBUGFAIL" \
-initrd initramfs.testing
grep -m 1 -q iscsi-OK client.img || return 1
+
}
test_run() {
@@ -64,6 +75,8 @@ test_setup() {
# Create the blank file to use as a root filesystem
dd if=/dev/zero of=root.ext2 bs=1M count=20
+ dd if=/dev/zero of=iscsidisk2.img bs=1M count=20
+ dd if=/dev/zero of=iscsidisk3.img bs=1M count=20
kernel=$KVERSION
# Create what will eventually be our root filesystem onto an overlay
@@ -104,7 +117,9 @@ test_setup() {
return 1
fi
# Invoke KVM and/or QEMU to actually create the target filesystem.
- $testdir/run-qemu -hda root.ext2 -hdb client.img -m 256M -nographic -net none \
+ $testdir/run-qemu -hda root.ext2 -hdb client.img \
+ -hdc iscsidisk2.img -hdd iscsidisk3.img \
+ -m 256M -nographic -net none \
-kernel "/boot/vmlinuz-$kernel" \
-append "root=/dev/dracut/root rw rootfstype=ext2 quiet console=ttyS0,115200n81 selinux=0" \
-initrd initramfs.makeroot || return 1
@@ -177,7 +192,7 @@ test_cleanup() {
fi
rm -rf mnt overlay
rm -f client.ext2 server.ext2 client.img initramfs.server initramfs.testing
- rm -f initramfs.makeroot root.ext2
+ rm -f initramfs.makeroot root.ext2 iscsidisk2.img iscsidisk3.img
}
. $testdir/test-functions