diff options
Diffstat (limited to 'test/TEST-03-USR-MOUNT')
-rwxr-xr-x | test/TEST-03-USR-MOUNT/create-root.sh | 16 | ||||
-rw-r--r-- | test/TEST-03-USR-MOUNT/fstab | 4 | ||||
-rwxr-xr-x | test/TEST-03-USR-MOUNT/test-init.sh | 24 | ||||
-rwxr-xr-x | test/TEST-03-USR-MOUNT/test.sh | 35 |
4 files changed, 22 insertions, 57 deletions
diff --git a/test/TEST-03-USR-MOUNT/create-root.sh b/test/TEST-03-USR-MOUNT/create-root.sh index 411fa99..734f377 100755 --- a/test/TEST-03-USR-MOUNT/create-root.sh +++ b/test/TEST-03-USR-MOUNT/create-root.sh @@ -12,22 +12,22 @@ set -e udevadm settle modprobe btrfs || : -mkfs.btrfs -L dracut /dev/disk/by-id/ata-disk_root -mkfs.btrfs -L dracutusr /dev/disk/by-id/ata-disk_usr -btrfs device scan /dev/disk/by-id/ata-disk_root -btrfs device scan /dev/disk/by-id/ata-disk_usr +mkfs.btrfs -q -L dracut /dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_root +mkfs.btrfs -q -L dracutusr /dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_usr +btrfs device scan /dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_root +btrfs device scan /dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_usr mkdir -p /root -mount -t btrfs /dev/disk/by-id/ata-disk_root /root +mount -t btrfs /dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_root /root [ -d /root/usr ] || mkdir -p /root/usr -mount -t btrfs /dev/disk/by-id/ata-disk_usr /root/usr +mount -t btrfs /dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_usr /root/usr btrfs subvolume create /root/usr/usr umount /root/usr -mount -t btrfs -o subvol=usr /dev/disk/by-id/ata-disk_usr /root/usr +mount -t btrfs -o subvol=usr /dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_usr /root/usr cp -a -t /root /source/* mkdir -p /root/run btrfs filesystem sync /root/usr btrfs filesystem sync /root umount /root/usr umount /root -echo "dracut-root-block-created" | dd oflag=direct,dsync of=/dev/disk/by-id/ata-disk_marker +echo "dracut-root-block-created" | dd oflag=direct,dsync of=/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_marker status=none poweroff -f diff --git a/test/TEST-03-USR-MOUNT/fstab b/test/TEST-03-USR-MOUNT/fstab index feac57a..114f945 100644 --- a/test/TEST-03-USR-MOUNT/fstab +++ b/test/TEST-03-USR-MOUNT/fstab @@ -1,2 +1,2 @@ -/dev/disk/by-id/ata-disk_root / btrfs defaults 0 0 -/dev/disk/by-id/ata-disk_usr /usr btrfs subvol=usr,ro 0 0 +/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_root / btrfs defaults 0 0 +/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_usr /usr btrfs subvol=usr,ro 0 0 diff --git a/test/TEST-03-USR-MOUNT/test-init.sh b/test/TEST-03-USR-MOUNT/test-init.sh deleted file mode 100755 index 108e626..0000000 --- a/test/TEST-03-USR-MOUNT/test-init.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/sh -: > /dev/watchdog - -. /lib/dracut-lib.sh - -export PATH=/usr/sbin:/usr/bin:/sbin:/bin -command -v plymouth > /dev/null 2>&1 && plymouth --quit -exec > /dev/console 2>&1 - -echo "dracut-root-block-success" | dd oflag=direct,dsync of=/dev/disk/by-id/ata-disk_marker - -export TERM=linux -export PS1='initramfs-test:\w\$ ' -[ -f /etc/mtab ] || ln -sfn /proc/mounts /etc/mtab -[ -f /etc/fstab ] || ln -sfn /proc/mounts /etc/fstab -stty sane -echo "made it to the rootfs!" -if getargbool 0 rd.shell; then - strstr "$(setsid --help)" "control" && CTTY="-c" - setsid $CTTY sh -i -fi -echo "Powering down." -mount -n -o remount,ro / -poweroff -f diff --git a/test/TEST-03-USR-MOUNT/test.sh b/test/TEST-03-USR-MOUNT/test.sh index 69ffda3..c64a582 100755 --- a/test/TEST-03-USR-MOUNT/test.sh +++ b/test/TEST-03-USR-MOUNT/test.sh @@ -15,15 +15,14 @@ client_run() { declare -a disk_args=() declare -i disk_index=0 - qemu_add_drive_args disk_index disk_args "$TESTDIR"/marker.img marker - qemu_add_drive_args disk_index disk_args "$TESTDIR"/root.btrfs root - qemu_add_drive_args disk_index disk_args "$TESTDIR"/usr.btrfs usr + qemu_add_drive disk_index disk_args "$TESTDIR"/marker.img marker + qemu_add_drive disk_index disk_args "$TESTDIR"/root.btrfs root + qemu_add_drive disk_index disk_args "$TESTDIR"/usr.btrfs usr test_marker_reset "$testdir"/run-qemu \ "${disk_args[@]}" \ - -device i6300esb -watchdog-action poweroff \ - -append "panic=1 oops=panic softlockup_panic=1 systemd.crash_reboot root=LABEL=dracut $client_opts loglevel=7 rd.retry=3 rd.info console=ttyS0,115200n81 selinux=0 rd.debug rd.shell=0 $DEBUGFAIL" \ + -append "root=LABEL=dracut $client_opts rd.retry=3" \ -initrd "$TESTDIR"/initramfs.testing || return 1 if ! test_marker_check; then @@ -41,13 +40,9 @@ test_run() { test_setup() { # Create what will eventually be our root filesystem onto an overlay - "$DRACUT" -l --keep --tmpdir "$TESTDIR" \ + "$DRACUT" -N -l --keep --tmpdir "$TESTDIR" \ -m "test-root" \ - -i ./test-init.sh /sbin/init \ -i ./fstab /etc/fstab \ - -i "${PKGLIBDIR}/modules.d/99base/dracut-lib.sh" "/lib/dracut-lib.sh" \ - -i "${PKGLIBDIR}/modules.d/99base/dracut-dev-lib.sh" "/lib/dracut-dev-lib.sh" \ - --no-hostonly --no-hostonly-cmdline --nomdadmconf --nohardlink \ -f "$TESTDIR"/initramfs.root "$KVERSION" || return 1 mkdir -p "$TESTDIR"/overlay/source && mv "$TESTDIR"/dracut.*/initramfs/* "$TESTDIR"/overlay/source && rm -rf "$TESTDIR"/dracut.* @@ -55,22 +50,19 @@ test_setup() { # create an initramfs that will create the target root filesystem. # We do it this way so that we do not risk trashing the host mdraid # devices, volume groups, encrypted partitions, etc. - "$DRACUT" -l -i "$TESTDIR"/overlay / \ + "$DRACUT" -N -l -i "$TESTDIR"/overlay / \ -m "test-makeroot" \ -I "mkfs.btrfs" \ -i ./create-root.sh /lib/dracut/hooks/initqueue/01-create-root.sh \ - --nomdadmconf \ - --nohardlink \ - --no-hostonly-cmdline -N \ -f "$TESTDIR"/initramfs.makeroot "$KVERSION" || return 1 rm -rf -- "$TESTDIR"/overlay # Create the blank file to use as a root filesystem declare -a disk_args=() declare -i disk_index=0 - qemu_add_drive_args disk_index disk_args "$TESTDIR"/marker.img marker 1 - qemu_add_drive_args disk_index disk_args "$TESTDIR"/root.btrfs root 160 - qemu_add_drive_args disk_index disk_args "$TESTDIR"/usr.btrfs usr 160 + qemu_add_drive disk_index disk_args "$TESTDIR"/marker.img marker 1 + qemu_add_drive disk_index disk_args "$TESTDIR"/root.btrfs root 160 + qemu_add_drive disk_index disk_args "$TESTDIR"/usr.btrfs usr 160 # Invoke KVM and/or QEMU to actually create the target filesystem. "$testdir"/run-qemu \ @@ -83,12 +75,9 @@ test_setup() { return 1 fi - "$DRACUT" -l -i "$TESTDIR"/overlay / \ - -a "test watchdog" \ - -o "network kernel-network-modules" \ - -d "piix ide-gd_mod ata_piix btrfs sd_mod i6300esb ib700wdt" \ - --no-hostonly-cmdline -N \ - -f "$TESTDIR"/initramfs.testing "$KVERSION" || return 1 + test_dracut \ + -d "btrfs" \ + "$TESTDIR"/initramfs.testing rm -rf -- "$TESTDIR"/overlay } |