diff mbox series

[v2,3/3] avocado/vnc: add test_change_listen

Message ID 20211222191731.467706-4-vsementsov@virtuozzo.com (mailing list archive)
State New, archived
Headers show
Series qapi/ui: add change-vnc-listen | expand

Commit Message

Vladimir Sementsov-Ogievskiy Dec. 22, 2021, 7:17 p.m. UTC
Add simple test-case for new change-vnc-listen qmp command.

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
 tests/avocado/vnc.py | 10 ++++++++++
 1 file changed, 10 insertions(+)
diff mbox series

Patch

diff --git a/tests/avocado/vnc.py b/tests/avocado/vnc.py
index 096432988f..f05ee1e00a 100644
--- a/tests/avocado/vnc.py
+++ b/tests/avocado/vnc.py
@@ -51,3 +51,13 @@  def test_change_password(self):
         set_password_response = self.vm.qmp('change-vnc-password',
                                             password='new_password')
         self.assertEqual(set_password_response['return'], {})
+
+    def test_change_listen(self):
+        self.vm.add_args('-nodefaults', '-S', '-vnc', ':0')
+        self.vm.launch()
+        self.assertEqual(self.vm.qmp('query-vnc')['return']['service'], '5900')
+        res = self.vm.qmp('change-vnc-listen', id='default',
+                          addresses=[{'type': 'inet', 'host': '0.0.0.0',
+                                      'port': '5901'}])
+        self.assertEqual(res['return'], {})
+        self.assertEqual(self.vm.qmp('query-vnc')['return']['service'], '5901')