From nobody Sun Apr 28 11:07:24 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.zoho.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 1495822489900950.5120369025451; Fri, 26 May 2017 11:14:49 -0700 (PDT) Received: from localhost ([::1]:37851 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dEJlA-0006qH-KL for importer@patchew.org; Fri, 26 May 2017 14:14:48 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57715) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dEJic-0003hp-Rv for qemu-devel@nongnu.org; Fri, 26 May 2017 14:12:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dEJia-0003ew-QW for qemu-devel@nongnu.org; Fri, 26 May 2017 14:12:10 -0400 Received: from mx1.redhat.com ([209.132.183.28]:58786) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dEJia-0003es-KJ for qemu-devel@nongnu.org; Fri, 26 May 2017 14:12:08 -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 7D865C04D2B6 for ; Fri, 26 May 2017 18:12:07 +0000 (UTC) Received: from localhost (ovpn-116-57.gru2.redhat.com [10.97.116.57]) by smtp.corp.redhat.com (Postfix) with ESMTP id E341817F54; Fri, 26 May 2017 18:12:04 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 7D865C04D2B6 Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=ehabkost@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 7D865C04D2B6 From: Eduardo Habkost To: qemu-devel@nongnu.org Date: Fri, 26 May 2017 15:11:58 -0300 Message-Id: <20170526181200.17227-2-ehabkost@redhat.com> In-Reply-To: <20170526181200.17227-1-ehabkost@redhat.com> References: <20170526181200.17227-1-ehabkost@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.31]); Fri, 26 May 2017 18:12:07 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v3 1/3] qemu.py: Don't set _popen=None on error/shutdown 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: Marcel Apfelbaum , Thomas Huth , Markus Armbruster 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" Keep the Popen object around to we can query its exit code later. To keep the existing 'self._popen is None' checks working, add a is_running() method, that will check if the process is still running. Signed-off-by: Eduardo Habkost --- scripts/qemu.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/scripts/qemu.py b/scripts/qemu.py index 6d1b6230b7..16934f1e02 100644 --- a/scripts/qemu.py +++ b/scripts/qemu.py @@ -85,8 +85,11 @@ class QEMUMachine(object): return raise =20 + def is_running(self): + return self._popen and (self._popen.returncode is None) + def get_pid(self): - if not self._popen: + if not self.is_running(): return None return self._popen.pid =20 @@ -128,16 +131,16 @@ class QEMUMachine(object): stderr=3Dsubprocess.STDOUT, she= ll=3DFalse) self._post_launch() except: - if self._popen: + if self.is_running(): self._popen.kill() + self._popen.wait() self._load_io_log() self._post_shutdown() - self._popen =3D None raise =20 def shutdown(self): '''Terminate the VM and clean up''' - if not self._popen is None: + if self.is_running(): try: self._qmp.cmd('quit') self._qmp.close() @@ -149,7 +152,6 @@ class QEMUMachine(object): sys.stderr.write('qemu received signal %i: %s\n' % (-exitc= ode, ' '.join(self._args))) self._load_io_log() self._post_shutdown() - self._popen =3D None =20 underscore_to_dash =3D string.maketrans('_', '-') def qmp(self, cmd, conv_keys=3DTrue, **args): --=20 2.11.0.259.g40922b1 From nobody Sun Apr 28 11:07:24 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.zoho.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 1495822408674299.0261936562823; Fri, 26 May 2017 11:13:28 -0700 (PDT) Received: from localhost ([::1]:37847 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dEJjr-0005vc-Dh for importer@patchew.org; Fri, 26 May 2017 14:13:27 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57729) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dEJig-0003qy-K9 for qemu-devel@nongnu.org; Fri, 26 May 2017 14:12:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dEJif-0003fa-P9 for qemu-devel@nongnu.org; Fri, 26 May 2017 14:12:14 -0400 Received: from mx1.redhat.com ([209.132.183.28]:44348) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dEJif-0003fO-J6 for qemu-devel@nongnu.org; Fri, 26 May 2017 14:12:13 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A0C764E02D for ; Fri, 26 May 2017 18:12:12 +0000 (UTC) Received: from localhost (ovpn-116-57.gru2.redhat.com [10.97.116.57]) by smtp.corp.redhat.com (Postfix) with ESMTP id DF77B17B88; Fri, 26 May 2017 18:12:08 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com A0C764E02D Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=ehabkost@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com A0C764E02D From: Eduardo Habkost To: qemu-devel@nongnu.org Date: Fri, 26 May 2017 15:11:59 -0300 Message-Id: <20170526181200.17227-3-ehabkost@redhat.com> In-Reply-To: <20170526181200.17227-1-ehabkost@redhat.com> References: <20170526181200.17227-1-ehabkost@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Fri, 26 May 2017 18:12:12 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v3 2/3] qemu.py: Add QEMUMachine.exitcode() method 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: Marcel Apfelbaum , Thomas Huth , Markus Armbruster 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" Allow the exit code of QEMU to be queried by scripts. Signed-off-by: Eduardo Habkost --- scripts/qemu.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/qemu.py b/scripts/qemu.py index 16934f1e02..ebe1c4b919 100644 --- a/scripts/qemu.py +++ b/scripts/qemu.py @@ -88,6 +88,10 @@ class QEMUMachine(object): def is_running(self): return self._popen and (self._popen.returncode is None) =20 + def exitcode(self): + if self._popen: + return self._popen.returncode + def get_pid(self): if not self.is_running(): return None --=20 2.11.0.259.g40922b1 From nobody Sun Apr 28 11:07:24 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.zoho.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 1495822581753694.2383000085173; Fri, 26 May 2017 11:16:21 -0700 (PDT) Received: from localhost ([::1]:37860 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dEJme-0007q3-6W for importer@patchew.org; Fri, 26 May 2017 14:16:20 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57748) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dEJin-0004A8-I0 for qemu-devel@nongnu.org; Fri, 26 May 2017 14:12:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dEJii-0003fw-Eq for qemu-devel@nongnu.org; Fri, 26 May 2017 14:12:21 -0400 Received: from mx1.redhat.com ([209.132.183.28]:59090) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dEJii-0003fq-1C for qemu-devel@nongnu.org; Fri, 26 May 2017 14:12:16 -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 13460C0B39D6 for ; Fri, 26 May 2017 18:12:15 +0000 (UTC) Received: from localhost (ovpn-116-57.gru2.redhat.com [10.97.116.57]) by smtp.corp.redhat.com (Postfix) with ESMTP id 00C9E17F54; Fri, 26 May 2017 18:12:13 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 13460C0B39D6 Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=ehabkost@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 13460C0B39D6 From: Eduardo Habkost To: qemu-devel@nongnu.org Date: Fri, 26 May 2017 15:12:00 -0300 Message-Id: <20170526181200.17227-4-ehabkost@redhat.com> In-Reply-To: <20170526181200.17227-1-ehabkost@redhat.com> References: <20170526181200.17227-1-ehabkost@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.32]); Fri, 26 May 2017 18:12:15 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v3 3/3] scripts: Test script to look for -device crashes 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: Marcel Apfelbaum , Thomas Huth , Markus Armbruster 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" Test code to check if we can crash QEMU using -device. It will test all accel/machine/device combinations by default, which may take a few hours (it's more than 90k test cases). There's a "-r" option that makes it test a random sample of combinations. The scripts contains a whitelist for: 1) known error messages that make QEMU exit cleanly; 2) known QEMU crashes. This is the behavior when the script finds a failure: * Known clean (exitcode=3D1) errors generate DEBUG messages (hidden by default) * Unknown clean (exitcode=3D1) errors will generate INFO messages (visible by default) * Known crashes generate error messages, but are not fatal (unless --strict mode is used) * Unknown crashes generate fatal error messages Having an updated whitelist of known clean errors is useful to make the script less verbose and run faster when in --quick mode, but the whitelist doesn't need to be always up to date. Signed-off-by: Eduardo Habkost --- Changes v2 -> v3: * Renamed to scripts/device-crash-test (removed .py suffix) * Changed license to GPLv2+ * whitelist updates: * New whitelist entries * Documented whitelist expectations more clearly * Use loglevel=3DINFO on unknown exitcode=3D1 cases * Ignore ide-cd errors on older QEMU versions * Refactor of whitelist lookup code to make it clearer * Optimization: when in quick mode, check if machine is usable before testing it using -device * Run in verbose mode by default * Include exception traceback on the log output. * Use lowercase on "skipped:" message for consistency * Run on quick mode by default * Added --strict option * Don't crash if -r argument is too large * Eliminate useless genAllCases() wrapper function * Eliminate dead pickRandomCase() function * Eliminate dead debugging code * Include exception details on debug log if a machine fails to run * Removed code that tries to detect obsolete entries * Update commenst to mention user_creatable instead of the old cannot_instantiate_with_device_add_yet name * Coding style updates to make pylint and pep8 happier Changes v1 -> v2: * New whitelist entries: * "could not find stage1 bootloader" * Segfaults when using devices: a15mpcore_priv, sb16, cs4231a, arm-gicv3 * Format "success" line using formatTestCase(), and using DEBUg loglevel * Reword "test case:" line with "running test case:", for clarity * Fix "pc-.*" whitelist to include "q35" too * Add --devtype option to test only a specific device type * Send all log messages to stdout instead of stderr * Avoid printing "obsolete whitelist entry?" messages if we know we are not testing every single accel/machine/device combination * --quick mode, to skip cases where failures are always expected, and to print a warning in case we don't get an expected failure * Use qemu.QEMUMachine instead of qtest.QEMUQtestMachine, as we don't use any of the QEMUQtestMachine features * Fix handling of multiple '-t' options * Simplify code that generate random sample of test cases --- scripts/device-crash-test | 624 ++++++++++++++++++++++++++++++++++++++++++= ++++ 1 file changed, 624 insertions(+) create mode 100755 scripts/device-crash-test diff --git a/scripts/device-crash-test b/scripts/device-crash-test new file mode 100755 index 0000000000..3b089099ce --- /dev/null +++ b/scripts/device-crash-test @@ -0,0 +1,624 @@ +#!/usr/bin/env python2.7 +# +# Copyright (c) 2017 Red Hat Inc +# +# Author: +# Eduardo Habkost +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +""" +Run QEMU with all combinations of -machine and -device types, +check for crashes and unexpected errors. +""" + +import sys +import os +import glob +import logging +import traceback +import re +import random +import argparse +from itertools import chain + +sys.path.append(os.path.join(os.path.dirname(__file__), '..', 'scripts')) +from qemu import QEMUMachine + +logger =3D logging.getLogger('device-crash-test') +dbg =3D logger.debug + + +# Purposes of the following whitelist: +# * Avoiding verbose log messages when we find known non-fatal +# (exitcode=3D1) errors +# * Avoiding fatal errors when we find known crashes +# * Skipping machines/devices that are known not to work out of +# the box, when running in --quick mode +# +# Keeping the whitelist updated is desirable, but not required, +# because unexpected cases where QEMU exits with exitcode=3D1 will +# just trigger a INFO message. + +# Valid whitelist entry keys: +# * accel: regexp, full match only +# * machine: regexp, full match only +# * device: regexp, full match only +# * log: regexp, partial match allowed +# * exitcode: if not present, defaults to 1. If None, matches any exitcode +# * warn: if True, matching failures will be logged as warnings +# * expected: if True, QEMU is expected to always fail every time +# when testing the corresponding test case +# * loglevel: log level of log output when there's a match. +ERROR_WHITELIST =3D [ + # Machines that won't work out of the box: + # MACHINE | ERROR MESSAGE + dict(machine=3D'niagara', expected=3DTrue), # Unable to load a f= irmware for -M niagara + dict(machine=3D'boston', expected=3DTrue), # Please provide eit= her a -kernel or -bios argument + dict(machine=3D'leon3_generic', expected=3DTrue), # Can't read bios im= age (null) + + # devices that don't work out of the box because they require extra op= tions to "-device DEV": + # DEVICE | ERROR MESSAGE + dict(device=3D'.*-(i386|x86_64)-cpu', expected=3DTrue), # CPU socke= t-id is not set + dict(device=3D'ARM,bitband-memory', expected=3DTrue), # source-me= mory property not set + dict(device=3D'arm.cortex-a9-global-timer', expected=3DTrue), # a9_gti= mer_realize: num-cpu must be between 1 and 4 + dict(device=3D'arm_mptimer', expected=3DTrue), # num-cpu m= ust be between 1 and 4 + dict(device=3D'armv7m', expected=3DTrue), # memory pr= operty was not set + dict(device=3D'aspeed.scu', expected=3DTrue), # Unknown s= ilicon revision: 0x0 + dict(device=3D'aspeed.sdmc', expected=3DTrue), # Unknown s= ilicon revision: 0x0 + dict(device=3D'bcm2835-dma', expected=3DTrue), # bcm2835_d= ma_realize: required dma-mr link not found: Property '.dma-mr' not found + dict(device=3D'bcm2835-fb', expected=3DTrue), # bcm2835_f= b_realize: required vcram-base property not set + dict(device=3D'bcm2835-mbox', expected=3DTrue), # bcm2835_m= box_realize: required mbox-mr link not found: Property '.mbox-mr' not found + dict(device=3D'bcm2835-peripherals', expected=3DTrue), # bcm2835_p= eripherals_realize: required ram link not found: Property '.ram' not found + dict(device=3D'bcm2835-property', expected=3DTrue), # bcm2835_p= roperty_realize: required fb link not found: Property '.fb' not found + dict(device=3D'bcm2835_gpio', expected=3DTrue), # bcm2835_g= pio_realize: required sdhci link not found: Property '.sdbus-sdhci' not fou= nd + dict(device=3D'bcm2836', expected=3DTrue), # bcm2836_r= ealize: required ram link not found: Property '.ram' not found + dict(device=3D'cfi.pflash01', expected=3DTrue), # attribute= "sector-length" not specified or zero. + dict(device=3D'cfi.pflash02', expected=3DTrue), # attribute= "sector-length" not specified or zero. + dict(device=3D'icp', expected=3DTrue), # icp_reali= ze: required link 'xics' not found: Property '.xics' not found + dict(device=3D'ics', expected=3DTrue), # ics_base_= realize: required link 'xics' not found: Property '.xics' not found + # "-device ide-cd" does work on more recent QEMU versions, so it doesn= 't have expected=3DTrue + dict(device=3D'ide-cd'), # No drive sp= ecified + dict(device=3D'ide-drive', expected=3DTrue), # No drive = specified + dict(device=3D'ide-hd', expected=3DTrue), # No drive = specified + dict(device=3D'ipmi-bmc-extern', expected=3DTrue), # IPMI exte= rnal bmc requires chardev attribute + dict(device=3D'isa-debugcon', expected=3DTrue), # Can't cre= ate serial device, empty char device + dict(device=3D'isa-ipmi-bt', expected=3DTrue), # IPMI devi= ce requires a bmc attribute to be set + dict(device=3D'isa-ipmi-kcs', expected=3DTrue), # IPMI devi= ce requires a bmc attribute to be set + dict(device=3D'isa-parallel', expected=3DTrue), # Can't cre= ate serial device, empty char device + dict(device=3D'isa-serial', expected=3DTrue), # Can't cre= ate serial device, empty char device + dict(device=3D'ivshmem', expected=3DTrue), # You must = specify either 'shm' or 'chardev' + dict(device=3D'ivshmem-doorbell', expected=3DTrue), # You must = specify a 'chardev' + dict(device=3D'ivshmem-plain', expected=3DTrue), # You must = specify a 'memdev' + dict(device=3D'kvm-pci-assign', expected=3DTrue), # no host d= evice specified + dict(device=3D'loader', expected=3DTrue), # please in= clude valid arguments + dict(device=3D'nand', expected=3DTrue), # Unsupport= ed NAND block size 0x1 + dict(device=3D'nvdimm', expected=3DTrue), # 'memdev' = property is not set + dict(device=3D'nvme', expected=3DTrue), # Device in= itialization failed + dict(device=3D'pc-dimm', expected=3DTrue), # 'memdev' = property is not set + dict(device=3D'pci-bridge', expected=3DTrue), # Bridge ch= assis not specified. Each bridge is required to be assigned a unique chassi= s id > 0. + dict(device=3D'pci-bridge-seat', expected=3DTrue), # Bridge ch= assis not specified. Each bridge is required to be assigned a unique chassi= s id > 0. + dict(device=3D'pci-serial', expected=3DTrue), # Can't cre= ate serial device, empty char device + dict(device=3D'pci-serial-2x', expected=3DTrue), # Can't cre= ate serial device, empty char device + dict(device=3D'pci-serial-4x', expected=3DTrue), # Can't cre= ate serial device, empty char device + dict(device=3D'pxa2xx-dma', expected=3DTrue), # channels = value invalid + dict(device=3D'pxb', expected=3DTrue), # Bridge ch= assis not specified. Each bridge is required to be assigned a unique chassi= s id > 0. + dict(device=3D'scsi-block', expected=3DTrue), # drive pro= perty not set + dict(device=3D'scsi-disk', expected=3DTrue), # drive pro= perty not set + dict(device=3D'scsi-generic', expected=3DTrue), # drive pro= perty not set + dict(device=3D'scsi-hd', expected=3DTrue), # drive pro= perty not set + dict(device=3D'spapr-pci-host-bridge', expected=3DTrue), # BUID not = specified for PHB + dict(device=3D'spapr-pci-vfio-host-bridge', expected=3DTrue), # BUID n= ot specified for PHB + dict(device=3D'spapr-rng', expected=3DTrue), # spapr-rng= needs an RNG backend! + dict(device=3D'spapr-vty', expected=3DTrue), # chardev p= roperty not set + dict(device=3D'tpm-tis', expected=3DTrue), # tpm_tis: = backend driver with id (null) could not be found + dict(device=3D'unimplemented-device', expected=3DTrue), # property = 'size' not specified or zero + dict(device=3D'usb-braille', expected=3DTrue), # Property = chardev is required + dict(device=3D'usb-mtp', expected=3DTrue), # x-root pr= operty must be configured + dict(device=3D'usb-redir', expected=3DTrue), # Parameter= 'chardev' is missing + dict(device=3D'usb-serial', expected=3DTrue), # Property = chardev is required + dict(device=3D'usb-storage', expected=3DTrue), # drive pro= perty not set + dict(device=3D'vfio-amd-xgbe', expected=3DTrue), # -device v= fio-amd-xgbe: vfio error: wrong host device name + dict(device=3D'vfio-calxeda-xgmac', expected=3DTrue), # -device v= fio-calxeda-xgmac: vfio error: wrong host device name + dict(device=3D'vfio-pci', expected=3DTrue), # No provid= ed host device + dict(device=3D'vfio-pci-igd-lpc-bridge', expected=3DTrue), # VFIO dumm= y ISA/LPC bridge must have address 1f.0 + dict(device=3D'vhost-scsi.*', expected=3DTrue), # vhost-scs= i: missing wwpn + dict(device=3D'vhost-vsock-device', expected=3DTrue), # guest-cid= property must be greater than 2 + dict(device=3D'vhost-vsock-pci', expected=3DTrue), # guest-cid= property must be greater than 2 + dict(device=3D'virtio-9p-ccw', expected=3DTrue), # 9pfs devi= ce couldn't find fsdev with the id =3D NULL + dict(device=3D'virtio-9p-device', expected=3DTrue), # 9pfs devi= ce couldn't find fsdev with the id =3D NULL + dict(device=3D'virtio-9p-pci', expected=3DTrue), # 9pfs devi= ce couldn't find fsdev with the id =3D NULL + dict(device=3D'virtio-blk-ccw', expected=3DTrue), # drive pro= perty not set + dict(device=3D'virtio-blk-device', expected=3DTrue), # drive pro= perty not set + dict(device=3D'virtio-blk-device', expected=3DTrue), # drive pro= perty not set + dict(device=3D'virtio-blk-pci', expected=3DTrue), # drive pro= perty not set + dict(device=3D'virtio-crypto-ccw', expected=3DTrue), # 'cryptode= v' parameter expects a valid object + dict(device=3D'virtio-crypto-device', expected=3DTrue), # 'cryptode= v' parameter expects a valid object + dict(device=3D'virtio-crypto-pci', expected=3DTrue), # 'cryptode= v' parameter expects a valid object + dict(device=3D'virtio-input-host-device', expected=3DTrue), # evdev pr= operty is required + dict(device=3D'virtio-input-host-pci', expected=3DTrue), # evdev pro= perty is required + dict(device=3D'xen-pvdevice', expected=3DTrue), # Device ID= invalid, it must always be supplied + dict(device=3D'vhost-vsock-ccw', expected=3DTrue), # guest-cid= property must be greater than 2 + dict(device=3D'ALTR.timer', expected=3DTrue), # "clock-fr= equency" property must be provided + dict(device=3D'zpci', expected=3DTrue), # target mu= st be defined + dict(device=3D'pnv-(occ|icp|lpc)', expected=3DTrue), # required = link 'xics' not found: Property '.xics' not found + dict(device=3D'powernv-cpu-.*', expected=3DTrue), # pnv_core_= realize: required link 'xics' not found: Property '.xics' not found + + # ioapic devices are already created by pc and will fail: + dict(machine=3D'q35|pc.*', device=3D'kvm-ioapic', expected=3DTrue), # = Only 1 ioapics allowed + dict(machine=3D'q35|pc.*', device=3D'ioapic', expected=3DTrue), # = Only 1 ioapics allowed + + # KVM-specific devices shouldn't be tried without accel=3Dkvm: + dict(accel=3D'(?!kvm).*', device=3D'kvmclock', expected=3DTrue), + dict(accel=3D'(?!kvm).*', device=3D'kvm-pci-assign', expected=3DTrue), + + # xen-specific machines and devices: + dict(accel=3D'(?!xen).*', machine=3D'xen.*', expected=3DTrue), + dict(accel=3D'(?!xen).*', device=3D'xen-.*', expected=3DTrue), + + # this fails on some machine-types, but not all, so they don't have ex= pected=3DTrue: + dict(device=3D'vmgenid'), # vmgenid requires DMA write support in fw_c= fg, which this machine type does not provide + + # Silence INFO messages for errors that are common on multiple + # devices/machines: + dict(log=3Dr"No '[\w-]+' bus found for device '[\w-]+'"), + dict(log=3Dr"images* must be given with the 'pflash' parameter"), + dict(log=3Dr"(Guest|ROM|Flash|Kernel) image must be specified"), + dict(log=3Dr"[cC]ould not load [\w ]+ (BIOS|bios) '[\w-]+\.bin'"), + dict(log=3Dr"Couldn't find rom image '[\w-]+\.bin'"), + dict(log=3Dr"speed mismatch trying to attach usb device"), + dict(log=3Dr"Can't create a second ISA bus"), + dict(log=3Dr"duplicate fw_cfg file name"), + # sysbus-related error messages: most machines reject most dynamic sys= bus devices: + dict(log=3Dr"Option '-device [\w.,-]+' cannot be handled by this machi= ne"), + dict(log=3Dr"Device [\w.,-]+ is not supported by this machine yet"), + dict(log=3Dr"Device [\w.,-]+ can not be dynamically instantiated"), + dict(log=3Dr"Platform Bus: Can not fit MMIO region of size "), + # other more specific errors we will ignore: + dict(device=3D'allwinner-a10', log=3D"Unsupported NIC model:"), + dict(device=3D'.*-spapr-cpu-core', log=3Dr"CPU core type should be"), + dict(log=3Dr"MSI(-X)? is not supported by interrupt controller"), + dict(log=3Dr"pxb-pcie? devices cannot reside on a PCIe? bus"), + dict(log=3Dr"Ignoring smp_cpus value"), + dict(log=3Dr"sd_init failed: Drive 'sd0' is already in use because it = has been automatically connected to another device"), + dict(log=3Dr"This CPU requires a smaller page size than the system is = using"), + dict(log=3Dr"MSI-X support is mandatory in the S390 architecture"), + dict(log=3Dr"rom check and register reset failed"), + dict(log=3Dr"Unable to initialize GIC, CPUState for CPU#0 not valid"), + dict(log=3Dr"Multiple VT220 operator consoles are not supported"), + dict(log=3Dr"core 0 already populated"), + dict(log=3Dr"could not find stage1 bootloader"), + + # other exitcode=3D1 failures not listed above will just generate INFO= messages: + dict(exitcode=3D1, loglevel=3Dlogging.INFO), + + # KNOWN CRASHES: + # Known crashes will generate error messages, but won't be fatal. + # Those entries must be removed once we fix the crashes. + dict(exitcode=3D-6, log=3Dr"Device 'serial0' is in use", loglevel=3Dlo= gging.ERROR), + dict(exitcode=3D-6, log=3Dr"spapr_rtas_register: Assertion .*rtas_tabl= e\[token\]\.name.* failed", loglevel=3Dlogging.ERROR), + dict(exitcode=3D-6, log=3Dr"qemu_net_client_setup: Assertion `!peer->p= eer' failed", loglevel=3Dlogging.ERROR), + dict(exitcode=3D-6, log=3Dr'RAMBlock "[\w.-]+" already registered', lo= glevel=3Dlogging.ERROR), + dict(exitcode=3D-6, log=3Dr"find_ram_offset: Assertion `size !=3D 0' f= ailed.", loglevel=3Dlogging.ERROR), + dict(exitcode=3D-6, log=3Dr"puv3_load_kernel: Assertion `kernel_filena= me !=3D NULL' failed", loglevel=3Dlogging.ERROR), + dict(exitcode=3D-6, log=3Dr"add_cpreg_to_hashtable: code should not be= reached", loglevel=3Dlogging.ERROR), + dict(exitcode=3D-6, log=3Dr"qemu_alloc_display: Assertion `surface->im= age !=3D NULL' failed", loglevel=3Dlogging.ERROR), + dict(exitcode=3D-6, log=3Dr"Unexpected error in error_set_from_qdev_pr= op_error", loglevel=3Dlogging.ERROR), + dict(exitcode=3D-6, log=3Dr"Object .* is not an instance of type spapr= -machine", loglevel=3Dlogging.ERROR), + dict(exitcode=3D-6, log=3Dr"Object .* is not an instance of type gener= ic-pc-machine", loglevel=3Dlogging.ERROR), + dict(exitcode=3D-6, log=3Dr"Object .* is not an instance of type e500-= ccsr", loglevel=3Dlogging.ERROR), + dict(exitcode=3D-6, log=3Dr"vmstate_register_with_alias_id: Assertion = `!se->compat || se->instance_id =3D=3D 0' failed", loglevel=3Dlogging.ERROR= ), + dict(exitcode=3D-11, device=3D'stm32f205-soc', loglevel=3Dlogging.ERRO= R, expected=3DTrue), + dict(exitcode=3D-11, device=3D'xlnx,zynqmp', loglevel=3Dlogging.ERROR,= expected=3DTrue), + dict(exitcode=3D-11, device=3D'mips-cps', loglevel=3Dlogging.ERROR, ex= pected=3DTrue), + dict(exitcode=3D-11, device=3D'gus', loglevel=3Dlogging.ERROR, expecte= d=3DTrue), + dict(exitcode=3D-11, device=3D'a9mpcore_priv', loglevel=3Dlogging.ERRO= R, expected=3DTrue), + dict(exitcode=3D-11, device=3D'a15mpcore_priv', loglevel=3Dlogging.ERR= OR, expected=3DTrue), + dict(exitcode=3D-11, device=3D'isa-serial', loglevel=3Dlogging.ERROR, = expected=3DTrue), + dict(exitcode=3D-11, device=3D'sb16', loglevel=3Dlogging.ERROR, expect= ed=3DTrue), + dict(exitcode=3D-11, device=3D'cs4231a', loglevel=3Dlogging.ERROR, exp= ected=3DTrue), + dict(exitcode=3D-11, device=3D'arm-gicv3', loglevel=3Dlogging.ERROR, e= xpected=3DTrue), + dict(exitcode=3D-11, machine=3D'isapc', device=3D'.*-iommu', loglevel= =3Dlogging.ERROR, expected=3DTrue), + + # everything else (including SIGABRT and SIGSEGV) will be a fatal erro= r: + dict(exitcode=3DNone, fatal=3DTrue, loglevel=3Dlogging.FATAL), +] + + +def whitelistTestCaseMatch(wl, t): + """Check if a test case specification can match a whitelist entry + + This only checks if a whitelist entry is a candidate match + for a given test case, it won't check if the test case + results/output match the entry. See whitelistResultMatch(). + """ + return (('machine' not in wl or + 'machine' not in t or + re.match(wl['machine'] + '$', t['machine'])) and + ('accel' not in wl or + 'accel' not in t or + re.match(wl['accel'] + '$', t['accel'])) and + ('device' not in wl or + 'device' not in t or + re.match(wl['device'] + '$', t['device']))) + + +def whitelistCandidates(t): + """Generate the list of candidates that can match a test case""" + for i, wl in enumerate(ERROR_WHITELIST): + if whitelistTestCaseMatch(wl, t): + yield (i, wl) + + +def findExpectedResult(t): + """Check if there's an expected=3DTrue whitelist entry for a test case + + Returns (i, wl) tuple, where i is the index in + ERROR_WHITELIST and wl is the whitelist entry itself. + """ + for i, wl in whitelistCandidates(t): + if wl.get('expected'): + return (i, wl) + + +def whitelistResultMatch(wl, r): + """Check if test case results/output match a whitelist entry + + It is valid to call this function only if + whitelistTestCaseMatch() is True for the entry (e.g. on + entries returned by whitelistCandidates()) + """ + assert whitelistTestCaseMatch(wl, r['testcase']) + return ((wl.get('exitcode', 1) is None or + r['exitcode'] =3D=3D wl.get('exitcode', 1)) and + ('log' not in wl or + re.search(wl['log'], r['log'], re.MULTILINE))) + + +def checkResultWhitelist(r): + """Look up whitelist entry for a given test case result + + Returns (i, wl) tuple, where i is the index in + ERROR_WHITELIST and wl is the whitelist entry itself. + """ + for i, wl in whitelistCandidates(r['testcase']): + if whitelistResultMatch(wl, r): + return i, wl + + raise Exception("this should never happen") + + +def qemuOptsEscape(s): + """Escape option value QemuOpts""" + return s.replace(",", ",,") + + +def formatTestCase(t): + """Format test case info as "key=3Dvalue key=3Dvalue" for prettier log= ging output""" + return ' '.join('%s=3D%s' % (k, v) for k, v in t.items()) + + +def qomListTypeNames(vm, **kwargs): + """Run qom-list-types QMP command, return type names""" + types =3D vm.command('qom-list-types', **kwargs) + return [t['name'] for t in types] + + +def infoQDM(vm): + """Parse 'info qdm' output""" + args =3D {'command-line': 'info qdm'} + devhelp =3D vm.command('human-monitor-command', **args) + for l in devhelp.split('\n'): + l =3D l.strip() + if l =3D=3D '' or l.endswith(':'): + continue + d =3D {'name': re.search(r'name "([^"]+)"', l).group(1), + 'no-user': (re.search(', no-user', l) is not None)} + yield d + + +class QemuBinaryInfo(object): + def __init__(self, binary, devtype): + if devtype is None: + devtype =3D 'device' + + self.binary =3D binary + self._machine_info =3D {} + + dbg("devtype: %r", devtype) + args =3D ['-S', '-machine', 'none,accel=3Dkvm:tcg'] + dbg("querying info for QEMU binary: %s", binary) + vm =3D QEMUMachine(binary=3Dbinary, args=3Dargs) + vm.launch() + try: + self.alldevs =3D set(qomListTypeNames(vm, implements=3Ddevtype= , abstract=3DFalse)) + # there's no way to query DeviceClass::user_creatable using QM= P, + # so use 'info qdm': + self.no_user_devs =3D set([d['name'] for d in infoQDM(vm, ) if= d['no-user']]) + self.machines =3D list(m['name'] for m in vm.command('query-ma= chines')) + self.user_devs =3D self.alldevs.difference(self.no_user_devs) + self.kvm_available =3D vm.command('query-kvm')['enabled'] + finally: + vm.shutdown() + + def machineInfo(self, machine): + """Query for information on a specific machine-type + + Results are cached internally, in case the same machine- + type is queried multiple times. + """ + if machine in self._machine_info: + return self._machine_info[machine] + + mi =3D {} + args =3D ['-S', '-machine', '%s' % (machine)] + dbg("querying machine info for binary=3D%s machine=3D%s", self.bin= ary, machine) + vm =3D QEMUMachine(binary=3Dself.binary, args=3Dargs) + try: + vm.launch() + mi['runnable'] =3D True + except KeyboardInterrupt: + raise + except: + dbg("exception trying to run binary=3D%s machine=3D%s", self.b= inary, machine, exc_info=3Dsys.exc_info()) + dbg("log: %r", vm.get_log()) + mi['runnable'] =3D False + + vm.shutdown() + self._machine_info[machine] =3D mi + return mi + + +BINARY_INFO =3D {} + + +def getBinaryInfo(args, binary): + if binary not in BINARY_INFO: + BINARY_INFO[binary] =3D QemuBinaryInfo(binary, args.devtype) + return BINARY_INFO[binary] + + +def checkOneCase(args, testcase): + """Check one specific case + + Returns a dictionary containing failure information on error, + or None on success + """ + binary =3D testcase['binary'] + accel =3D testcase['accel'] + machine =3D testcase['machine'] + device =3D testcase['device'] + + dbg("will test: %r", testcase) + + args =3D ['-S', '-machine', '%s,accel=3D%s' % (machine, accel), + '-device', qemuOptsEscape(device)] + cmdline =3D ' '.join([binary] + args) + dbg("will launch QEMU: %s", cmdline) + vm =3D QEMUMachine(binary=3Dbinary, args=3Dargs) + + exc_traceback =3D None + try: + vm.launch() + except KeyboardInterrupt: + raise + except: + exc_traceback =3D traceback.format_exc() + dbg("Exception while running test case") + finally: + vm.shutdown() + ec =3D vm.exitcode() + log =3D vm.get_log() + + if exc_traceback is not None or ec !=3D 0: + return dict(exc_traceback=3Dexc_traceback, + exitcode=3Dec, + log=3Dlog, + testcase=3Dtestcase, + cmdline=3Dcmdline) + + +def binariesToTest(args, testcase): + if args.qemu: + r =3D args.qemu + else: + r =3D glob.glob('./*-softmmu/qemu-system-*') + return r + + +def accelsToTest(args, testcase): + if getBinaryInfo(args, testcase['binary']).kvm_available: + yield 'kvm' + yield 'tcg' + + +def machinesToTest(args, testcase): + return getBinaryInfo(args, testcase['binary']).machines + + +def devicesToTest(args, testcase): + return getBinaryInfo(args, testcase['binary']).user_devs + + +TESTCASE_VARIABLES =3D [ + ('binary', binariesToTest), + ('accel', accelsToTest), + ('machine', machinesToTest), + ('device', devicesToTest), +] + + +def genCases1(args, testcases, var, fn): + """Generate new testcases for one variable + + If an existing item already has a variable set, don't + generate new items and just return it directly. This + allows the "-t" command-line option to be used to choose + a specific test case. + """ + for testcase in testcases: + if var in testcase: + yield testcase.copy() + else: + for i in fn(args, testcase): + t =3D testcase.copy() + t[var] =3D i + yield t + + +def genCases(args, testcase): + """Generate test cases for all variables + """ + cases =3D [testcase.copy()] + for var, fn in TESTCASE_VARIABLES: + dbg("var: %r, fn: %r", var, fn) + cases =3D genCases1(args, cases, var, fn) + return cases + + +def casesToTest(args, testcase): + cases =3D genCases(args, testcase) + if args.random: + cases =3D list(cases) + cases =3D random.sample(cases, min(args.random, len(cases))) + if args.debug: + cases =3D list(cases) + dbg("%d test cases to test", len(cases)) + if args.shuffle: + cases =3D list(cases) + random.shuffle(cases) + return cases + + +def logFailure(f, level): + t =3D f['testcase'] + logger.log(level, "failed: %s", formatTestCase(t)) + logger.log(level, "cmdline: %s", f['cmdline']) + for l in f['log'].strip().split('\n'): + logger.log(level, "log: %s", l) + logger.log(level, "exit code: %r", f['exitcode']) + if f['exc_traceback']: + logger.log(level, "exception:") + for l in f['exc_traceback'].split('\n'): + logger.log(level, " %s", l.rstrip('\n')) + + +def main(): + parser =3D argparse.ArgumentParser(description=3D"QEMU -device crash t= est") + parser.add_argument('-t', metavar=3D'KEY=3DVALUE', nargs=3D'*', + help=3D"Limit test cases to KEY=3DVALUE", + action=3D'append', dest=3D'testcases', default=3D[= ]) + parser.add_argument('-d', '--debug', action=3D'store_true', + help=3D'debug output') + parser.add_argument('-v', '--verbose', action=3D'store_true', default= =3DTrue, + help=3D'verbose output') + parser.add_argument('-q', '--quiet', dest=3D'verbose', action=3D'store= _false', + help=3D'non-verbose output') + parser.add_argument('-r', '--random', type=3Dint, metavar=3D'COUNT', + help=3D'run a random sample of COUNT test cases', + default=3D0) + parser.add_argument('--shuffle', action=3D'store_true', + help=3D'Run test cases in random order') + parser.add_argument('--dry-run', action=3D'store_true', + help=3D"Don't run any tests, just generate list") + parser.add_argument('-D', '--devtype', metavar=3D'TYPE', + help=3D"Test only device types that implement TYPE= ") + parser.add_argument('-Q', '--quick', action=3D'store_true', default=3D= True, + help=3D"Quick mode: skip test cases that are expec= ted to fail") + parser.add_argument('-F', '--full', action=3D'store_false', dest=3D'qu= ick', + help=3D"Full mode: test cases that are expected to= fail") + parser.add_argument('--strict', action=3D'store_true', dest=3D'strict', + help=3D"Treat all warnings as fatal") + parser.add_argument('qemu', nargs=3D'*', metavar=3D'QEMU', + help=3D'QEMU binary to run') + args =3D parser.parse_args() + + if args.debug: + lvl =3D logging.DEBUG + elif args.verbose: + lvl =3D logging.INFO + else: + lvl =3D logging.WARN + logging.basicConfig(stream=3Dsys.stdout, level=3Dlvl, format=3D'%(leve= lname)s: %(message)s') + + fatal_failures =3D [] + wl_stats =3D {} + skipped =3D 0 + total =3D 0 + + tc =3D {} + dbg("testcases: %r", args.testcases) + if args.testcases: + for t in chain(*args.testcases): + for kv in t.split(): + k, v =3D kv.split('=3D', 1) + tc[k] =3D v + + if len(binariesToTest(args, tc)) =3D=3D 0: + print >>sys.stderr, "No QEMU binary found" + parser.print_usage(sys.stderr) + return 1 + + for t in casesToTest(args, tc): + logger.info("running test case: %s", formatTestCase(t)) + total +=3D 1 + + expected_match =3D findExpectedResult(t) + if (args.quick and + (expected_match or + not getBinaryInfo(args, t['binary']).machineInfo(t['machi= ne'])['runnable'])): + dbg("skipped: %s", formatTestCase(t)) + skipped +=3D 1 + continue + + if args.dry_run: + continue + + try: + f =3D checkOneCase(args, t) + except KeyboardInterrupt: + break + + if f: + i, wl =3D checkResultWhitelist(f) + dbg("testcase: %r, whitelist match: %r", t, wl) + wl_stats.setdefault(i, []).append(f) + level =3D wl.get('loglevel', logging.DEBUG) + logFailure(f, level) + if wl.get('fatal') or (args.strict and level >=3D logging.WARN= ): + fatal_failures.append(f) + else: + dbg("success: %s", formatTestCase(t)) + if expected_match: + logger.warn("Didn't fail as expected: %s", formatTestCase(= t)) + + logger.info("Total: %d test cases", total) + if skipped: + logger.info("Skipped %d test cases", skipped) + + if args.debug: + stats =3D sorted([(len(wl_stats.get(i, [])), wl) for i, wl in enum= erate(ERROR_WHITELIST)]) + for count, wl in stats: + dbg("whitelist entry stats: %d: %r", count, wl) + + if fatal_failures: + for f in fatal_failures: + t =3D f['testcase'] + logger.error("Fatal failure: %s", formatTestCase(t)) + logger.error("Fatal failures on some machine/device combinations") + return 1 + +if __name__ =3D=3D '__main__': + sys.exit(main()) --=20 2.11.0.259.g40922b1