From patchwork Fri Mar 29 21:07:59 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wainer dos Santos Moschetta X-Patchwork-Id: 10878035 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 330911669 for ; Sat, 30 Mar 2019 02:50:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0F39128E6C for ; Sat, 30 Mar 2019 02:50:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F146A28F37; Sat, 30 Mar 2019 02:50:21 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id AAC2F28E6C for ; Sat, 30 Mar 2019 02:50:20 +0000 (UTC) Received: from localhost ([127.0.0.1]:46396 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hA44U-00087T-6R for patchwork-qemu-devel@patchwork.kernel.org; Fri, 29 Mar 2019 22:50:14 -0400 Received: from eggs.gnu.org ([209.51.188.92]:46392) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hA12O-0000oB-CD for qemu-devel@nongnu.org; Fri, 29 Mar 2019 19:35:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h9yk4-0004qW-AT for qemu-devel@nongnu.org; Fri, 29 Mar 2019 17:08:50 -0400 Received: from mx1.redhat.com ([209.132.183.28]:57268) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1h9yk2-0004PE-7q for qemu-devel@nongnu.org; Fri, 29 Mar 2019 17:08:46 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4919D307D848; Fri, 29 Mar 2019 21:08:08 +0000 (UTC) Received: from virtlab514.virt.lab.eng.bos.redhat.com (virtlab514.virt.lab.eng.bos.redhat.com [10.19.152.210]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1C5C018247; Fri, 29 Mar 2019 21:08:04 +0000 (UTC) From: Wainer dos Santos Moschetta To: qemu-devel@nongnu.org Date: Fri, 29 Mar 2019 17:07:59 -0400 Message-Id: <20190329210804.22121-1-wainersm@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.48]); Fri, 29 Mar 2019 21:08:08 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 0/5] tests/vm: Python 3, improve image caching, and misc X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: fam@euphon.net, peter.maydell@linaro.org, philmd@redhat.com, lersek@redhat.com, pbonzini@redhat.com, alex.bennee@linaro.org Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Hi all! This series bundles the support to Python3, improvement to image caching, and miscellaneous changes for the vm-test (`make vm-build-*`). Git tree: http://github.com/wainersm/qemu Branch: vm_test_python3_and_misc Travis: https://travis-ci.org/wainersm/qemu/builds/513220300 Below you can find some general comments. Patch 01: Uses python configured at build, although vm-test can be executed from the code tree (see docs/devel/testing.rst) too. In this case $(PYTHON) will be empty and it picks python pointed by the script's shebang, as a result failing on Python 3 only Linux distros. Patch 02: Ported based.py to work with Python 3 (kept Python 2 compatibility). Fixed the follow errors: - Raising "TypeError: Unicode-objects must be encoded before hashing" exception by hashlib.sha1(). - get_default_jobs() is used to set the vm cpus, but it was returning an invalid float number. - On check_sha256sum(), subprocess.check_output() returns bytes so that string comparison was failing. Patch 03: Implemented a simple mechanism to detect the image file changed on http://download.patchew.org, as discussed in https://www.mail-archive.com/qemu-devel@nongnu.org/msg607839.html. I didn't implement the '--force' option that Paolo suggested, because it would require a major refactoring (technically the vm implementation decides whether use the cache or not). My intention is to keep the script as simple as possible, so IMO, if the image file changed on the server then it should equally be updated the checksum on QEMU's side. Patch 04: Default network (NETWORK=1) backend is enough to have the docker-based tests run properly. Note: `make docker-test-block@centos7` is broken inside the CentOS VM and apparently on my host (Fedora 29 x86_64) too. Wainer dos Santos Moschetta (5): tests/vm: Use python configured on build tests/vm: Port basevm to Python 3 tests/vm: Detect the image changed on server tests/vm: Fix build-centos docker-based tests run tests/vm: Add missing variables on help tests/vm/Makefile.include | 12 ++++++++---- tests/vm/basevm.py | 39 ++++++++++++++++++++++++++++++++++----- tests/vm/centos | 6 +++--- 3 files changed, 45 insertions(+), 12 deletions(-)