From nobody Tue May 7 16:24:09 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1616526557; cv=none; d=zohomail.com; s=zohoarc; b=IED2Sxjk3X6wM/7vLvtxwGTXgxJswMNWd7DXy9WBDwM5QWvqnC/U312/UaU3rjZ/nA/hzP9k2lmkzY4F6+8PrtZX3tHeAtNX/XuxJfLV1mJMq0PJY9JLA4i6DAAKpst5ADWp8/Nq2dPDWSjh+h/HOQ/XXF5mC0tcDtwT6EQuu7Q= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1616526557; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=czzHm2ccyhhF9zSRE5fhZxlUCkJ2TFJg6JtCeRoNsII=; b=h8spJgbGYUCymh+DEE3GT4r1qb4vbhF2YVGfqlfNk5Cnx0Fw8aKRvHvQiMQECJ5i3Pv+63Y5KMnewWlyGP/BZfw1YqaX2thKC3WTG8ZsoD0JEHTLQDZfAjt48sXjqowhv4l4wIdweJqIHIQRwVZzZnKC54YTos1HAQG+FsJuzVU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 16165265573456.67007998492727; Tue, 23 Mar 2021 12:09:17 -0700 (PDT) Received: from localhost ([::1]:59634 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lOmOy-0006b2-7D for importer@patchew.org; Tue, 23 Mar 2021 15:09:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53922) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lOlcu-000832-Ei; Tue, 23 Mar 2021 14:19:41 -0400 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]:34413) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lOlcq-0006dp-3E; Tue, 23 Mar 2021 14:19:36 -0400 Received: by mail-wm1-x332.google.com with SMTP id n11-20020a05600c4f8bb029010e5cf86347so1581294wmq.1; Tue, 23 Mar 2021 11:19:31 -0700 (PDT) Received: from avogadro.redhat.com ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id u8sm24204412wrr.42.2021.03.23.11.19.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Mar 2021 11:19:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=czzHm2ccyhhF9zSRE5fhZxlUCkJ2TFJg6JtCeRoNsII=; b=UcGeb9ITWEsSMOagHb5hleTDdLK1TCpT8rYKJ3jGDFpugHB5u34CzyzKPrkaLTPGCt fteBHuesRVO8ncne+4PMjsBMGPn0Tu9Ox35fXyMgSDasrGZbl/zBZrIGhHLgmVCTcTQX ZI4q2avTT9/innG2P38mZH0oxkVX2un46Vmb+J5ynJEl9P9qFbdnHF9FW6PuYCYVdven VHZ1ZFZrW3aKZ7/ufpxdmbnOrBvEcY0l1lLtit3y9360neiHAZJF+kp0RrbKR2bXMszK I/F4r/NzDoyQRsF2OcDHP6nJEzss2Zw7XRTaFFMGS0goUMc/HgKmlwptf1U48/3EkQR9 kN5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=czzHm2ccyhhF9zSRE5fhZxlUCkJ2TFJg6JtCeRoNsII=; b=dR0tYUgc/qF7p/Wpkpw+Qu2r3MmrCsZchAeVmQJB69jwxtZqolR/eUYRxdQr6u25Zh nLL0fC6X1Oo05GGP0dpSWhX0PuyQirty5eZaIrl43wS83+I7HIhkPzvi3BgWaEmASMpV lSsgwWu3v/2o6PUooCsdDMlccxVABxtVjAh03GskQireTCf7jxIl3vKLoLupKe62ujTn weMCiTe/R8NAVihDbJp6UBks+TDOcgCUPyfwLZEVlKt5F2o3WimICyRWXjxR8DPnlIaj 7t7ZYfXR2e6yQcNxtEHUXXDvPtIVlk6zO5V3oe/47rT/vQfiH347AE/USHk7XYcyIqZN gk2w== X-Gm-Message-State: AOAM530YNvAy7GVfF3OMDKCTV/LQrhXCMSPjVveO7FIIO/s1WJAu5jKN htVYnQMn6Nb4e/i4qWDKigF6glzRQOw= X-Google-Smtp-Source: ABdhPJzzzq1BkRmLbWQCcMug1+blxbmiWPQ+4GWRl1qSknnzePYQUH/ibYTugYGS1UCc/VQnzEKf2g== X-Received: by 2002:a1c:6309:: with SMTP id x9mr4588914wmb.62.1616523570473; Tue, 23 Mar 2021 11:19:30 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PATCH v2 1/5] qemu-iotests: do not buffer the test output Date: Tue, 23 Mar 2021 19:19:23 +0100 Message-Id: <20210323181928.311862-2-pbonzini@redhat.com> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210323181928.311862-1-pbonzini@redhat.com> References: <20210323181928.311862-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::332; envelope-from=paolo.bonzini@gmail.com; helo=mail-wm1-x332.google.com X-Spam_score_int: 5 X-Spam_score: 0.5 X-Spam_bar: / X-Spam_report: (0.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, PDS_OTHER_BAD_TLD=1.999, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: eesposit@redhat.com, kwolf@redhat.com, vsementsov@virtuozzo.com, qemu-block@nongnu.org, mreitz@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Instead of buffering the test output into a StringIO, patch it on the fly by wrapping sys.stdout's write method. This can be done unconditionally, even if using -d, which makes execute_unittest a bit simpler. Signed-off-by: Paolo Bonzini Reviewed-by: Vladimir Sementsov-Ogievskiy Tested-by: Emanuele Giuseppe Esposito --- tests/qemu-iotests/iotests.py | 68 ++++++++++++++++++++--------------- 1 file changed, 40 insertions(+), 28 deletions(-) diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py index 90d0b62523..0521235030 100644 --- a/tests/qemu-iotests/iotests.py +++ b/tests/qemu-iotests/iotests.py @@ -32,7 +32,7 @@ import sys import time from typing import (Any, Callable, Dict, Iterable, - List, Optional, Sequence, Tuple, TypeVar) + List, Optional, Sequence, Tuple, Type, TypeVar) import unittest =20 from contextlib import contextmanager @@ -1271,37 +1271,49 @@ def func_wrapper(*args, **kwargs): return func(*args, **kwargs) return func_wrapper =20 +# We need to filter out the time taken from the output so that +# qemu-iotest can reliably diff the results against master output, +# and hide skipped tests from the reference output. + +class ReproducibleTestResult(unittest.TextTestResult): + def addSkip(self, test, reason): + # Same as TextTestResult, but print dot instead of "s" + unittest.TestResult.addSkip(self, test, reason) + if self.showAll: + self.stream.writeln("skipped {0!r}".format(reason)) + elif self.dots: + self.stream.write(".") + self.stream.flush() + +class ReproducibleStreamWrapper(object): + def __init__(self, stream): + self.stream =3D stream + + def __getattr__(self, attr): + if attr in ('stream', '__getstate__'): + raise AttributeError(attr) + return getattr(self.stream,attr) + + def write(self, arg=3DNone): + arg =3D re.sub(r'Ran (\d+) tests? in [\d.]+s', r'Ran \1 tests', ar= g) + arg =3D re.sub(r' \(skipped=3D\d+\)', r'', arg) + self.stream.write(arg) + +class ReproducibleTestRunner(unittest.TextTestRunner): + def __init__(self, stream: Optional[io.TextIOBase] =3D None, + resultclass: Type =3D ReproducibleTestResult, *args, **kw= args): + rstream =3D ReproducibleStreamWrapper(stream or sys.stdout) + super().__init__(stream=3Drstream, # type: ignore + descriptions=3DTrue, + resultclass=3Dresultclass, + *args, **kwargs) + def execute_unittest(debug=3DFalse): """Executes unittests within the calling module.""" =20 verbosity =3D 2 if debug else 1 - - if debug: - output =3D sys.stdout - else: - # We need to filter out the time taken from the output so that - # qemu-iotest can reliably diff the results against master output. - output =3D io.StringIO() - - runner =3D unittest.TextTestRunner(stream=3Doutput, descriptions=3DTru= e, - verbosity=3Dverbosity) - try: - # unittest.main() will use sys.exit(); so expect a SystemExit - # exception - unittest.main(testRunner=3Drunner) - finally: - # We need to filter out the time taken from the output so that - # qemu-iotest can reliably diff the results against master output. - if not debug: - out =3D output.getvalue() - out =3D re.sub(r'Ran (\d+) tests? in [\d.]+s', r'Ran \1 tests'= , out) - - # Hide skipped tests from the reference output - out =3D re.sub(r'OK \(skipped=3D\d+\)', 'OK', out) - out_first_line, out_rest =3D out.split('\n', 1) - out =3D out_first_line.replace('s', '.') + '\n' + out_rest - - sys.stderr.write(out) + runner =3D unittest.ReproducibleTestRunner(verbosity=3Dverbosity) + unittest.main(testRunner=3Drunner) =20 def execute_setup_common(supported_fmts: Sequence[str] =3D (), supported_platforms: Sequence[str] =3D (), --=20 2.30.1 From nobody Tue May 7 16:24:09 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1616526178; cv=none; d=zohomail.com; s=zohoarc; b=ghHcIeWXuVVA82mHwjkzFcH6/U2/JxoJhqu7Dy1iUfksE9AvyvXehyoa3sO2pei8RZFVB5YBQZlrXHgEbsrpoYOvpjqCF3cidizkNBwIbtMfgRIeeNZpFy5jfKo5ht5sW7b/INNuJ6m4tG9DjWOmJ670NCjxvs3WFQDABF0GoMc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1616526178; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=OjfYXuvapzfoicvsPzenNs9Pa0X+2b/AgIrWbXMqX7I=; b=SZDtb8UBMDNGyKP3FxzcwOX/6HYy1JnpWzY8TRLEVVpW85zeI+bNWxgvGSNhpYdekM+HKUb3QoGyRJWBumqpesBZA9lWFjirlIgHu97RY+AVapk+M2WMmQ9UNg1fcROG7lEEtDb0MnslawS/jIlBiRAJnSTtVz2DYs4NkbW8Pog= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1616526178430348.20459805951805; Tue, 23 Mar 2021 12:02:58 -0700 (PDT) Received: from localhost ([::1]:42552 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lOmIo-0005nm-AO for importer@patchew.org; Tue, 23 Mar 2021 15:02:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53956) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lOlcv-000836-HP; Tue, 23 Mar 2021 14:19:41 -0400 Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]:46030) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lOlcs-0006ft-S5; Tue, 23 Mar 2021 14:19:37 -0400 Received: by mail-wm1-x336.google.com with SMTP id r10-20020a05600c35cab029010c946c95easo11387189wmq.4; Tue, 23 Mar 2021 11:19:32 -0700 (PDT) Received: from avogadro.redhat.com ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id u8sm24204412wrr.42.2021.03.23.11.19.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Mar 2021 11:19:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=OjfYXuvapzfoicvsPzenNs9Pa0X+2b/AgIrWbXMqX7I=; b=XE1onioODOjbotMesjy3DnzkyuZeiMlPjInEAOB1lULRLeGVNmQ7Nptau7jX4+aw/8 +Bg6HcqSjJ+btNWAxwW1wHyaWfoyYNKHD3GNMF+P1UfUlLHSpXs9Wedfv+1jlvW7cFo7 i/XhqNbUcWh0wGHo+EP0LyplKR6iOWrxXvwINjtQYAfPo3xVfULhU/06QA1Ogcth9kKz XhG/+Sw+eR8n7DskTSo2RSa4G2xtlTFMF1QWoh8Z8XclJ7xOORctY+DPevZD8IRMac9B DKFOyaaObIePO8btMpRJHXjgwIpJm0+a/L5PDWrzTiI8eTmEqnakeobRp5Q6BqoHwuGE edOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=OjfYXuvapzfoicvsPzenNs9Pa0X+2b/AgIrWbXMqX7I=; b=Oe9pw0Rr7BGhK8i7W5dZuk5npm/mHdAM5JxsrqZvKyVlfWLDIWR1fqjDd7oDpcNUfF 6xwE0c7ONMYv9gXEuX9PZBtE1ps0Nl5R+7LHG4Zd9tjADNgQhlaXUlAfxVAEgn2jPrhU A8k9liD+U+HghjJhL6Hd3nkasBN4RiGN1Y2EAwdr4gq3WnfT5l9EmtBSgeiWShDGceYw xWZOrzL3LWeRwQUBfTsdrlWtl9UfPyqTsSMz5BXxH8IZ4YT/Vo4E9TucjzzvSQC7kZho XiRQvfeqpOjPwZsI/ciuwPjoLXwKTfmJfdpS1VF4gcGD3GIOmoRiCWNp1j56ZCKKP5OG Ga4w== X-Gm-Message-State: AOAM530YE9/N/mkRJOsFjoAsw6blc5h5uCNnx1yb99Fa9vg1Qc+T6EaY v+UcGjV+9YgtHVN+Fl/bxJ9oGLAloWI= X-Google-Smtp-Source: ABdhPJz3Inp5OeqcnPQGzwnRC84XWK/r1h+YxAN8bkIRyPw3AjjDVkjh98rol02IDjzgYxhgfmKtXA== X-Received: by 2002:a1c:e041:: with SMTP id x62mr4485637wmg.95.1616523571229; Tue, 23 Mar 2021 11:19:31 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PATCH v2 2/5] qemu-iotests: allow passing unittest.main arguments to the test scripts Date: Tue, 23 Mar 2021 19:19:24 +0100 Message-Id: <20210323181928.311862-3-pbonzini@redhat.com> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210323181928.311862-1-pbonzini@redhat.com> References: <20210323181928.311862-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::336; envelope-from=paolo.bonzini@gmail.com; helo=mail-wm1-x336.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: eesposit@redhat.com, kwolf@redhat.com, vsementsov@virtuozzo.com, qemu-block@nongnu.org, mreitz@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Python test scripts that use unittest consist of multiple tests. unittest.main allows selecting which tests to run, but currently this is not possible because the iotests wrapper ignores sys.argv. unittest.main command line options also allow the user to pick the desired options for verbosity, failfast mode, etc. While "-d" is currently translated to "-v", it also enables extra debug output, and other options are not available at all. These command line options only work if the unittest.main testRunner argument is a type, rather than a TestRunner instance. Therefore, pass the class name and "verbosity" argument to unittest.main, and adjust for the different default warnings between TextTestRunner and unittest.main. Signed-off-by: Paolo Bonzini Reviewed-by: Vladimir Sementsov-Ogievskiy Tested-by: Emanuele Giuseppe Esposito --- tests/qemu-iotests/iotests.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py index 0521235030..c7915684ba 100644 --- a/tests/qemu-iotests/iotests.py +++ b/tests/qemu-iotests/iotests.py @@ -1308,12 +1308,16 @@ def __init__(self, stream: Optional[io.TextIOBase] = =3D None, resultclass=3Dresultclass, *args, **kwargs) =20 -def execute_unittest(debug=3DFalse): +def execute_unittest(argv: List[str], debug: bool=3D False): """Executes unittests within the calling module.""" =20 - verbosity =3D 2 if debug else 1 - runner =3D unittest.ReproducibleTestRunner(verbosity=3Dverbosity) - unittest.main(testRunner=3Drunner) + # Some tests have warnings, especially ResourceWarnings for unclosed + # files and sockets. Ignore them for now to ensure reproducibility of + # the test output. + unittest.main(argv=3Dargv, + testRunner=3DReproducibleTestRunner, + verbosity=3D2 if debug else 1, + warnings=3DNone if sys.warnoptions else 'ignore') =20 def execute_setup_common(supported_fmts: Sequence[str] =3D (), supported_platforms: Sequence[str] =3D (), @@ -1350,7 +1354,7 @@ def execute_test(*args, test_function=3DNone, **kwarg= s): =20 debug =3D execute_setup_common(*args, **kwargs) if not test_function: - execute_unittest(debug) + execute_unittest(sys.argv, debug) else: test_function() =20 --=20 2.30.1 From nobody Tue May 7 16:24:09 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1616526303; cv=none; d=zohomail.com; s=zohoarc; b=DMUu15ZLLvsXqzMTyHEqTx3yNdzmBCWj3jl3ZA70K/XkWR2fDihxuHzN1Nfnju9pruslrBdFZJJRiIVhwwERPMrnt3TeInsw1O3UEp45C0AaPKCklYawhaYJLQC8LiBhpm5LGIqMO5uvJu0HSgvVJRvEh0q1Y8Morv9QjDeRPvg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1616526303; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=jgTZhKhS2DWM3MMib2DER4FbfRHawRaIKc8lzpzBQ4c=; b=VjWaVafMQAX5nw4LeRW5leZiGeOmB5rYqL22s+vbC+Wrw/B/kTtPgKtl4Zwnvmcsf1CpzVrvHQtNB+eT0uu3vJfwq1AQVDgODYSYblnNKbK+GiZiHLTMoWWuujpkMTTu0wmzMTBkAufoMT5v5KEjuFYbg7tOPNvyBwJmAH2YjDM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1616526300655644.5476012732888; Tue, 23 Mar 2021 12:05:00 -0700 (PDT) Received: from localhost ([::1]:47522 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lOmKn-0008OY-Fr for importer@patchew.org; Tue, 23 Mar 2021 15:04:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53960) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lOlcw-00083N-Ib; Tue, 23 Mar 2021 14:19:42 -0400 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]:43647) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lOlct-0006gb-4v; Tue, 23 Mar 2021 14:19:37 -0400 Received: by mail-wm1-x32f.google.com with SMTP id u5-20020a7bcb050000b029010e9316b9d5so11387688wmj.2; Tue, 23 Mar 2021 11:19:33 -0700 (PDT) Received: from avogadro.redhat.com ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id u8sm24204412wrr.42.2021.03.23.11.19.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Mar 2021 11:19:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=jgTZhKhS2DWM3MMib2DER4FbfRHawRaIKc8lzpzBQ4c=; b=b9qU7jBmMnLvLf55jr+ZvdlrQm0zb46L7WQWQr3fappU30plvP3cnH/G0Li7/Zd7vB XQ5lDYsSzTraHoADwB0V0GkhdexjBVPlFXNtwd/VcQSsH+SdXOx4RrgfFLPtko9OSdZ1 O7kdBrVhAmcZ/DBsD8C8cjOPivZKBn36sS0P5Sk4RBtpUI5wesOXJOy3dnUXFIcxjS58 4aCOidkVjwsRrRcpY2XjQk50KI4X781qoBsQ3EyZYEobM3aGThrESym6bAUUPKG7NEiX Zk+EBToy6FZK86EV4zNEdhMX4EihdBHSoEB1mnojUUhuGG3s8jf6qeYGHJ7qix3PuvaL 0VJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=jgTZhKhS2DWM3MMib2DER4FbfRHawRaIKc8lzpzBQ4c=; b=JuFNtBC90GX1KUX54fdfHUcTtQTktPrDQ+npZshhgpyJ42oQln5kBq8lrQwLo5RWb9 h4x6GjMB+AeNCtNbwTZW5KddB+Vuodm5b/W0KkMymMeGHUNQfs28HS7bLC8Sni873F1X AYCQm97HxRkK8NLDzwKuEdnzTN4t5ZR3Zt2ntHmKs1iUD90sHuVZJCAMPc/v+tSNA7HD 7pmPXHdPq2J2OevxQ+JFF4SVZAxknfPVqot1FGKBvb9J7ZNx8HBKlCs+efQFylUR9Uwl F/bVNG3KK5ZVB50LF+Mmb42/tYlEYc0IG3OjXS6EeCs+400/jsQzKN3TvkxJJUbL196N ib9Q== X-Gm-Message-State: AOAM530D7QiGztWLJfUPZHLp9VwHR5Hn6frgTxYy64hgVgl9CESkgVUS Z3vz2COHx5ya4Par9Xld3kUwFEyofjo= X-Google-Smtp-Source: ABdhPJy+dX4c7fqKsKIFSYx05vuRxsPOWWORat4BSz+4aZa7Cs1Reck6yZn11fHvwiDB0EpPxb4Zlw== X-Received: by 2002:a1c:7e45:: with SMTP id z66mr4542117wmc.126.1616523572034; Tue, 23 Mar 2021 11:19:32 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PATCH v2 3/5] qemu-iotests: move command line and environment handling from TestRunner to TestEnv Date: Tue, 23 Mar 2021 19:19:25 +0100 Message-Id: <20210323181928.311862-4-pbonzini@redhat.com> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210323181928.311862-1-pbonzini@redhat.com> References: <20210323181928.311862-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32f; envelope-from=paolo.bonzini@gmail.com; helo=mail-wm1-x32f.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: eesposit@redhat.com, kwolf@redhat.com, vsementsov@virtuozzo.com, qemu-block@nongnu.org, mreitz@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" In the next patch, "check" will learn how to execute a test script without going through TestRunner. To enable this, keep only the text output and subprocess handling in the TestRunner; move into TestEnv the logic to prepare for running a subprocess. Reviewed-by: Vladimir Sementsov-Ogievskiy Signed-off-by: Paolo Bonzini Tested-by: Emanuele Giuseppe Esposito --- tests/qemu-iotests/testenv.py | 17 ++++++++++++++++- tests/qemu-iotests/testrunner.py | 14 +------------- 2 files changed, 17 insertions(+), 14 deletions(-) diff --git a/tests/qemu-iotests/testenv.py b/tests/qemu-iotests/testenv.py index 1fbec854c1..341a4af4e9 100644 --- a/tests/qemu-iotests/testenv.py +++ b/tests/qemu-iotests/testenv.py @@ -25,7 +25,7 @@ import random import subprocess import glob -from typing import Dict, Any, Optional, ContextManager +from typing import List, Dict, Any, Optional, ContextManager =20 =20 def isxfile(path: str) -> bool: @@ -74,6 +74,21 @@ class TestEnv(ContextManager['TestEnv']): 'CACHEMODE_IS_DEFAULT', 'IMGFMT_GENERIC', 'IMGOPTSSYN= TAX', 'IMGKEYSECRET', 'QEMU_DEFAULT_MACHINE', 'MALLOC_PERTU= RB_'] =20 + def prepare_subprocess(self, args: List[str]) -> Dict[str, str]: + if self.debug: + args.append('-d') + + with open(args[0], encoding=3D"utf-8") as f: + try: + if f.readline().rstrip() =3D=3D '#!/usr/bin/env python3': + args.insert(0, self.python) + except UnicodeDecodeError: # binary test? for future. + pass + + os_env =3D os.environ.copy() + os_env.update(self.get_env()) + return os_env + def get_env(self) -> Dict[str, str]: env =3D {} for v in self.env_variables: diff --git a/tests/qemu-iotests/testrunner.py b/tests/qemu-iotests/testrunn= er.py index 1fc61fcaa3..519924dc81 100644 --- a/tests/qemu-iotests/testrunner.py +++ b/tests/qemu-iotests/testrunner.py @@ -129,7 +129,6 @@ class TestRunner(ContextManager['TestRunner']): def __init__(self, env: TestEnv, makecheck: bool =3D False, color: str =3D 'auto') -> None: self.env =3D env - self.test_run_env =3D self.env.get_env() self.makecheck =3D makecheck self.last_elapsed =3D LastElapsedTime('.last-elapsed-cache', env) =20 @@ -243,18 +242,7 @@ def do_run_test(self, test: str) -> TestResult: silent_unlink(p) =20 args =3D [str(f_test.resolve())] - if self.env.debug: - args.append('-d') - - with f_test.open(encoding=3D"utf-8") as f: - try: - if f.readline().rstrip() =3D=3D '#!/usr/bin/env python3': - args.insert(0, self.env.python) - except UnicodeDecodeError: # binary test? for future. - pass - - env =3D os.environ.copy() - env.update(self.test_run_env) + env =3D self.env.prepare_subprocess(args) =20 t0 =3D time.time() with f_bad.open('w', encoding=3D"utf-8") as f: --=20 2.30.1 From nobody Tue May 7 16:24:09 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1616523765; cv=none; d=zohomail.com; s=zohoarc; b=Ag18oBIjj0JkQnS8e8Dw0Bs2GfLQXSsVK9PBXfx+WQaNbPSwpp9xb0PMesM/GRye4XZBc59e4UmPhjoSmY5uzkX/ULlp+3Vd4jk7Q/qOeInaJy+ygn1/4sVrwoxyxL1/CdDtF5fIvQaTovoYYvOsz3Eln/Ogmt0ltUV5icyNnFs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1616523765; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=uTL85snKqZD+x0TbRPkYuMyCQH1BBmhkWDzvtSAkqEU=; b=XM/U08poLhJSRwmqiPzOb0yhZhmQeWysC4TypZ67bWMwIFrbavB8GrDSoWuCGsJ7py3r/uLvghGkV3S1lVm3W3voQwGcm8fGQuIPWG8Ev0eFTbK3YEs/rH0nT764dA9449y+IBKdLb3Cl0UjN9ArRKwpd45zlMNrJ0WKbnA9y5U= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1616523765926784.2308090029169; Tue, 23 Mar 2021 11:22:45 -0700 (PDT) Received: from localhost ([::1]:42052 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lOlfu-0002Fv-Ks for importer@patchew.org; Tue, 23 Mar 2021 14:22:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53962) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lOlcw-00083O-Iq; Tue, 23 Mar 2021 14:19:44 -0400 Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]:46017) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lOlct-0006gh-4U; Tue, 23 Mar 2021 14:19:37 -0400 Received: by mail-wr1-x42d.google.com with SMTP id 61so21761704wrm.12; Tue, 23 Mar 2021 11:19:33 -0700 (PDT) Received: from avogadro.redhat.com ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id u8sm24204412wrr.42.2021.03.23.11.19.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Mar 2021 11:19:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=uTL85snKqZD+x0TbRPkYuMyCQH1BBmhkWDzvtSAkqEU=; b=gdImYuo9Dr8Cd/OLpVuQwFM47DUhW/hNQHZGKOcsGFQfuiiT5VNva2ZwzXlbyq/qjX sZ/jP0NnkPFaql3NJSQ4rZvCgYasczdXCQKrOk+gC5btLii2eVTavwMSbpveTv2Vjnv7 GKn+JhpL6rTXMDtj+gdC10WGhlzIWVor46GMHxQ9pL0KjRy9zFi87HmhWU6sCP09HqNc dyTtKD+DS9JhCVwD1wEo0usPL7vYJyW3nQobJpc0bnsg14Q+QtznHA29EGkOU8/v8oxs v1QhuE95GmM0Fce68eYfyyFbxDiXVJXc2Ya6oa9ack3fEsQjxXUOBv9IzO8yK0CjdqJ7 3ztA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=uTL85snKqZD+x0TbRPkYuMyCQH1BBmhkWDzvtSAkqEU=; b=NxvkVw8ptGTV6YWr4trZB4m/Uc5q6xtuM1QotGRJBp7dITzH7n/zu52C/PErGhpe3j jZH5r4tigI3hd+i/uFboVsGtHB1PeXDnEeIJ6I6c824ULoEaXo8aFh7DMr7VCAZ5l27L C+g+mxsqHY6s366uSry6Zy5aKOw4Q2PtLqwtram54CE58D6SgmZoxJQISjW3hhV0Xw9E JYlXb55N7b5FSqODEvQN6YLgqQF6QAsVBu1mK387q2/OZCrbv8HXKEIqohWiZij8j2EH t9UlffQ7tGk/GHlb00CwHYRnFgkgg2BJLTBax+VA494GFBc9CXHPAExJ4T/NC6nJnylH Joug== X-Gm-Message-State: AOAM530cmw3tqkwzaMWTfBx0PzeBX5hZfDOzI7/OV5sczRkYmA4q3Kpg HV/07PcZ8ToFO71lBuSfyK/pwDIPO/o= X-Google-Smtp-Source: ABdhPJzqsXFRK1Nv685GgY3NU7h2byJMenuXNp00h+y58FOWIQYj7aCi6d5UjsFkPLu/IZewv2rOlg== X-Received: by 2002:a5d:6443:: with SMTP id d3mr5367171wrw.292.1616523572810; Tue, 23 Mar 2021 11:19:32 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PATCH v2 4/5] qemu-iotests: let "check" spawn an arbitrary test command Date: Tue, 23 Mar 2021 19:19:26 +0100 Message-Id: <20210323181928.311862-5-pbonzini@redhat.com> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210323181928.311862-1-pbonzini@redhat.com> References: <20210323181928.311862-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::42d; envelope-from=paolo.bonzini@gmail.com; helo=mail-wr1-x42d.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: eesposit@redhat.com, kwolf@redhat.com, vsementsov@virtuozzo.com, qemu-block@nongnu.org, mreitz@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Right now there is no easy way for "check" to print a reproducer command. Because such a reproducer command line would be huge, we can instead teach check to start a command of our choice. This can be for example a Python unit test with arguments to only run a specific subtest. Move the trailing empty line to print_env(), since it always looks better and one caller was not adding it. Signed-off-by: Paolo Bonzini Reviewed-by: Vladimir Sementsov-Ogievskiy Tested-by: Emanuele Giuseppe Esposito --- tests/qemu-iotests/check | 15 ++++++++++++++- tests/qemu-iotests/testenv.py | 3 ++- tests/qemu-iotests/testrunner.py | 1 - 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/tests/qemu-iotests/check b/tests/qemu-iotests/check index d1c87ceaf1..478d74e509 100755 --- a/tests/qemu-iotests/check +++ b/tests/qemu-iotests/check @@ -19,6 +19,7 @@ import os import sys import argparse +import shutil from findtests import TestFinder from testenv import TestEnv from testrunner import TestRunner @@ -101,7 +102,7 @@ def make_argparser() -> argparse.ArgumentParser: 'rerun failed ./check command, starting from the ' 'middle of the process.') g_sel.add_argument('tests', metavar=3D'TEST_FILES', nargs=3D'*', - help=3D'tests to run') + help=3D'tests to run, or "--" followed by a command= ') =20 return p =20 @@ -114,6 +115,18 @@ if __name__ =3D=3D '__main__': imgopts=3Dargs.imgopts, misalign=3Dargs.misalign, debug=3Dargs.debug, valgrind=3Dargs.valgrind) =20 + if len(sys.argv) > 1 and sys.argv[-len(args.tests)-1] =3D=3D '--': + if not args.tests: + sys.exit("missing command after '--'") + cmd =3D args.tests + env.print_env() + exec_path =3D shutil.which(cmd[0]) + if exec_path is None: + sys.exit('command not found: ' + cmd[0]) + cmd[0] =3D exec_path + full_env =3D env.prepare_subprocess(cmd) + os.execve(cmd[0], cmd, full_env) + testfinder =3D TestFinder(test_dir=3Denv.source_iotests) =20 groups =3D args.groups.split(',') if args.groups else None diff --git a/tests/qemu-iotests/testenv.py b/tests/qemu-iotests/testenv.py index 341a4af4e9..6767eeeb25 100644 --- a/tests/qemu-iotests/testenv.py +++ b/tests/qemu-iotests/testenv.py @@ -283,7 +283,8 @@ def print_env(self) -> None: PLATFORM -- {platform} TEST_DIR -- {TEST_DIR} SOCK_DIR -- {SOCK_DIR} -SOCKET_SCM_HELPER -- {SOCKET_SCM_HELPER}""" +SOCKET_SCM_HELPER -- {SOCKET_SCM_HELPER} +""" =20 args =3D collections.defaultdict(str, self.get_env()) =20 diff --git a/tests/qemu-iotests/testrunner.py b/tests/qemu-iotests/testrunn= er.py index 519924dc81..2f56ac545d 100644 --- a/tests/qemu-iotests/testrunner.py +++ b/tests/qemu-iotests/testrunner.py @@ -316,7 +316,6 @@ def run_tests(self, tests: List[str]) -> bool: =20 if not self.makecheck: self.env.print_env() - print() =20 test_field_width =3D max(len(os.path.basename(t)) for t in tests) = + 2 =20 --=20 2.30.1 From nobody Tue May 7 16:24:09 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1616526392; cv=none; d=zohomail.com; s=zohoarc; b=Txe84hcYbmm0GbGWSEXE0YolCeWsxox1H6RRzPDWyPDUEYaBuC/gLcSZsHiqtS2o65DH/Lv9x9espLButiz+TyWuT+p5nzjRtHvZt9q2J57wnMaEnxHL85BHi+jC6tWRWOCprvt+791ElPQPR/QJOScy0/KfRdx7ECrTFXn9YJA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1616526392; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=StBk6nmiw+EsZlpW2CZlR4Ksx6/vUMF0JabBotCAztI=; b=JHIGKGVzRowWVGJ7V+CB4t/6Dxbr3rIZUsX8v9+EGKfvK/ANRz1BzN9QhxYX6axAet0cjNepm37cpuBu3yXaKPPWPQ5zAh97qnx6+nyTwoZAGV+0OWOOtR+RvhoHHem4q01HsriE7ohX5WD7XNejSNi0HWv3sumK5jIJtPpaHM4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 161652639298269.92797368724973; Tue, 23 Mar 2021 12:06:32 -0700 (PDT) Received: from localhost ([::1]:50750 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lOmMJ-0001nQ-P5 for importer@patchew.org; Tue, 23 Mar 2021 15:06:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53964) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lOlcw-00083P-JA; Tue, 23 Mar 2021 14:19:44 -0400 Received: from mail-wr1-x431.google.com ([2a00:1450:4864:20::431]:38663) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lOlct-0006gq-6e; Tue, 23 Mar 2021 14:19:37 -0400 Received: by mail-wr1-x431.google.com with SMTP id z2so21808309wrl.5; Tue, 23 Mar 2021 11:19:34 -0700 (PDT) Received: from avogadro.redhat.com ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id u8sm24204412wrr.42.2021.03.23.11.19.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Mar 2021 11:19:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=StBk6nmiw+EsZlpW2CZlR4Ksx6/vUMF0JabBotCAztI=; b=lcUp/6ToYNoI8njcCq4Bbf3sOjStl1j7HHy9MHJnR7w2ydZ6DCDgsiugpsbQsZizeU AM+aayBKTOBPq+SJWXjQEKqpC+EnoTj6hwIQeQQVeTafrKVZKyHlJH96B/ySHXD1R18Z xtqS5bylqCOmj5Fvz8b+v8e/gJKnzt1eicUvFjr0XBmlhqG1BM8PVwlo95zNeu+EOLvN mGVwZsRQHP1qTgr+qosTo5mCRLAjV6XXe3xOQbgLKG1D17lIpSWIps0x8xemhRjg5HZO 1qxK5JvVknFajaMOBvvwuPCI/Wxe2crd4NtwwCLmn/mzo3wY5D0xpBCWYtWEmlOQIO9u qS2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=StBk6nmiw+EsZlpW2CZlR4Ksx6/vUMF0JabBotCAztI=; b=baRSQtFM4ed682PuGgpQA1qMTZYKZyt4i3pxTUX2N8BOzT1C5+DCPO0gu9MVCT3cSj ZLo0psOA42Fq+ShQScf05nZ0zcwOp3pnX1NxecrrEwEqTfxidQPaGFWRK3S1H/OMRaPA VBuetP8NN3S3gESRFqtIxkxIdQBQugW9lWUwLasP/EjiXgL+iAYFBA6zVewoYCYrgIYd x1C3uiTkXtIZ21BqABuZ15Ug6NPvN+UAsAjfozo+5szXdTtFuz603ONYDUSz7/nJR6BT m0h0rSuZVjOvxoixyLG7ck4TWwsomz7DjiJZuHVyNt793DM3GIlQssmmmrx6MN0BspjQ 1+CA== X-Gm-Message-State: AOAM530ZkeUI5nO4pnhQEXW4rtPiG8uj2GkJ51gbElIM+3OVfikegKt/ KSrD0j3sXxbIjbWjo5WEN+8OXhJdE6E= X-Google-Smtp-Source: ABdhPJwTav+gFCq1m+3KmwjaD/qfvGxsxUEm3b4BQDV1zAi0oduQlJpVM+isrN4Xy5cu8VAf+edOdQ== X-Received: by 2002:a5d:4e52:: with SMTP id r18mr5616063wrt.28.1616523573594; Tue, 23 Mar 2021 11:19:33 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PATCH v2 5/5] qemu-iotests: fix case of SOCK_DIR already in the environment Date: Tue, 23 Mar 2021 19:19:27 +0100 Message-Id: <20210323181928.311862-6-pbonzini@redhat.com> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210323181928.311862-1-pbonzini@redhat.com> References: <20210323181928.311862-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::431; envelope-from=paolo.bonzini@gmail.com; helo=mail-wr1-x431.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: eesposit@redhat.com, kwolf@redhat.com, vsementsov@virtuozzo.com, qemu-block@nongnu.org, mreitz@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Due to a typo, in this case the SOCK_DIR was not being created. Reviewed-by: Vladimir Sementsov-Ogievskiy Signed-off-by: Paolo Bonzini Tested-by: Emanuele Giuseppe Esposito --- tests/qemu-iotests/testenv.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/qemu-iotests/testenv.py b/tests/qemu-iotests/testenv.py index 6767eeeb25..169268f61a 100644 --- a/tests/qemu-iotests/testenv.py +++ b/tests/qemu-iotests/testenv.py @@ -120,7 +120,7 @@ def init_directories(self) -> None: try: self.sock_dir =3D os.environ['SOCK_DIR'] self.tmp_sock_dir =3D False - Path(self.test_dir).mkdir(parents=3DTrue, exist_ok=3DTrue) + Path(self.sock_dir).mkdir(parents=3DTrue, exist_ok=3DTrue) except KeyError: self.sock_dir =3D tempfile.mkdtemp() self.tmp_sock_dir =3D True --=20 2.30.1