[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v3 02/14] tests/vm: python3 fixes
From: |
Philippe Mathieu-Daudé |
Subject: |
Re: [Qemu-devel] [PATCH v3 02/14] tests/vm: python3 fixes |
Date: |
Wed, 29 May 2019 13:33:17 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 |
On 5/20/19 2:47 PM, Gerd Hoffmann wrote:
> Add proper unicode handling when processing strings.
> Also need to explicitly say we want int not float.
>
> Signed-off-by: Gerd Hoffmann <address@hidden>
> ---
> tests/vm/basevm.py | 10 +++++-----
> 1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/tests/vm/basevm.py b/tests/vm/basevm.py
> index 0556bdcf9e9f..3126fb10a819 100755
> --- a/tests/vm/basevm.py
> +++ b/tests/vm/basevm.py
> @@ -73,7 +73,7 @@ class BaseVM(object):
> "-vnc", "127.0.0.1:0,to=20",
> "-serial", "file:%s" % os.path.join(self._tmpdir, "serial.out")]
> if vcpus and vcpus > 1:
> - self._args += ["-smp", str(vcpus)]
> + self._args += ["-smp", "%d" % vcpus]
> if kvm_available(self.arch):
> self._args += ["-enable-kvm"]
> else:
> @@ -85,12 +85,12 @@ class BaseVM(object):
> if not sha256sum:
> return True
> checksum = subprocess.check_output(["sha256sum",
> fname]).split()[0]
> - return sha256sum == checksum
> + return sha256sum == checksum.decode("utf-8")
>
> cache_dir = os.path.expanduser("~/.cache/qemu-vm/download")
> if not os.path.exists(cache_dir):
> os.makedirs(cache_dir)
> - fname = os.path.join(cache_dir, hashlib.sha1(url).hexdigest())
> + fname = os.path.join(cache_dir,
> hashlib.sha1(url.encode("utf-8")).hexdigest())
> if os.path.exists(fname) and check_sha256sum(fname):
> return fname
> logging.debug("Downloading %s to %s...", url, fname)
> @@ -134,7 +134,7 @@ class BaseVM(object):
> raise NotImplementedError
>
> def add_source_dir(self, src_dir):
> - name = "data-" + hashlib.sha1(src_dir).hexdigest()[:5]
> + name = "data-" +
> hashlib.sha1(src_dir.encode("utf-8")).hexdigest()[:5]
> tarfile = os.path.join(self._tmpdir, name + ".tar")
> logging.debug("Creating archive %s for src_dir dir: %s", tarfile,
> src_dir)
> subprocess.check_call(["./scripts/archive-source.sh", tarfile],
> @@ -256,7 +256,7 @@ def main(vmcls):
> vm.add_source_dir(args.build_qemu)
> cmd = [vm.BUILD_SCRIPT.format(
> configure_opts = " ".join(argv),
> - jobs=args.jobs,
> + jobs=int(args.jobs),
> target=args.build_target,
> verbose = "V=1" if args.verbose else "")]
> else:
>
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
Tested-by: Philippe Mathieu-Daudé <address@hidden>
- [Qemu-devel] [PATCH v3 04/14] tests/vm: use ssh with pty unconditionally, (continued)
- [Qemu-devel] [PATCH v3 04/14] tests/vm: use ssh with pty unconditionally, Gerd Hoffmann, 2019/05/20
- [Qemu-devel] [PATCH v3 01/14] scripts: use git archive in archive-source, Gerd Hoffmann, 2019/05/20
- [Qemu-devel] [PATCH v3 14/14] tests/vm: ubuntu.i386: apt proxy setup, Gerd Hoffmann, 2019/05/20
- [Qemu-devel] [PATCH v3 07/14] tests/vm: add vm-boot-{ssh, serial}-<guest> targets, Gerd Hoffmann, 2019/05/20
- [Qemu-devel] [PATCH v3 06/14] tests/vm: proper guest shutdown, Gerd Hoffmann, 2019/05/20
- [Qemu-devel] [PATCH v3 02/14] tests/vm: python3 fixes, Gerd Hoffmann, 2019/05/20
- Re: [Qemu-devel] [PATCH v3 02/14] tests/vm: python3 fixes,
Philippe Mathieu-Daudé <=
- [Qemu-devel] [PATCH v3 11/14] tests/vm: freebsd autoinstall, using serial console, Gerd Hoffmann, 2019/05/20
- [Qemu-devel] [PATCH v3 13/14] tests/vm: fedora autoinstall, using serial console, Gerd Hoffmann, 2019/05/20
- [Qemu-devel] [PATCH v3 12/14] tests/vm: netbsd autoinstall, using serial console, Gerd Hoffmann, 2019/05/20
- [Qemu-devel] [PATCH v3 10/14] tests/vm: openbsd autoinstall, using serial console, Gerd Hoffmann, 2019/05/20
- Re: [Qemu-devel] [PATCH v3 00/14] tests/vm: serial console autoinstall, misc fixes., Gerd Hoffmann, 2019/05/29