[{"id":1767523,"web_url":"http://patchwork.ozlabs.org/comment/1767523/","msgid":"<150527250819.321.3518047184213665168@6d89bd104fc3>","list_archive_url":null,"date":"2017-09-13T03:15:08","subject":"Re: [Qemu-devel] [PATCH v7 00/13] tests: Add VM based build tests\n\t(for non-x86_64 and/or non-Linux)","submitter":{"id":69632,"url":"http://patchwork.ozlabs.org/api/people/69632/","name":null,"email":"no-reply@patchew.org"},"content":"Hi,\n\nThis series seems to have some coding style problems. See output below for\nmore information:\n\nSubject: [Qemu-devel] [PATCH v7 00/13] tests: Add VM based build tests (for non-x86_64 and/or non-Linux)\nMessage-id: 20170913030119.3957-1-famz@redhat.com\nType: series\n\n=== TEST SCRIPT BEGIN ===\n#!/bin/bash\n\nBASE=base\nn=1\ntotal=$(git log --oneline $BASE.. | wc -l)\nfailed=0\n\ngit config --local diff.renamelimit 0\ngit config --local diff.renames True\n\ncommits=\"$(git log --format=%H --reverse $BASE..)\"\nfor c in $commits; do\n    echo \"Checking PATCH $n/$total: $(git log -n 1 --format=%s $c)...\"\n    if ! git show $c --format=email | ./scripts/checkpatch.pl --mailback -; then\n        failed=1\n        echo\n    fi\n    n=$((n+1))\ndone\n\nexit $failed\n=== TEST SCRIPT END ===\n\nUpdating 3c8cf5a9c21ff8782164d1def7f44bd888713384\nFrom https://github.com/patchew-project/qemu\n t [tag update]            patchew/1504812251-23438-1-git-send-email-sundeep.lkml@gmail.com -> patchew/1504812251-23438-1-git-send-email-sundeep.lkml@gmail.com\n t [tag update]            patchew/1505232834-20890-1-git-send-email-peter.maydell@linaro.org -> patchew/1505232834-20890-1-git-send-email-peter.maydell@linaro.org\n * [new tag]               patchew/20170913030119.3957-1-famz@redhat.com -> patchew/20170913030119.3957-1-famz@redhat.com\nSwitched to a new branch 'test'\n2a093b5b91 docker: Use archive-source.py\nd2593fa09c tests: Add README for vm tests\nfb3acd78df MAINTAINERS: Add tests/vm entry\n90ed120035 Makefile: Add rules to run vm tests\n0ce88831a3 tests: Add OpenBSD image\nd5f133ecf2 tests: Add NetBSD image\nda78075e20 tests: Add FreeBSD image\nd1f4a3a768 tests: Add ubuntu.i386 image\necb8ea14ca tests: Add vm test lib\nfb1ed69ecc tests: Add a test key pair\nab63dd9b38 scripts: Add archive-source.sh\n1c4bcf6389 qemu.py: Add \"wait()\" method\n6376f7d0bb gitignore: Ignore vm test images\n\n=== OUTPUT BEGIN ===\nChecking PATCH 1/13: gitignore: Ignore vm test images...\nChecking PATCH 2/13: qemu.py: Add \"wait()\" method...\nChecking PATCH 3/13: scripts: Add archive-source.sh...\nChecking PATCH 4/13: tests: Add a test key pair...\nChecking PATCH 5/13: tests: Add vm test lib...\nWARNING: line over 80 characters\n#71: FILE: tests/vm/basevm.py:46:\n+        self._tmpdir = tempfile.mkdtemp(prefix=\"vm-test-\", suffix=\".tmp\", dir=\".\")\n\nWARNING: line over 80 characters\n#162: FILE: tests/vm/basevm.py:137:\n+        logging.debug(\"Creating archive %s for src_dir dir: %s\", tarfile, src_dir)\n\nWARNING: line over 80 characters\n#167: FILE: tests/vm/basevm.py:142:\n+                            \"file=%s,if=none,id=%s,cache=writeback,format=raw\" % \\\n\nWARNING: line over 80 characters\n#170: FILE: tests/vm/basevm.py:145:\n+                            \"virtio-blk,drive=%s,serial=%s,bootindex=1\" % (name, name)]\n\nERROR: line over 90 characters\n#225: FILE: tests/vm/basevm.py:200:\n+    VM test utility.  Exit codes: 0 = success, 1 = command line error, 2 = environment initialization failed, 3 = test command failed\"\"\")\n\nWARNING: line over 80 characters\n#232: FILE: tests/vm/basevm.py:207:\n+    parser.add_option(\"--jobs\", type=int, default=multiprocessing.cpu_count() / 2,\n\ntotal: 1 errors, 5 warnings, 256 lines checked\n\nYour patch has style problems, please review.  If any of these errors\nare false positives report them to the maintainer, see\nCHECKPATCH in MAINTAINERS.\n\nChecking PATCH 6/13: tests: Add ubuntu.i386 image...\nChecking PATCH 7/13: tests: Add FreeBSD image...\nChecking PATCH 8/13: tests: Add NetBSD image...\nChecking PATCH 9/13: tests: Add OpenBSD image...\nChecking PATCH 10/13: Makefile: Add rules to run vm tests...\nChecking PATCH 11/13: MAINTAINERS: Add tests/vm entry...\nChecking PATCH 12/13: tests: Add README for vm tests...\nChecking PATCH 13/13: docker: Use archive-source.py...\n=== OUTPUT END ===\n\nTest command exited with code: 1\n\n\n---\nEmail generated automatically by Patchew [http://patchew.org/].\nPlease send your feedback to patchew-devel@freelists.org","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":"ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xsRd60Q3wz9s7v\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed, 13 Sep 2017 13:15:54 +1000 (AEST)","from localhost ([::1]:39836 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1dry9Y-0006W6-6c\n\tfor incoming@patchwork.ozlabs.org; Tue, 12 Sep 2017 23:15:52 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:52093)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <no-reply@patchew.org>) id 1dry9F-0006Vo-Ug\n\tfor qemu-devel@nongnu.org; Tue, 12 Sep 2017 23:15:35 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <no-reply@patchew.org>) id 1dry9B-0001Sl-NA\n\tfor qemu-devel@nongnu.org; Tue, 12 Sep 2017 23:15:33 -0400","from sender-of-o52.zoho.com ([135.84.80.217]:21449)\n\tby eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <no-reply@patchew.org>)\n\tid 1dry9B-0001SA-Eh\n\tfor qemu-devel@nongnu.org; Tue, 12 Sep 2017 23:15:29 -0400","from [172.17.0.2] (23.253.156.214 [23.253.156.214]) by\n\tmx.zohomail.com with SMTPS id 1505272508848211.0766856934979;\n\tTue, 12 Sep 2017 20:15:08 -0700 (PDT)"],"Resent-Date":"Tue, 12 Sep 2017 23:15:33 -0400","Resent-Message-Id":"<E1dry9B-0001Sl-NA@eggs.gnu.org>","In-Reply-To":"<20170913030119.3957-1-famz@redhat.com>","Message-ID":"<150527250819.321.3518047184213665168@6d89bd104fc3>","MIME-Version":"1.0","Content-Type":"text/plain; charset=\"utf-8\"","Content-Transfer-Encoding":"base64","Resent-From":"","From":"no-reply@patchew.org","To":"famz@redhat.com","Date":"Tue, 12 Sep 2017 20:15:08 -0700 (PDT)","X-ZohoMailClient":"External","X-detected-operating-system":"by eggs.gnu.org: GNU/Linux 3.x [fuzzy]","X-Received-From":"135.84.80.217","Subject":"Re: [Qemu-devel] [PATCH v7 00/13] tests: Add VM based build tests\n\t(for non-x86_64 and/or non-Linux)","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Reply-To":"qemu-devel@nongnu.org","Cc":"peter.maydell@linaro.org, famz@redhat.com, f4bug@amsat.org,\n\tqemu-devel@nongnu.org, kamil@netbsd.org, stefanha@redhat.com,\n\tcrosa@redhat.com, pbonzini@redhat.com, alex.bennee@linaro.org","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"}},{"id":1767793,"web_url":"http://patchwork.ozlabs.org/comment/1767793/","msgid":"<CAFEAcA_BfVKDOs3R6hv+-VY5MUcfi97g0RuLwNL2-Zxb+0yK6Q@mail.gmail.com>","list_archive_url":null,"date":"2017-09-13T10:55:44","subject":"Re: [Qemu-devel] [PATCH v7 03/13] scripts: Add archive-source.sh","submitter":{"id":5111,"url":"http://patchwork.ozlabs.org/api/people/5111/","name":"Peter Maydell","email":"peter.maydell@linaro.org"},"content":"On 13 September 2017 at 04:01, Fam Zheng <famz@redhat.com> wrote:\n> Signed-off-by: Fam Zheng <famz@redhat.com>\n> ---\n>  scripts/archive-source.sh | 33 +++++++++++++++++++++++++++++++++\n>  1 file changed, 33 insertions(+)\n>  create mode 100755 scripts/archive-source.sh\n>\n> diff --git a/scripts/archive-source.sh b/scripts/archive-source.sh\n> new file mode 100755\n> index 0000000000..8b373e3090\n> --- /dev/null\n> +++ b/scripts/archive-source.sh\n> @@ -0,0 +1,33 @@\n> +#!/bin/sh\n> +#\n> +# Author: Fam Zheng <famz@redhat.com>\n> +#\n> +# Archive source tree, including submodules. This is created for test code to\n> +# export the source files, in order to be built in a different enviornment,\n\n\"environment\"\n\n> +# such as in a docker instance or VM.\n> +#\n> +# This code is licensed under the GPL version 2 or later.  See\n> +# the COPYING file in the top-level directory.\n> +\n> +set -e\n> +\n> +if test $# -lt 1; then\n> +    echo \"Usage: $0 <output tarball>\"\n> +    exit 1\n> +fi\n> +\n> +submodules=$(git submodule foreach --recursive --quiet 'echo $name')\n> +\n> +if test -n \"$submodules\"; then\n> +    {\n> +        git ls-files\n> +        for sm in $submodules; do\n> +            (cd $sm; git ls-files) | sed \"s:^:$sm/:\"\n> +        done\n> +    } | grep -x -v $(for sm in $submodules; do echo \"-e $sm\"; done) > \"$1\".list\n> +else\n> +    git ls-files > \"$1\".list\n> +fi\n> +\n> +tar -cf \"$1\" -T \"$1\".list\n> +rm \"$1\".list\n> --\n> 2.13.5\n>\n\nthanks\n-- PMM","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=linaro.org header.i=@linaro.org\n\theader.b=\"UT1hAiAs\"; dkim-atps=neutral"],"Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xsdrX62d8z9s78\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed, 13 Sep 2017 20:56:28 +1000 (AEST)","from localhost ([::1]:41532 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1ds5LG-0002WU-UU\n\tfor incoming@patchwork.ozlabs.org; Wed, 13 Sep 2017 06:56:26 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:39357)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <peter.maydell@linaro.org>) id 1ds5Kx-0002V1-Ig\n\tfor qemu-devel@nongnu.org; Wed, 13 Sep 2017 06:56:08 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <peter.maydell@linaro.org>) id 1ds5Kw-0008Ry-OO\n\tfor qemu-devel@nongnu.org; Wed, 13 Sep 2017 06:56:07 -0400","from mail-wm0-x232.google.com ([2a00:1450:400c:c09::232]:47035)\n\tby eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)\n\t(Exim 4.71) (envelope-from <peter.maydell@linaro.org>)\n\tid 1ds5Kw-0008Qo-I4\n\tfor qemu-devel@nongnu.org; Wed, 13 Sep 2017 06:56:06 -0400","by mail-wm0-x232.google.com with SMTP id i189so3580561wmf.1\n\tfor <qemu-devel@nongnu.org>; Wed, 13 Sep 2017 03:56:06 -0700 (PDT)","by 10.223.139.215 with HTTP; Wed, 13 Sep 2017 03:55:44 -0700 (PDT)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google;\n\th=mime-version:in-reply-to:references:from:date:message-id:subject:to\n\t:cc; bh=VAGJ0oIZjok/Dec2RDzOQDUelMXTQhqwbE6hRAC1bSs=;\n\tb=UT1hAiAsv1/nfwLk/1R//Er0WqYL8yWmTbd0DP/HJP/ShP4e0IT+LV0jScyIemGYfo\n\tPlBhZ0rEWHRzz040f5MIcFSK2+aIQuZEnB/oeahwhj0xPzT2IimT/4NDfuMLS9PS5LHX\n\thXULd/b/NITum226Cugj14PNgKZ+Iwnp6Wst4=","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:mime-version:in-reply-to:references:from:date\n\t:message-id:subject:to:cc;\n\tbh=VAGJ0oIZjok/Dec2RDzOQDUelMXTQhqwbE6hRAC1bSs=;\n\tb=Pr1HGOWOtd03K+BI+00uESZT2JJQt2h7vd5PsTIyvlixy7/+xkCWgWFmHew9AXQrsD\n\twryUJC4BfGL5Xj3rU4y3e9Soj2NPb5+8D6KUrBVow39UdXuV7feJf0hTsh+ZwxUHBwRW\n\twQf/Xpidr8fRceeaUb8bUjAD31MonqLS0bFDB7EycOPKZ7FvqnP1B7Mhs/lMoptx81H5\n\tATXiT5Bf7Og1LK0gOec2ztpWJMEq3RrmBL8AXNrzKwNKhXdWOFAwb5jm72X+XkreMI56\n\taKTVb/CzJNfH3VYIsxS1Oyt7tEw3/cYMPZ5YP+dj1yLDudmLaB2bIaN+mUueD0+af7b4\n\tjyxw==","X-Gm-Message-State":"AHPjjUiE6SLVX9O2BCeTPbMFC85yhKb+roLTVk5L+Y1ca+esi/L1uQ1f\n\tBunNVBtUSzVce99lQuSsOcXQJnHEMNrKk1j4jjLtWg==","X-Google-Smtp-Source":"AOwi7QCJcJwAMSxeC7lnn6xHLNEQxUap6Bzn7uipto4U9QyLOXMoApKYaC3NaFqRT/sho4XDabyvtiQ8ttmXh+ZLr3g=","X-Received":"by 10.28.52.81 with SMTP id b78mr2080670wma.11.1505300165414;\n\tWed, 13 Sep 2017 03:56:05 -0700 (PDT)","MIME-Version":"1.0","In-Reply-To":"<20170913030119.3957-4-famz@redhat.com>","References":"<20170913030119.3957-1-famz@redhat.com>\n\t<20170913030119.3957-4-famz@redhat.com>","From":"Peter Maydell <peter.maydell@linaro.org>","Date":"Wed, 13 Sep 2017 11:55:44 +0100","Message-ID":"<CAFEAcA_BfVKDOs3R6hv+-VY5MUcfi97g0RuLwNL2-Zxb+0yK6Q@mail.gmail.com>","To":"Fam Zheng <famz@redhat.com>","Content-Type":"text/plain; charset=\"UTF-8\"","X-detected-operating-system":"by eggs.gnu.org: Genre and OS details not\n\trecognized.","X-Received-From":"2a00:1450:400c:c09::232","Subject":"Re: [Qemu-devel] [PATCH v7 03/13] scripts: Add archive-source.sh","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Cc":"QEMU Developers <qemu-devel@nongnu.org>, =?utf-8?q?Philippe_Mathieu-Da?=\n\t=?utf-8?q?ud=C3=A9?= <f4bug@amsat.org>,\n\tKamil Rytarowski <kamil@netbsd.org>,\n\tStefan Hajnoczi <stefanha@redhat.com>, Cleber Rosa <crosa@redhat.com>,\n\tPaolo Bonzini <pbonzini@redhat.com>, =?utf-8?q?Alex_Benn=C3=A9e?=\n\t<alex.bennee@linaro.org>","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"}},{"id":1768955,"web_url":"http://patchwork.ozlabs.org/comment/1768955/","msgid":"<20170915061415.GC17199@lemon>","list_archive_url":null,"date":"2017-09-15T06:14:15","subject":"Re: [Qemu-devel] [PATCH v7 03/13] scripts: Add archive-source.sh","submitter":{"id":24872,"url":"http://patchwork.ozlabs.org/api/people/24872/","name":"Fam Zheng","email":"famz@redhat.com"},"content":"On Wed, 09/13 11:55, Peter Maydell wrote:\n> On 13 September 2017 at 04:01, Fam Zheng <famz@redhat.com> wrote:\n> > Signed-off-by: Fam Zheng <famz@redhat.com>\n> > ---\n> >  scripts/archive-source.sh | 33 +++++++++++++++++++++++++++++++++\n> >  1 file changed, 33 insertions(+)\n> >  create mode 100755 scripts/archive-source.sh\n> >\n> > diff --git a/scripts/archive-source.sh b/scripts/archive-source.sh\n> > new file mode 100755\n> > index 0000000000..8b373e3090\n> > --- /dev/null\n> > +++ b/scripts/archive-source.sh\n> > @@ -0,0 +1,33 @@\n> > +#!/bin/sh\n> > +#\n> > +# Author: Fam Zheng <famz@redhat.com>\n> > +#\n> > +# Archive source tree, including submodules. This is created for test code to\n> > +# export the source files, in order to be built in a different enviornment,\n> \n> \"environment\"\n\nFixed, thanks.\n\nFam","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","ext-mx09.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com","ext-mx09.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=famz@redhat.com"],"Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xtlVj3b7rz9t2Z\n\tfor <incoming@patchwork.ozlabs.org>;\n\tFri, 15 Sep 2017 16:14:49 +1000 (AEST)","from localhost ([::1]:51498 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1dsjtm-0003pQ-Rp\n\tfor incoming@patchwork.ozlabs.org; Fri, 15 Sep 2017 02:14:46 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:56865)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <famz@redhat.com>) id 1dsjtQ-0003pK-KZ\n\tfor qemu-devel@nongnu.org; Fri, 15 Sep 2017 02:14:25 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <famz@redhat.com>) id 1dsjtN-00025O-G5\n\tfor qemu-devel@nongnu.org; Fri, 15 Sep 2017 02:14:24 -0400","from mx1.redhat.com ([209.132.183.28]:35116)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <famz@redhat.com>) id 1dsjtN-00025F-9Q\n\tfor qemu-devel@nongnu.org; Fri, 15 Sep 2017 02:14:21 -0400","from smtp.corp.redhat.com\n\t(int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id 067704ACBB;\n\tFri, 15 Sep 2017 06:14:20 +0000 (UTC)","from localhost (ovpn-12-95.pek2.redhat.com [10.72.12.95])\n\tby smtp.corp.redhat.com (Postfix) with ESMTP id 13FBD5C1A3;\n\tFri, 15 Sep 2017 06:14:16 +0000 (UTC)"],"DMARC-Filter":"OpenDMARC Filter v1.3.2 mx1.redhat.com 067704ACBB","Date":"Fri, 15 Sep 2017 14:14:15 +0800","From":"Fam Zheng <famz@redhat.com>","To":"Peter Maydell <peter.maydell@linaro.org>","Message-ID":"<20170915061415.GC17199@lemon>","References":"<20170913030119.3957-1-famz@redhat.com>\n\t<20170913030119.3957-4-famz@redhat.com>\n\t<CAFEAcA_BfVKDOs3R6hv+-VY5MUcfi97g0RuLwNL2-Zxb+0yK6Q@mail.gmail.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=us-ascii","Content-Disposition":"inline","In-Reply-To":"<CAFEAcA_BfVKDOs3R6hv+-VY5MUcfi97g0RuLwNL2-Zxb+0yK6Q@mail.gmail.com>","User-Agent":"Mutt/1.8.3 (2017-05-23)","X-Scanned-By":"MIMEDefang 2.79 on 10.5.11.16","X-Greylist":"Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.38]);\n\tFri, 15 Sep 2017 06:14:20 +0000 (UTC)","X-detected-operating-system":"by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]\n\t[fuzzy]","X-Received-From":"209.132.183.28","Subject":"Re: [Qemu-devel] [PATCH v7 03/13] scripts: Add archive-source.sh","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Cc":"QEMU Developers <qemu-devel@nongnu.org>, Philippe =?iso-8859-1?q?Mathi?=\n\t=?iso-8859-1?q?eu-Daud=E9?= <f4bug@amsat.org>,\n\tKamil Rytarowski <kamil@netbsd.org>,\n\tStefan Hajnoczi <stefanha@redhat.com>, Cleber Rosa <crosa@redhat.com>,\n\tPaolo Bonzini <pbonzini@redhat.com>, Alex =?iso-8859-1?q?Benn=E9e?=\n\t<alex.bennee@linaro.org>","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"}},{"id":1769103,"web_url":"http://patchwork.ozlabs.org/comment/1769103/","msgid":"<87y3pg8cb8.fsf@linaro.org>","list_archive_url":null,"date":"2017-09-15T10:51:23","subject":"Re: [Qemu-devel] [PATCH v7 04/13] tests: Add a test key pair","submitter":{"id":39532,"url":"http://patchwork.ozlabs.org/api/people/39532/","name":"Alex Bennée","email":"alex.bennee@linaro.org"},"content":"Fam Zheng <famz@redhat.com> writes:\n\n> This will be used by setup test user ssh.\n>\n> Signed-off-by: Fam Zheng <famz@redhat.com>\n\nReviewed-by: Alex Bennée <alex.bennee@linaro.org>\n\n> ---\n>  tests/keys/id_rsa     | 27 +++++++++++++++++++++++++++\n>  tests/keys/id_rsa.pub |  1 +\n>  2 files changed, 28 insertions(+)\n>  create mode 100644 tests/keys/id_rsa\n>  create mode 100644 tests/keys/id_rsa.pub\n>\n> diff --git a/tests/keys/id_rsa b/tests/keys/id_rsa\n> new file mode 100644\n> index 0000000000..3a3787154b\n> --- /dev/null\n> +++ b/tests/keys/id_rsa\n> @@ -0,0 +1,27 @@\n> +----BEGIN RSA PRIVATE KEY-----\n> +MIIEowIBAAKCAQEAopAuOlmLV6LVHdFBj8/eeOwI9CqguIJPp7eAQSZvOiB4Ag/R\n> +coEhl/RBbrV5Yc/SmSD4PTpJO/iM10RwliNjDb4a3I8q3sykRJu9c9PI/YsH8WN9\n> ++NH2NjKPtJIcKTu287IM5JYxyB6nDoOzILbTyJ1TDR/xH6qYEfBAyiblggdjcvhA\n> +RTf93QIn39F/xLypXvT1K2O9BJEsnJ8lEUvB2UXhKo/JTfSeZF8wPBeowaP9EONk\n> +7b+nuJOWHGg68Ji6wVi62tjwl2Szch6lxIhZBpnV7QNRKMfYHP6eIyF4pusazzZq\n> +Telsq6xI2ghecWLzb/MF5A+rklsGx2FNuJSAJwIDAQABAoIBAHHi4o/8VZNivz0x\n> +cWXn8erzKV6tUoWQvW85Lj/2RiwJvSlsnYZDkx5af1CpEE2HA/pFT8PNRqsd+MWC\n> +7AEy710cVsM4BYerBFYQaYxwzblaoojo88LSjVPw3h5Z0iLM8+IMVd36nwuc9dpE\n> +R8TecMZ1+U4Tl6BgqkK+9xToZRdPKdjS8L5MoFhGN+xY0vRbbJbGaV9Q0IHxLBkB\n> +rEBV7T1mUynneCHRUQlJQEwJmKpT8MH3IjsUXlG5YvnuuvcQJSNTaW2iDLxuOKp8\n> +cxW8+qL88zpb1D5dppoIu6rlrugN0azSq70ruFJQPc/A8GQrDKoGgRQiagxNY3u+\n> +vHZzXlECgYEA0dKO3gfkSxsDBb94sQwskMScqLhcKhztEa8kPxTx6Yqh+x8/scx3\n> +XhJyOt669P8U1v8a/2Al+s81oZzzfQSzO1Q7gEwSrgBcRMSIoRBUw9uYcy02ngb/\n> +j/ng3DGivfJztjjiSJwb46FHkJ2JR8mF2UisC6UMXk3NgFY/3vWQx78CgYEAxlcG\n> +T3hfSWSmTgKRczMJuHQOX9ULfTBIqwP5VqkkkiavzigGRirzb5lgnmuTSPTpF0LB\n> +XVPjR2M4q+7gzP0Dca3pocrvLEoxjwIKnCbYKnyyvnUoE9qHv4Kr+vDbgWpa2LXG\n> +JbLmE7tgTCIp20jOPPT4xuDvlbzQZBJ5qCQSoZkCgYEAgrotSSihlCnAOFSTXbu4\n> +CHp3IKe8xIBBNENq0eK61kcJpOxTQvOha3sSsJsU4JAM6+cFaxb8kseHIqonCj1j\n> +bhOM/uJmwQJ4el/4wGDsbxriYOBKpyq1D38gGhDS1IW6kk3erl6VAb36WJ/OaGum\n> +eTpN9vNeQWM4Jj2WjdNx4QECgYAwTdd6mU1TmZCrJRL5ZG+0nYc2rbMrnQvFoqUi\n> +BvWiJovggHzur90zy73tNzPaq9Ls2FQxf5G1vCN8NCRJqEEjeYCR59OSDMu/EXc2\n> +CnvQ9SevHOdS1oEDEjcCWZCMFzPi3XpRih1gptzQDe31uuiHjf3cqcGPzTlPdfRt\n> +D8P92QKBgC4UaBvIRwREVJsdZzpIzm224Bpe8LOmA7DeTnjlT0b3lkGiBJ36/Q0p\n> +VhYh/6cjX4/iuIs7gJbGon7B+YPB8scmOi3fj0+nkJAONue1mMfBNkba6qQTc6Y2\n> +5mEKw2/O7/JpND7ucU3OK9plcw/qnrWDgHxl0Iz95+OzUIIagxne\n> +-----END RSA PRIVATE KEY-----\n> diff --git a/tests/keys/id_rsa.pub b/tests/keys/id_rsa.pub\n> new file mode 100644\n> index 0000000000..d9888e312f\n> --- /dev/null\n> +++ b/tests/keys/id_rsa.pub\n> @@ -0,0 +1 @@\n> +ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCikC46WYtXotUd0UGPz9547Aj0KqC4gk+nt4BBJm86IHgCD9FygSGX9EFutXlhz9KZIPg9Okk7+IzXRHCWI2MNvhrcjyrezKREm71z08j9iwfxY3340fY2Mo+0khwpO7bzsgzkljHIHqcOg7MgttPInVMNH/EfqpgR8EDKJuWCB2Ny+EBFN/3dAiff0X/EvKle9PUrY70EkSycnyURS8HZReEqj8lN9J5kXzA8F6jBo/0Q42Ttv6e4k5YcaDrwmLrBWLra2PCXZLNyHqXEiFkGmdXtA1Eox9gc/p4jIXim6xrPNmpN6WyrrEjaCF5xYvNv8wXkD6uSWwbHYU24lIAn qemu-test\n\n\n--\nAlex Bennée","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=linaro.org header.i=@linaro.org\n\theader.b=\"P6EYs/At\"; dkim-atps=neutral"],"Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xtsfD5xTSz9s7M\n\tfor <incoming@patchwork.ozlabs.org>;\n\tFri, 15 Sep 2017 20:51:48 +1000 (AEST)","from localhost ([::1]:52475 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1dsoDq-0007jp-PQ\n\tfor incoming@patchwork.ozlabs.org; Fri, 15 Sep 2017 06:51:46 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:47550)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <alex.bennee@linaro.org>) id 1dsoDZ-0007jV-J8\n\tfor qemu-devel@nongnu.org; Fri, 15 Sep 2017 06:51:30 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <alex.bennee@linaro.org>) id 1dsoDW-0000ta-FY\n\tfor qemu-devel@nongnu.org; Fri, 15 Sep 2017 06:51:29 -0400","from mail-wr0-x22f.google.com ([2a00:1450:400c:c0c::22f]:53761)\n\tby eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)\n\t(Exim 4.71) (envelope-from <alex.bennee@linaro.org>)\n\tid 1dsoDW-0000t8-8B\n\tfor qemu-devel@nongnu.org; Fri, 15 Sep 2017 06:51:26 -0400","by mail-wr0-x22f.google.com with SMTP id l22so1507678wrc.10\n\tfor <qemu-devel@nongnu.org>; Fri, 15 Sep 2017 03:51:26 -0700 (PDT)","from zen.linaro.local ([81.128.185.34])\n\tby smtp.gmail.com with ESMTPSA id\n\tp80sm634052wmf.42.2017.09.15.03.51.23\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tFri, 15 Sep 2017 03:51:23 -0700 (PDT)","from zen (localhost [127.0.0.1])\n\tby zen.linaro.local (Postfix) with ESMTPS id 60AFB3E02DF;\n\tFri, 15 Sep 2017 11:51:23 +0100 (BST)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google;\n\th=references:user-agent:from:to:cc:subject:in-reply-to:date\n\t:message-id:mime-version:content-transfer-encoding;\n\tbh=O5gYExlVCB38ZwrXu+DAKr3VaD6n8PE1T05B2o3rM5M=;\n\tb=P6EYs/AtjQ4kFYouipEKt1mYhQ0MUx5Y2EYE6XMT5q+x/vMmZtz0T3IwqOp3ee8v4Z\n\t2XzBy3tHgh35hVbthnJJuZvDBvrZ9c7S37nA04cYsSpF6ao7Z/rhnYmxjZ7yMvnVY2ZV\n\t7yrGQeMH1G8wg/pSmm00qAVQK+yt6zgPDAmD0=","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:references:user-agent:from:to:cc:subject\n\t:in-reply-to:date:message-id:mime-version:content-transfer-encoding; \n\tbh=O5gYExlVCB38ZwrXu+DAKr3VaD6n8PE1T05B2o3rM5M=;\n\tb=osSVKNNtzxFGyrFci94d874AdP30GOXkAniy/ULVPu+s8Qnxeb+vr+I8BvUPpefCOT\n\tcVRk9nbi+wAgH6K3QBnLY13jaUidCnD+I8skTF/duRA/fWjVXcGh4BvviY0Jsp3EKa7e\n\tkDQMm4o7wvmCCcW3bpvvKdzr8XDh6D9XRWjYOOCJJk9jPH7jB+caWW45Tj91SHAnPOmc\n\tswRp3z+neg9WGCcUqJwghzJ7xr0V3WyAhkkf+/deSdLRiRVCYhkquo/Mkwpl6jtsCBNh\n\tQr3REnHLROmG+mLbDSm9LiBKKJAaM9XFzjZ5vBjCJw61yklNSlS/jcOUuckIBxyBwjox\n\t5GZA==","X-Gm-Message-State":"AHPjjUjWV3smHjsZxCJ8byyEPX/wYFQd1nHznZ4CRVdwvuQ+6MGl9/lg\n\taZ9YnC1TDOA5Mijw","X-Google-Smtp-Source":"ADKCNb4/Z7d5VPf++BK/bVJRRofeC7oQ51cWzdZGYHdaB8D2ovnlTkZAj46xtN84KvW4o/eUqHir5A==","X-Received":"by 10.223.147.195 with SMTP id 61mr20347637wrp.119.1505472684925;\n\tFri, 15 Sep 2017 03:51:24 -0700 (PDT)","References":"<20170913030119.3957-1-famz@redhat.com>\n\t<20170913030119.3957-5-famz@redhat.com>","User-agent":"mu4e 0.9.19; emacs 25.2.50.3","From":"Alex =?utf-8?q?Benn=C3=A9e?= <alex.bennee@linaro.org>","To":"Fam Zheng <famz@redhat.com>","In-reply-to":"<20170913030119.3957-5-famz@redhat.com>","Date":"Fri, 15 Sep 2017 11:51:23 +0100","Message-ID":"<87y3pg8cb8.fsf@linaro.org>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Transfer-Encoding":"8bit","X-detected-operating-system":"by eggs.gnu.org: Genre and OS details not\n\trecognized.","X-Received-From":"2a00:1450:400c:c0c::22f","Subject":"Re: [Qemu-devel] [PATCH v7 04/13] tests: Add a test key pair","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Cc":"Peter Maydell <peter.maydell@linaro.org>, qemu-devel@nongnu.org, Philippe\n\t=?utf-8?q?Mathieu-Daud=C3=A9?= <f4bug@amsat.org>,\n\tKamil Rytarowski <kamil@netbsd.org>, stefanha@redhat.com, \n\tCleber Rosa <crosa@redhat.com>, pbonzini@redhat.com","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"}},{"id":1769116,"web_url":"http://patchwork.ozlabs.org/comment/1769116/","msgid":"<87wp508a5w.fsf@linaro.org>","list_archive_url":null,"date":"2017-09-15T11:37:47","subject":"Re: [Qemu-devel] [PATCH v7 05/13] tests: Add vm test lib","submitter":{"id":39532,"url":"http://patchwork.ozlabs.org/api/people/39532/","name":"Alex Bennée","email":"alex.bennee@linaro.org"},"content":"Fam Zheng <famz@redhat.com> writes:\n\n> This is the common code to implement a \"VM test\" to\n>\n>   1) Download and initialize a pre-defined VM that has necessary\n>   dependencies to build QEMU and SSH access.\n>\n>   2) Archive $SRC_PATH to a .tar file.\n>\n>   3) Boot the VM, and pass the source tar file to the guest.\n>\n>   4) SSH into the VM, untar the source tarball, build from the source.\n>\n> Signed-off-by: Fam Zheng <famz@redhat.com>\n> ---\n>  tests/vm/basevm.py | 256 +++++++++++++++++++++++++++++++++++++++++++++++++++++\n>  1 file changed, 256 insertions(+)\n>  create mode 100755 tests/vm/basevm.py\n>\n> diff --git a/tests/vm/basevm.py b/tests/vm/basevm.py\n> new file mode 100755\n> index 0000000000..e4603f3fba\n> --- /dev/null\n> +++ b/tests/vm/basevm.py\n> @@ -0,0 +1,256 @@\n> +#!/usr/bin/env python\n> +#\n> +# VM testing base class\n> +#\n> +# Copyright 2017 Red Hat Inc.\n> +#\n> +# Authors:\n> +#  Fam Zheng <famz@redhat.com>\n> +#\n> +# This code is licensed under the GPL version 2 or later.  See\n> +# the COPYING file in the top-level directory.\n> +#\n> +\n> +import os\n> +import sys\n> +import logging\n> +import time\n> +import datetime\n> +sys.path.append(os.path.join(os.path.dirname(__file__), \"..\", \"..\", \"scripts\"))\n> +from qemu import QEMUMachine\n> +import subprocess\n> +import hashlib\n> +import optparse\n> +import atexit\n> +import tempfile\n> +import shutil\n> +import multiprocessing\n> +import traceback\n> +\n> +SSH_KEY = open(os.path.join(od.path.dirname(__file__),\n> +               \"..\", \"keys\", \"id_rsa\")).read()\n> +SSH_PUB_KEY = open(os.path.join(od.path.dirname(__file__),\n> +                   \"..\", \"keys\", \"id_rsa.pub\")).read()\n\nHmm I don't think this was tested:\n\n12:35:56 [alex@zen:~/l/q/qemu.git] review/fam-vm-build-test-v7(+2/-2) ± make vm-build-netbsd\n        CHK version_gen.h\n    VM-IMAGE netbsd\nTraceback (most recent call last):\n  File \"/home/alex/lsrc/qemu/qemu.git/tests/vm/netbsd\", line 17, in <module>\n    import basevm\n  File \"/home/alex/lsrc/qemu/qemu.git/tests/vm/basevm.py\", line 30, in <module>\n    SSH_KEY = open(os.path.join(od.path.dirname(__file__),\nNameError: name 'od' is not defined\n/home/alex/lsrc/qemu/qemu.git/tests/vm/Makefile.include:23: recipe for target 'tests/vm/netbsd.img' failed\n\n\n> +\n> +class BaseVM(object):\n> +    GUEST_USER = \"qemu\"\n> +    GUEST_PASS = \"qemupass\"\n> +    ROOT_PASS = \"qemupass\"\n> +\n> +    # The script to run in the guest that builds QEMU\n> +    BUILD_SCRIPT = \"\"\n> +    # The guest name, to be overridden by subclasses\n> +    name = \"#base\"\n> +    def __init__(self, debug=False, vcpus=None):\n> +        self._guest = None\n> +        self._tmpdir = tempfile.mkdtemp(prefix=\"vm-test-\", suffix=\".tmp\", dir=\".\")\n> +        atexit.register(shutil.rmtree, self._tmpdir)\n> +\n> +        self._ssh_key_file = os.path.join(self._tmpdir, \"id_rsa\")\n> +        open(self._ssh_key_file, \"w\").write(SSH_KEY)\n> +        subprocess.check_call([\"chmod\", \"600\", self._ssh_key_file])\n> +\n> +        self._ssh_pub_key_file = os.path.join(self._tmpdir, \"id_rsa.pub\")\n> +        open(self._ssh_pub_key_file, \"w\").write(SSH_PUB_KEY)\n> +\n> +        self.debug = debug\n> +        self._stderr = sys.stderr\n> +        self._devnull = open(os.devnull, \"w\")\n> +        if self.debug:\n> +            self._stdout = sys.stdout\n> +        else:\n> +            self._stdout = self._devnull\n> +        self._args = [ \\\n> +            \"-nodefaults\", \"-m\", \"2G\",\n> +            \"-cpu\", \"host\",\n> +            \"-netdev\", \"user,id=vnet,hostfwd=:0.0.0.0:0-:22\",\n> +            \"-device\", \"virtio-net-pci,netdev=vnet\",\n> +            \"-vnc\", \":0,to=20\",\n> +            \"-serial\", \"file:%s\" % os.path.join(self._tmpdir, \"serial.out\")]\n> +        if vcpus:\n> +            self._args += [\"-smp\", str(vcpus)]\n> +        if os.access(\"/dev/kvm\", os.R_OK | os.W_OK):\n> +            self._args += [\"-enable-kvm\"]\n> +        else:\n> +            logging.info(\"KVM not available, not using -enable-kvm\")\n> +        self._data_args = []\n> +\n> +    def _download_with_cache(self, url, sha256sum=None):\n> +        def check_sha256sum(fname):\n> +            if not sha256sum:\n> +                return True\n> +            checksum = subprocess.check_output([\"sha256sum\", fname]).split()[0]\n> +            return sha256sum == checksum\n> +\n> +        cache_dir = os.path.expanduser(\"~/.cache/qemu-vm/download\")\n> +        if not os.path.exists(cache_dir):\n> +            os.makedirs(cache_dir)\n> +        fname = os.path.join(cache_dir, hashlib.sha1(url).hexdigest())\n> +        if os.path.exists(fname) and check_sha256sum(fname):\n> +            return fname\n> +        logging.debug(\"Downloading %s to %s...\", url, fname)\n> +        subprocess.check_call([\"wget\", \"-c\", url, \"-O\", fname + \".download\"],\n> +                              stdout=self._stdout, stderr=self._stderr)\n> +        os.rename(fname + \".download\", fname)\n> +        return fname\n> +\n> +    def _ssh_do(self, user, cmd, check, interactive=False):\n> +        ssh_cmd = [\"ssh\", \"-q\",\n> +                   \"-o\", \"StrictHostKeyChecking=no\",\n> +                   \"-o\", \"UserKnownHostsFile=\" + os.devnull,\n> +                   \"-o\", \"ConnectTimeout=1\",\n> +                   \"-p\", self.ssh_port, \"-i\", self._ssh_key_file]\n> +        if interactive:\n> +            ssh_cmd += ['-t']\n> +        assert not isinstance(cmd, str)\n> +        ssh_cmd += [\"%s@127.0.0.1\" % user] + list(cmd)\n> +        logging.debug(\"ssh_cmd: %s\", \" \".join(ssh_cmd))\n> +        r = subprocess.call(ssh_cmd,\n> +                            stdin=sys.stdin if interactive else self._devnull,\n> +                            stdout=sys.stdout if interactive else self._stdout,\n> +                            stderr=sys.stderr if interactive else self._stderr)\n> +        if check and r != 0:\n> +            raise Exception(\"SSH command failed: %s\" % cmd)\n> +        return r\n> +\n> +    def ssh(self, *cmd):\n> +        return self._ssh_do(self.GUEST_USER, cmd, False)\n> +\n> +    def ssh_interactive(self, *cmd):\n> +        return self._ssh_do(self.GUEST_USER, cmd, False, True)\n> +\n> +    def ssh_root(self, *cmd):\n> +        return self._ssh_do(\"root\", cmd, False)\n> +\n> +    def ssh_check(self, *cmd):\n> +        self._ssh_do(self.GUEST_USER, cmd, True)\n> +\n> +    def ssh_root_check(self, *cmd):\n> +        self._ssh_do(\"root\", cmd, True)\n> +\n> +    def build_image(self, img):\n> +        raise NotImplementedError\n> +\n> +    def add_source_dir(self, src_dir):\n> +        name = \"data-\" + hashlib.sha1(src_dir).hexdigest()[:5]\n> +        tarfile = os.path.join(self._tmpdir, name + \".tar\")\n> +        logging.debug(\"Creating archive %s for src_dir dir: %s\", tarfile, src_dir)\n> +        subprocess.check_call([\"./scripts/archive-source.sh\", tarfile],\n> +                              cwd=src_dir, stdin=self._devnull,\n> +                              stdout=self._stdout, stderr=self._stderr)\n> +        self._data_args += [\"-drive\",\n> +                            \"file=%s,if=none,id=%s,cache=writeback,format=raw\" % \\\n> +                                    (tarfile, name),\n> +                            \"-device\",\n> +                            \"virtio-blk,drive=%s,serial=%s,bootindex=1\" % (name, name)]\n> +\n> +    def boot(self, img, extra_args=[]):\n> +        args = self._args + [\n> +            \"-device\", \"VGA\",\n> +            \"-drive\", \"file=%s,if=none,id=drive0,cache=writeback\" % img,\n> +            \"-device\", \"virtio-blk,drive=drive0,bootindex=0\"]\n> +        args += self._data_args + extra_args\n> +        logging.debug(\"QEMU args: %s\", \" \".join(args))\n> +        qemu_bin = os.environ.get(\"QEMU\", \"qemu-system-x86_64\")\n> +        guest = QEMUMachine(binary=qemu_bin, args=args)\n> +        try:\n> +            guest.launch()\n> +        except:\n> +            logging.error(\"Failed to launch QEMU, command line:\")\n> +            logging.error(\" \".join([qemu_bin] + args))\n> +            logging.error(\"Log:\")\n> +            logging.error(guest.get_log())\n> +            logging.error(\"QEMU version >= 2.10 is required\")\n> +            raise\n> +        atexit.register(self.shutdown)\n> +        self._guest = guest\n> +        usernet_info = guest.qmp(\"human-monitor-command\",\n> +                                 command_line=\"info usernet\")\n> +        self.ssh_port = None\n> +        for l in usernet_info[\"return\"].splitlines():\n> +            fields = l.split()\n> +            if \"TCP[HOST_FORWARD]\" in fields and \"22\" in fields:\n> +                self.ssh_port = l.split()[3]\n> +        if not self.ssh_port:\n> +            raise Exception(\"Cannot find ssh port from 'info usernet':\\n%s\" % \\\n> +                            usernet_info)\n> +\n> +    def wait_ssh(self, seconds=120):\n> +        starttime = datetime.datetime.now()\n> +        guest_up = False\n> +        while (datetime.datetime.now() - starttime).total_seconds() < seconds:\n> +            if self.ssh(\"exit 0\") == 0:\n> +                guest_up = True\n> +                break\n> +            time.sleep(1)\n> +        if not guest_up:\n> +            raise Exception(\"Timeout while waiting for guest ssh\")\n> +\n> +    def shutdown(self):\n> +        self._guest.shutdown()\n> +\n> +    def wait(self):\n> +        self._guest.wait()\n> +\n> +    def qmp(self, *args, **kwargs):\n> +        return self._guest.qmp(*args, **kwargs)\n> +\n> +def parse_args(vm_name):\n> +    parser = optparse.OptionParser(description=\"\"\"\n> +    VM test utility.  Exit codes: 0 = success, 1 = command line error, 2 = environment initialization failed, 3 = test command failed\"\"\")\n> +    parser.add_option(\"--debug\", \"-D\", action=\"store_true\",\n> +                      help=\"enable debug output\")\n> +    parser.add_option(\"--image\", \"-i\", default=\"%s.img\" % vm_name,\n> +                      help=\"image file name\")\n> +    parser.add_option(\"--force\", \"-f\", action=\"store_true\",\n> +                      help=\"force build image even if image exists\")\n> +    parser.add_option(\"--jobs\", type=int, default=multiprocessing.cpu_count() / 2,\n> +                      help=\"number of virtual CPUs\")\n> +    parser.add_option(\"--build-image\", \"-b\", action=\"store_true\",\n> +                      help=\"build image\")\n> +    parser.add_option(\"--build-qemu\",\n> +                      help=\"build QEMU from source in guest\")\n> +    parser.add_option(\"--interactive\", \"-I\", action=\"store_true\",\n> +                      help=\"Interactively run command\")\n> +    parser.disable_interspersed_args()\n> +    return parser.parse_args()\n> +\n> +def main(vmcls):\n> +    try:\n> +        args, argv = parse_args(vmcls.name)\n> +        if not argv and not args.build_qemu and not args.build_image:\n> +            print \"Nothing to do?\"\n> +            return 1\n> +        if args.debug:\n> +            logging.getLogger().setLevel(logging.DEBUG)\n> +        vm = vmcls(debug=args.debug, vcpus=args.jobs)\n> +        if args.build_image:\n> +            if os.path.exists(args.image) and not args.force:\n> +                sys.stderr.writelines([\"Image file exists: %s\\n\" % args.image,\n> +                                      \"Use --force option to overwrite\\n\"])\n> +                return 1\n> +            return vm.build_image(args.image)\n> +        if args.build_qemu:\n> +            vm.add_source_dir(args.build_qemu)\n> +            cmd = [vm.BUILD_SCRIPT.format(\n> +                   configure_opts = \" \".join(argv),\n> +                   jobs=args.jobs)]\n> +        else:\n> +            cmd = argv\n> +        vm.boot(args.image + \",snapshot=on\")\n> +        vm.wait_ssh()\n> +    except Exception as e:\n> +        if isinstance(e, SystemExit) and e.code == 0:\n> +            return 0\n> +        sys.stderr.write(\"Failed to prepare guest environment\\n\")\n> +        traceback.print_exc()\n> +        return 2\n> +\n> +    if args.interactive:\n> +        if vm.ssh_interactive(*cmd) == 0:\n> +            return 0\n> +        vm.ssh_interactive()\n> +        return 3\n> +    else:\n> +        if vm.ssh(*cmd) != 0:\n> +            return 3\n\n\n--\nAlex Bennée","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=linaro.org header.i=@linaro.org\n\theader.b=\"L0oSegJ6\"; dkim-atps=neutral"],"Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xttgr5tD2z9sPs\n\tfor <incoming@patchwork.ozlabs.org>;\n\tFri, 15 Sep 2017 21:38:16 +1000 (AEST)","from localhost ([::1]:52615 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1dsowo-0003hv-VI\n\tfor incoming@patchwork.ozlabs.org; Fri, 15 Sep 2017 07:38:15 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:33314)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <alex.bennee@linaro.org>) id 1dsowU-0003dr-Ck\n\tfor qemu-devel@nongnu.org; Fri, 15 Sep 2017 07:37:56 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <alex.bennee@linaro.org>) id 1dsowR-0006qb-5E\n\tfor qemu-devel@nongnu.org; Fri, 15 Sep 2017 07:37:54 -0400","from mail-wm0-x22e.google.com ([2a00:1450:400c:c09::22e]:49657)\n\tby eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)\n\t(Exim 4.71) (envelope-from <alex.bennee@linaro.org>)\n\tid 1dsowQ-0006qI-S4\n\tfor qemu-devel@nongnu.org; Fri, 15 Sep 2017 07:37:51 -0400","by mail-wm0-x22e.google.com with SMTP id e71so7530747wmg.4\n\tfor <qemu-devel@nongnu.org>; Fri, 15 Sep 2017 04:37:50 -0700 (PDT)","from zen.linaro.local ([81.128.185.34])\n\tby smtp.gmail.com with ESMTPSA id\n\t193sm934177wmh.47.2017.09.15.04.37.48\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tFri, 15 Sep 2017 04:37:48 -0700 (PDT)","from zen (localhost [127.0.0.1])\n\tby zen.linaro.local (Postfix) with ESMTPS id 06E983E02DF;\n\tFri, 15 Sep 2017 12:37:48 +0100 (BST)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google;\n\th=references:user-agent:from:to:cc:subject:in-reply-to:date\n\t:message-id:mime-version:content-transfer-encoding;\n\tbh=FnFv+y2lxdJFkrxD/mhUg+agZU/5L0XeZtvgwz/QIB4=;\n\tb=L0oSegJ6CA1cosJZHfipxgaqJ95WjuqMU2SKyxicmaZvRCGUxGickXxKkzH9XA1o+v\n\tXu5dBzeghPhjItEKdPEPtSdcDEtROcE/1j6XbyFimRiU68a15Rm5ciHQnHYp0iEEO1Au\n\tcU6AYLQLpXAw9KrvIxvYxgValUm8MC9Aay7IE=","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:references:user-agent:from:to:cc:subject\n\t:in-reply-to:date:message-id:mime-version:content-transfer-encoding; \n\tbh=FnFv+y2lxdJFkrxD/mhUg+agZU/5L0XeZtvgwz/QIB4=;\n\tb=QdIyW+cxTft9G43MSgej/BFWec5x+21Tj0iPgxcC2XmtpEn6lLGtvoAODLeb4v00Oi\n\tHczJA9mZBkTm5epeRw0D+AboAOCuRPDNNbzPixI0Ymo6OjO8np6Jhc59McXI2TPZowln\n\tiYU+0zox39KWmTyT+fMrK+vPZAIk/e4n5d2zYAaTBVfSKa4sMgukTMVovetuz4cW+544\n\t6ythgyCz69vUtTqPDDZsslHoIZJ+02iDp7kojQTyqRpm5QumkjuCm9i3h60BetWtKOFz\n\tw0vGnxHq1O8sW+KDdkgtmiM8T20A9cgVr8hyZXFqQMs/jL7ONjYS+NdBveC1bbjXVFbE\n\ttIZA==","X-Gm-Message-State":"AHPjjUhP3jfOi9qZgprpc635KCTIHjRB3ZFlDVoF32vVgBZw7cxUiYKS\n\tmxGO1eOxXT4iwyEr","X-Google-Smtp-Source":"AOwi7QCN5O7D5OwHq4T33yoINqywJSHFEVyJhtKli6AOz9QwRWOP/7L4c8gD7YT+IFSebVRZj620Iw==","X-Received":"by 10.28.46.210 with SMTP id u201mr2528808wmu.64.1505475469425; \n\tFri, 15 Sep 2017 04:37:49 -0700 (PDT)","References":"<20170913030119.3957-1-famz@redhat.com>\n\t<20170913030119.3957-6-famz@redhat.com>","User-agent":"mu4e 0.9.19; emacs 25.2.50.3","From":"Alex =?utf-8?q?Benn=C3=A9e?= <alex.bennee@linaro.org>","To":"Fam Zheng <famz@redhat.com>","In-reply-to":"<20170913030119.3957-6-famz@redhat.com>","Date":"Fri, 15 Sep 2017 12:37:47 +0100","Message-ID":"<87wp508a5w.fsf@linaro.org>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Transfer-Encoding":"8bit","X-detected-operating-system":"by eggs.gnu.org: Genre and OS details not\n\trecognized.","X-Received-From":"2a00:1450:400c:c09::22e","Subject":"Re: [Qemu-devel] [PATCH v7 05/13] tests: Add vm test lib","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Cc":"Peter Maydell <peter.maydell@linaro.org>, qemu-devel@nongnu.org, Philippe\n\t=?utf-8?q?Mathieu-Daud=C3=A9?= <f4bug@amsat.org>,\n\tKamil Rytarowski <kamil@netbsd.org>, stefanha@redhat.com, \n\tCleber Rosa <crosa@redhat.com>, pbonzini@redhat.com","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"}},{"id":1769121,"web_url":"http://patchwork.ozlabs.org/comment/1769121/","msgid":"<20170915115726.GJ17199@lemon>","list_archive_url":null,"date":"2017-09-15T11:57:26","subject":"Re: [Qemu-devel] [PATCH v7 05/13] tests: Add vm test lib","submitter":{"id":24872,"url":"http://patchwork.ozlabs.org/api/people/24872/","name":"Fam Zheng","email":"famz@redhat.com"},"content":"On Fri, 09/15 12:37, Alex Bennée wrote:\n> \n> Fam Zheng <famz@redhat.com> writes:\n> \n> > This is the common code to implement a \"VM test\" to\n> >\n> >   1) Download and initialize a pre-defined VM that has necessary\n> >   dependencies to build QEMU and SSH access.\n> >\n> >   2) Archive $SRC_PATH to a .tar file.\n> >\n> >   3) Boot the VM, and pass the source tar file to the guest.\n> >\n> >   4) SSH into the VM, untar the source tarball, build from the source.\n> >\n> > Signed-off-by: Fam Zheng <famz@redhat.com>\n> > ---\n> >  tests/vm/basevm.py | 256 +++++++++++++++++++++++++++++++++++++++++++++++++++++\n> >  1 file changed, 256 insertions(+)\n> >  create mode 100755 tests/vm/basevm.py\n> >\n> > diff --git a/tests/vm/basevm.py b/tests/vm/basevm.py\n> > new file mode 100755\n> > index 0000000000..e4603f3fba\n> > --- /dev/null\n> > +++ b/tests/vm/basevm.py\n> > @@ -0,0 +1,256 @@\n> > +#!/usr/bin/env python\n> > +#\n> > +# VM testing base class\n> > +#\n> > +# Copyright 2017 Red Hat Inc.\n> > +#\n> > +# Authors:\n> > +#  Fam Zheng <famz@redhat.com>\n> > +#\n> > +# This code is licensed under the GPL version 2 or later.  See\n> > +# the COPYING file in the top-level directory.\n> > +#\n> > +\n> > +import os\n> > +import sys\n> > +import logging\n> > +import time\n> > +import datetime\n> > +sys.path.append(os.path.join(os.path.dirname(__file__), \"..\", \"..\", \"scripts\"))\n> > +from qemu import QEMUMachine\n> > +import subprocess\n> > +import hashlib\n> > +import optparse\n> > +import atexit\n> > +import tempfile\n> > +import shutil\n> > +import multiprocessing\n> > +import traceback\n> > +\n> > +SSH_KEY = open(os.path.join(od.path.dirname(__file__),\n> > +               \"..\", \"keys\", \"id_rsa\")).read()\n> > +SSH_PUB_KEY = open(os.path.join(od.path.dirname(__file__),\n> > +                   \"..\", \"keys\", \"id_rsa.pub\")).read()\n> \n> Hmm I don't think this was tested:\n> \n> 12:35:56 [alex@zen:~/l/q/qemu.git] review/fam-vm-build-test-v7(+2/-2) ± make vm-build-netbsd\n>         CHK version_gen.h\n>     VM-IMAGE netbsd\n> Traceback (most recent call last):\n>   File \"/home/alex/lsrc/qemu/qemu.git/tests/vm/netbsd\", line 17, in <module>\n>     import basevm\n>   File \"/home/alex/lsrc/qemu/qemu.git/tests/vm/basevm.py\", line 30, in <module>\n>     SSH_KEY = open(os.path.join(od.path.dirname(__file__),\n> NameError: name 'od' is not defined\n> /home/alex/lsrc/qemu/qemu.git/tests/vm/Makefile.include:23: recipe for target 'tests/vm/netbsd.img' failed\n\nRight, I tested the fixed version (s/od/os).\n\nFam","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","ext-mx03.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com","ext-mx03.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=famz@redhat.com"],"Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xtv6b2nTrz9t2h\n\tfor <incoming@patchwork.ozlabs.org>;\n\tFri, 15 Sep 2017 21:57:59 +1000 (AEST)","from localhost ([::1]:52704 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1dspFt-00043G-HY\n\tfor incoming@patchwork.ozlabs.org; Fri, 15 Sep 2017 07:57:57 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:41268)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <famz@redhat.com>) id 1dspFX-00042s-Af\n\tfor qemu-devel@nongnu.org; Fri, 15 Sep 2017 07:57:36 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <famz@redhat.com>) id 1dspFU-0006bg-8m\n\tfor qemu-devel@nongnu.org; Fri, 15 Sep 2017 07:57:35 -0400","from mx1.redhat.com ([209.132.183.28]:9934)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <famz@redhat.com>) id 1dspFT-0006bM-VI\n\tfor qemu-devel@nongnu.org; Fri, 15 Sep 2017 07:57:32 -0400","from smtp.corp.redhat.com\n\t(int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id C82827E422;\n\tFri, 15 Sep 2017 11:57:30 +0000 (UTC)","from localhost (ovpn-12-95.pek2.redhat.com [10.72.12.95])\n\tby smtp.corp.redhat.com (Postfix) with ESMTP id 5146976120;\n\tFri, 15 Sep 2017 11:57:28 +0000 (UTC)"],"DMARC-Filter":"OpenDMARC Filter v1.3.2 mx1.redhat.com C82827E422","Date":"Fri, 15 Sep 2017 19:57:26 +0800","From":"Fam Zheng <famz@redhat.com>","To":"Alex =?iso-8859-1?q?Benn=E9e?= <alex.bennee@linaro.org>","Message-ID":"<20170915115726.GJ17199@lemon>","References":"<20170913030119.3957-1-famz@redhat.com>\n\t<20170913030119.3957-6-famz@redhat.com> <87wp508a5w.fsf@linaro.org>","MIME-Version":"1.0","Content-Type":"text/plain; charset=iso-8859-1","Content-Disposition":"inline","In-Reply-To":"<87wp508a5w.fsf@linaro.org>","User-Agent":"Mutt/1.8.3 (2017-05-23)","X-Scanned-By":"MIMEDefang 2.79 on 10.5.11.14","X-Greylist":"Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.27]);\n\tFri, 15 Sep 2017 11:57:30 +0000 (UTC)","Content-Transfer-Encoding":"quoted-printable","X-detected-operating-system":"by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]\n\t[fuzzy]","X-Received-From":"209.132.183.28","Subject":"Re: [Qemu-devel] [PATCH v7 05/13] tests: Add vm test lib","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Cc":"Peter Maydell <peter.maydell@linaro.org>, qemu-devel@nongnu.org, Philippe\n\t=?iso-8859-1?q?Mathieu-Daud=E9?= <f4bug@amsat.org>,\n\tKamil Rytarowski <kamil@netbsd.org>, stefanha@redhat.com, \n\tCleber Rosa <crosa@redhat.com>, pbonzini@redhat.com","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"}},{"id":1769217,"web_url":"http://patchwork.ozlabs.org/comment/1769217/","msgid":"<87tw0482fo.fsf@linaro.org>","list_archive_url":null,"date":"2017-09-15T14:24:43","subject":"Re: [Qemu-devel] [PATCH v7 12/13] tests: Add README for vm tests","submitter":{"id":39532,"url":"http://patchwork.ozlabs.org/api/people/39532/","name":"Alex Bennée","email":"alex.bennee@linaro.org"},"content":"Fam Zheng <famz@redhat.com> writes:\n\n> Signed-off-by: Fam Zheng <famz@redhat.com>\n> ---\n>  tests/vm/README | 63 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n>  1 file changed, 63 insertions(+)\n>  create mode 100644 tests/vm/README\n>\n> diff --git a/tests/vm/README b/tests/vm/README\n> new file mode 100644\n> index 0000000000..7d2fe4ac8d\n> --- /dev/null\n> +++ b/tests/vm/README\n> @@ -0,0 +1,63 @@\n> +=== VM test suite to run build in guests ===\n> +\n> +== Intro ==\n> +\n> +This test suite contains scripts that bootstrap various guest images that have\n> +necessary packages to build QEMU. The basic usage is documented in Makefile\n> +help which is displayed with \"make vm-test\".\n> +\n> +== Quick start ==\n> +\n> +Run \"make vm-test\" to list available make targets.\n\nRunning make vm-build-netbsd I get several prompts for pass-phrase and\npassword:\n\n    Enter passphrase for key './vm-test-QdFtLJ.tmp/id_rsa':\n    Password for qemu@:\n    Enter passphrase for key './vm-test-QdFtLJ.tmp/id_rsa':\n    Password for qemu@:\n    ar: creating libfdt/libfdt.a\n\nWhich seems odd considering the private key isn't protected by a\npassphrase and the build tools know what the password is.\n\nWe should also mention the images are added to ${QEMU_SRC}/tests/vm/\n\n> +\n> +== Manual invocation ==\n> +\n> +Each guest script is an executable script with the same command line options.\n> +For example to work with the netbsd guest, use $QEMU_SRC/tests/vm/netbsd:\n> +\n> +    $ cd $QEMU_SRC/tests/vm\n> +\n> +    # To bootstrap the image\n> +    $ ./netbsd --build-image --image /var/tmp/netbsd.img\n> +    <...>\n> +\n> +    # To run an arbitrary command in guest (the output will not be echoed unless\n> +    # --debug is added)\n> +    $ ./netbsd --debug --image /var/tmp/netbsd.img uname -a\n> +\n> +    # To build QEMU in guest\n> +    $ ./netbsd --debug --image /var/tmp/netbsd.img --build-qemu $QEMU_SRC\n> +\n> +    # To get to an interactive shell\n> +    $ ./netbsd --interactive --image /var/tmp/netbsd.img sh\n> +\n> +== Adding new guests ==\n> +\n> +Please look at existing guest scripts for how to add new guests.\n> +\n> +Most importantly, create a subclass of BaseVM and implement build_image()\n> +method and define BUILD_SCRIPT, then finally call basevm.main() from the\n> +script's main().\n> +\n> +  - Usually in build_image(), a template image is downloaded from a predefined\n> +    URL. BaseVM._download_with_cache() takes care of the cache and the\n> +    checksum, so consider using it.\n> +\n> +  - Once the image is downloaded, users, SSH server and QEMU build deps should\n> +    be set up:\n> +\n> +    * Root password set to BaseVM.ROOT_PASS\n> +    * User BaseVM.GUEST_USER is created, and password set to BaseVM.GUEST_PASS\n> +    * SSH service is enabled and started on boot, BaseVM.SSH_PUB_KEY is added\n> +      to authorized_keys of both root and the normal user\n> +    * DHCP client service is enabled and started on boot, so that it can\n> +      automatically configure the virtio-net-pci NIC and communicate with QEMU\n> +      user net (10.0.2.2)\n> +    * Necessary packages are installed to untar the source tarball and build\n> +      QEMU\n> +\n> +  - Write a proper BUILD_SCRIPT template, which should be a shell script that\n> +    untars a raw virtio-blk block device, which is the tarball data blob of the\n> +    QEMU source tree, then configure/build it. Running \"make check\" is also\n> +    recommended.\n> +\n\n\n--\nAlex Bennée","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=linaro.org header.i=@linaro.org\n\theader.b=\"QHuG6pU8\"; dkim-atps=neutral"],"Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xtyNT5Y7jz9s7m\n\tfor <incoming@patchwork.ozlabs.org>;\n\tSat, 16 Sep 2017 00:25:10 +1000 (AEST)","from localhost ([::1]:53571 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1dsrYK-0003lG-9J\n\tfor incoming@patchwork.ozlabs.org; Fri, 15 Sep 2017 10:25:08 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:60422)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <alex.bennee@linaro.org>) id 1dsrY2-0003l4-Jp\n\tfor qemu-devel@nongnu.org; Fri, 15 Sep 2017 10:24:51 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <alex.bennee@linaro.org>) id 1dsrXy-00073A-Ji\n\tfor qemu-devel@nongnu.org; Fri, 15 Sep 2017 10:24:50 -0400","from mail-wr0-x22d.google.com ([2a00:1450:400c:c0c::22d]:55729)\n\tby eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)\n\t(Exim 4.71) (envelope-from <alex.bennee@linaro.org>)\n\tid 1dsrXy-00072x-Bz\n\tfor qemu-devel@nongnu.org; Fri, 15 Sep 2017 10:24:46 -0400","by mail-wr0-x22d.google.com with SMTP id l39so1958135wrl.12\n\tfor <qemu-devel@nongnu.org>; Fri, 15 Sep 2017 07:24:46 -0700 (PDT)","from zen.linaro.local ([81.128.185.34])\n\tby smtp.gmail.com with ESMTPSA id\n\ts9sm758410wra.73.2017.09.15.07.24.43\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tFri, 15 Sep 2017 07:24:43 -0700 (PDT)","from zen (localhost [127.0.0.1])\n\tby zen.linaro.local (Postfix) with ESMTPS id 58E553E031F;\n\tFri, 15 Sep 2017 15:24:43 +0100 (BST)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google;\n\th=references:user-agent:from:to:cc:subject:in-reply-to:date\n\t:message-id:mime-version:content-transfer-encoding;\n\tbh=Ndq+W9HXh4xYhgbnWhyqJBmIQ6qi2lLg4l1CsCydxTY=;\n\tb=QHuG6pU811jvPY3tiT2jXAXAe/p17D6tUS/7zj0RewouR1Dc4SfUNPA8YTNEGMczPK\n\tlQmbnf0fuap7XMTFASBk7C0vAU4uWpaPxTKBIHf7eJRJgY4z+OTI3kjnJWbOZyODpauZ\n\thV4EDpK1sFzOuu3Iz37pmdsFIWbVRqA2xdOtE=","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:references:user-agent:from:to:cc:subject\n\t:in-reply-to:date:message-id:mime-version:content-transfer-encoding; \n\tbh=Ndq+W9HXh4xYhgbnWhyqJBmIQ6qi2lLg4l1CsCydxTY=;\n\tb=MnNmLwYefyB98Vl5CMrdot7g5wGHl2y/0ZI1iU4rMtooeq6g4mR5c/Fl71FcPbTCke\n\tuBzdK5ZtWEllCYaG2vghWxvwoaeala5xIuHcK41i3f6hahbo4m/QCaVSlguauEoam/N5\n\tEyELy52z/B045/SxX7GB1UXur6ESeAB5duBeiJ9LyAWEzsHHdOYZM3hXqiEFebQ61QYx\n\tSwsw+zr6SftVbV4yLk8ASWLOkKmPNr8hhDEgc25EBjA9IM0FgcIWota308FHWVJdsFgl\n\t7+5ylKEaQs8KCku5slArd+JkhELW8UZAY4JKBiZBiRkWxzkUCfmuwMWTY6qT4syUnAwh\n\tC65g==","X-Gm-Message-State":"AHPjjUgdQYz52TIShKK2fu7O8NbF2Vb4/FXkEU+3hrrT98hbVS6438By\n\tXHwcxxx4Gc4zlMX7","X-Google-Smtp-Source":"ADKCNb4Ekm19mKUKiy/aD6yO+8XT6ORnSu0iU9UoKYdNvi+p8xaigQh89ab7U++BZJXKf+B2XyDiWg==","X-Received":"by 10.223.171.206 with SMTP id s72mr20735518wrc.27.1505485484926;\n\tFri, 15 Sep 2017 07:24:44 -0700 (PDT)","References":"<20170913030119.3957-1-famz@redhat.com>\n\t<20170913030119.3957-13-famz@redhat.com>","User-agent":"mu4e 0.9.19; emacs 25.2.50.3","From":"Alex =?utf-8?q?Benn=C3=A9e?= <alex.bennee@linaro.org>","To":"Fam Zheng <famz@redhat.com>","In-reply-to":"<20170913030119.3957-13-famz@redhat.com>","Date":"Fri, 15 Sep 2017 15:24:43 +0100","Message-ID":"<87tw0482fo.fsf@linaro.org>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Transfer-Encoding":"8bit","X-detected-operating-system":"by eggs.gnu.org: Genre and OS details not\n\trecognized.","X-Received-From":"2a00:1450:400c:c0c::22d","Subject":"Re: [Qemu-devel] [PATCH v7 12/13] tests: Add README for vm tests","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Cc":"Peter Maydell <peter.maydell@linaro.org>, qemu-devel@nongnu.org, Philippe\n\t=?utf-8?q?Mathieu-Daud=C3=A9?= <f4bug@amsat.org>,\n\tKamil Rytarowski <kamil@netbsd.org>, stefanha@redhat.com, \n\tCleber Rosa <crosa@redhat.com>, pbonzini@redhat.com","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"}},{"id":1769231,"web_url":"http://patchwork.ozlabs.org/comment/1769231/","msgid":"<20170915145208.GB21852@lemon.lan>","list_archive_url":null,"date":"2017-09-15T14:52:08","subject":"Re: [Qemu-devel] [PATCH v7 12/13] tests: Add README for vm tests","submitter":{"id":24872,"url":"http://patchwork.ozlabs.org/api/people/24872/","name":"Fam Zheng","email":"famz@redhat.com"},"content":"On Fri, 09/15 15:24, Alex Bennée wrote:\n> \n> Fam Zheng <famz@redhat.com> writes:\n> \n> > Signed-off-by: Fam Zheng <famz@redhat.com>\n> > ---\n> >  tests/vm/README | 63 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n> >  1 file changed, 63 insertions(+)\n> >  create mode 100644 tests/vm/README\n> >\n> > diff --git a/tests/vm/README b/tests/vm/README\n> > new file mode 100644\n> > index 0000000000..7d2fe4ac8d\n> > --- /dev/null\n> > +++ b/tests/vm/README\n> > @@ -0,0 +1,63 @@\n> > +=== VM test suite to run build in guests ===\n> > +\n> > +== Intro ==\n> > +\n> > +This test suite contains scripts that bootstrap various guest images that have\n> > +necessary packages to build QEMU. The basic usage is documented in Makefile\n> > +help which is displayed with \"make vm-test\".\n> > +\n> > +== Quick start ==\n> > +\n> > +Run \"make vm-test\" to list available make targets.\n> \n> Running make vm-build-netbsd I get several prompts for pass-phrase and\n> password:\n> \n>     Enter passphrase for key './vm-test-QdFtLJ.tmp/id_rsa':\n>     Password for qemu@:\n>     Enter passphrase for key './vm-test-QdFtLJ.tmp/id_rsa':\n>     Password for qemu@:\n>     ar: creating libfdt/libfdt.a\n> \n> Which seems odd considering the private key isn't protected by a\n> passphrase and the build tools know what the password is.\n\nYeah, this version also has a corrupted private key file (the first byte, '-',\nis somehow deleted). Sorry for the mess. :(\n\n> \n> We should also mention the images are added to ${QEMU_SRC}/tests/vm/\n\nOK, will do. Also as Peter and Daniel have pointed out, the hostfwd and vnc\nshould listen on a local address rather than 0.0.0.0. I will send v8 with all of\nthem fixed.\n\nFam","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","ext-mx06.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com","ext-mx06.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=famz@redhat.com"],"Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xtz0L1dFMz9sBZ\n\tfor <incoming@patchwork.ozlabs.org>;\n\tSat, 16 Sep 2017 00:52:50 +1000 (AEST)","from localhost ([::1]:53698 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1dsrz6-0004GW-DC\n\tfor incoming@patchwork.ozlabs.org; Fri, 15 Sep 2017 10:52:48 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:40230)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <famz@redhat.com>) id 1dsryf-0004FN-1B\n\tfor qemu-devel@nongnu.org; Fri, 15 Sep 2017 10:52:22 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <famz@redhat.com>) id 1dsryZ-0003h4-Ew\n\tfor qemu-devel@nongnu.org; Fri, 15 Sep 2017 10:52:21 -0400","from mx1.redhat.com ([209.132.183.28]:50290)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <famz@redhat.com>) id 1dsryZ-0003gj-9Z\n\tfor qemu-devel@nongnu.org; Fri, 15 Sep 2017 10:52:15 -0400","from smtp.corp.redhat.com\n\t(int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id 35221356E6;\n\tFri, 15 Sep 2017 14:52:14 +0000 (UTC)","from localhost (ovpn-12-95.pek2.redhat.com [10.72.12.95])\n\tby smtp.corp.redhat.com (Postfix) with ESMTP id 2C8FC6B6DE;\n\tFri, 15 Sep 2017 14:52:09 +0000 (UTC)"],"DMARC-Filter":"OpenDMARC Filter v1.3.2 mx1.redhat.com 35221356E6","Date":"Fri, 15 Sep 2017 22:52:08 +0800","From":"Fam Zheng <famz@redhat.com>","To":"Alex =?iso-8859-1?q?Benn=E9e?= <alex.bennee@linaro.org>","Message-ID":"<20170915145208.GB21852@lemon.lan>","References":"<20170913030119.3957-1-famz@redhat.com>\n\t<20170913030119.3957-13-famz@redhat.com>\n\t<87tw0482fo.fsf@linaro.org>","MIME-Version":"1.0","Content-Type":"text/plain; charset=iso-8859-1","Content-Disposition":"inline","In-Reply-To":"<87tw0482fo.fsf@linaro.org>","User-Agent":"Mutt/1.8.3 (2017-05-23)","X-Scanned-By":"MIMEDefang 2.79 on 10.5.11.15","X-Greylist":"Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.30]);\n\tFri, 15 Sep 2017 14:52:14 +0000 (UTC)","Content-Transfer-Encoding":"quoted-printable","X-detected-operating-system":"by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]\n\t[fuzzy]","X-Received-From":"209.132.183.28","Subject":"Re: [Qemu-devel] [PATCH v7 12/13] tests: Add README for vm tests","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Cc":"Peter Maydell <peter.maydell@linaro.org>, qemu-devel@nongnu.org, Philippe\n\t=?iso-8859-1?q?Mathieu-Daud=E9?= <f4bug@amsat.org>,\n\tKamil Rytarowski <kamil@netbsd.org>, stefanha@redhat.com, \n\tCleber Rosa <crosa@redhat.com>, pbonzini@redhat.com","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"}}]