qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Cleber Rosa <crosa@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Eduardo Habkost" <ehabkost@redhat.com>,
	"Philippe Mathieu-Daudé" <f4bug@amsat.org>,
	"Stefan Hajnoczi" <stefanha@redhat.com>,
	"Fam Zheng" <famz@redhat.com>, "Amador Pahim" <amador@pahim.org>,
	"Cleber Rosa" <crosa@redhat.com>
Subject: [Qemu-devel] [PATCH v3 3/5] Acceptance tests: add quick VNC tests
Date: Tue, 29 May 2018 15:37:28 -0400	[thread overview]
Message-ID: <20180529193730.9204-4-crosa@redhat.com> (raw)
In-Reply-To: <20180529193730.9204-1-crosa@redhat.com>

This patch adds a few simple behavior tests for VNC.

Signed-off-by: Cleber Rosa <crosa@redhat.com>
---
 tests/acceptance/vnc.py | 60 +++++++++++++++++++++++++++++++++++++++++
 1 file changed, 60 insertions(+)
 create mode 100644 tests/acceptance/vnc.py

diff --git a/tests/acceptance/vnc.py b/tests/acceptance/vnc.py
new file mode 100644
index 0000000000..b1ef9d71b1
--- /dev/null
+++ b/tests/acceptance/vnc.py
@@ -0,0 +1,60 @@
+# Simple functional tests for VNC functionality
+#
+# Copyright (c) 2018 Red Hat, Inc.
+#
+# Author:
+#  Cleber Rosa <crosa@redhat.com>
+#
+# This work is licensed under the terms of the GNU GPL, version 2 or
+# later.  See the COPYING file in the top-level directory.
+
+from avocado_qemu import Test
+
+
+class Vnc(Test):
+    """
+    :avocado: enable
+    :avocado: tags=vnc,quick
+    """
+    def test_no_vnc(self):
+        self.vm.add_args('-nodefaults', '-S')
+        self.vm.launch()
+        self.assertFalse(self.vm.qmp('query-vnc')['return']['enabled'])
+
+    def test_no_vnc_change_password(self):
+        self.vm.add_args('-nodefaults', '-S')
+        self.vm.launch()
+        self.assertFalse(self.vm.qmp('query-vnc')['return']['enabled'])
+        set_password_response = self.vm.qmp('change',
+                                            device='vnc',
+                                            target='password',
+                                            arg='new_password')
+        self.assertIn('error', set_password_response)
+        self.assertEqual(set_password_response['error']['class'],
+                         'GenericError')
+        self.assertEqual(set_password_response['error']['desc'],
+                         'Could not set password')
+
+    def test_vnc_change_password_requires_a_password(self):
+        self.vm.add_args('-nodefaults', '-S', '-vnc', ':0')
+        self.vm.launch()
+        self.assertTrue(self.vm.qmp('query-vnc')['return']['enabled'])
+        set_password_response = self.vm.qmp('change',
+                                            device='vnc',
+                                            target='password',
+                                            arg='new_password')
+        self.assertIn('error', set_password_response)
+        self.assertEqual(set_password_response['error']['class'],
+                         'GenericError')
+        self.assertEqual(set_password_response['error']['desc'],
+                         'Could not set password')
+
+    def test_vnc_change_password(self):
+        self.vm.add_args('-nodefaults', '-S', '-vnc', ':0,password')
+        self.vm.launch()
+        self.assertTrue(self.vm.qmp('query-vnc')['return']['enabled'])
+        set_password_response = self.vm.qmp('change',
+                                            device='vnc',
+                                            target='password',
+                                            arg='new_password')
+        self.assertEqual(set_password_response['return'], {})
-- 
2.17.0

  parent reply	other threads:[~2018-05-29 19:37 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-29 19:37 [Qemu-devel] [PATCH v3 0/5] Acceptance/functional tests Cleber Rosa
2018-05-29 19:37 ` [Qemu-devel] [PATCH v3 1/5] Add functional/acceptance tests infrastructure Cleber Rosa
2018-05-30 12:54   ` Stefan Hajnoczi
2018-05-30 18:15     ` Cleber Rosa
2018-05-29 19:37 ` [Qemu-devel] [PATCH v3 2/5] scripts/qemu.py: allow adding to the list of extra arguments Cleber Rosa
2018-05-30 12:54   ` Stefan Hajnoczi
2018-05-29 19:37 ` Cleber Rosa [this message]
2018-05-30 12:57   ` [Qemu-devel] [PATCH v3 3/5] Acceptance tests: add quick VNC tests Stefan Hajnoczi
2018-05-30 13:04     ` Fam Zheng
2018-05-30 16:29     ` Eduardo Habkost
2018-05-30 18:00       ` Cleber Rosa
2018-05-30 20:00         ` Eduardo Habkost
2018-05-30 21:03           ` Cleber Rosa
2018-05-30 21:31             ` Eduardo Habkost
2018-05-30 22:28               ` Cleber Rosa
2018-05-30 12:57   ` Stefan Hajnoczi
2018-05-29 19:37 ` [Qemu-devel] [PATCH v3 4/5] scripts/qemu.py: introduce set_console() method Cleber Rosa
2018-05-30 19:17   ` Stefan Hajnoczi
2018-05-29 19:37 ` [Qemu-devel] [PATCH v3 5/5] Acceptance tests: add Linux kernel boot and console checking test Cleber Rosa
2018-05-30 19:20   ` Stefan Hajnoczi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180529193730.9204-4-crosa@redhat.com \
    --to=crosa@redhat.com \
    --cc=amador@pahim.org \
    --cc=ehabkost@redhat.com \
    --cc=f4bug@amsat.org \
    --cc=famz@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).