KVM test: Add a subtest vnc via which interacts with guest
PATCH 1/1 KVM test: Add a subtest vnc via which interacts with guest
--- client/tests/kvm/tests/vnc.py | 24 ++++++++++++++++++++++++ client/tests/kvm/tests_base.cfg.sample | 3 +++ 2 files changed, 27 insertions(+), 0 deletions(-) create mode 100644 client/tests/kvm/tests/vnc.py
client/tests/kvm/tests/vnc.py new file +24 -0
@@ -0,0 +1,24 @@ +import logging, pexpect +from autotest_lib.client.common_lib import error +import kvm_test_utils, kvm_subprocess + +def run_vnc(test, params, env): + """ + Test whether guest could be interacted with vnc. + + @param test: kvm test object + @param params: Dictionary with the test parameters + @param env: Dictionary with test environment. + """ + vm = kvm_test_utils.get_living_vm(env, params.get("main_vm")) + session = kvm_test_utils.wait_for_login(vm) + + # Start vnc connection test + vnc_port = str(vm.vnc_port - 5900) + vnc_cmd = "vncviewer" + " localhost:" + vnc_port + logging.debug("Using command to vnc connect: %s" % vnc_cmd) + + p = kvm_subprocess.run_bg(vnc_cmd, None, logging.debug, "(vnc) ") + if not p.is_alive(): + raise error.TestFail("Vnc connect to guest failed") + p.close()
client/tests/kvm/tests_base.cfg.sample +3 -0
@@ -270,6 +270,9 @@ variants: type = physical_resources_check catch_uuid_cmd = dmidecode | awk -F: '/UUID/ {print $2}' + - vnc: install setup unattended_install + type = vnc + # NICs variants: - @rtl8139:
Signature · 1 line
1.6.5.5
Quoted 21 lines · Yolkfull Chow
Signed-off-by Yolkfull Chow <[email protected]>--- client/tests/kvm/tests/vnc.py | 24 ++++++++++++++++++++++++ client/tests/kvm/tests_base.cfg.sample | 3 +++ 2 files changed, 27 insertions(+), 0 deletions(-) create mode 100644 client/tests/kvm/tests/vnc.pyclient/tests/kvm/tests/vnc.py new file +8
-0@@ -0,0 +1,24 @@ +import logging, pexpect +from autotest_lib.client.common_lib import error +import kvm_test_utils, kvm_subprocess + +def run_vnc(test, params, env): + """ + Test whether guest could be interacted with vnc. +
client/tests/kvm/tests/vnc.py line 18
Quoted 10 lines
client/tests/kvm/tests/vnc.py new file +10
-0+ @param test: kvm test object + @param params: Dictionary with the test parameters + @param env: Dictionary with test environment. + """ + vm = kvm_test_utils.get_living_vm(env, params.get("main_vm")) + session = kvm_test_utils.wait_for_login(vm) + + # Start vnc connection test + vnc_port = str(vm.vnc_port - 5900) + vnc_cmd = "vncviewer" + " localhost:" + vnc_port
Can we make this configurable? vncviewer does have a few bugs that kvm tends to expose; it'd be good to let the admin set this value.
Quoted 27 lines
client/tests/kvm/tests/vnc.py new file +6
-0+ logging.debug("Using command to vnc connect: %s" % vnc_cmd) + + p = kvm_subprocess.run_bg(vnc_cmd, None, logging.debug, "(vnc) ") + if not p.is_alive(): + raise error.TestFail("Vnc connect to guest failed") + p.close()client/tests/kvm/tests_base.cfg.sample +3
-0@@ -270,6 +270,9 @@ variants: type = physical_resources_check catch_uuid_cmd = dmidecode | awk -F: '/UUID/ {print $2}' + - vnc: install setup unattended_install + type = vnc + # NICs variants: - @rtl8139:Signature · 6 lines
1.6.5.5 _______________________________________________ Autotest mailing list [email protected] http://test.kernel.org/cgi-bin/mailman/listinfo/autotest
Signature · 4 lines
Ryan Harper Software Engineer; Linux Technology Center IBM Corp., Austin, Tx [email protected]
Quoted 27 lines · Ryan Harper
Quoted 26 lines · Yolkfull Chow
Signed-off-by Yolkfull Chow <[email protected]>--- client/tests/kvm/tests/vnc.py | 24 ++++++++++++++++++++++++ client/tests/kvm/tests_base.cfg.sample | 3 +++ 2 files changed, 27 insertions(+), 0 deletions(-) create mode 100644 client/tests/kvm/tests/vnc.pyclient/tests/kvm/tests/vnc.py new file +13
-0@@ -0,0 +1,24 @@ +import logging, pexpect +from autotest_lib.client.common_lib import error +import kvm_test_utils, kvm_subprocess + +def run_vnc(test, params, env): + """ + Test whether guest could be interacted with vnc. + + @param test: kvm test object + @param params: Dictionary with the test parameters + @param env: Dictionary with test environment. + """ + vm = kvm_test_utils.get_living_vm(env, params.get("main_vm"))
Quoted 8 lines
client/tests/kvm/tests/vnc.py line 18
Quoted 5 lines
client/tests/kvm/tests/vnc.py new file +5
-0+ session = kvm_test_utils.wait_for_login(vm) + + # Start vnc connection test + vnc_port = str(vm.vnc_port - 5900) + vnc_cmd = "vncviewer" + " localhost:" + vnc_portCan we make this configurable? vncviewer does have a few bugs that kvm tends to expose; it'd be good to let the admin set this value.
Hi Ryan,
Sorry for late reply and thanks very much for these suggestions.
During our testing, we found a problem for this test:
the sessions autotest server gets from its client machines will not get X services and this test will always fail with following error:
12/29 17:04:44 DEBUG| vnc:0020| Try to connect to guest via vnc, vnc_port is: 1 12/29 17:04:44 DEBUG| vnc:0023| Using command to vnc connect: vncviewer localhost:1 12/29 17:04:44 DEBUG|kvm_subpro:0686| (vnc) 12/29 17:04:44 DEBUG|kvm_subpro:0686| (vnc) VNC Viewer Free Edition 4.1.2 for X - built Jan 26 2009 11:52:08 12/29 17:04:44 DEBUG|kvm_subpro:0686| (vnc) Copyright (C) 2002-2005 RealVNC Ltd. 12/29 17:04:44 DEBUG|kvm_subpro:0686| (vnc) See http://www.realvnc.com for information on VNC. 12/29 17:04:44 DEBUG|kvm_subpro:0686| (vnc) vncviewer: unable to open display "" 12/29 17:04:44 DEBUG|kvm_subpro:0686| (vnc) (Process terminated with status 1) 12/29 17:04:44 ERROR| kvm:0063| Test failed: Vnc connect to guest failed
Therefore, we need to use socket to connect to vncserver of qemu-kvm and analyse the header info readed from socket connection. I will improve this test later.
Any further suggestions will be appreciated. :-)
Thanks again.
Quoted 39 lines
Quoted 29 lines
client/tests/kvm/tests/vnc.py new file +6
-0+ logging.debug("Using command to vnc connect: %s" % vnc_cmd) + + p = kvm_subprocess.run_bg(vnc_cmd, None, logging.debug, "(vnc) ") + if not p.is_alive(): + raise error.TestFail("Vnc connect to guest failed") + p.close()client/tests/kvm/tests_base.cfg.sample +3
-0@@ -270,6 +270,9 @@ variants: type = physical_resources_check catch_uuid_cmd = dmidecode | awk -F: '/UUID/ {print $2}' + - vnc: install setup unattended_install + type = vnc + # NICs variants: - @rtl8139:Signature · 6 lines
1.6.5.5 _______________________________________________ Autotest mailing list [email protected] http://test.kernel.org/cgi-bin/mailman/listinfo/autotestSignature · 8 lines
Ryan Harper Software Engineer; Linux Technology Center IBM Corp., Austin, Tx [email protected] -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 23 lines · Yolkfull Chow
Quoted 3 lines · Ryan Harper
Can we make this configurable? vncviewer does have a few bugs that kvm tends to expose; it'd be good to let the admin set this value.
Hi Ryan,
Sorry for late reply and thanks very much for these suggestions.
During our testing, we found a problem for this test:
the sessions autotest server gets from its client machines will not get X services and this test will always fail with following error:12/29 17:04:44 DEBUG| vnc:0020| Try to connect to guest via vnc, vnc_port is: 1 12/29 17:04:44 DEBUG| vnc:0023| Using command to vnc connect: vncviewer localhost:1 12/29 17:04:44 DEBUG|kvm_subpro:0686| (vnc) 12/29 17:04:44 DEBUG|kvm_subpro:0686| (vnc) VNC Viewer Free Edition 4.1.2 for X - built Jan 26 2009 11:52:08 12/29 17:04:44 DEBUG|kvm_subpro:0686| (vnc) Copyright (C) 2002-2005 RealVNC Ltd. 12/29 17:04:44 DEBUG|kvm_subpro:0686| (vnc) See http://www.realvnc.com for information on VNC. 12/29 17:04:44 DEBUG|kvm_subpro:0686| (vnc) vncviewer: unable to open display "" 12/29 17:04:44 DEBUG|kvm_subpro:0686| (vnc) (Process terminated with status 1) 12/29 17:04:44 ERROR| kvm:0063| Test failed: Vnc connect to guest failed
Quoted 2 lines
Therefore, we need to use socket to connect to vncserver of qemu-kvm and analyse the header info readed from socket connection. I will improve this test later.
Yes, and even though reading the header info doesn't quite guarantee that we'll have bug-free vnc streaming.
If you have a new version of the test with these limitations worked out, please let us know.
Cheers,
Signature · 1 line
Lucas