未验证 提交 c2aefbfc 编写于 作者: L Longxiang Lyu 提交者: GitHub

Merge pull request #2151 from hellohellenmao/1814185

New case of cache_sizes_test
import logging
from provider import qemu_img_utils as img_utils
def run(test, params, env):
"""
Cache sizes test for a guest.
1. Boot a guest up with different cache sizes.
2. Check writing data to the guest works fine.
3. Shut the guest down.
:param test: Qemu test object
:param params: Dictionary with the test parameters
:param env: Dictionary with test environment
"""
file = params["guest_file_name"]
initial_tag = params["images"]
cache_sizes = params["cache_sizes"].split()
logging.info("Boot a guest up from initial image: %s, and create a"
" file %s on the disk.", initial_tag, file)
for cache_size in cache_sizes:
params["drv_extra_params"] = "cache-size=%s" % cache_size
vm = img_utils.boot_vm_with_images(test, params, env)
session = vm.wait_for_login()
guest_temp_file = params["guest_file_name"]
sync_bin = params.get("sync_bin", "sync")
logging.debug("Create temporary file on guest: %s", guest_temp_file)
img_utils.save_random_file_to_vm(vm, guest_temp_file, 2048 * 512,
sync_bin)
session.close()
vm.destroy()
- cache_sizes_test:
only qcow2
virt_test_type = qemu
type = cache_sizes_test
start_vm = no
kill_vm = yes
force_create_image = no
tmp_dir = /var/tmp
tmp_file_name = ${tmp_dir}/testfile
guest_file_name = ${tmp_file_name}
cache_sizes = "0 2 1024 65525 65527"
Windows:
guest_file_name = C:\testfile
x86_64:
sync_bin = WIN_UTILS:\Sync\sync64.exe /accepteula
i386, i686:
sync_bin = WIN_UTILS:\Sync\sync.exe /accepteula
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册