summaryrefslogtreecommitdiffstats
path: root/test/TEST-01-BASIC
diff options
context:
space:
mode:
Diffstat (limited to '')
-rwxr-xr-xtest/TEST-01-BASIC/create-root.sh6
-rwxr-xr-xtest/TEST-01-BASIC/test-init.sh24
-rwxr-xr-xtest/TEST-01-BASIC/test.sh29
3 files changed, 12 insertions, 47 deletions
diff --git a/test/TEST-01-BASIC/create-root.sh b/test/TEST-01-BASIC/create-root.sh
index 633b11f..0fe0f67 100755
--- a/test/TEST-01-BASIC/create-root.sh
+++ b/test/TEST-01-BASIC/create-root.sh
@@ -12,11 +12,11 @@ udevadm settle
set -ex
-mkfs.ext4 -L ' rdinit=/bin/sh' /dev/disk/by-id/ata-disk_root
+mkfs.ext4 -q -L ' rdinit=/bin/sh' /dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_root
mkdir -p /root
-mount -t ext4 /dev/disk/by-id/ata-disk_root /root
+mount -t ext4 /dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_root /root
cp -a -t /root /source/*
mkdir -p /root/run
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 status=none of=/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_marker
poweroff -f
diff --git a/test/TEST-01-BASIC/test-init.sh b/test/TEST-01-BASIC/test-init.sh
deleted file mode 100755
index 108e626..0000000
--- a/test/TEST-01-BASIC/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-01-BASIC/test.sh b/test/TEST-01-BASIC/test.sh
index b3a8656..252c3f9 100755
--- a/test/TEST-01-BASIC/test.sh
+++ b/test/TEST-01-BASIC/test.sh
@@ -8,14 +8,13 @@ TEST_DESCRIPTION="root filesystem on a ext4 filesystem"
test_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.img root
+ qemu_add_drive disk_index disk_args "$TESTDIR"/marker.img marker
+ qemu_add_drive disk_index disk_args "$TESTDIR"/root.img root
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= rdinit=/bin/sh\" rw systemd.log_level=debug systemd.log_target=console rd.retry=3 rd.debug console=ttyS0,115200n81 rd.shell=0 $DEBUGFAIL" \
+ -append 'rw "root=LABEL= rdinit=/bin/sh" rd.retry=3' \
-initrd "$TESTDIR"/initramfs.testing || return 1
test_marker_check || return 1
@@ -23,12 +22,8 @@ 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 "${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.*
@@ -36,19 +31,16 @@ 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.ext4" \
-i ./create-root.sh /lib/dracut/hooks/initqueue/01-create-root.sh \
- --nomdadmconf \
- --no-hostonly-cmdline -N \
-f "$TESTDIR"/initramfs.makeroot "$KVERSION" || return 1
rm -rf -- "$TESTDIR"/overlay
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.img root 80
+ qemu_add_drive disk_index disk_args "$TESTDIR"/marker.img marker 1
+ qemu_add_drive disk_index disk_args "$TESTDIR"/root.img root 80
# Invoke KVM and/or QEMU to actually create the target filesystem.
"$testdir"/run-qemu \
@@ -59,12 +51,9 @@ test_setup() {
rm -- "$TESTDIR"/marker.img
# make sure --omit-drivers does not filter out drivers using regexp to test for an earlier regression (assuming there is no one letter linux kernel module needed to run the test)
- "$DRACUT" -l -i "$TESTDIR"/overlay / \
- -a "test watchdog" \
- -d "piix ide-gd_mod ata_piix ext4 sd_mod i6300esb ib700wdt" \
+ test_dracut \
--omit-drivers 'a b c d e f g h i j k l m n o p q r s t u v w x y z' \
- --no-hostonly-cmdline -N \
- -f "$TESTDIR"/initramfs.testing "$KVERSION" || return 1
+ "$TESTDIR"/initramfs.testing
}
# shellcheck disable=SC1090