qemu.tests: readonly_floppy testcase

KVM readonly_floppy test:
1) pre_command on the host to generate the floppy media
    : "dd if=images/fd1.img bs=512 count=2880
      && dd if=images/fd2.img bs=512 count=2880"
2) Boot and login into a guest;
3) If the OS is linux, load the floppy module, or if
   it is a Windows,wait 20s until the floppies are ready to be used
4) Make filesystem against the floppy and reads the output of the
   command,check if there is 'Read-only'(for linux) or
   'protected'(for windows) keyword,if not,fail the test;
5) Close session to the VM

Signed-off-by: yacui <yacui@redhat.com>
Acked-by: Feng Yang <fyang@redhat.com>
Acked-by: Amos Kong <akong@redhat.com>

Update the wait_for_login() interface up to date in readonly floppy
to ignore the login easily failed problem.

Signed-off-by: Yiqiao Pu <ypu@redhat.com>
Acked-by: Qingtang Zhou <qzhou@redhat.com>

Fix typo error in readonly_floppy case

Signed-off-by: Xu Tian <xutian@redhat.com>
qemu.tests: Add readonly disk test for windows guest

Now this case only works for Windows guests.

changes from v1:
  - Get winutils letter from guest
  - Close session after testing
changes from v2:
  - Add the missing import

Signed-off-by: Yiqiao Pu <ypu@redhat.com>
Acked-by: Feng Yang <fyang@redhat.com>
qemu.tests: Add qcow2 performance cases

Add 5 qcow2 performance cases:
  - write
  - read
  - convert
  - rebase
  - commit

These tests will records the time for 1G size data operations.

changes from v1:
  - Update the log format for the results
  - Update the qemu-io command line with option -n

Signed-off-by: Yiqiao Pu <ypu@redhat.com>
Acked-by: Suqin Huang <shuang@redhat.com>

Support -t parameter in commit, rebase, convert function

Changes from v1:
Add cache_mode as a parameter of rebase, commit, convert function.

Signed-off-by: Feng Yang <fyang@redhat.com>

Send one command to write image by qemu-io
Before testing qcow2 performace, drop cache
Use "time strace -c" to get the result of commit/convert/rebase
Use "time" to test write/read time

changes from v1:
    1: instead commands.get_output function with frame function
    2: skip write offset 0 step when write offset 1 to get a clean image
    3: rename fd as result_file
changes from v2:
    1: remove "'\'" in code
    2: use writecmd to replace cmd, use iocmd to replace writecmd.

Signed-off-by: Xiaomei Gao <xigao@redhat.com>
Acked-by: Feng Yang <fyang@redhat.com>
qemu.tests: Add some qemu_io_blkdebug sub cases

Add the case cluster free for qemu_io_blkdebug

changes from v1:
  - typo fix

Signed-off-by: Yiqiao Pu <ypu@redhat.com>
Acked-by: Feng Yang <fyang@redhat.com>

Move the create operate inside the loop of different blkdebug cfg file
check to ignore the influnce of old image may cause in test. Also
add code to remove the old image after image operation in the loop.

Signed-off-by: Yiqiao Pu <ypu@redhat.com>
Acked-by: Feng Yang <fyang@redhat.com>

Add case qemu-io blkdebug l2_alloc.cow_read

Signed-off-by: Yiqiao Pu <ypu@redhat.com>
Acked-by: Feng Yang <fyang@redhat.com>

Add case qemu-io blkdebug l2_load

Signed-off-by: Yiqiao Pu <ypu@redhat.com>
Acked-by: Feng Yang <fyang@redhat.com>