qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 1/1] VM tests: account for changes in qemu.utils.get_info_use


From: John Snow
Subject: Re: [PATCH 1/1] VM tests: account for changes in qemu.utils.get_info_usernet_hostfwd_port()
Date: Tue, 1 Jun 2021 13:56:10 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1

On 6/1/21 1:36 PM, Willian Rampazzo wrote:
On Tue, Jun 1, 2021 at 12:46 PM Cleber Rosa <crosa@redhat.com> wrote:

The utility function actually accepts a string, and not the raw
dictionary response from QMP.  Also, it returns (optionally) an
integer, so that must also be accounted for.

Signed-off-by: John Snow <jsnow@redhat.com>
Signed-off-by: Cleber Rosa <crosa@redhat.com>
---
  tests/vm/basevm.py | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tests/vm/basevm.py b/tests/vm/basevm.py
index 6f4f0fc95e..0f2e436ed3 100644
--- a/tests/vm/basevm.py
+++ b/tests/vm/basevm.py
@@ -227,7 +227,7 @@ def _ssh_do(self, user, cmd, check):
                     "-o", "UserKnownHostsFile=" + os.devnull,
                     "-o",
                     "ConnectTimeout={}".format(self._config["ssh_timeout"]),
-                   "-p", self.ssh_port, "-i", self._ssh_tmp_key_file]
+                   "-p", str(self.ssh_port), "-i", self._ssh_tmp_key_file]
          # If not in debug mode, set ssh to quiet mode to
          # avoid printing the results of commands.
          if not self.debug:
@@ -305,7 +305,7 @@ def boot(self, img, extra_args=[]):
          # Init console so we can start consuming the chars.
          self.console_init()
          usernet_info = guest.qmp("human-monitor-command",
-                                 command_line="info usernet")
+                                 command_line="info usernet").get("return")
          self.ssh_port = get_info_usernet_hostfwd_port(usernet_info)

 From here, your file differs from the upstream and your patch does not
work. I'm trying on commit 52848929b70dcf92a68aedcfd90207be81ba3274.


Cleber is patching against my pull request -- I'll be squashing it into (from PR tree) 0739780d621f8fd4163ce6969a183e59113245aa -- just waiting on some tests to finish running before I move ahead with it.

commit 0739780d621f8fd4163ce6969a183e59113245aa
Author: Cleber Rosa <crosa@redhat.com>
Date:   Mon Apr 12 00:46:36 2021 -0400

    Python: add utility function for retrieving port redirection

    Slightly different versions for the same utility code are currently
    present on different locations.  This unifies them all, giving
    preference to the version from virtiofs_submounts.py, because of the
    last tweaks added to it.

    While at it, this adds a "qemu.utils" module to host the utility
    function and a test.

    Signed-off-by: Cleber Rosa <crosa@redhat.com>
    Reviewed-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
    Reviewed-by: Eric Auger <eric.auger@redhat.com>
    Reviewed-by: Willian Rampazzo <willianr@redhat.com>
    Message-Id: <20210412044644.55083-4-crosa@redhat.com>
    Signed-off-by: John Snow <jsnow@redhat.com>


          if not self.ssh_port:
              raise Exception("Cannot find ssh port from 'info usernet':\n%s" % 
\
--
2.25.4



thanks,
--js




reply via email to

[Prev in Thread] Current Thread [Next in Thread]