From nobody Tue May 7 05:41:11 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1522810445343870.1307531825771; Tue, 3 Apr 2018 19:54:05 -0700 (PDT) Received: from localhost ([::1]:55155 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f3YYd-0002Ao-98 for importer@patchew.org; Tue, 03 Apr 2018 22:53:55 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47314) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f3YXB-0001V3-EU for qemu-devel@nongnu.org; Tue, 03 Apr 2018 22:52:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f3YX8-0003do-Cu for qemu-devel@nongnu.org; Tue, 03 Apr 2018 22:52:25 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:48866 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1f3YX8-0003de-7a for qemu-devel@nongnu.org; Tue, 03 Apr 2018 22:52:22 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6D000406E8A4; Wed, 4 Apr 2018 02:52:20 +0000 (UTC) Received: from lemon.usersys.redhat.com (ovpn-12-21.pek2.redhat.com [10.72.12.21]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2369B10FFE70; Wed, 4 Apr 2018 02:52:16 +0000 (UTC) From: Fam Zheng To: qemu-devel@nongnu.org Date: Wed, 4 Apr 2018 10:51:59 +0800 Message-Id: <20180404025201.11921-2-famz@redhat.com> In-Reply-To: <20180404025201.11921-1-famz@redhat.com> References: <20180404025201.11921-1-famz@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Wed, 04 Apr 2018 02:52:20 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Wed, 04 Apr 2018 02:52:20 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'famz@redhat.com' RCPT:'' X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PATCH 1/3] archive-source.sh: Drop submodule code 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: =?UTF-8?q?Alex=20Benn=C3=A9e?= , pbonzini@redhat.com, Fam Zheng , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" ./configure and make now take care of submodules, we only need to clone the top tree. Signed-off-by: Fam Zheng --- scripts/archive-source.sh | 47 ++++---------------------------------------= ---- 1 file changed, 4 insertions(+), 43 deletions(-) diff --git a/scripts/archive-source.sh b/scripts/archive-source.sh index 4e63774f9a..d53774d507 100755 --- a/scripts/archive-source.sh +++ b/scripts/archive-source.sh @@ -18,51 +18,12 @@ if test $# -lt 1; then error "Usage: $0 " fi =20 -tar_file=3D`realpath "$1"` -list_file=3D"${tar_file}.list" -vroot_dir=3D"${tar_file}.vroot" +tar_file=3D"$1" +list_file=3D"$1.list" =20 -# We want a predictable list of submodules for builds, that is -# independent of what the developer currently has initialized -# in their checkout, because the build environment is completely -# different to the host OS. -submodules=3D"dtc ui/keycodemapdb" +trap "status=3D$?; rm -f \"$list_file\"; exit \$status" 0 1 2 3 15 =20 -trap "status=3D$?; rm -rf \"$list_file\" \"$vroot_dir\"; exit \$status" 0 = 1 2 3 15 - -if git diff-index --quiet HEAD -- &>/dev/null -then - HEAD=3DHEAD -else - HEAD=3D`git stash create` -fi -git clone --shared . "$vroot_dir" -test $? -ne 0 && error "failed to clone into '$vroot_dir'" - -cd "$vroot_dir" -test $? -ne 0 && error "failed to change into '$vroot_dir'" - -git checkout $HEAD -test $? -ne 0 && error "failed to checkout $HEAD revision" - -for sm in $submodules; do - git submodule update --init $sm - test $? -ne 0 && error "failed to init submodule $sm" -done - -if test -n "$submodules"; then - { - git ls-files || error "git ls-files failed" - for sm in $submodules; do - (cd $sm; git ls-files) | sed "s:^:$sm/:" - if test "${PIPESTATUS[*]}" !=3D "0 0"; then - error "git ls-files in submodule $sm failed" - fi - done - } | grep -x -v $(for sm in $submodules; do echo "-e $sm"; done) > "$li= st_file" -else - git ls-files > "$list_file" -fi +( git ls-files && echo '.git' ) > "$list_file" =20 if test $? -ne 0; then error "failed to generate list file" --=20 2.14.3 From nobody Tue May 7 05:41:11 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1522810444513926.7100149028702; Tue, 3 Apr 2018 19:54:04 -0700 (PDT) Received: from localhost ([::1]:55157 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f3YYg-0002Cc-89 for importer@patchew.org; Tue, 03 Apr 2018 22:53:58 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47317) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f3YXB-0001V5-Kk for qemu-devel@nongnu.org; Tue, 03 Apr 2018 22:52:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f3YXA-0003e6-N8 for qemu-devel@nongnu.org; Tue, 03 Apr 2018 22:52:25 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:34934 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1f3YXA-0003dw-HY for qemu-devel@nongnu.org; Tue, 03 Apr 2018 22:52:24 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 05A208182D0A; Wed, 4 Apr 2018 02:52:24 +0000 (UTC) Received: from lemon.usersys.redhat.com (ovpn-12-21.pek2.redhat.com [10.72.12.21]) by smtp.corp.redhat.com (Postfix) with ESMTP id 39BE010AF9F2; Wed, 4 Apr 2018 02:52:20 +0000 (UTC) From: Fam Zheng To: qemu-devel@nongnu.org Date: Wed, 4 Apr 2018 10:52:00 +0800 Message-Id: <20180404025201.11921-3-famz@redhat.com> In-Reply-To: <20180404025201.11921-1-famz@redhat.com> References: <20180404025201.11921-1-famz@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Wed, 04 Apr 2018 02:52:24 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Wed, 04 Apr 2018 02:52:24 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'famz@redhat.com' RCPT:'' X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PATCH 2/3] tests: Add an option for snapshot (default: off) 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: =?UTF-8?q?Alex=20Benn=C3=A9e?= , pbonzini@redhat.com, Fam Zheng , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Not using snapshot has the benefit of automatically persisting useful test harnesses, such as docker images and ccache database. Although it will lose some cleanness, it is imaginably useful for patchew. Signed-off-by: Fam Zheng --- tests/vm/basevm.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/vm/basevm.py b/tests/vm/basevm.py index 686d88decf..960e13f349 100755 --- a/tests/vm/basevm.py +++ b/tests/vm/basevm.py @@ -218,6 +218,8 @@ def parse_args(vm_name): help=3D"build QEMU from source in guest") parser.add_option("--interactive", "-I", action=3D"store_true", help=3D"Interactively run command") + parser.add_option("--snapshot", "-s", action=3D"store_true", + help=3D"run tests with a snapshot") parser.disable_interspersed_args() return parser.parse_args() =20 @@ -243,7 +245,10 @@ def main(vmcls): jobs=3Dargs.jobs)] else: cmd =3D argv - vm.boot(args.image + ",snapshot=3Don") + img =3D args.image + if args.snapshot: + img +=3D ",snapshot=3Don" + vm.boot(img) vm.wait_ssh() except Exception as e: if isinstance(e, SystemExit) and e.code =3D=3D 0: --=20 2.14.3 From nobody Tue May 7 05:41:11 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1522810618874972.9317211649116; Tue, 3 Apr 2018 19:56:58 -0700 (PDT) Received: from localhost ([::1]:55292 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f3Yba-0004Gb-6G for importer@patchew.org; Tue, 03 Apr 2018 22:56:58 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47350) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f3YXF-0001Wc-9A for qemu-devel@nongnu.org; Tue, 03 Apr 2018 22:52:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f3YXE-0003ep-49 for qemu-devel@nongnu.org; Tue, 03 Apr 2018 22:52:29 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:48872 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1f3YXD-0003ej-U0 for qemu-devel@nongnu.org; Tue, 03 Apr 2018 22:52:28 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 627944067EF0; Wed, 4 Apr 2018 02:52:27 +0000 (UTC) Received: from lemon.usersys.redhat.com (ovpn-12-21.pek2.redhat.com [10.72.12.21]) by smtp.corp.redhat.com (Postfix) with ESMTP id AF07410B2B26; Wed, 4 Apr 2018 02:52:24 +0000 (UTC) From: Fam Zheng To: qemu-devel@nongnu.org Date: Wed, 4 Apr 2018 10:52:01 +0800 Message-Id: <20180404025201.11921-4-famz@redhat.com> In-Reply-To: <20180404025201.11921-1-famz@redhat.com> References: <20180404025201.11921-1-famz@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Wed, 04 Apr 2018 02:52:27 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Wed, 04 Apr 2018 02:52:27 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'famz@redhat.com' RCPT:'' X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PATCH 3/3] tests: Add centos VM testing 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: =?UTF-8?q?Alex=20Benn=C3=A9e?= , pbonzini@redhat.com, Fam Zheng , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" This one does docker testing in the VM. It is intended to replace the native docker testing on patchew testers. Signed-off-by: Fam Zheng --- tests/vm/centos | 82 +++++++++++++++++++++++++++++++++++++++++++++++++++++= ++++ 1 file changed, 82 insertions(+) create mode 100755 tests/vm/centos diff --git a/tests/vm/centos b/tests/vm/centos new file mode 100755 index 0000000000..1a0d1fc0a2 --- /dev/null +++ b/tests/vm/centos @@ -0,0 +1,82 @@ +#!/usr/bin/env python +# +# CentOS image +# +# Copyright 2018 Red Hat Inc. +# +# Authors: +# Fam Zheng +# +# This code is licensed under the GPL version 2 or later. See +# the COPYING file in the top-level directory. +# + +import os +import sys +import subprocess +import basevm +import time + +class CentosVM(basevm.BaseVM): + name =3D "centos" + BUILD_SCRIPT =3D """ + set -e; + cd $(mktemp -d); + sudo chmod a+r /dev/vdb; + tar -xf /dev/vdb; + make docker-test-mingw@fedora V=3D1 J=3D8; + make docker-test-build@min-glib V=3D1 J=3D8; + """ + + def _gen_cloud_init_iso(self): + cidir =3D self._tmpdir + mdata =3D open(os.path.join(cidir, "meta-data"), "w") + mdata.writelines(["instance-id: centos-vm-0\n", + "local-hostname: centos-guest\n"]) + mdata.close() + udata =3D open(os.path.join(cidir, "user-data"), "w") + udata.writelines(["#cloud-config\n", + "chpasswd:\n", + " list: |\n", + " root:%s\n" % self.ROOT_PASS, + " %s:%s\n" % (self.GUEST_USER, self.GUEST_PAS= S), + " expire: False\n", + "users:\n", + " - name: %s\n" % self.GUEST_USER, + " sudo: ALL=3D(ALL) NOPASSWD:ALL\n", + " ssh-authorized-keys:\n", + " - %s\n" % basevm.SSH_PUB_KEY, + " - name: root\n", + " ssh-authorized-keys:\n", + " - %s\n" % basevm.SSH_PUB_KEY, + "locale: en_US.UTF-8\n"]) + udata.close() + subprocess.check_call(["genisoimage", "-output", "cloud-init.iso", + "-volid", "cidata", "-joliet", "-rock", + "user-data", "meta-data"], + cwd=3Dcidir, + stdin=3Dself._devnull, stdout=3Dself._stdou= t, + stderr=3Dself._stdout) + return os.path.join(cidir, "cloud-init.iso") + + def build_image(self, img): + cimg =3D self._download_with_cache("https://cloud.centos.org/cento= s/7/images/CentOS-7-x86_64-GenericCloud-1802.qcow2.xz") + img_tmp =3D img + ".tmp" + subprocess.check_call(["cp", "-f", cimg, img_tmp + ".xz"]) + subprocess.check_call(["xz", "-df", img_tmp + ".xz"]) + subprocess.check_call(["qemu-img", "resize", img_tmp, "50G"]) + self.boot(img_tmp, extra_args =3D ["-cdrom", self._gen_cloud_init_= iso()]) + self.wait_ssh() + self.ssh_root_check("touch /etc/cloud/cloud-init.disabled") + self.ssh_root_check("yum update -y") + self.ssh_root_check("yum install -y docker make git") + self.ssh_root_check("systemctl enable docker") + self.ssh_root("poweroff") + self.wait() + if os.path.exists(img): + os.remove(img) + os.rename(img_tmp, img) + return 0 + +if __name__ =3D=3D "__main__": + sys.exit(basevm.main(CentosVM)) --=20 2.14.3