From d6908288ec77fd2e302f32c003d5d84a5dc7d8ca Mon Sep 17 00:00:00 2001 From: Vimal Patel Date: Wed, 13 Feb 2013 11:56:35 -0500 Subject: [PATCH 01/16] Refactoring the config files for spice tests. Refactoring the config files by moving all the separate cfg files per test to one, and removing the redundancies set in each one. Refactoring the base tests-spice.cfg to clean up the redundancies also and split up the tests per platform to be tested on. Signed-off-by: Vimal Patel Signed-off-by: Marian Krcmarik --- qemu/cfg/tests-spice.cfg | 289 ++++++++++------------------ qemu/tests/cfg/fullscreen_setup.cfg | 23 --- qemu/tests/cfg/rv_connect.cfg | 24 --- qemu/tests/cfg/rv_connect_win.cfg | 28 --- qemu/tests/cfg/rv_copyandpaste.cfg | 40 ---- qemu/tests/cfg/rv_disconnect.cfg | 23 --- qemu/tests/cfg/rv_fullscreen.cfg | 24 --- qemu/tests/cfg/rv_input.cfg | 24 --- qemu/tests/cfg/rv_logging.cfg | 32 --- qemu/tests/cfg/spice.cfg | 92 +++++++++ 10 files changed, 199 insertions(+), 400 deletions(-) delete mode 100644 qemu/tests/cfg/fullscreen_setup.cfg delete mode 100644 qemu/tests/cfg/rv_connect.cfg delete mode 100644 qemu/tests/cfg/rv_connect_win.cfg delete mode 100644 qemu/tests/cfg/rv_copyandpaste.cfg delete mode 100644 qemu/tests/cfg/rv_disconnect.cfg delete mode 100644 qemu/tests/cfg/rv_fullscreen.cfg delete mode 100644 qemu/tests/cfg/rv_input.cfg delete mode 100644 qemu/tests/cfg/rv_logging.cfg create mode 100644 qemu/tests/cfg/spice.cfg diff --git a/qemu/cfg/tests-spice.cfg b/qemu/cfg/tests-spice.cfg index af94b7c27..88030eefb 100644 --- a/qemu/cfg/tests-spice.cfg +++ b/qemu/cfg/tests-spice.cfg @@ -1,10 +1,52 @@ include tests-shared.cfg image_size = 20G +spice_seamless_migration = on +drive_cache=none + +# Use non-root user for Spice tests rather than root +# since User gnome session is needed. +username=test +password=123456 + +# Use static MAC addresses for spice tests to have +# the same IP in all test. +nics = nic1 nic2 +nics_vm1 = nic1 +nics_vm2 = nic2 +mac_nic1 = 9a:96:97:98:99:9a +mac_nic2 = 9a:9b:9c:9d:9e:9f + +qemu_binary = /usr/libexec/qemu-kvm +qemu_img_binary = /usr/bin/qemu-img +qemu_io_binary = /usr/bin/qemu-io +rv_binary = /usr/bin/remote-viewer + +# Only qcow2 file format +only qcow2 +# Only e1000 for nw card +only e1000 +# Only ide hard drives +only ide +# qemu-kvm will start with a single processor +only up +# Disable 9p export by default +only no_9p_export +# No PCI assignable devices +only no_pci_assignable +# No large memory pages +only smallpages variants: - qxl: + - os: + variants: + - RHEL: + only Linux.RHEL.6.devel.x86_64 + - Windows: + only Win7.64.sp1 + variants: - vnc: display = vnc @@ -141,225 +183,83 @@ variants: variants: - qemu_kvm_rhel6devel_install_client: - # Use this only when you need to create rhel6devel image qcow - qemu_binary = /usr/libexec/qemu-kvm - qemu_img_binary = /usr/bin/qemu-img - qemu_io_binary = /usr/bin/qemu-io - image_name = images/rhel6devel-64_client - only qcow2 - only rtl8139 - only ide - only smp2 - only no_9p_export - only no_pci_assignable - only smallpages - only Linux.RHEL.6.devel.x86_64 + image_name += "_client" + only os.RHEL only spice.default_ipv.default_pc.default_sv.default_zlib_wc.default_jpeg_wc.default_ic.no_ssl.no_password.dcp_off.1monitor only unattended_install.cdrom.extra_cdrom_ks # Runs qemu-kvm Windows guest install - @qemu_kvm_windows_install_guest: - # We want qemu-kvm for this run - qemu_binary = /usr/libexec/qemu-kvm - qemu_img_binary = /usr/bin/qemu-img - qemu_io_binary = /usr/bin/qemu-io - # Only qcow2 file format - only qcow2 - # Only rtl8139 for nw card (default on qemu-kvm) - only rtl8139 - # Only ide hard drives - only ide - # qemu-kvm will start only with -smp 2 (2 processors) - only smp2 - # Disable 9p export by default - only no_9p_export - # No PCI assignable devices - only no_pci_assignable - # No large memory pages - only smallpages - # Operating system choice - only Win7.64.sp1 + only os.Windows # Subtest choice. You can modify that line to add more subtests only spice.default_ipv.default_pc.default_sv.default_zlib_wc.default_jpeg_wc.default_ic.no_ssl.no_password.dcp_off.1monitor only unattended_install.cdrom - - qemu_kvm_rhel6devel_install_guest: - # Use this only when you need to create rhel6devel image qcow - qemu_binary = /usr/libexec/qemu-kvm - qemu_img_binary = /usr/bin/qemu-img - qemu_io_binary = /usr/bin/qemu-io - only qcow2 - only rtl8139 - only ide - only smp2 - only no_9p_export - only no_pci_assignable - only smallpages - only Linux.RHEL.6.devel.x86_64 + only os.RHEL only spice.default_ipv.default_pc.default_sv.default_zlib_wc.default_jpeg_wc.default_ic.no_ssl.no_password.dcp_off.1monitor only unattended_install.cdrom.extra_cdrom_ks - @remote_viewer_rhel6develssl: - qemu_binary = /usr/libexec/qemu-kvm - qemu_img_binary = /usr/bin/qemu-img - qemu_io_binary = /usr/bin/qemu-io - rv_binary = /usr/bin/remote-viewer - only qcow2 - only e1000 - only ide - only up - only no_9p_export - only no_pci_assignable - only smallpages - only Linux.RHEL.6.devel.x86_64 + only os.RHEL only spice.default_ipv.default_pc.default_sv.default_zlib_wc.default_jpeg_wc.default_ic.ssl.key_password.password.dcp_off.1monitor - only rv_connect.RHEL.6.devel.x86_64, shutdown + only rv.rr.rv_connect.RHEL.6.devel.x86_64, rv.rr.client_guest_shutdown.RHEL.6.devel.x86_64 - @remote_viewer_rhel6devel_quick: - qemu_binary = /usr/libexec/qemu-kvm - qemu_img_binary = /usr/bin/qemu-img - qemu_io_binary = /usr/bin/qemu-io - rv_binary = /usr/bin/remote-viewer - only qcow2 - only e1000 - only ide - only up - only no_9p_export - only no_pci_assignable - only smallpages - only Linux.RHEL.6.devel.x86_64 + only os.RHEL + only spice.default_ipv.default_pc.default_sv.default_zlib_wc.default_jpeg_wc.default_ic.no_ssl.no_password.dcp_off.1monitor + only rv.rr.rv_connect.RHEL.6.devel.x86_64, rv.rr.client_guest_shutdown.RHEL.6.devel.x86_64 + + - @remote_viewer_rhel6devel_password: + only os.RHEL only spice.default_ipv.default_pc.default_sv.default_zlib_wc.default_jpeg_wc.default_ic.no_ssl.no_password.dcp_off.1monitor - only rv_connect.RHEL.6.devel.x86_64, shutdown + only rv.rr.rv_connect.RHEL.6.devel.x86_64, rv.rr.client_guest_shutdown.RHEL.6.devel.x86_64 - @remote_viewer_win_guest_quick: - qemu_binary = /usr/libexec/qemu-kvm - qemu_img_binary = /usr/bin/qemu-img - qemu_io_binary = /usr/bin/qemu-io - rv_binary = /usr/bin/remote-viewer - only qcow2 - only e1000 - only ide - only up - only no_9p_export - only no_pci_assignable - only smallpages - only Win7.64.sp1 + only os.Windows only spice.default_ipv.default_pc.default_sv.default_zlib_wc.default_jpeg_wc.default_ic.no_ssl.no_password.dcp_off.1monitor #rv_connect_win is specifically a test meant for a windows guest and a rhel client, rv_connect cannot be used. - only rv_connect_win.RHEL.6.devel.x86_64, shutdown + only rv.rw.rv_connect.RHEL.6.devel.x86_64, rv.rr.client_guest_shutdown.RHEL.6.devel.x86_64 - @spice_negative_rhel6devel: - qemu_binary = /usr/libexec/qemu-kvm - qemu_img_binary = /usr/bin/qemu-img - qemu_io_binary = /usr/bin/qemu-io - rv_binary = /usr/bin/remote-viewer - only qcow2 - only e1000 - only ide - only up - only no_9p_export - only no_pci_assignable - only smallpages - only Linux.RHEL.6.devel.x86_64 + only os.RHEL only negative_create - @rv_disconnect_rhel6devel: - qemu_binary = /usr/libexec/qemu-kvm - qemu_img_binary = /usr/bin/qemu-img - qemu_io_binary = /usr/bin/qemu-io - rv_binary = /usr/bin/remote-viewer - only qcow2 - only e1000 - only ide - only up - only no_9p_export - only no_pci_assignable - only smallpages - only Linux.RHEL.6.devel.x86_64 + only os.RHEL only spice.default_ipv.default_pc.default_sv.default_zlib_wc.default_jpeg_wc.default_ic.no_ssl.no_password.dcp_off.1monitor - only rv_connect.RHEL.6.devel.x86_64, rv_disconnect.RHEL.6.devel.x86_64, shutdown + only rv.rr.rv_connect.RHEL.6.devel.x86_64, rv.rr.rv_disconnect.RHEL.6.devel.x86_64, rv.rr.client_guest_shutdown.RHEL.6.devel.x86_64 - @rv_fullscreen_rhel6devel: - qemu_binary = /usr/libexec/qemu-kvm - qemu_img_binary = /usr/bin/qemu-img - qemu_io_binary = /usr/bin/qemu-io - rv_binary = /usr/bin/remote-viewer - spice_port = 3000 - only qcow2 - only e1000 - only ide - only up - only no_9p_export - only no_pci_assignable - only smallpages - only Linux.RHEL.6.devel.x86_64 + spice_port=3000 + only os.RHEL only spice.default_ipv.default_pc.default_sv.default_zlib_wc.default_jpeg_wc.default_ic.no_ssl.no_password.dcp_off.1monitor - only fullscreen_setup.RHEL.6.devel.x86_64, rv_connect.RHEL.6.devel.x86_64, rv_fullscreen.RHEL.6.devel.x86_64, shutdown + only rv.rr.fullscreen_setup.RHEL.6.devel.x86_64, rv.rr.rv_connect.RHEL.6.devel.x86_64, rv.rr.rv_fullscreen.RHEL.6.devel.x86_64, rv.rr.client_guest_shutdown.RHEL.6.devel.x86_64 - @rv_logging_rhel6devel: - qemu_binary = /usr/libexec/qemu-kvm - qemu_img_binary = /usr/bin/qemu-img - qemu_io_binary = /usr/bin/qemu-io - rv_binary = /usr/bin/remote-viewer - only qcow2 - only e1000 - only ide - only up - only no_9p_export - only no_pci_assignable - only smallpages - only Linux.RHEL.6.devel.x86_64 + only os.RHEL only spice.default_ipv.default_pc.default_sv.default_zlib_wc.default_jpeg_wc.default_ic.no_ssl.no_password.dcp_off.1monitor - only rv_connect.RHEL.6.devel.x86_64, rv_logging.RHEL.6.devel.x86_64, shutdown + only rv.rr.rv_connect.RHEL.6.devel.x86_64, rv.rr.rv_logging.RHEL.6.devel.x86_64, rv.rr.client_guest_shutdown.RHEL.6.devel.x86_64 - @rv_copyandpaste_rhel6devel: - qemu_binary = /usr/libexec/qemu-kvm - qemu_img_binary = /usr/bin/qemu-img - qemu_io_binary = /usr/bin/qemu-io - rv_binary = /usr/bin/remote-viewer - only qcow2 - only e1000 - only ide - only up - only no_9p_export - only no_pci_assignable - only smallpages + only os.RHEL only spice.default_ipv.default_pc.default_sv.default_zlib_wc.default_jpeg_wc.default_ic.no_ssl.no_password.dcp_off.1monitor - only Linux.RHEL.6.devel.x86_64 - only rv_connect.RHEL.6.devel.x86_64, rv_copyandpaste.RHEL.6.devel.x86_64, shutdown + only rv.rr.rv_connect.RHEL.6.devel.x86_64, rv.rr.rv_copyandpaste.RHEL.6.devel.x86_64, rv.rr.client_guest_shutdown.RHEL.6.devel.x86_64 - @rv_copyandpaste_dcp_rhel6devel: - qemu_binary = /usr/libexec/qemu-kvm - qemu_img_binary = /usr/bin/qemu-img - qemu_io_binary = /usr/bin/qemu-io - rv_binary = /usr/bin/remote-viewer - only qcow2 - only e1000 - only ide - only up - only no_9p_export - only no_pci_assignable - only smallpages + only os.RHEL only spice.default_ipv.default_pc.default_sv.default_zlib_wc.default_jpeg_wc.default_ic.no_ssl.no_password.dcp_on.1monitor - only Linux.RHEL.6.devel.x86_64 - only rv_connect.RHEL.6.devel.x86_64, rv_copyandpaste.RHEL.6.devel.x86_64, shutdown + only rv.rr.rv_connect.RHEL.6.devel.x86_64, rv.rr.rv_copyandpaste.RHEL.6.devel.x86_64, rv.rr.client_guest_shutdown.RHEL.6.devel.x86_64 - @rv_input_rhel6devel: - qemu_binary = /usr/libexec/qemu-kvm - qemu_img_binary = /usr/bin/qemu-img - qemu_io_binary = /usr/bin/qemu-io - rv_binary = /usr/bin/remote-viewer - only qcow2 - only e1000 - only ide - only up - only no_9p_export - only no_pci_assignable - only smallpages - only Linux.RHEL.6.devel.x86_64 + only os.RHEL only spice.default_ipv.default_pc.default_sv.default_zlib_wc.default_jpeg_wc.default_ic.no_ssl.no_password.dcp_off.1monitor - only rv_connect.RHEL.6.devel.x86_64, rv_input.RHEL.6.devel.x86_64, shutdown + only rv.rr.rv_connect.RHEL.6.devel.x86_64, rv.rr.rv_input.RHEL.6.devel.x86_64, rv.rr.client_guest_shutdown.RHEL.6.devel.x86_64 + + - @rv_vmshutdown_rhel6devel: + only os.RHEL + only spice.default_ipv.default_pc.default_sv.default_zlib_wc.default_jpeg_wc.default_ic.no_ssl.no_password.dcp_off.1monitor + only rv.rr.rv_connect.RHEL.6.devel.x86_64, rv.rr.rv_vmshutdown.RHEL.6.devel.x86_64, rv.rr.client_guest_shutdown.RHEL.6.devel.x86_64 variants: #The following are all the individual tests for spice @@ -387,6 +287,24 @@ variants: only spice_negative_rhel6devel - remote_viewer_test: only remote_viewer_rhel6devel_quick + - rv_connect_passwd: + only remote_viewer_rhel6devel_password + - rv_connect_wrong_passwd: + test_type = negative + spice_password_send = incorrectpass + only remote_viewer_rhel6devel_password + - rv_qemu_password: + qemu_password = qemupassword + only remote_viewer_rhel6devel_quick + - rv_qemu_password_overwrite: + qemu_password = qemupassword + only remote_viewer_rhel6devel_password + - guestvmshutdown_cmd: + shutdownfrom = cmd + only rv_vmshutdown_rhel6devel + - guestvmshutdown_qemu: + shutdownfrom = qemu_monitor + only rv_vmshutdown_rhel6devel - remote_viewer_fullscreen_test: full_screen = yes only rv_fullscreen_rhel6devel @@ -517,15 +435,19 @@ variants: text_to_test=262144 only rv_copyandpaste_rhel6devel - keyboard_input_leds_and_esc_keys: + full_screen = yes config_test = "leds_and_esc_keys" only rv_input_rhel6devel - keyboard_input_non-us_layout: + full_screen = yes config_test = "nonus_layout" only rv_input_rhel6devel - keyboard_input_type_and_func_keys: + full_screen = yes config_test = "type_and_func_keys" only rv_input_rhel6devel - keyboard_input_leds_migration: + full_screen = yes config_test = "leds_migration" only rv_input_rhel6devel - qxl_logging: @@ -534,11 +456,14 @@ variants: logtest = spice-vdagent only rv_logging_rhel6devel -#Running all Logging Tests -#only spice_vdagent_logging, qxl_logging +#Running all RHEL Client, RHEL Guest Spice Tests +only create_vms, negative_qemu_spice_launch_badport, negative_qemu_spice_launch_badic, negative_qemu_spice_launch_badjpegwc, negative_qemu_spice_launch_badzlib, negative_qemu_spice_launch_badsv, negative_qemu_spice_launch_badpc, remote_viewer_test, remote_viewer_ssl_test, remote_viewer_disconnect_test, guestvmshutdown_cmd, guestvmshutdown_qemu, copy_client_to_guest_largetext_pos, copy_guest_to_client_largetext_pos, copy_client_to_guest_pos, copy_guest_to_client_pos, copy_guest_to_client_neg, copy_client_to_guest_neg, copyimg_client_to_guest_pos, copyimg_client_to_guest_neg, copyimg_guest_to_client_pos, copyimg_guest_to_client_neg, copyimg_client_to_guest_dcp_neg, copyimg_guest_to_client_dcp_neg, copy_guest_to_client_dcp_neg, copy_client_to_guest_dcp_neg, copybmpimg_client_to_guest_pos, copybmpimg_guest_to_client_pos, copy_guest_to_client_largetext_10mb_pos, copy_client_to_guest_largetext_10mb_pos, copyimg_medium_client_to_guest_pos, copyimg_medium_guest_to_client_pos, copyimg_large_client_to_guest_pos, copyimg_large_guest_to_client_pos, restart_vdagent_copy_client_to_guest_pos, restart_vdagent_copy_guest_to_client_pos, restart_vdagent_copyimg_client_to_guest_pos, restart_vdagent_copyimg_guest_to_client_pos, restart_vdagent_copybmpimg_client_to_guest_pos, restart_vdagent_copybmpimg_guest_to_client_pos, restart_vdagent_copy_client_to_guest_largetext_pos, restart_vdagent_copy_guest_to_client_largetext_pos, remote_viewer_fullscreen_test, remote_viewer_fullscreen_test_neg, spice_vdagent_logging, qxl_logging, keyboard_input_leds_and_esc_keys, keyboard_input_non-us_layout, keyboard_input_type_and_func_keys, keyboard_input_leds_migration, rv_connect_passwd, rv_connect_wrong_passwd, rv_qemu_password, rv_qemu_password_overwrite + +#Running all RHEL Client, Windows Guest Spice Tests +#only install_win_guest, remote_viewer_winguest_test -#Spice Vdagent Tests: -#only copy_client_to_guest_largetext_pos, copy_guest_to_client_largetext_pos, copy_client_to_guest_pos, copy_guest_to_client_pos, copy_guest_to_client_neg, copy_client_to_guest_neg, copyimg_client_to_guest_pos, copyimg_client_to_guest_neg, copyimg_guest_to_client_pos, copyimg_guest_to_client_neg, copyimg_client_to_guest_dcp_neg, copyimg_guest_to_client_dcp_neg, copy_guest_to_client_dcp_neg, copy_client_to_guest_dcp_neg, copybmpimg_client_to_guest_pos, copybmpimg_guest_to_client_pos, copy_guest_to_client_largetext_10mb_pos, copy_client_to_guest_largetext_10mb_pos, copyimg_medium_client_to_guest_pos, copyimg_medium_guest_to_client_pos, copyimg_large_client_to_guest_pos, copyimg_large_guest_to_client_pos, restart_vdagent_copy_client_to_guest_pos, only restart_vdagent_copy_guest_to_client_pos, restart_vdagent_copyimg_client_to_guest_pos, restart_vdagent_copyimg_guest_to_client_pos, restart_vdagent_copybmpimg_client_to_guest_pos, restart_vdagent_copybmpimg_guest_to_client_pos, restart_vdagent_copy_client_to_guest_largetext_pos, restart_vdagent_copy_guest_to_client_largetext_pos +#Running all Windows Client, RHEL Guest Spice Tests +#to be added -#Running all Spice Tests -only create_vms, install_win_guest, negative_qemu_spice_launch_badport, negative_qemu_spice_launch_badic, negative_qemu_spice_launch_badjpegwc, negative_qemu_spice_launch_badzlib, negative_qemu_spice_launch_badsv, negative_qemu_spice_launch_badpc, remote_viewer_test, remote_viewer_ssl_test, remote_viewer_winguest_test, remote_viewer_disconnect_test, copy_client_to_guest_largetext_pos, copy_guest_to_client_largetext_pos, copy_client_to_guest_pos, copy_guest_to_client_pos, copy_guest_to_client_neg, copy_client_to_guest_neg, copyimg_client_to_guest_pos, copyimg_client_to_guest_neg, copyimg_guest_to_client_pos, copyimg_guest_to_client_neg, copyimg_client_to_guest_dcp_neg, copyimg_guest_to_client_dcp_neg, copy_guest_to_client_dcp_neg, copy_client_to_guest_dcp_neg, copybmpimg_client_to_guest_pos, copybmpimg_guest_to_client_pos, copy_guest_to_client_largetext_10mb_pos, copy_client_to_guest_largetext_10mb_pos, copyimg_medium_client_to_guest_pos, copyimg_medium_guest_to_client_pos, copyimg_large_client_to_guest_pos, copyimg_large_guest_to_client_pos, restart_vdagent_copy_client_to_guest_pos, only restart_vdagent_copy_guest_to_client_pos, restart_vdagent_copyimg_client_to_guest_pos, restart_vdagent_copyimg_guest_to_client_pos, restart_vdagent_copybmpimg_client_to_guest_pos, restart_vdagent_copybmpimg_guest_to_client_pos, restart_vdagent_copy_client_to_guest_largetext_pos, restart_vdagent_copy_guest_to_client_largetext_pos, remote_viewer_fullscreen_test, remote_viewer_fullscreen_test_neg, spice_vdagent_logging, qxl_logging, keyboard_input_leds_and_esc_keys, keyboard_input_non-us_layout, keyboard_input_type_and_func_keys, keyboard_input_leds_migration +#Running all Windows Client, Windows Guest Spice Tests +#to be added diff --git a/qemu/tests/cfg/fullscreen_setup.cfg b/qemu/tests/cfg/fullscreen_setup.cfg deleted file mode 100644 index 0bc09a496..000000000 --- a/qemu/tests/cfg/fullscreen_setup.cfg +++ /dev/null @@ -1,23 +0,0 @@ -- fullscreen_setup: - no JeOS - type = fullscreen_setup - vms = vm1 vm2 - guest_vm = vm1 - client_vm = vm2 - image_name_vm2 = client_vm - display_vm2 = vnc - vga_vm2 = cirrus - virtio_ports_vm1 = "vdagent" - virtio_port_type_vm1 = "serialport" - virtio_port_chardev_vm1 = "spicevmc" - virtio_port_name_prefix_vm1 = "com.redhat.spice." - - variants: - - RHEL: - variants: - # This is current solution of handling - # multiple guests running exact same OS - -6.3.x86_64: - image_name_vm2 = images/rhel6devel-64_client - -6.3.i386: - image_name_vm2 = images/rhel6devel-32_client diff --git a/qemu/tests/cfg/rv_connect.cfg b/qemu/tests/cfg/rv_connect.cfg deleted file mode 100644 index 4b4a4c543..000000000 --- a/qemu/tests/cfg/rv_connect.cfg +++ /dev/null @@ -1,24 +0,0 @@ -- rv_connect: - no JeOS - type = rv_connect - vms = vm1 vm2 - guest_vm = vm1 - client_vm = vm2 - image_name_vm2 = client_vm - display_vm2 = vnc - vga_vm2 = cirrus - full_screen = no - virtio_ports_vm1 = "vdagent" - virtio_port_type_vm1 = "serialport" - virtio_port_chardev_vm1 = "spicevmc" - virtio_port_name_prefix_vm1 = "com.redhat.spice." - - variants: - - RHEL: - variants: - # This is current solution of handling - # multiple guests running exact same OS - -6.3.x86_64: - image_name_vm2 = images/rhel6devel-64_client - -6.3.i386: - image_name_vm2 = images/rhel6devel-32_client diff --git a/qemu/tests/cfg/rv_connect_win.cfg b/qemu/tests/cfg/rv_connect_win.cfg deleted file mode 100644 index 6422d4250..000000000 --- a/qemu/tests/cfg/rv_connect_win.cfg +++ /dev/null @@ -1,28 +0,0 @@ -- rv_connect_win: - no JeOS - type = rv_connect - vms = vm1 vm2 - guest_vm = vm1 - client_vm = vm2 - image_name_vm2 = client_vm - display_vm2 = vnc - os_type_vm2 = linux - shell_prompt_vm2 = ^\[.*\][\#\$]\s*$ - shell_client_vm2 = ssh - username_vm2 = root - shell_port_vm2 = 22 - status_test_command_vm2 = echo $? - virtio_ports_vm1 = "vdagent" - virtio_port_type_vm1 = "serialport" - virtio_port_chardev_vm1 = "spicevmc" - virtio_port_name_prefix_vm1 = "com.redhat.spice." - - variants: - - RHEL: - variants: - # This is current solution of handling - # multiple guests running exact same OS - -6.3.x86_64: - image_name_vm2 = images/rhel6devel-64_client - -6.3.i386: - image_name_vm2 = images/rhel6devel-32_client diff --git a/qemu/tests/cfg/rv_copyandpaste.cfg b/qemu/tests/cfg/rv_copyandpaste.cfg deleted file mode 100644 index f0782b34c..000000000 --- a/qemu/tests/cfg/rv_copyandpaste.cfg +++ /dev/null @@ -1,40 +0,0 @@ -- rv_copyandpaste: rv_connect - no JeOS - type = rv_copyandpaste - vms = vm1 vm2 - shell_prompt_vm2 = ^\[.*\][\#\$]\s*$ - guest_vm = vm1 - client_vm = vm2 - image_name_vm2 = client_vm - display_vm2 = vnc - vga_vm2 = cirrus - interpreter = python - dst_dir = /tmp - guest_script = cb.py - script_params_img_set = --set_image - script_params_img_save = -m - script_params_writef = -f - script_params_createf = -n - final_textfile = StringLengthTest.txt - final_image = PNGTest.png - image_tocopy_name = Image-small.png - final_image_bmp = BMPTest.bmp - image_tocopy_name_bmp = Image2.bmp - image_type = png - script_params = --set - script_params_clear = --clear - text_to_test = Testing_this_text_was_copied - virtio_ports_vm1 = "vdagent" - virtio_port_type_vm1 = "serialport" - virtio_port_chardev_vm1 = "spicevmc" - virtio_port_name_prefix_vm1 = "com.redhat.spice." - - variants: - - RHEL: - variants: - # This is current solution of handling - # multiple guests running exact same OS - -6.3.x86_64: - image_name_vm2 = images/rhel6devel-64_client - -6.3.i386: - image_name_vm2 = images/rhel6devel-32_client diff --git a/qemu/tests/cfg/rv_disconnect.cfg b/qemu/tests/cfg/rv_disconnect.cfg deleted file mode 100644 index c064cf837..000000000 --- a/qemu/tests/cfg/rv_disconnect.cfg +++ /dev/null @@ -1,23 +0,0 @@ -- rv_disconnect: rv_connect - no JeOS - type = rv_disconnect - vms = vm1 vm2 - guest_vm = vm1 - client_vm = vm2 - image_name_vm2 = client_vm - display_vm2 = vnc - vga_vm2 = cirrus - virtio_ports_vm1 = "vdagent" - virtio_port_type_vm1 = "serialport" - virtio_port_chardev_vm1 = "spicevmc" - virtio_port_name_prefix_vm1 = "com.redhat.spice." - - variants: - - RHEL: - variants: - # This is current solution of handling - # multiple guests running exact same OS - -6.3.x86_64: - image_name_vm2 = images/rhel6devel-64_client - -6.3.i386: - image_name_vm2 = images/rhel6devel-32_client diff --git a/qemu/tests/cfg/rv_fullscreen.cfg b/qemu/tests/cfg/rv_fullscreen.cfg deleted file mode 100644 index a3fb611a1..000000000 --- a/qemu/tests/cfg/rv_fullscreen.cfg +++ /dev/null @@ -1,24 +0,0 @@ -- rv_fullscreen: rv_connect - no JeOS - type = rv_fullscreen - vms = vm1 vm2 - guest_vm = vm1 - client_vm = vm2 - image_name_vm2 = client_vm - display_vm2 = vnc - vga_vm2 = cirrus - virtio_ports_vm1 = "vdagent" - virtio_port_type_vm1 = "serialport" - virtio_port_chardev_vm1 = "spicevmc" - virtio_port_name_prefix_vm1 = "com.redhat.spice." - - - variants: - - RHEL: - variants: - # This is current solution of handling - # multiple guests running exact same OS - -6.3.x86_64: - image_name_vm2 = images/rhel6devel-64_client - -6.3.i386: - image_name_vm2 = images/rhel6devel-32_client diff --git a/qemu/tests/cfg/rv_input.cfg b/qemu/tests/cfg/rv_input.cfg deleted file mode 100644 index 8890498b0..000000000 --- a/qemu/tests/cfg/rv_input.cfg +++ /dev/null @@ -1,24 +0,0 @@ -- rv_input: rv_connect - type = rv_input - vms = vm1 vm2 - guest_vm = vm1 - client_vm = vm2 - image_name_vm2 = client_vm - display_vm2 = vnc - vga_vm2 = cirrus - full_screen = "False" - guest_script = key_event_form.py - virtio_ports_vm1 = "vdagent" - virtio_port_type_vm1 = "serialport" - virtio_port_chardev_vm1 = "spicevmc" - virtio_port_name_prefix_vm1 = "com.redhat.spice." - - variants: - - RHEL: - variants: - # This is current solution of handling - # multiple guests running exact same OS - -6.3.x86_64: - image_name_vm2 = images/rhel6devel-64_client - -6.3.i386: - image_name_vm2 = images/rhel6devel-32_client diff --git a/qemu/tests/cfg/rv_logging.cfg b/qemu/tests/cfg/rv_logging.cfg deleted file mode 100644 index 2a8782ea3..000000000 --- a/qemu/tests/cfg/rv_logging.cfg +++ /dev/null @@ -1,32 +0,0 @@ -- rv_logging: rv_connect - type = rv_logging - logtest = qxl - qxl_log = /var/log/Xorg.0.log - spice_log = /var/log/spice-vdagent.log - vms = vm1 vm2 - guest_vm = vm1 - client_vm = vm2 - image_name_vm2 = client_vm - display_vm2 = vnc - vga_vm2 = cirrus - interpreter = python - dst_dir = /tmp - guest_script = cb.py - script_params = --set - text_to_test = Testing_this_text_was_copied - virtio_ports_vm1 = "vdagent" - virtio_port_type_vm1 = "serialport" - virtio_port_chardev_vm1 = "spicevmc" - virtio_port_name_prefix_vm1 = "com.redhat.spice." - - variants: - - RHEL: - variants: - # This is current solution of handling - # multiple guests running exact same OS - -6.3.x86_64: - image_name_vm2 = images/rhel6devel-64_client - -6.3.i386: - image_name_vm2 = images/rhel6devel-32_client - - diff --git a/qemu/tests/cfg/spice.cfg b/qemu/tests/cfg/spice.cfg new file mode 100644 index 000000000..96edbb117 --- /dev/null +++ b/qemu/tests/cfg/spice.cfg @@ -0,0 +1,92 @@ +- rv: + no JeOS + vms = vm1 vm2 + guest_vm = vm1 + client_vm = vm2 + display_vm2 = vnc + vga_vm2 = cirrus + full_screen = no + virtio_ports_vm1 = "vdagent" + virtio_port_type_vm1 = "serialport" + virtio_port_chardev_vm1 = "spicevmc" + virtio_port_name_prefix_vm1 = "com.redhat.spice." + + variants: + -RHEL.6.3.x86_64: + image_name_vm2 = images/rhel63-64_client + -RHEL.6.3.i386: + image_name_vm2 = images/rhel63-32_client + -RHEL.6.devel.x86_64: + image_name_vm2 = images/rhel6devel-64_client + -RHEL.6.devel.i386: + image_name_vm2 = images/rhel6devel-32_client + variants: + -fullscreen_setup: + type = fullscreen_setup + -rv_connect: + type = rv_connect + -rv_disconnect: rv_connect + type = rv_disconnect + -rv_fullscreen: fullscreen_setup, rv_connect + type = rv_fullscreen + -rv_copyandpaste: rv_connect + type = rv_copyandpaste + interpreter = python + dst_dir = /tmp + guest_script = cb.py + script_params_img_set = --set_image + script_params_img_save = -m + script_params_writef = -f + script_params_createf = -n + final_textfile = StringLengthTest.txt + final_image = PNGTest.png + image_tocopy_name = Image-small.png + final_image_bmp = BMPTest.bmp + image_tocopy_name_bmp = Image2.bmp + image_type = png + script_params = --set + script_params_clear = --clear + text_to_test = Testing_this_text_was_copied + - rv_input: rv_connect + type = rv_input + guest_script = key_event_form.py + - rv_logging: rv_connect + type = rv_logging + logtest = qxl + qxl_log = /var/log/Xorg.0.log + spice_log = /var/log/spice-vdagent.log + interpreter = python + dst_dir = /tmp + guest_script = cb.py + script_params = --set + text_to_test = Testing_this_text_was_copied + - rv_vmshutdown: rv_connect + type = rv_vmshutdown + cmd_cli_shutdown = "shutdown -h now" + cmd_qemu_shutdown = "system_powerdown" + - client_guest_shutdown: + type = client_guest_shutdown + shutdown_method = shell + kill_vm = yes + kill_vm_gracefully = no + + variants: + #variant for a RHEL client and a RHEL guest + -rr: + #variant for a RHEL client and a Windows guest + -rw: + pssword = 1q2w3eP + password_vm2 = 123456 + display_vm2 = vnc + os_type_vm2 = linux + shell_prompt_vm2 = ^\[.*\][\#\$]\s*$ + shell_client_vm2 = ssh + username_vm2 = root + shell_port_vm2 = 22 + status_test_command_vm2 = echo $? + + #variant for a Windows client and a RHEL guest + -wr: + #variant for a Windows client and a Windows guest + -ww: + From ee1431216195f55cb8304216a962decfe6e7f641 Mon Sep 17 00:00:00 2001 From: Vimal Patel Date: Thu, 24 Jan 2013 11:45:05 -0500 Subject: [PATCH 02/16] Adding the ability to handle remote-viewer password tests. Adding the functionality of passing a password different then set, support negative testing, where rv_connection is not established, and setting a password through the qemu monitor. Signed-off-by: Vimal Patel Signed-off-by: Marian Krcmarik --- tests/rv_connect.py | 78 ++++++++++++++++++++------------------------- 1 file changed, 34 insertions(+), 44 deletions(-) diff --git a/tests/rv_connect.py b/tests/rv_connect.py index 92d1b08ee..0bc371e62 100644 --- a/tests/rv_connect.py +++ b/tests/rv_connect.py @@ -6,15 +6,10 @@ """ import logging, os -from virttest.aexpect import ShellCmdError, ShellStatusError -from virttest.aexpect import ShellTimeoutError, ShellProcessTerminatedError +from virttest.aexpect import ShellStatusError +from virttest.aexpect import ShellProcessTerminatedError from virttest import utils_net, utils_spice, remote - - -class RVConnectError(Exception): - """Exception raised in case that remote-viewer fails to connect""" - pass - +from autotest.client.shared import error def send_ticket(client_vm, ticket): """ @@ -29,35 +24,6 @@ def send_ticket(client_vm, ticket): client_vm.send_key("kp_enter") # send enter -def verify_established(client_vm, host, port, rv_binary): - """ - Parses netstat output for established connection on host:port - @param client_session - vm.wait_for_login() - @param host - host ip addr - @param port - port for client to connect - @param rv_binary - remote-viewer binary - """ - rv_binary = rv_binary.split(os.path.sep)[-1] - - client_session = client_vm.wait_for_login(timeout=60) - - # !!! -n means do not resolve port names - cmd = '(netstat -pn 2>&1| grep "^tcp.*:.*%s:%s.*ESTABLISHED.*%s.*") \ - > /dev/null' % (host, str(port), rv_binary) - try: - netstat_out = client_session.cmd(cmd) - logging.info("netstat output: %s", netstat_out) - - except ShellCmdError: - logging.error("Failed to get established connection from netstat") - raise RVConnectError() - - else: - logging.info("%s connection to %s:%s successful.", - rv_binary, host, port) - client_session.close() - - def print_rv_version(client_session, rv_binary): """ prints remote-viewer and spice-gtk version available inside client_session @@ -92,11 +58,20 @@ def launch_rv(client_vm, guest_vm, params): """ rv_binary = params.get("rv_binary", "remote-viewer") host_ip = utils_net.get_host_ip_address(params) + test_type = params.get("test_type") host_port = None full_screen = params.get("full_screen") display = params.get("display") cmd = rv_binary + " --display=:0.0" ticket = None + ticket_send = params.get("spice_password_send") + qemu_ticket = params.get("qemu_password") + + #If qemu_ticket is set, set the password of the VM using the qemu-monitor + if qemu_ticket: + guest_vm.monitor.cmd("set_password spice %s" % qemu_ticket) + logging.info("Sending to qemu monitor: set_password spice %s" + % qemu_ticket) client_session = client_vm.wait_for_login( timeout=int(params.get("login_timeout", 360))) @@ -105,7 +80,8 @@ def launch_rv(client_vm, guest_vm, params): ticket = guest_vm.get_spice_var("spice_password") if guest_vm.get_spice_var("spice_ssl") == "yes": - host_port = guest_vm.get_spice_var("spice_tls_port") + host_tls_port = guest_vm.get_spice_var("spice_tls_port") + host_port = guest_vm.get_spice_var("spice_port") cacert = "%s/%s" % (guest_vm.get_spice_var("spice_x509_prefix"), guest_vm.get_spice_var("spice_x509_cacert_file")) #cacert subj is in format for create certificate(with '/' delimiter) @@ -114,7 +90,8 @@ def launch_rv(client_vm, guest_vm, params): host_subj = guest_vm.get_spice_var("spice_x509_server_subj") host_subj = host_subj.replace('/', ',')[1:] - cmd += " spice://%s?tls-port=%s" % (host_ip, host_port) + cmd += " spice://%s?tls-port=%s\&port=%s" % (host_ip, host_tls_port, + host_port) cmd += " --spice-ca-file=%s" % cacert if params.get("spice_client_host_subject") == "yes": @@ -148,8 +125,6 @@ def launch_rv(client_vm, guest_vm, params): cmd = "nohup " + cmd + " &> /dev/null &" # Launch it on background # Launching the actual set of commands - utils_spice.launch_startx(client_vm) - try: print_rv_version(client_session, rv_binary) except ShellStatusError, ShellProcessTerminatedError: @@ -166,12 +141,25 @@ def launch_rv(client_vm, guest_vm, params): "remote-viewer later") # client waits for user entry (authentication) if spice_password is set - if ticket: + # use qemu monitor password if set, else check if the normal password is set + if qemu_ticket: + # Wait for remote-viewer to launch + utils_spice.wait_timeout(5) + send_ticket(client_vm, qemu_ticket) + elif ticket: + if ticket_send: + ticket = ticket_send + utils_spice.wait_timeout(5) # Wait for remote-viewer to launch send_ticket(client_vm, ticket) - utils_spice.wait_timeout(5) # Wait for conncetion to establish - verify_established(client_vm, host_ip, host_port, rv_binary) + try: + utils_spice.verify_established(client_vm, host_ip, host_port, rv_binary) + except utils_spice.RVConnectError: + if test_type == "negative": + logging.info("remote-viewer connection failed as expected") + else: + raise error.TestFail("remote-viewer connection failed") #prevent from kill remote-viewer after test finish cmd = "disown -ar" @@ -200,6 +188,8 @@ def run_rv_connect(test, params, env): client_session = client_vm.wait_for_login( timeout=int(params.get("login_timeout", 360))) + utils_spice.wait_timeout(15) + launch_rv(client_vm, guest_vm, params) client_session.close() From 7653693143c119a94afe760152a23a492e126d9a Mon Sep 17 00:00:00 2001 From: Marian Krcmarik Date: Fri, 15 Feb 2013 17:45:12 +0100 Subject: [PATCH 03/16] shared/cfg/guest-os/Linux/RHEL/6.devel.*.cfg: ISO path Signed-off-by: Marian Krcmarik --- shared/cfg/guest-os/Linux/RHEL/6.devel.i386.cfg | 2 +- shared/cfg/guest-os/Linux/RHEL/6.devel.x86_64.cfg | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/shared/cfg/guest-os/Linux/RHEL/6.devel.i386.cfg b/shared/cfg/guest-os/Linux/RHEL/6.devel.i386.cfg index e084c1ad3..e0a14f728 100644 --- a/shared/cfg/guest-os/Linux/RHEL/6.devel.i386.cfg +++ b/shared/cfg/guest-os/Linux/RHEL/6.devel.i386.cfg @@ -14,4 +14,4 @@ initrd = images/rhel6devel-32/initrd.img syslog_server_proto = udp unattended_install.cdrom: - cdrom_cd1 = RHEL6-devel-i386.iso + cdrom_cd1 = isos/linux/RHEL6-devel-i386.iso diff --git a/shared/cfg/guest-os/Linux/RHEL/6.devel.x86_64.cfg b/shared/cfg/guest-os/Linux/RHEL/6.devel.x86_64.cfg index 05a620e41..f53975c16 100644 --- a/shared/cfg/guest-os/Linux/RHEL/6.devel.x86_64.cfg +++ b/shared/cfg/guest-os/Linux/RHEL/6.devel.x86_64.cfg @@ -15,4 +15,4 @@ initrd = images/rhel6devel-64/initrd.img syslog_server_proto = udp unattended_install.cdrom: - cdrom_cd1 = RHEL6-devel-x86_64.iso + cdrom_cd1 = isos/linux/RHEL6-devel-x86_64.iso From bc2ced8bf7a40a0154286e9ebdc2b19a9628eaf2 Mon Sep 17 00:00:00 2001 From: Marian Krcmarik Date: Fri, 15 Feb 2013 17:46:09 +0100 Subject: [PATCH 04/16] tests/rv_input.py: Minor changes. - use yum instead of rpm, - use nogpgcheck, - EPEL repo link has i386 string instead of i686. - use root account for installation. Signed-off-by: Marian Krcmarik --- tests/rv_input.py | 40 ++++++++++++++++++++++++++-------------- 1 file changed, 26 insertions(+), 14 deletions(-) diff --git a/tests/rv_input.py b/tests/rv_input.py index 3dfaf5ef5..a68e724cd 100644 --- a/tests/rv_input.py +++ b/tests/rv_input.py @@ -8,7 +8,7 @@ import logging, os from autotest.client.shared import error -from virttest.aexpect import ShellCmdError, ShellStatusError, ShellTimeoutError +from virttest.aexpect import ShellCmdError from virttest import utils_misc, utils_spice def deploy_epel_repo(guest_session, params): @@ -25,18 +25,23 @@ def deploy_epel_repo(guest_session, params): output = guest_session.cmd(cmd, timeout=10) #Install epel repository If needed if "NeedsInstall" in output: + arch = guest_session.cmd("arch") + if "i686" in arch: + arch = "i386" + else: + arch = arch[:-1] if "release 5" in guest_session.cmd("cat /etc/redhat-release"): - cmd = ("rpm -ivh http://download.fedoraproject.org/pub/epel/5/" - "`arch`/epel-release-5-4.noarch.rpm 2>&1") + cmd = ("yum -y localinstall http://download.fedoraproject.org/" + "pub/epel/5/%s/epel-release-5-4.noarch.rpm 2>&1" % arch) logging.info("Installing epel repository to %s", params.get("guest_vm")) - guest_session.cmd(cmd, print_func=logging.info, timeout=60) + guest_session.cmd(cmd, print_func=logging.info, timeout=90) elif "release 6" in guest_session.cmd("cat /etc/redhat-release"): - cmd = ("rpm -ivh http://download.fedoraproject.org/pub/epel/6/" - "`arch`/epel-release-6-8.noarch.rpm 2>&1") + cmd = ("yum -y localinstall http://download.fedoraproject.org/" + "pub/epel/6/%s/epel-release-6-8.noarch.rpm 2>&1" % arch) logging.info("Installing epel repository to %s", params.get("guest_vm")) - guest_session.cmd(cmd, print_func=logging.info, timeout=60) + guest_session.cmd(cmd, print_func=logging.info, timeout=90) else: raise Exception("Unsupported RHEL guest") @@ -53,7 +58,7 @@ def install_wxpython(guest_session, params): try: guest_session.cmd(cmd) except ShellCmdError: - cmd = "yum -y install wxPython > /dev/null" + cmd = "yum -y install wxPython --nogpgcheck > /dev/null" logging.info("Installing wxPython package to %s", params.get("guest_vm")) guest_session.cmd(cmd, timeout=60) @@ -217,6 +222,7 @@ def test_leds_migration(client_vm, guest_vm, guest_session, params): for key in test_keys: client_vm.send_key(key) utils_spice.wait_timeout(0.3) + utils_spice.wait_timeout(30) def analyze_results(file_path, test_type): """ @@ -279,19 +285,25 @@ def run_rv_input(test, params, env): guest_session = guest_vm.wait_for_login( timeout=int(params.get("login_timeout", 360))) + guest_root_session = guest_vm.wait_for_login( + timeout=int(params.get("login_timeout", 360)), + username="root", password="123456") try: guest_session.cmd("! test -e /etc/redhat-release") except ShellCmdError: - deploy_epel_repo(guest_session, params) + deploy_epel_repo(guest_root_session, params) - utils_spice.launch_startx(guest_vm) + #utils_spice.launch_startx(guest_vm) - guest_session.cmd("export DISPLAY=:0.0") - utils_spice.wait_timeout(3) # Verify that gnome is now running on the guest - guest_session.cmd("ps aux | grep -v grep | grep gnome-session") + try: + guest_session.cmd("ps aux | grep -v grep | grep gnome-session") + except aexpect.ShellCmdError: + raise error.TestWarn("gnome-session was probably not corretly started") + + guest_session.cmd("export DISPLAY=:0.0") - install_wxpython(guest_session, params) + install_wxpython(guest_root_session, params) deploy_test_form(test, guest_vm, params) From 8cc4299f08a2312ea198828f53a75d5580ea3eed Mon Sep 17 00:00:00 2001 From: Marian Krcmarik Date: Fri, 15 Feb 2013 18:00:38 +0100 Subject: [PATCH 05/16] tests/rv_copyandpaste: Do no start vdagent and use root session. Spice vdagent is started with gnome-session automatically and use root session when needed since default user for spice tests is non-root. Do not fail test If gnome-session does not run. Signed-off-by: Marian Krcmarik --- tests/rv_copyandpaste.py | 68 +++++++++++++++++----------------------- 1 file changed, 29 insertions(+), 39 deletions(-) diff --git a/tests/rv_copyandpaste.py b/tests/rv_copyandpaste.py index 4e560d477..f6d8dea9c 100644 --- a/tests/rv_copyandpaste.py +++ b/tests/rv_copyandpaste.py @@ -456,8 +456,6 @@ def copy_and_paste_pos(session_to_copy_from, session_to_paste_to, # Before doing the copy and paste, verify vdagent is # installed and the daemon is running on the guest utils_spice.verify_vdagent(guest_session, test_timeout) - # Start vdagent daemon - utils_spice.start_vdagent(guest_session, test_timeout) # Make sure virtio driver is running utils_spice.verify_virtio(guest_session, test_timeout) # Command to copy text and put it in the keyboard, copy on the client @@ -492,8 +490,6 @@ def restart_cppaste(session_to_copy_from, session_to_paste_to, # Before doing the copy and paste, verify vdagent is # installed and the daemon is running on the guest utils_spice.verify_vdagent(guest_session, test_timeout) - # start vdagent daemon - utils_spice.start_vdagent(guest_session, test_timeout) # Make sure virtio driver is running utils_spice.verify_virtio(guest_session, test_timeout) # Command to copy text and put it in the keyboard, copy on the client @@ -545,8 +541,6 @@ def copy_and_paste_cpdisabled_neg(session_to_copy_from, session_to_paste_to, # Before doing the copy and paste, verify vdagent is installed and the # daemon is running on the guest utils_spice.verify_vdagent(guest_session, test_timeout) - # Start vdagent for this negative test - utils_spice.start_vdagent(guest_session, test_timeout) # Make sure virtio driver is running utils_spice.verify_virtio(guest_session, test_timeout) # Command to copy text and put it in the keyboard, copy on the client @@ -584,8 +578,6 @@ def copy_and_paste_largetext(session_to_copy_from, session_to_paste_to, # Before doing the copy and paste, verify vdagent is # installed and the daemon is running on the guest utils_spice.verify_vdagent(guest_session, test_timeout) - # Start vdagent - utils_spice.start_vdagent(guest_session, test_timeout) # Make sure virtio driver is running utils_spice.verify_virtio(guest_session, test_timeout) @@ -627,8 +619,6 @@ def restart_cppaste_lrgtext(session_to_copy_from, session_to_paste_to, # Before doing the copy and paste, verify vdagent is # installed and the daemon is running on the guest utils_spice.verify_vdagent(guest_session, test_timeout) - # Start vdagent - utils_spice.start_vdagent(guest_session, test_timeout) # Make sure virtio driver is running utils_spice.verify_virtio(guest_session, test_timeout) @@ -691,8 +681,6 @@ def copy_and_paste_image_pos(session_to_copy_from, session_to_paste_to, # Before doing the copy and paste, verify vdagent is # installed and the daemon is running on the guest utils_spice.verify_vdagent(guest_session, test_timeout) - # Start vdagent for this negative test - utils_spice.start_vdagent(guest_session, test_timeout) # Make sure virtio driver is running utils_spice.verify_virtio(guest_session, test_timeout) @@ -760,8 +748,6 @@ def restart_cppaste_image(session_to_copy_from, session_to_paste_to, # Before doing the copy and paste, verify vdagent is # installed and the daemon is running on the guest utils_spice.verify_vdagent(guest_session, test_timeout) - # Start vdagent - utils_spice.start_vdagent(guest_session, test_timeout) # Make sure virtio driver is running utils_spice.verify_virtio(guest_session, test_timeout) @@ -909,8 +895,6 @@ def copyandpasteimg_cpdisabled_neg(session_to_copy_from, session_to_paste_to, # Before doing the copy and paste, verify vdagent is # installed and the daemon is running on the guest utils_spice.verify_vdagent(guest_session, test_timeout) - # Start vdagent for this negative test - utils_spice.start_vdagent(guest_session, test_timeout) # Make sure virtio driver is running utils_spice.verify_virtio(guest_session, test_timeout) # Command to copy text and put it in the keyboard, copy on the client @@ -961,6 +945,9 @@ def run_rv_copyandpaste(test, params, env): guest_vm = env.get_vm(params["guest_vm"]) guest_session = guest_vm.wait_for_login( timeout=int(params.get("login_timeout", 360))) + guest_root_session = guest_vm.wait_for_login( + timeout=int(params.get("login_timeout", 360)), + username="root", password="123456") logging.info("Get PID of remote-viewer") client_session.cmd("pgrep remote-viewer") @@ -1014,11 +1001,14 @@ def run_rv_copyandpaste(test, params, env): client_session.cmd("export DISPLAY=:0.0") - utils_spice.launch_startx(guest_vm) + # Verify that gnome is now running on the guest + try: + guest_session.cmd("ps aux | grep -v grep | grep gnome-session") + except aexpect.ShellCmdError: + raise error.TestWarn("gnome-session was probably not corretly started") guest_session.cmd("export DISPLAY=:0.0") - # Verify that gnome is now running on the guest - guest_session.cmd("ps aux | grep -v grep | grep gnome-session") + # Make sure the clipboards are clear before starting the test clear_cb(guest_session, params) @@ -1034,23 +1024,23 @@ def run_rv_copyandpaste(test, params, env): logging.info("Negative Test Case: Copy/Paste Disabled, Copying" "Image from the Client to Guest Should Not Work\n") copyandpasteimg_cpdisabled_neg(client_session, guest_session, - guest_session, params) + guest_root_session, params) else: logging.info("Negative Test Case: Copy/Paste Disabled, Copying" " from the Client to Guest Should Not Work\n") copy_and_paste_cpdisabled_neg(client_session, guest_session, - guest_session, params) + guest_root_session, params) if "guest_to_client" in test_type: if "image" in test_type: logging.info("Negative Test Case: Copy/Paste Disabled, Copying" "Image from the Guest to Client Should Not Work\n") copyandpasteimg_cpdisabled_neg(guest_session, client_session, - guest_session, params) + guest_root_session, params) else: logging.info("Negative Test Case: Copy/Paste Disabled, Copying" " from the Guest to Client Should Not Work\n") copy_and_paste_cpdisabled_neg(guest_session, client_session, - guest_session, params) + guest_root_session, params) elif "positive" in test_type: # These are positive tests, where the clipboards are synced because @@ -1060,61 +1050,61 @@ def run_rv_copyandpaste(test, params, env): if "restart" in test_type: logging.info("Restart Vdagent, Cp Img Client to Guest") restart_cppaste_image(client_session, guest_session, - guest_session, params) + guest_root_session, params) else: logging.info("Copying an Image from the Client to Guest") copy_and_paste_image_pos(client_session, guest_session, - guest_session, params) + guest_root_session, params) elif testing_text.isdigit(): if "restart" in test_type: logging.info("Restart Vdagent, Copying a String of size " + testing_text + " from the Client to Guest") restart_cppaste_lrgtext(client_session, guest_session, - guest_session, params) + guest_root_session, params) else: logging.info("Copying a String of size " + testing_text + " from the Client to Guest") copy_and_paste_largetext(client_session, guest_session, - guest_session, params) + guest_root_session, params) else: if "restart" in test_type: logging.info("Restart Vdagent, Copying from Client to Guest\n") restart_cppaste(client_session, guest_session, - guest_session, params) + guest_root_session, params) else: logging.info("Copying from the Client to Guest\n") copy_and_paste_pos(client_session, guest_session, - guest_session, params) + guest_root_session, params) if "guest_to_client" in test_type: if "image" in test_type: if "restart" in test_type: logging.info("Restart Vdagent, Copy Img Guest to Client") restart_cppaste_image(guest_session, client_session, - guest_session, params) + guest_root_session, params) else: logging.info("Copying an Image from the Guest to Client") copy_and_paste_image_pos(guest_session, client_session, - guest_session, params) + guest_root_session, params) elif testing_text.isdigit(): if "restart" in test_type: logging.info("Restart Vdagent, Copying a String of size " + testing_text + " from the Guest to Client") restart_cppaste_lrgtext(guest_session, client_session, - guest_session, params) + guest_root_session, params) else: logging.info("Copying a String of size " + testing_text + " from the Guest to Client") copy_and_paste_largetext(guest_session, client_session, - guest_session, params) + guest_root_session, params) else: if "restart" in test_type: logging.info("Restart Vdagent, Copying: Client to Guest\n") restart_cppaste(guest_session, client_session, - guest_session, params) + guest_root_session, params) else: logging.info("Copying from the Guest to Client\n") copy_and_paste_pos(guest_session, client_session, - guest_session, params) + guest_root_session, params) elif "negative" in test_type: # These are negative tests, where the clipboards are not synced because # the spice-vdagent service will not be running on the guest. @@ -1123,23 +1113,23 @@ def run_rv_copyandpaste(test, params, env): logging.info("Negative Test Case: Copying an Image from the " "Client to Guest") copy_and_paste_image_neg(client_session, guest_session, - guest_session, params) + guest_root_session, params) else: logging.info("Negative Test Case: Copying from the Client to" "Guest Should Not Work\n") copy_and_paste_neg(client_session, guest_session, - guest_session, params) + guest_root_session, params) if "guest_to_client" in test_type: if "image" in test_type: logging.info("Negative Test Case: Copying an Image from the " "Guest to Client") copy_and_paste_image_neg(guest_session, client_session, - guest_session, params) + guest_root_session, params) else: logging.info("Negative Test Case: Copying from the Guest to" " Client Should Not Work\n") copy_and_paste_neg(guest_session, client_session, - guest_session, params) + guest_root_session, params) else: # The test is not supported, verify what is a supported test. raise error.TestFail("Couldn't Find the Correct Test To Run") From 197b4cc2c7a0d66c41899e70372a7ebc4d27b4da Mon Sep 17 00:00:00 2001 From: Vimal Patel Date: Thu, 31 Jan 2013 11:09:50 -0500 Subject: [PATCH 06/16] Moved verified established method from rv_connect to utils. Moved verify established and an exception class from rv_connect to utils_spice, to make it accessible by all spice tests. Signed-off-by: Vimal Patel Signed-off-by: Marian Krcmarik --- virttest/utils_spice.py | 50 ++++++++++++++++++++++++++--------------- 1 file changed, 32 insertions(+), 18 deletions(-) diff --git a/virttest/utils_spice.py b/virttest/utils_spice.py index eb02b61eb..d113165d2 100644 --- a/virttest/utils_spice.py +++ b/virttest/utils_spice.py @@ -2,10 +2,13 @@ Common spice test utility functions. """ -import logging, time +import os, logging, time from autotest.client.shared import error from aexpect import ShellCmdError, ShellStatusError, ShellTimeoutError +class RVConnectError(Exception): + """Exception raised in case that remote-viewer fails to connect""" + pass def wait_timeout(timeout=10): """ @@ -16,6 +19,34 @@ def wait_timeout(timeout=10): logging.debug("Waiting (timeout=%ss)", timeout) time.sleep(timeout) +def verify_established(client_vm, host, port, rv_binary): + """ + Parses netstat output for established connection on host:port + @param client_session - vm.wait_for_login() + @param host - host ip addr + @param port - port for client to connect + @param rv_binary - remote-viewer binary + """ + rv_binary = rv_binary.split(os.path.sep)[-1] + + client_session = client_vm.wait_for_login(timeout=60) + + # !!! -n means do not resolve port names + cmd = '(netstat -pn 2>&1| grep "^tcp.*:.*%s:%s.*ESTABLISHED.*%s.*") \ + > /dev/null' % (host, str(port), rv_binary) + try: + netstat_out = client_session.cmd(cmd) + logging.info("netstat output: %s", netstat_out) + + except ShellCmdError: + logging.error("Failed to get established connection from netstat") + raise RVConnectError() + + else: + logging.info("%s connection to %s:%s successful.", + rv_binary, host, port) + client_session.close() + def start_vdagent(guest_session, test_timeout): """ @@ -116,20 +147,3 @@ def verify_virtio(guest_session, test_timeout): logging.debug("------------ End of guest check of the Virtio-Serial" " Driver------------") wait_timeout(3) - -def launch_startx(vm): - """ - Run startx on the VM - - @param guest_session: ssh session of the VM - """ - vm_session = vm.wait_for_login(timeout=60) - - try: - logging.info("Starting X server on the VM"); - vm_session.cmd("startx &", timeout=15) - except (ShellCmdError, ShellStatusError, ShellTimeoutError): - logging.debug("Ignoring an Exception that Occurs from calling startx") - - wait_timeout(15) - vm_session.close() From b994bbd25b6c1b32d8ff721367405bfecc037118 Mon Sep 17 00:00:00 2001 From: Vimal Patel Date: Thu, 31 Jan 2013 11:13:52 -0500 Subject: [PATCH 07/16] Adding a test for a clean exit of guest VM shutdown. Signed-off-by: Vimal Patel Signed-off-by: Marian Krcmarik --- tests/rv_vmshutdown.py | 110 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 110 insertions(+) create mode 100644 tests/rv_vmshutdown.py diff --git a/tests/rv_vmshutdown.py b/tests/rv_vmshutdown.py new file mode 100644 index 000000000..c7f4e9481 --- /dev/null +++ b/tests/rv_vmshutdown.py @@ -0,0 +1,110 @@ +""" +rv_vmshutdown.py - shutdown the guest and verify it is a clean exit. + +Requires: connected binaries remote-viewer, Xorg, gnome session + +""" +import logging +from virttest.virt_vm import VMDeadError +from autotest.client.shared import error +from virttest.aexpect import ShellCmdError +from virttest import utils_spice +from virttest import utils_misc +from virttest import utils_net + + +def run_rv_vmshutdown(test, params, env): + """ + Tests clean exit after shutting down the VM. + Covers two cases: + (1)Shutdown from the command line of the guest. + (2)Shutdown from the qemu monitor. + + Verify after the shutdown: + (1)Verifying the guest is down + (2)Verify the spice connection to the guest is no longer established + (3)Verify the remote-viewer process is not running + + @param test: QEMU test object. + @param params: Dictionary with the test parameters. + @param env: Dictionary with test environment. + """ + + #Get the required variables + rv_binary = params.get("rv_binary", "remote-viewer") + host_ip = utils_net.get_host_ip_address(params) + shutdownfrom = params.get("shutdownfrom") + cmd_cli_shutdown = params.get("cmd_cli_shutdown") + cmd_qemu_shutdown = params.get("cmd_qemu_shutdown") + host_port = None + + guest_vm = env.get_vm(params["guest_vm"]) + guest_vm.verify_alive() + guest_session = guest_vm.wait_for_login( + timeout=int(params.get("login_timeout", 360)), + username="root", password="123456") + + client_vm = env.get_vm(params["client_vm"]) + client_vm.verify_alive() + client_session = client_vm.wait_for_login( + timeout=int(params.get("login_timeout", 360)), + username="root", password="123456") + + if guest_vm.get_spice_var("spice_ssl") == "yes": + host_port = guest_vm.get_spice_var("spice_tls_port") + else: + host_port = guest_vm.get_spice_var("spice_port") + + #Determine if the test is to shutdown from cli or qemu monitor + if shutdownfrom == "cmd": + logging.info("Shutting down guest from command line:" + + " %s\n" % cmd_cli_shutdown) + output = guest_session.cmd(cmd_cli_shutdown) + logging.debug("Guest is being shutdown: %s" % output) + elif shutdownfrom == "qemu_monitor": + logging.info("Shutting down guest from qemu monitor\n") + output = guest_vm.monitor.cmd(cmd_qemu_shutdown) + logging.debug("Output of %s: %s" % (cmd_qemu_shutdown, output)) + else: + raise error.TestFail("shutdownfrom var not set, valid values are" + + " cmd or qemu_monitor") + + #wait for the guest vm to be shutoff + logging.info("Waiting for the guest VM to be shutoff") + utils_misc.wait_for(guest_vm.is_dead, 70, 30, 1, "waiting...") + logging.info("Guest VM is now shutoff") + + #Verify there was a clean exit by + #(1)Verifying the guest is down + #(2)Verify the spice connection to the guest is no longer established + #(3)Verify the remote-viewer process is not running + try: + guest_vm.verify_alive() + raise error.TestFail("Guest VM is still alive, shutdown failed.") + except VMDeadError as exc: + if "VM is dead" in str(exc): + logging.info("Guest VM is verified to be shutdown") + else: + raise error.TestFail("Unexpected Error: %s" % exc.value()) + + try: + utils_spice.verify_established(client_vm, host_ip, host_port, rv_binary) + raise error.TestFail("Remote-Viewer connection to guest" + "is still established.") + except utils_spice.RVConnectError: + logging.info("There is no remote-viewer connection as expected") + else: + raise error.TestFail("Unexpected error while trying to see if there" + " was no spice connection to the guest") + + #Verify the remote-viewer process is not running + logging.info("Checking to see if remote-viewer process is still running on" + " client after VM has been shutdown") + try: + pidoutput = str(client_session.cmd("pgrep remote-viewer")) + raise error.TestFail("Remote-viewer is still running on the client.") + except ShellCmdError: + logging.info("Remote-viewer process is not running as expected.") + else: + raise error.TestFail("Unexpected error while trying to verify" + + "remote-viewer process was not running.") From e63491ccdf4d33f84669f0c285eaa43425f74658 Mon Sep 17 00:00:00 2001 From: Vimal Patel Date: Fri, 1 Feb 2013 15:37:07 -0500 Subject: [PATCH 08/16] Adding a test to shutdown both VMs for spice tests. Adding client_guest_shutdown test to replace the default shutdown test to shutdown both VMs used for the spice tests. Signed-off-by: Vimal Patel Signed-off-by: Marian Krcmarik --- tests/client_guest_shutdown.py | 49 ++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 tests/client_guest_shutdown.py diff --git a/tests/client_guest_shutdown.py b/tests/client_guest_shutdown.py new file mode 100644 index 000000000..f3723710b --- /dev/null +++ b/tests/client_guest_shutdown.py @@ -0,0 +1,49 @@ +import time +from autotest.client.shared import error +from virttest import utils_misc + + +@error.context_aware +def run_client_guest_shutdown(test, params, env): + """ + KVM shutdown test: + For a test with two VMs: client & guest + 1) Log into the VMS(guests) that represent the client &guest + 2) Send a shutdown command to the guest, or issue a system_powerdown + monitor command (depending on the value of shutdown_method) + 3) Wait until the guest is down + + @param test: kvm test object + @param params: Dictionary with the test parameters + @param env: Dictionary with test environment + """ + client_vm = env.get_vm(params["client_vm"]) + client_vm.verify_alive() + guest_vm = env.get_vm(params["guest_vm"]) + guest_vm.verify_alive() + + timeout = int(params.get("login_timeout", 360)) + + #shutdown both of the sessions + for vm in [client_vm, guest_vm]: + vm_session = vm.wait_for_login(timeout=timeout, username="root", + password="123456") + try: + error.base_context("shutting down the VM") + if params.get("shutdown_method") == "shell": + # Send a shutdown command to the guest's shell + vm_session.sendline(vm.get_params().get("shutdown_command")) + error.context("waiting VM to go down (shutdown shell cmd)") + elif params.get("shutdown_method") == "system_powerdown": + # Sleep for a while -- give the guest a chance to finish booting + time.sleep(float(params.get("sleep_before_powerdown", 10))) + # Send a system_powerdown monitor command + vm.monitor.cmd("system_powerdown") + error.context("waiting VM to go down " + "(system_powerdown monitor cmd)") + + if not utils_misc.wait_for(vm.is_dead, 240, 0, 1): + raise error.TestFail("Guest refuses to go down") + + finally: + vm_session.close() From 877e735d5a1088f6a3fbd9a686e1faef76b5bcd8 Mon Sep 17 00:00:00 2001 From: Tomas Jamrisko Date: Thu, 14 Feb 2013 14:26:28 +0100 Subject: [PATCH 09/16] shared/unattended/RHEL-6.3.ks: Start X when booting. Start X right after boot and create test user to be used for Spice related tests. Signed-off-by: Tomas Jamrisko Signed-off-by: Marian Krcmarik --- shared/unattended/RHEL-6.3.ks | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/shared/unattended/RHEL-6.3.ks b/shared/unattended/RHEL-6.3.ks index 53f638e29..576f27cf9 100644 --- a/shared/unattended/RHEL-6.3.ks +++ b/shared/unattended/RHEL-6.3.ks @@ -6,13 +6,15 @@ lang en_US.UTF-8 keyboard us key --skip network --bootproto dhcp -rootpw 123456 +rootpw --plaintext 123456 +user --name=test --password=123456 --plaintext firewall --enabled --ssh selinux --enforcing timezone --utc America/New_York firstboot --disable bootloader --location=mbr --append="console=tty0 console=ttyS0,115200" zerombr +xconfig --startxonboot clearpart --all --initlabel autopart poweroff @@ -37,8 +39,9 @@ virt-viewer spice-vdagent usbredir SDL +%end -%post --interpreter /usr/bin/python +%post --nochroot --interpreter /usr/bin/python import os os.system('grubby --remove-args="rhgb quiet" --update-kernel=$(grubby --default-kernel)') os.system('dhclient') @@ -47,3 +50,8 @@ os.system('iptables -F') os.system('echo 0 > /selinux/enforce') os.system('echo Post set up finished > /dev/ttyS0') os.system('echo Post set up finished > /dev/hvc0') +f = open('/mnt/sysimage/etc/gdm/custom.conf','w') +f.write('[daemon]\n' + 'AutomaticLogin=test\n' + 'AutomaticLoginEnable=True\n') +%end From 4736231cebd3c9664290027e77dc4e35b55bce58 Mon Sep 17 00:00:00 2001 From: Marian Krcmarik Date: Fri, 22 Feb 2013 17:43:56 +0100 Subject: [PATCH 10/16] tests/fullscreen_setup: Do not startx. X and gnome session is started automatically after boot for Spice related tests. Signed-off-by: Marian Krcmarik --- tests/fullscreen_setup.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/fullscreen_setup.py b/tests/fullscreen_setup.py index 7c1c21042..bc0d0d284 100644 --- a/tests/fullscreen_setup.py +++ b/tests/fullscreen_setup.py @@ -29,9 +29,10 @@ def run_fullscreen_setup(test, params, env): guest_session = guest_vm.wait_for_login( timeout=int(params.get("login_timeout", 360))) + utils_spice.wait_timeout(10) + logging.debug("Exporting guest display") guest_session.cmd("export DISPLAY=:0.0") - utils_spice.launch_startx(guest_vm) # Get the min, current, and max resolution on the guest output = guest_session.cmd("xrandr | grep Screen") From 3989ef198267e959ddebbd4057160b7263340020 Mon Sep 17 00:00:00 2001 From: Marian Krcmarik Date: Fri, 22 Feb 2013 17:45:15 +0100 Subject: [PATCH 11/16] tests/rv_logging: Use root session when needed. Since Spice tests use test (non-root) user, use root session when root privileges are needed. Signed-off-by: Marian Krcmarik --- tests/rv_logging.py | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/tests/rv_logging.py b/tests/rv_logging.py index 97fc27d01..12cab6c96 100644 --- a/tests/rv_logging.py +++ b/tests/rv_logging.py @@ -7,7 +7,6 @@ """ import logging, os -from virttest.aexpect import ShellCmdError, ShellStatusError, ShellTimeoutError from autotest.client.shared import error from virttest import utils_misc, utils_spice @@ -36,6 +35,9 @@ def run_rv_logging(test, params, env): guest_vm.verify_alive() guest_session = guest_vm.wait_for_login( timeout=int(params.get("login_timeout", 360))) + guest_root_session = guest_vm.wait_for_login( + timeout=int(params.get("login_timeout", 360)), + username="root", password="123456") scriptdir = os.path.join("scripts", script) script_path = utils_misc.get_path(test.virtdir, scriptdir) @@ -49,35 +51,34 @@ def run_rv_logging(test, params, env): # Some logging tests need the full desktop environment guest_session.cmd("export DISPLAY=:0.0") - utils_spice.launch_startx(guest_vm) - # Logging test for the qxl driver if(log_test == 'qxl'): logging.info("Running the logging test for the qxl driver") - guest_session.cmd("grep -i qxl " + qxl_logfile) + guest_root_session.cmd("grep -i qxl " + qxl_logfile) # Logging test for spice-vdagent elif(log_test == 'spice-vdagent'): logging.info("Running the logging test for spice-vdagent daemon") - utils_spice.start_vdagent(guest_session, test_timeout=15) + utils_spice.start_vdagent(guest_root_session, test_timeout=15) # Testing the log after stopping spice-vdagentd - utils_spice.stop_vdagent(guest_session, test_timeout=15) - output = guest_session.cmd("tail -n 3 " + spicevdagent_logfile + + utils_spice.stop_vdagent(guest_root_session, test_timeout=15) + output = guest_root_session.cmd("tail -n 3 " + spicevdagent_logfile + " | grep 'vdagentd quiting'") # Testing the log after starting spice-vdagentd - utils_spice.start_vdagent(guest_session, test_timeout=15) - output = guest_session.cmd("tail -n 2 " + spicevdagent_logfile + + utils_spice.start_vdagent(guest_root_session, test_timeout=15) + output = guest_root_session.cmd("tail -n 2 " + spicevdagent_logfile + " | grep 'opening vdagent virtio channel'") # Testing the log after restart spice-vdagentd - utils_spice.restart_vdagent(guest_session, test_timeout=10) - output = guest_session.cmd("tail -n 2 " + spicevdagent_logfile + + utils_spice.restart_vdagent(guest_root_session, test_timeout=10) + output = guest_root_session.cmd("tail -n 2 " + spicevdagent_logfile + " | grep 'opening vdagent virtio channel'") - cmd = "echo \"SPICE_VDAGENTD_EXTRA_ARGS=-dd\"> /etc/sysconfig/spice-vdagentd" - guest_session.cmd(cmd) - utils_spice.restart_vdagent(guest_session, test_timeout=10) + cmd = ("echo \"SPICE_VDAGENTD_EXTRA_ARGS=-dd\">" + "/etc/sysconfig/spice-vdagentd") + guest_root_session.cmd(cmd) + utils_spice.restart_vdagent(guest_root_session, test_timeout=10) # Finally test copying text within the guest cmd = "%s %s %s %s" % (interpreter, script_call, @@ -101,12 +102,13 @@ def run_rv_logging(test, params, env): logging.debug("------------ End of script output of the Copying" " Session ------------") - output = guest_session.cmd("tail -n 3 " + spicevdagent_logfile + + output = guest_root_session.cmd("tail -n 3 " + spicevdagent_logfile + " | grep 'clipboard grab'") else: # Couldn't find the right test to run guest_session.close() + guest_root_session.close() raise error.TestFail("Couldn't find the right test to run," + " check cfg files.") guest_session.close() From f38bd278fd08771e9cb4e273109e85825ef34e0e Mon Sep 17 00:00:00 2001 From: Vimal Patel Date: Thu, 21 Mar 2013 13:26:45 -0400 Subject: [PATCH 12/16] Adding Windows guest SSL test. Added windows guest SSL tests, and minor fixes to get the rest of the Windows guest tests working. Signed-off-by: Vimal Patel --- qemu/cfg/tests-spice.cfg | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/qemu/cfg/tests-spice.cfg b/qemu/cfg/tests-spice.cfg index 88030eefb..9f893af52 100644 --- a/qemu/cfg/tests-spice.cfg +++ b/qemu/cfg/tests-spice.cfg @@ -45,7 +45,7 @@ variants: - RHEL: only Linux.RHEL.6.devel.x86_64 - Windows: - only Win7.64.sp1 + only Win7.x86_64.sp1 variants: - vnc: @@ -219,7 +219,13 @@ variants: only os.Windows only spice.default_ipv.default_pc.default_sv.default_zlib_wc.default_jpeg_wc.default_ic.no_ssl.no_password.dcp_off.1monitor #rv_connect_win is specifically a test meant for a windows guest and a rhel client, rv_connect cannot be used. - only rv.rw.rv_connect.RHEL.6.devel.x86_64, rv.rr.client_guest_shutdown.RHEL.6.devel.x86_64 + only rv.rw.rv_connect.RHEL.6.devel.x86_64, rv.rw.client_guest_shutdown.RHEL.6.devel.x86_64 + + - @remote_viewer_winssl: + only os.Windows + only spice.default_ipv.default_pc.default_sv.default_zlib_wc.default_jpeg_wc.default_ic.ssl.key_password.password.dcp_off.1monitor + only rv.rw.rv_connect.RHEL.6.devel.x86_64, rv.rw.client_guest_shutdown.RHEL.6.devel.x86_64 + - @spice_negative_rhel6devel: only os.RHEL @@ -265,8 +271,8 @@ variants: #The following are all the individual tests for spice - create_vms: only qemu_kvm_rhel6devel_install_guest, qemu_kvm_rhel6devel_install_client - - install_win_guest: - only qemu_kvm_windows_install_guest + - create_vms_winguest: + only qemu_kvm_windows_install_guest, qemu_kvm_rhel6devel_install_client - negative_qemu_spice_launch_badport: only spice.default_ipv.default_pc.default_sv.default_zlib_wc.default_jpeg_wc.default_ic.bad_port.no_password.dcp_off.1monitor only spice_negative_rhel6devel @@ -317,6 +323,8 @@ variants: only rv_disconnect_rhel6devel - remote_viewer_ssl_test: only remote_viewer_rhel6develssl + - remote_viewer_ssl_win_test: + only remote_viewer_winssl - copy_client_to_guest_pos: config_test = "positive_client_to_guest" only rv_copyandpaste_rhel6devel @@ -460,7 +468,7 @@ variants: only create_vms, negative_qemu_spice_launch_badport, negative_qemu_spice_launch_badic, negative_qemu_spice_launch_badjpegwc, negative_qemu_spice_launch_badzlib, negative_qemu_spice_launch_badsv, negative_qemu_spice_launch_badpc, remote_viewer_test, remote_viewer_ssl_test, remote_viewer_disconnect_test, guestvmshutdown_cmd, guestvmshutdown_qemu, copy_client_to_guest_largetext_pos, copy_guest_to_client_largetext_pos, copy_client_to_guest_pos, copy_guest_to_client_pos, copy_guest_to_client_neg, copy_client_to_guest_neg, copyimg_client_to_guest_pos, copyimg_client_to_guest_neg, copyimg_guest_to_client_pos, copyimg_guest_to_client_neg, copyimg_client_to_guest_dcp_neg, copyimg_guest_to_client_dcp_neg, copy_guest_to_client_dcp_neg, copy_client_to_guest_dcp_neg, copybmpimg_client_to_guest_pos, copybmpimg_guest_to_client_pos, copy_guest_to_client_largetext_10mb_pos, copy_client_to_guest_largetext_10mb_pos, copyimg_medium_client_to_guest_pos, copyimg_medium_guest_to_client_pos, copyimg_large_client_to_guest_pos, copyimg_large_guest_to_client_pos, restart_vdagent_copy_client_to_guest_pos, restart_vdagent_copy_guest_to_client_pos, restart_vdagent_copyimg_client_to_guest_pos, restart_vdagent_copyimg_guest_to_client_pos, restart_vdagent_copybmpimg_client_to_guest_pos, restart_vdagent_copybmpimg_guest_to_client_pos, restart_vdagent_copy_client_to_guest_largetext_pos, restart_vdagent_copy_guest_to_client_largetext_pos, remote_viewer_fullscreen_test, remote_viewer_fullscreen_test_neg, spice_vdagent_logging, qxl_logging, keyboard_input_leds_and_esc_keys, keyboard_input_non-us_layout, keyboard_input_type_and_func_keys, keyboard_input_leds_migration, rv_connect_passwd, rv_connect_wrong_passwd, rv_qemu_password, rv_qemu_password_overwrite #Running all RHEL Client, Windows Guest Spice Tests -#only install_win_guest, remote_viewer_winguest_test +#only create_vms_winguest, remote_viewer_winguest_test, remote_viewer_ssl_win_test #Running all Windows Client, RHEL Guest Spice Tests #to be added From 29ed0fd0fa395cf160c8c67254ded4e5b3f64f7e Mon Sep 17 00:00:00 2001 From: Vimal Patel Date: Thu, 21 Mar 2013 13:28:17 -0400 Subject: [PATCH 13/16] Define rootuser/root password. define rootuser/root password variants for combination of client/guest tests, and adding windows guest variants. Signed-off-by: Vimal Patel --- qemu/tests/cfg/spice.cfg | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/qemu/tests/cfg/spice.cfg b/qemu/tests/cfg/spice.cfg index 96edbb117..842b33496 100644 --- a/qemu/tests/cfg/spice.cfg +++ b/qemu/tests/cfg/spice.cfg @@ -73,16 +73,30 @@ variants: #variant for a RHEL client and a RHEL guest -rr: + rootuser=root + rootpassword=123456 + rootuser_vm2=root + rootpassword_vm2=123456 #variant for a RHEL client and a Windows guest -rw: - pssword = 1q2w3eP - password_vm2 = 123456 + shutdown_command_vm2 = shutdown -h now + rootuser_vm1 = Administrator + pssword_vm1 = 1q2w3eP + shell_port_vm1 = 10022 + shell_client_vm1 = nc + shell_linesep_vm1 = \r\n + shell_prompt_vm1 = >$ + file_transfer_port_vm1 = 10023 + file_transfer_client_vm1 = rss display_vm2 = vnc os_type_vm2 = linux shell_prompt_vm2 = ^\[.*\][\#\$]\s*$ shell_client_vm2 = ssh - username_vm2 = root + rootuser_vm2 = root + rootpassword_vm2 = 123456 shell_port_vm2 = 22 + file_transfer_client_vm2 = scp + file_transfer_port_vm2 = 22 status_test_command_vm2 = echo $? #variant for a Windows client and a RHEL guest From ae29891c289a246f4130cfff544fec1b70d825a3 Mon Sep 17 00:00:00 2001 From: Vimal Patel Date: Thu, 21 Mar 2013 13:50:21 -0400 Subject: [PATCH 14/16] Get the root session by using cfg file values. Signed-off-by: Vimal Patel --- tests/client_guest_shutdown.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/client_guest_shutdown.py b/tests/client_guest_shutdown.py index f3723710b..438951352 100644 --- a/tests/client_guest_shutdown.py +++ b/tests/client_guest_shutdown.py @@ -26,8 +26,11 @@ def run_client_guest_shutdown(test, params, env): #shutdown both of the sessions for vm in [client_vm, guest_vm]: - vm_session = vm.wait_for_login(timeout=timeout, username="root", - password="123456") + rootuser = vm.get_params().get("rootuser") + rootpassword = vm.get_params().get("rootpassword") + + vm_session = vm.wait_for_login(timeout=timeout, username=rootuser, + password=rootpassword) try: error.base_context("shutting down the VM") if params.get("shutdown_method") == "shell": From 6242554a948026e048b4d0d030bd4192f7811ccd Mon Sep 17 00:00:00 2001 From: Vimal Patel Date: Thu, 21 Mar 2013 13:51:14 -0400 Subject: [PATCH 15/16] Simplify copying files, and other minor edits. Simplifying copying files call so it could possibly used for other platforms other than RHEL, and logging the PID of the remote-viewer process. Signed-off-by: Vimal Patel --- tests/rv_connect.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/tests/rv_connect.py b/tests/rv_connect.py index 0bc371e62..cd5e8ef5b 100644 --- a/tests/rv_connect.py +++ b/tests/rv_connect.py @@ -101,11 +101,7 @@ def launch_rv(client_vm, guest_vm, params): client_session.cmd("rm -rf %s && mkdir -p %s" % ( guest_vm.get_spice_var("spice_x509_prefix"), guest_vm.get_spice_var("spice_x509_prefix"))) - remote.copy_files_to(client_vm.get_address(), 'scp', - params.get("username"), - params.get("password"), - params.get("shell_port"), - cacert, cacert) + client_vm.copy_files_to(cacert, cacert, timeout=60) else: host_port = guest_vm.get_spice_var("spice_port") cmd += " spice://%s?port=%s" % (host_ip, host_port) @@ -135,7 +131,7 @@ def launch_rv(client_vm, guest_vm, params): logging.info("Launching %s on the client (virtual)", cmd) try: - client_session.cmd(cmd) + logging.info("spice,connection: %s", client_session.cmd(cmd)) except ShellStatusError: logging.debug("Ignoring a status exception, will check connection of" "remote-viewer later") From 1b5834e1e3d14d928a7f1977986e0205023c4e12 Mon Sep 17 00:00:00 2001 From: Vimal Patel Date: Thu, 21 Mar 2013 13:53:01 -0400 Subject: [PATCH 16/16] Get root session values defined in the cfg. Signed-off-by: Vimal Patel --- tests/rv_copyandpaste.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/rv_copyandpaste.py b/tests/rv_copyandpaste.py index f6d8dea9c..4c4f08787 100644 --- a/tests/rv_copyandpaste.py +++ b/tests/rv_copyandpaste.py @@ -943,6 +943,8 @@ def run_rv_copyandpaste(test, params, env): timeout=int(params.get("login_timeout", 360))) guest_vm = env.get_vm(params["guest_vm"]) + rootuser = guest_vm.get_params().get("rootuser") + rootpassword = guest_vm.get_params().get("rootpassword") guest_session = guest_vm.wait_for_login( timeout=int(params.get("login_timeout", 360))) guest_root_session = guest_vm.wait_for_login( @@ -1008,7 +1010,6 @@ def run_rv_copyandpaste(test, params, env): raise error.TestWarn("gnome-session was probably not corretly started") guest_session.cmd("export DISPLAY=:0.0") - # Make sure the clipboards are clear before starting the test clear_cb(guest_session, params)