qemu.tests.cdrom: Add a cdrom locked case

Lock status should only works for tray open. So the
cdrom should can be closed under locked status.

Signed-off-by: Yiqiao Pu <ypu@redhat.com>
Signed-off-by: Qingtang Zhou <qzhou@redhat.com>
qemu.tests.cfg: Add cdrom locked case in cfg files

Signed-off-by: Yiqiao Pu <ypu@redhat.com>
Signed-off-by: Qingtang Zhou <qzhou@redhat.com>
qemu.tests: cdrom.py: Add sub test support

Signed-off-by: Qingtang Zhou <qzhou@redhat.com>
Acked-by: Feng Yang <fyang@redhat.com>
virt.cfg: Update config files for cdrom with acpi testing

Signed-off-by: Qingtang Zhou <qzhou@redhat.com>
Acked-by: Feng Yang <fyang@redhat.com>
virt.qemu_vm: Support cdrom device without iso filename

This patch make qemu_vm module work with a cdrom device
without assigning an iso file to it.

Signed-off-by: Yiqiao Pu <ypu@redhat.com>
Signed-off-by: Qingtang Zhou <qzhou@redhat.com>
qemu.tests.cdrom: Add lock check case when media is not present

Add the case that check if the cdrom can be locked without the media
presend.

Signed-off-by: Yiqiao Pu <ypu@redhat.com>
Signed-off-by: Qingtang Zhou <qzhou@redhat.com>
qemu.tests.cdrom: make cdrom test compatible with rhel6 and rhel7

RHEL6 qmp monitor uses "tray_open" string to identify cdrom tray
status, but rhel7 uses "tray-open" string.
This patch is about to make cdrom test script compatible with
rhel6 and rhel7 qmp monitor output.

This patch also makes script print steps to INFO log file.

Signed-off-by: Xu Tian <xutian@redhat.com>
Signed-off-by: Qingtang Zhou <qzhou@redhat.com>
Acked-by: Yiqiao Pu <ypu@redhat.com>
qemu.tests.cdrom: Rename get_cdrom_device

Rename this function to get_empty_cdrom_device, to make its name
match what it does.

Signed-off-by: Qingtang Zhou <qzhou@redhat.com>
qemu.tests.cdrom: Update get_cdrom_file function

Break the for-loop if we find the matched file name, and slightly
update the code flow to let this function have a single exit.

Signed-off-by: Qingtang Zhou <qzhou@redhat.com>
Acked-by: Xu Tian <xutian@redhat.com>
qemu.tests.cdrom: Seperate check_cdrom_tray function

Create a separated function to deal with monitor commands,
And add the missing docstring.

Signed-off-by: Qingtang Zhou <qzhou@redhat.com>
qemu.tests.cdrom: Rename check_cdrom_tray to is_tray_opened

Signed-off-by: Qingtang Zhou <qzhou@redhat.com>
qemu.tests.cdrom: Put all subtests into functions

This patch creates a series of functions for subtests in cdrom
testing, and add some parameters to enable/disable these subtests.

Signed-off-by: Qingtang Zhou <qzhou@redhat.com>
qemu.tests.cdrom: Fix error log message

Signed-off-by: Qingtang Zhou <qzhou@redhat.com>
Acked-by: Xu Tian <xutian@redhat.com>
qemu.tests.cdrom: Fix coding style problem

Signed-off-by: Qingtang Zhou <qzhou@redhat.com>
qemu.tests.cdrom: Update docstring and context

Signed-off-by: Qingtang Zhou <qzhou@redhat.com>
qemu.tests.cdrom: Rename max_times to cdrom_max_test_times

To avoid possible conflict with other tests.

Signed-off-by: Qingtang Zhou <qzhou@redhat.com>
Acked-by: Xu Tian <xutian@redhat.com>