From nobody Fri Apr 19 01:11:22 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=patchew-devel-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=patchew-devel-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1534580996741940.4869848227274; Sat, 18 Aug 2018 01:29:56 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.26]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 44FA73086253; Sat, 18 Aug 2018 08:29:55 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 3518D309128B; Sat, 18 Aug 2018 08:29:55 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 2A0D64BB78; Sat, 18 Aug 2018 08:29:54 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w7I8TrBL011987 for ; Sat, 18 Aug 2018 04:29:53 -0400 Received: by smtp.corp.redhat.com (Postfix) id 960363790; Sat, 18 Aug 2018 08:29:53 +0000 (UTC) Received: from mx1.redhat.com (ext-mx13.extmail.prod.ext.phx2.redhat.com [10.5.110.42]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8D13917C39 for ; Sat, 18 Aug 2018 08:29:50 +0000 (UTC) Received: from mail-wm0-f67.google.com (mail-wm0-f67.google.com [74.125.82.67]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0270D308212F for ; Sat, 18 Aug 2018 08:29:49 +0000 (UTC) Received: by mail-wm0-f67.google.com with SMTP id o18-v6so9332966wmc.0 for ; Sat, 18 Aug 2018 01:29:48 -0700 (PDT) Received: from donizetti.lan (dynamic-adsl-78-12-184-244.clienti.tiscali.it. [78.12.184.244]) by smtp.gmail.com with ESMTPSA id t4-v6sm6672784wrb.45.2018.08.18.01.29.46 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 18 Aug 2018 01:29:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:date:message-id; bh=sByP7YFJN5ecTxRoflI2lDIu1aaNy3mLwndbeoPFBWA=; b=RNOKEYI6vyLKLCT3O4TXjhY7lt0eFYLUVri5MvlruScyIv02OhbE8rHiVtFe4hXpTu zqOfn9ubqlMQ65uPUAliEfw7L/ppH311DBNEjXPluoNP/NP3quyCYU/s6jgeSDZFfjCF AHFZn2X0Bsi1dIZutl6AuVVCOSrVy4OONmJoJckf+aiyAvp/W18iRmtyb1TW+mYhlLC+ pMilPNbBAUKBjYEDgAA6b1sXTQ9j55S2A/8m9jN37UnO3pwb1hutdRMfU/LV6pG4w8oe x/aNpjblsv1epDNs0DGybEXBYLBGP898sV+gjrVScLfpQptNUQxjEo6CtebDoCJEhQ9R 3VNQ== 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:subject:date:message-id; bh=sByP7YFJN5ecTxRoflI2lDIu1aaNy3mLwndbeoPFBWA=; b=tzQIERx82xjJVrvvRt36gJEUXBGXhxQy89nE3VblNTaQNdzkE7aEzMINQ3vtEoFFZE +MrKIl0NjkKH/ugH5Drio1osdGTWR0Ke9sZHldxPcSntpOP/t3DDjH6g6YMGYagwmMDt E442/RHfz0CFfDDjgi9Sq5NugHQqgrXwkRsxaAst5kc0+WKWPOjNTZzVkR9KNtfaBVsG B8Th22azrDPFmcOnzyjh9+vXJmmGdMZ2MnVNFhE5a82d2cF7bEdw56cBvzMcTTwVzeCN 39sv5zpzRCo/MjgFopZ94tC3qCeS/OdDS5d9eDbT8vu/mtN8dLal915XYs2I1kSzl5rz ZE4g== X-Gm-Message-State: AOUpUlFaiwzOPuj2LcZE8MclYQ0rS6E6bKevYTVycvQF27dX/oh2M5+E A9wPpFeRFSdmlk3R+Hf/A4XkQPPE X-Google-Smtp-Source: AA+uWPzAiSSDECFfKGQF9J60hex0NnGVLBU40D7Y/+3WoGX0/6eMB0iRqza6ANDo7p87MB4wUHjjZQ== X-Received: by 2002:a1c:5f82:: with SMTP id t124-v6mr21074181wmb.14.1534580987414; Sat, 18 Aug 2018 01:29:47 -0700 (PDT) From: Paolo Bonzini To: patchew-devel@redhat.com Date: Sat, 18 Aug 2018 10:29:46 +0200 Message-Id: <20180818082946.15429-1-pbonzini@redhat.com> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.42]); Sat, 18 Aug 2018 08:29:49 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.42]); Sat, 18 Aug 2018 08:29:49 +0000 (UTC) for IP:'74.125.82.67' DOMAIN:'mail-wm0-f67.google.com' HELO:'mail-wm0-f67.google.com' FROM:'paolo.bonzini@gmail.com' RCPT:'' X-RedHat-Spam-Score: -0.028 (DKIM_SIGNED, DKIM_VALID, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_PASS) 74.125.82.67 mail-wm0-f67.google.com 74.125.82.67 mail-wm0-f67.google.com X-RedHat-Possible-Forgery: Paolo Bonzini X-Scanned-By: MIMEDefang 2.84 on 10.5.110.42 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: patchew-devel@redhat.com Subject: [Patchew-devel] [PATCH] patchew-cli: tester: add subcommand to print capabilities of the current host X-BeenThere: patchew-devel@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Patchew development and discussion list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: patchew-devel-bounces@redhat.com Errors-To: patchew-devel-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.26 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.49]); Sat, 18 Aug 2018 08:29:55 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDMRC_0 RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" This can be useful for debugging. Signed-off-by: Paolo Bonzini --- patchew-cli | 16 +++++++++++++--- tests/test_testing.py | 8 ++++++++ 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/patchew-cli b/patchew-cli index f4539a7..c67abd5 100755 --- a/patchew-cli +++ b/patchew-cli @@ -446,6 +446,8 @@ class TesterCommand(SubCommand): want_argv =3D True =20 def arguments(self, parser): + parser.add_argument("--print-capabilities", action=3D"store_true", + help=3D"print capabilities for the current mac= hine") parser.add_argument("--singleton", "-S", action=3D"store_true", help=3D"quit if another singleton mode tester = is running") parser.add_argument("--project", "-p", required=3DTrue, @@ -591,14 +593,22 @@ class TesterCommand(SubCommand): =20 def do(self, args, argv): # Make sure git works + projects =3D [x.strip() for x in args.project.split(",") if len(x.= strip())] + if not projects: + raise Exception("No project specified") + if args.print_capabilities: + if len(projects) > 1: + print("Only one project is allowed for --print-capabilitie= s") + return 1 + caps =3D self._refresh_capabilities(projects[0], args.name) + for i in caps: + print(i) + return 0 if args.singleton: self._check_singleton() subprocess.check_output(["git", "version"]) count =3D 0 cap_refresh =3D 10 - projects =3D [x.strip() for x in args.project.split(",") if len(x.= strip())] - if not projects: - raise Exception("No project specified") capabilities =3D {} while True: progress =3D False diff --git a/tests/test_testing.py b/tests/test_testing.py index 5b6420a..c9452a4 100755 --- a/tests/test_testing.py +++ b/tests/test_testing.py @@ -242,6 +242,14 @@ class TesterTest(PatchewTestCase): cwd=3Dself.repo).decode() p.set_property("git.head", head) =20 + def test_print_capability(self): + self.cli_login() + out, err =3D self.check_cli(["tester", "-p", "ALLOW", "--print-cap= abilities"]) + self.assertEqual(out, 'allow') + out, err =3D self.check_cli(["tester", "-p", "DENY", "--print-capa= bilities"]) + self.assertEqual(out, '') + self.cli_logout() + def test_tester(self): self.cli_login() out, err =3D self.check_cli(["tester", "-p", "QEMU,UMEQ,ALLOW,DENY= ", --=20 2.17.1 _______________________________________________ Patchew-devel mailing list Patchew-devel@redhat.com https://www.redhat.com/mailman/listinfo/patchew-devel