TEST-16-DMSQUASH: add code for IO throtteling in qemu

To test the mediacheck feature, I added commented out code with qemu IO
throtteling.
master
Harald Hoyer 2015-11-18 10:17:04 +01:00
parent 27d7936f0e
commit 90ac2d2429
2 changed files with 20 additions and 9 deletions

View File

@ -4,7 +4,7 @@ strstr() { [ "${1##*"$2"*}" != "$1" ]; }
CMDLINE=$(while read line || [ -n "$line" ]; do echo $line;done < /proc/cmdline) CMDLINE=$(while read line || [ -n "$line" ]; do echo $line;done < /proc/cmdline)
plymouth --quit plymouth --quit
exec >/dev/console 2>&1 exec >/dev/console 2>&1
echo "dracut-root-block-success" >/dev/sda echo "dracut-root-block-success" >/dev/sdb
export TERM=linux export TERM=linux
export PS1='initramfs-test:\w\$ ' export PS1='initramfs-test:\w\$ '
[ -f /etc/mtab ] || ln -sfn /proc/mounts /etc/mtab [ -f /etc/mtab ] || ln -sfn /proc/mounts /etc/mtab

View File

@ -4,7 +4,7 @@ TEST_DESCRIPTION="root filesystem on a LiveCD dmsquash filesystem"
KVERSION="${KVERSION-$(uname -r)}" KVERSION="${KVERSION-$(uname -r)}"


# Uncomment this to debug failures # Uncomment this to debug failures
#DEBUGFAIL="rd.shell rd.break" #DEBUGFAIL="rd.shell rd.break rd.debug systemd.log_level=debug systemd.log_target=console"


test_check() { test_check() {
if ! [ -d "/usr/lib/python2.7/site-packages/imgcreate" ]; then if ! [ -d "/usr/lib/python2.7/site-packages/imgcreate" ]; then
@ -17,12 +17,23 @@ test_check() {
test_run() { test_run() {
"$testdir"/run-qemu \ "$testdir"/run-qemu \
-boot order=d \ -boot order=d \
-cdrom "$TESTDIR"/livecd.iso \ -drive format=raw,bps=1000000,index=0,media=disk,file="$TESTDIR"/livecd.iso \
-drive format=raw,index=0,media=disk,file="$TESTDIR"/root.img \ -drive format=raw,index=1,media=disk,file="$TESTDIR"/root.img \
-m 256M -smp 2 -nographic \ -m 256M -smp 2 \
-nographic \
-net none \ -net none \
-append "root=live:CDLABEL=LiveCD live rw quiet rd.retry=3 rd.info console=ttyS0,115200n81 selinux=0 rd.debug systemd.log_level=debug systemd.log_target=console $DEBUGFAIL" \ -append "root=live:CDLABEL=LiveCD live rw quiet rd.retry=3 rd.info console=ttyS0,115200n81 selinux=0 $DEBUGFAIL" \
-initrd "$TESTDIR"/initramfs.testing -initrd "$TESTDIR"/initramfs.testing

# mediacheck test with qemu GUI
# "$testdir"/run-qemu \
# -drive format=raw,bps=1000000,index=0,media=disk,file="$TESTDIR"/livecd.iso \
# -drive format=raw,index=1,media=disk,file="$TESTDIR"/root.img \
# -m 256M -smp 2 \
# -net none \
# -append "root=live:CDLABEL=LiveCD live quiet rhgb selinux=0 rd.live.check" \
# -initrd "$TESTDIR"/initramfs.testing

grep -F -m 1 -q dracut-root-block-success -- "$TESTDIR"/root.img || return 1 grep -F -m 1 -q dracut-root-block-success -- "$TESTDIR"/root.img || return 1
} }