tests/vm/basevm.py: use cmd() instead of qmp()

We don't expect failure here and need 'result' object. cmd() is better
in this case.

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-id: 20231006154125.1068348-14-vsementsov@yandex-team.ru
Signed-off-by: John Snow <jsnow@redhat.com>
This commit is contained in:
Vladimir Sementsov-Ogievskiy 2023-10-06 18:41:23 +03:00 committed by John Snow
parent 39995e2126
commit 9acd49e29e

View File

@ -312,8 +312,8 @@ class BaseVM(object):
self._guest = guest self._guest = guest
# Init console so we can start consuming the chars. # Init console so we can start consuming the chars.
self.console_init() self.console_init()
usernet_info = guest.qmp("human-monitor-command", usernet_info = guest.cmd("human-monitor-command",
command_line="info usernet").get("return") command_line="info usernet")
self.ssh_port = get_info_usernet_hostfwd_port(usernet_info) self.ssh_port = get_info_usernet_hostfwd_port(usernet_info)
if not self.ssh_port: if not self.ssh_port:
raise Exception("Cannot find ssh port from 'info usernet':\n%s" % \ raise Exception("Cannot find ssh port from 'info usernet':\n%s" % \