KVM-test: Add a ENOSPC subtest
PATCH 1/1 KVM-test: Add a ENOSPC subtest
From: Amos Kong <[email protected]>
KVM guest always pauses on NOSPACE error, this test just repeatedly extend guest disk space and resume guest from paused status.
Changes from v1:
- Use the most current KVM test API
- Use the autotest API for external commands execution
- Instead of chaining multiple shell commands as pre and post commands, create proper pre and post scripts for the test, as it is easier to figure out problems
- Instead of setting up /dev/loop0 hardcoded by default, find the first available loop device before and use it.
Signed-off-by Amos Kong <[email protected]>
--- client/tests/kvm/scripts/enospc-post.py | 74 +++++++++++++++++++++++++++++ client/tests/kvm/scripts/enospc-pre.py | 71 +++++++++++++++++++++++++++ client/tests/kvm/tests/enospc.py | 68 ++++++++++++++++++++++++++ client/tests/kvm/tests_base.cfg.sample | 14 +++++ 4 files changed, 227 insertions(+), 0 deletions(-) mode change 100644 => 100755 client/tests/kvm/scripts/bonding_setup.py mode change 100644 => 100755 client/tests/kvm/scripts/check_image.py create mode 100755 client/tests/kvm/scripts/enospc-post.py create mode 100755 client/tests/kvm/scripts/enospc-pre.py create mode 100644 client/tests/kvm/tests/enospc.py
client/tests/kvm/scripts/bonding_setup.py +0 -0
client/tests/kvm/scripts/check_image.py +0 -0
client/tests/kvm/scripts/enospc-post.py new file +74 -0
74 lines not on this page · raw message
client/tests/kvm/scripts/enospc-pre.py new file +71 -0
71 lines not on this page · raw message
client/tests/kvm/tests/enospc.py new file +68 -0
68 lines not on this page · raw message
client/tests/kvm/tests_base.cfg.sample +14 -0
@@ -591,6 +591,20 @@ variants: - fmt_raw: image_format_stg = raw + - enospc: + type = enospc + images += " stg" + drive_werror = stop + drive_cache = none + image_name_stg = enospc + image_format_stg = qcow2 + image_boot_stg = no + image_snapshot_stg = no + background_cmd = "nohup dd if=/dev/zero of=%s bs=1024 &" + pre_command += "qemu-img create -f raw /tmp/enospc.raw 10G && losetup /dev/loop0 /tmp/enospc.raw && pvcreate /dev/loop0 && vgcreate vgtest /dev/loop0 && lvcreate -L200M -n lvtest vgtest && qemu-img create -f qcow2 /dev/vgtest/lvtest 10G && ln -s /dev/vgtest/lvtest /tmp/kvm_autotest_root/images/enospc.qcow2;" + post_command += "lvremove -f vgtest; losetup -d /dev/loop0; rm -rf /tmp/enospc.raw /tmp/kvm_autotest_root/images/enospc.qcow2;" + kill_vm = yes + - qmp_basic: install setup unattended_install.cdrom type = qmp_basic
Signature · 1 line
1.7.3.4