From nobody Mon Sep 21 18:56:55 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=patchew-devel-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=patchew-devel-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1646645850; cv=none; d=zohomail.com; s=zohoarc; b=PSQEFobxCooySxR5tRKKQqVhNhca2v76vSIUspzygjt00OzIqQsWDDSnkk49Slrtz0idMClI6r+T4JORVlPiDlLDwc5p+yU5GacaOOnbJzKCdk/CqXTjx2KY9jJOm0TJLPvb5I2xlbP+NqO681+HRxc12mlFCAb51GoRjrXBCo4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1646645850; h=Content-Type:Content-Transfer-Encoding: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=89PKzIA1tcVjoUTlWpcj3caGf5znCXoQDVZuHTEJcDw=; b=TKPWtB8myu+8CJtTD677QuVICgUKAZtKb5TGAWyRPQfqbCg9ORWWoCm88x8ghax3h8GDC/P/fN48XfIpZqEOi55uVHqZbu32qWSLqQ5rqqvYiuGEhwgvnF+ArRFY98X+Lqmgi5NxV2BEcZXKcoqdhXMnUCQh3qTtCT3BwUAU6uo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=patchew-devel-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1646645850657214.9392380320537; Mon, 7 Mar 2022 01:37:30 -0800 (PST) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-385-vMtmmYucN3qlKGpGCMmTsQ-1; Mon, 07 Mar 2022 04:37:26 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 92BC6801597; Mon, 7 Mar 2022 09:37:26 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8ABB7C0809A; Mon, 7 Mar 2022 09:37:26 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id E71E31931BE9; Mon, 7 Mar 2022 09:37:25 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 661571931BDD for ; Mon, 7 Mar 2022 09:37:24 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 412811466C42; Mon, 7 Mar 2022 09:37:24 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast09.extmail.prod.ext.rdu2.redhat.com [10.11.55.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 3D48C1466C41 for ; Mon, 7 Mar 2022 09:37:24 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 23B602A59552 for ; Mon, 7 Mar 2022 09:37:24 +0000 (UTC) Received: from mail-ed1-f53.google.com (mail-ed1-f53.google.com [209.85.208.53]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-633-jDItC2xbOvO7SjazoVSk_g-1; Mon, 07 Mar 2022 04:37:22 -0500 Received: by mail-ed1-f53.google.com with SMTP id h13so6839851ede.5 for ; Mon, 07 Mar 2022 01:37:22 -0800 (PST) Received: from avogadro.lan ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id g16-20020a170906521000b006d58773e992sm4524340ejm.188.2022.03.07.01.37.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Mar 2022 01:37:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1646645849; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=89PKzIA1tcVjoUTlWpcj3caGf5znCXoQDVZuHTEJcDw=; b=hgTjirZrx38aNsxksSGWfYmSSgp0F+B4kpXKmaeCu3whiQfnBZyGRa1UmAW3Pdxs+EPZdf A6UQVYLV9CE0+WEV1kesfAzip1BD7HSMC4Z5suwRjIgg1iO8iA9sepJG2KAQzmJPWcrkPk dte1lBUrlu/RyQlbrGl25Tg7jHLHOE8= X-MC-Unique: vMtmmYucN3qlKGpGCMmTsQ-1 X-Original-To: patchew-devel@listman.corp.redhat.com X-MC-Unique: jDItC2xbOvO7SjazoVSk_g-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=epy9gUIO9eTSpPUC55lAlxlXYP8Z7+klCSXD4h2KVYU=; b=agbEGCu3wLgMn2zMc/A4zt2mSG3OAwRsTCiabMKHSRycFUgSMofLfdyALPcsJqzTxI wD2ocC/pFd+S4PkiogEVG1msWtZGbBU8L4sr3SSj9/MoRB2E0RCYrta675Gu0TCMe4HE tFQFBmrvaKX5/7XuInHaGAUu2++Fjwm+jbvz8f8BUgtsGLTRKEURhJRfIsrbiLJobBh5 8LS/KXndRapW/WtZ3RMtNNumOcb7gg7Lxl6IoWC2BxBomdl4u4++tkwCThhRrpKi9F41 DE91ebbjrO41vpBwAa41R97J4kbHRs7Qu95+Y8+XW8E/uV8TMAMx5nNJnru/35wxcq/G PnpQ== X-Gm-Message-State: AOAM5310Rv+m2T5CALMFYF+7aJjzD3OWX4vyK3joo5YjdnsJgJx7OTPR EoQRcXhMJ0zoO3eT2gxSS6ka36Q38J4= X-Google-Smtp-Source: ABdhPJwp/mwDwKmQO8QLRqSGUNYCrM/BGECDFlow2T4kc2fj4YTAimBSTa7kptJwmR+EV7haOl5C4w== X-Received: by 2002:a50:d4d2:0:b0:410:9fa2:60d6 with SMTP id e18-20020a50d4d2000000b004109fa260d6mr10404903edj.35.1646645841403; Mon, 07 Mar 2022 01:37:21 -0800 (PST) From: Paolo Bonzini To: patchew-devel@redhat.com Date: Mon, 7 Mar 2022 10:37:17 +0100 Message-Id: <20220307093719.544203-2-pbonzini@redhat.com> In-Reply-To: <20220307093719.544203-1-pbonzini@redhat.com> References: <20220307093719.544203-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 2.85 on 10.11.54.7 Subject: [Patchew-devel] [PATCH 1/3] test_import: actually test the project update command X-BeenThere: patchew-devel@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Patchew development and discussion list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: patchew-devel-bounces@redhat.com Sender: "Patchew-devel" X-Scanned-By: MIMEDefang 2.85 on 10.11.54.8 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=patchew-devel-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1646645852675100009 Content-Type: text/plain; charset="utf-8" Apply a patch and check that the message-id is reflected in the headers and matched in the database. Signed-off-by: Paolo Bonzini --- tests/patchewtest.py | 16 ++++++++-------- tests/test_import.py | 9 ++++++++- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/tests/patchewtest.py b/tests/patchewtest.py index ca1975a..4c30768 100644 --- a/tests/patchewtest.py +++ b/tests/patchewtest.py @@ -73,25 +73,25 @@ class PatchewTestCase(dj_test.LiveServerTestCase): user.save() return user =20 - def cli(self, argv): - return self.do_cli(False, argv) + def cli(self, argv, cwd=3DNone): + return self.do_cli(False, argv, cwd=3Dcwd) =20 - def cli_debug(self, argv): - return self.do_cli(True, argv) + def cli_debug(self, argv, cwd=3DNone): + return self.do_cli(True, argv, cwd=3Dcwd) =20 - def do_cli(self, debug, argv): + def do_cli(self, debug, argv, cwd=3DNone): """Run patchew-cli command and return (retcode, stdout, stderr)""" dbgopt =3D "-d" if debug else "-D" cmd =3D [PATCHEW_CLI, dbgopt, "-s", self.live_server_url] + argv - p =3D subprocess.Popen(cmd, stdout=3Dsubprocess.PIPE, stderr=3Dsub= process.PIPE) + p =3D subprocess.Popen(cmd, stdout=3Dsubprocess.PIPE, stderr=3Dsub= process.PIPE, cwd=3Dcwd) a, b =3D p.communicate() a =3D a.decode("utf-8") b =3D b.decode("utf-8") return p.returncode, a.strip(), b.strip() =20 - def check_cli(self, args, rc=3D0, stdout=3DNone, stderr=3DNone): + def check_cli(self, args, rc=3D0, stdout=3DNone, stderr=3DNone, cwd=3D= None): assert isinstance(args, list) - r, a, b =3D self.cli(args) + r, a, b =3D self.cli(args, cwd=3Dcwd) self.assertEqual( r, rc, diff --git a/tests/test_import.py b/tests/test_import.py index 1dbf16e..d6c57e4 100755 --- a/tests/test_import.py +++ b/tests/test_import.py @@ -134,7 +134,14 @@ class UnprivilegedImportTest(ImportTest): repo =3D self.create_git_repo() p.git =3D repo p.save() - self.check_cli(["project", "update"]) + + self.cli_import("0013-foo-patch.mbox.gz") + self.check_cli(["apply", "id:20160628014747.20971-1-famz@redhat.co= m"], cwd=3Drepo) + s =3D Message.objects.series_heads()[0] + self.assertEqual(s.is_merged, False) + self.check_cli(["project", "update"], cwd=3Drepo) + s =3D Message.objects.series_heads()[0] + self.assertEqual(s.is_merged, True) =20 =20 if __name__ =3D=3D "__main__": --=20 2.34.1 _______________________________________________ Patchew-devel mailing list Patchew-devel@redhat.com https://listman.redhat.com/mailman/listinfo/patchew-devel