]> www.infradead.org Git - users/dwmw2/qemu.git/commitdiff
tests/functional/test_vnc: Do not use a hard-coded VNC port
authorThomas Huth <thuth@redhat.com>
Wed, 18 Dec 2024 13:14:37 +0000 (14:14 +0100)
committerThomas Huth <thuth@redhat.com>
Thu, 2 Jan 2025 07:58:08 +0000 (08:58 +0100)
Two tests here are using the hard-coded VNC port :0 ... if there
is already a QEMU or other program running that is using this
port, the tests will be failing. Fortunately, QEMU can also
auto-detect a free port with the "to=..." parameter, so let's
use that for the tests to avoid the problem.

Message-ID: <20241218131439.255841-4-thuth@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
tests/functional/test_vnc.py

index b769d3b26817d0435cdebfb086b82388cc2acd34..e6328567c787ea15e9c476d6d3026fea3c3f745e 100755 (executable)
@@ -72,7 +72,7 @@ class Vnc(QemuSystemTest):
                          'Could not set password')
 
     def test_change_password_requires_a_password(self):
-        self.vm.add_args('-nodefaults', '-S', '-vnc', ':0')
+        self.vm.add_args('-nodefaults', '-S', '-vnc', ':1,to=999')
         self.vm.launch()
         self.assertTrue(self.vm.qmp('query-vnc')['return']['enabled'])
         set_password_response = self.vm.qmp('change-vnc-password',
@@ -84,7 +84,7 @@ class Vnc(QemuSystemTest):
                          'Could not set password')
 
     def test_change_password(self):
-        self.vm.add_args('-nodefaults', '-S', '-vnc', ':0,password=on')
+        self.vm.add_args('-nodefaults', '-S', '-vnc', ':1,to=999,password=on')
         self.vm.launch()
         self.assertTrue(self.vm.qmp('query-vnc')['return']['enabled'])
         self.vm.cmd('change-vnc-password',