{"id":2198123,"url":"http://patchwork.ozlabs.org/api/1.0/patches/2198123/?format=json","project":{"id":14,"url":"http://patchwork.ozlabs.org/api/1.0/projects/14/?format=json","name":"QEMU Development","link_name":"qemu-devel","list_id":"qemu-devel.nongnu.org","list_email":"qemu-devel@nongnu.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20260219115530.2019498-8-vsementsov@yandex-team.ru>","date":"2026-02-19T11:55:28","name":"[v11,7/8] tests/functional: add skipWithoutSudo() decorator","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"0f8e209904d3e63fe210d1aff53791346e214754","submitter":{"id":84116,"url":"http://patchwork.ozlabs.org/api/1.0/people/84116/?format=json","name":"Vladimir Sementsov-Ogievskiy","email":"vsementsov@yandex-team.ru"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/qemu-devel/patch/20260219115530.2019498-8-vsementsov@yandex-team.ru/mbox/","series":[{"id":492667,"url":"http://patchwork.ozlabs.org/api/1.0/series/492667/?format=json","date":"2026-02-19T11:55:27","name":"virtio-net: live-TAP local migration","version":11,"mbox":"http://patchwork.ozlabs.org/series/492667/mbox/"}],"check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/2198123/checks/","tags":{},"headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@legolas.ozlabs.org","Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (1024-bit key;\n unprotected) header.d=yandex-team.ru header.i=@yandex-team.ru\n header.a=rsa-sha256 header.s=default header.b=FKTCddc1;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org\n (client-ip=209.51.188.17; helo=lists.gnu.org;\n envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n receiver=patchwork.ozlabs.org)","mail-nwsmtp-smtp-corp-main-34.sas.yp-c.yandex.net;\n dkim=pass header.i=@yandex-team.ru"],"Received":["from lists.gnu.org (lists.gnu.org [209.51.188.17])\n\t(using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fGsLd2LqYz1xpY\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 19 Feb 2026 22:57:13 +1100 (AEDT)","from localhost ([::1] helo=lists1p.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.90_1)\n\t(envelope-from <qemu-devel-bounces@nongnu.org>)\n\tid 1vt2dN-0004Po-1M; Thu, 19 Feb 2026 06:55:53 -0500","from eggs.gnu.org ([2001:470:142:3::10])\n by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)\n (Exim 4.90_1) (envelope-from <vsementsov@yandex-team.ru>)\n id 1vt2dG-0004OK-9h\n for qemu-devel@nongnu.org; Thu, 19 Feb 2026 06:55:47 -0500","from forwardcorp1b.mail.yandex.net ([178.154.239.136])\n by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)\n (Exim 4.90_1) (envelope-from <vsementsov@yandex-team.ru>)\n id 1vt2dD-0006EY-Ez\n for qemu-devel@nongnu.org; Thu, 19 Feb 2026 06:55:46 -0500","from mail-nwsmtp-smtp-corp-main-34.sas.yp-c.yandex.net\n (mail-nwsmtp-smtp-corp-main-34.sas.yp-c.yandex.net\n [IPv6:2a02:6b8:c24:fa2:0:640:41ee:0])\n by forwardcorp1b.mail.yandex.net (Yandex) with ESMTPS id B841A808B7;\n Thu, 19 Feb 2026 14:55:41 +0300 (MSK)","from vsementsov-lin (unknown [2a02:6bf:8080:192::1:26])\n by mail-nwsmtp-smtp-corp-main-34.sas.yp-c.yandex.net (smtpcorp/Yandex) with\n ESMTPSA id VtZwpM4A6uQ0-URNphVNs; Thu, 19 Feb 2026 14:55:41 +0300"],"Precedence":"bulk","X-Yandex-Fwd":"1","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex-team.ru;\n s=default; t=1771502141;\n bh=FtthCjv4jZclLpHuxzc/o+cbJSRbpvzPto3AWwLXoAM=;\n h=Cc:Message-ID:References:Date:In-Reply-To:Subject:To:From;\n b=FKTCddc1za7lxH+MHZRflbpxV0KF69YpDikJLO+C12jLWpExHF+aVGCDGPfeiBNZc\n /6YGEL4bRE4uU9ttN4F3SSzgh714qgUyJ/aRN+jxHILHJKNVi0wyngxRHle80IB/6k\n ZTuH24LsKsqgGqz5b7Nqwj4F9KdOPxde5OJyY/7o=","From":"Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>","To":"jasowang@redhat.com,\n\tmst@redhat.com","Cc":"thuth@redhat.com, armbru@redhat.com, eblake@redhat.com, farosas@suse.de,\n peterx@redhat.com, zhao1.liu@intel.com, wangyanan55@huawei.com,\n philmd@linaro.org, marcel.apfelbaum@gmail.com, eduardo@habkost.net,\n davydov-max@yandex-team.ru, qemu-devel@nongnu.org, vsementsov@yandex-team.ru,\n yc-core@yandex-team.ru, leiyang@redhat.com, raphael.s.norwitz@gmail.com,\n bchaney@akamai.com,\n =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= <berrange@redhat.com>","Subject":"[PATCH v11 7/8] tests/functional: add skipWithoutSudo() decorator","Date":"Thu, 19 Feb 2026 14:55:28 +0300","Message-ID":"<20260219115530.2019498-8-vsementsov@yandex-team.ru>","X-Mailer":"git-send-email 2.52.0","In-Reply-To":"<20260219115530.2019498-1-vsementsov@yandex-team.ru>","References":"<20260219115530.2019498-1-vsementsov@yandex-team.ru>","MIME-Version":"1.0","Content-Type":"text/plain; charset=UTF-8","Content-Transfer-Encoding":"8bit","Received-SPF":"pass client-ip=178.154.239.136;\n envelope-from=vsementsov@yandex-team.ru; helo=forwardcorp1b.mail.yandex.net","X-Spam_score_int":"-20","X-Spam_score":"-2.1","X-Spam_bar":"--","X-Spam_report":"(-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,\n DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,\n RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001,\n RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001,\n SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no","X-Spam_action":"no action","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.29","List-Id":"qemu development <qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<https://lists.nongnu.org/archive/html/qemu-devel>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n <mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org"},"content":"To be used in the next commit: that would be a test for TAP\nnetworking, and it will need to setup TAP device.\n\nSigned-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>\nReviewed-by: Daniel P. Berrangé <berrange@redhat.com>\nReviewed-by: Thomas Huth <thuth@redhat.com>\nTested-by: Lei Yang <leiyang@redhat.com>\nReviewed-by: Maksim Davydov <davydov-max@yandex-team.ru>\n---\n tests/functional/qemu_test/decorators.py | 16 ++++++++++++++++\n 1 file changed, 16 insertions(+)","diff":"diff --git a/tests/functional/qemu_test/decorators.py b/tests/functional/qemu_test/decorators.py\nindex fcf236ecfd..aa135acc78 100644\n--- a/tests/functional/qemu_test/decorators.py\n+++ b/tests/functional/qemu_test/decorators.py\n@@ -6,6 +6,7 @@\n import os\n import platform\n import resource\n+import subprocess\n from unittest import skipIf, skipUnless\n \n from .cmd import which\n@@ -177,3 +178,18 @@ def skipLockedMemoryTest(locked_memory):\n         ulimit_memory == resource.RLIM_INFINITY or ulimit_memory >= locked_memory * 1024,\n         f'Test required {locked_memory} kB of available locked memory',\n     )\n+\n+'''\n+Decorator to skip execution of a test if passwordless\n+sudo command is not available.\n+'''\n+def skipWithoutSudo():\n+    proc = subprocess.run([\"sudo\", \"-n\", \"/bin/true\"],\n+                          stdin=subprocess.PIPE,\n+                          stdout=subprocess.PIPE,\n+                          stderr=subprocess.STDOUT,\n+                          universal_newlines=True,\n+                          check=False)\n+\n+    return skipUnless(proc.returncode == 0,\n+                      f'requires password-less sudo access: {proc.stdout}')\n","prefixes":["v11","7/8"]}