From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.openvz.org (unknown [69.168.225.77]) by lore.virtuozzo.com (Postfix) with ESMTPS id 8834C803D5 for ; Wed, 2 Sep 2026 14:58:48 +0000 (UTC) Received: from mail.openvz.org (localhost [127.0.0.1]) by mail.openvz.org (8.14.4/8.14.4) with ESMTP id 682EvWIS024293; Wed, 2 Sep 2026 17:57:34 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 682EvWIS024293 Authentication-Results: mail.openvz.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=virtuozzo.com header.i=@virtuozzo.com header.b="nAde+coL" Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by mail.openvz.org (8.14.4/8.14.4) with ESMTP id 682EvUpf024289 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=FAIL) for ; Wed, 2 Sep 2026 17:57:30 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 682EvUpf024289 Received: by mail-wm1-f71.google.com with SMTP id 5b1f17b1804b1-49cc954a3edso7779975e9.2 for ; Wed, 02 Sep 2026 07:57:30 -0700 (PDT) X-Forwarded-Encrypted: i=2; AHgh+RoNFeNBF/dMvNYMCzVzySjy/DByCPcoIkpTIMBzTVLCa7d5m3IN1EQ2+Xu0vhXQFQsUG8zaEw==@openvz.org X-Gm-Message-State: AFuF++nOF/d5m/w1fYYDhMAisV0Hvx6B74kOT96LPrHfRAOzc7JSZ6s5 zTyZUcc/9mzEtjvMB+vcVbjeF5eQj+nkpZ1bE20dVUJ5ad7olWudYEuJrqtyvntczjbhff+g++V vTu8jEV/oq4HEtrUvNzK2T/NGqqOlE9wiQ+zHyBBiLIukC0b5pHVSOQ== X-Gm-Gg: AR+sD13XxfdvcHPZWvhsFienvcc1WWq5WY5/w/K3L4CP14SJbNfaF2CnU+CtuNhMRej cF2COeBSYLfKhxcdL+iAFRsPsj3wNAN9oVvwFFYrrWfRG+UgSdCnuwcdkUm4aFlLwof9Fce/d2n 9bSEsonseW8ok0HxD8KhlTq0N8Eml719NKhx/jJ0H9KU8JNEj6b2IX7GOq0B1ePqEkIjvuXLaad 4GReSjY1hp6z4XOsSTViGUsqxlv/8MHKb00+XYGrhOLIc3ZdvWTHbmcWk+LMb1r7T1KPGgQT3k9 b3tIip4ydXVELG/imhIRECvmyLlU+xZ7ZrwjGNlFwGzmUJFmXYqmFGX2Wrtso8eTT44Gq9TjGHc 7Q+DdpDjvIWiq0WH2tQ== X-Received: by 2002:a05:600c:4e4a:b0:49b:9113:e04a with SMTP id 5b1f17b1804b1-49ce55ecde6mr98076645e9.1.1788361050196; Wed, 02 Sep 2026 07:57:30 -0700 (PDT) X-Received: by 2002:a05:600c:4e4a:b0:49b:9113:e04a with SMTP id 5b1f17b1804b1-49ce55ecde6mr98075415e9.1.1788361049273; Wed, 02 Sep 2026 07:57:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1788361049; cv=none; d=google.com; s=arc-20260327; b=ZR88clYhE6aXObdvT+RKilJotvUGk5Qp/Gk44cGzP3GU0NuuJyujO9GH7YIzLe91ia LyFqVDUUXqbh9CG4IyVDnwnsyLnVh8Zg5/kR0pfdKGU7iLs6KCEZ2WQ+DblEbUPY1Q8V DG1nRCn+LSZgmNL+Z2UGk1sjnmoY2h7Py3Opw8ld6k3k0h4oBcErTWNb1sUktNKsNrH5 7/iy4kTWkH8tqrM9XGzZguaB9wVw9XqZCfwPFk8etWKGu7gPAl2JimuaAgS9+en6wdET lvbM8n55JyuzRmZaPswUOYRrx1uPcVGqrnThRaY5oRMQhpEkxuBCdJrrrLeQATCyXPCk 7ewg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327; h=message-id:date:references:in-reply-to:cc:to:from:subject :content-transfer-encoding:mime-version:dkim-signature; bh=uOCjhyKM44D4O1N6bvbfLR6ItLnIBhIDi49IbwXFkag=; fh=CTF2GHyV+XdzB5TROrdG4fdLri6JSHNOBC+LNuNq5bA=; b=n5UTD2nFdrofstufhN8ImW0anxM++ek+TvXWUtRAVk8wh/5dGGKxInrOPgEZH59E5z 5qek35JiAJM/Aje0CEEhD+aRkk4Wlo3huxP7CURkLLXSDXRUqb9lrrV5TUEo+HTu9tN7 DcKv+Y1tZFB4g5AytFyNn9GoWgc1RAZw28GCtBhI7TeQ8Du0BXqyrD4u+tAqlSJnPeqQ ZeEkpSZhdUWp73rkulDrPdmNQKUlW0RIrOyvTfqqEQM1p2niDF6ROqWffcEcR/Mz0HpB vfjow6Aw6jf8tk5/uafLOKiI5xcyjrcsi6+dsBw3biMAU3G6kA3ewqsdvpy8QIf7QII8 AhAg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=relay header.b=nAde+coL; spf=pass (google.com: domain of khorenko@virtuozzo.com designates 130.117.225.111 as permitted sender) smtp.mailfrom=khorenko@virtuozzo.com; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=virtuozzo.com Received: from relay.virtuozzo.com (relay.virtuozzo.com. [130.117.225.111]) by mx.google.com with ESMTPS id ffacd0b85a97d-484494c38ddsi6419089f8f.177.2026.09.02.07.57.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Sep 2026 07:57:29 -0700 (PDT) Received-SPF: pass (google.com: domain of khorenko@virtuozzo.com designates 130.117.225.111 as permitted sender) client-ip=130.117.225.111; Authentication-Results: mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=relay header.b=nAde+coL; spf=pass (google.com: domain of khorenko@virtuozzo.com designates 130.117.225.111 as permitted sender) smtp.mailfrom=khorenko@virtuozzo.com; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=virtuozzo.com DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=virtuozzo.com; s=relay; h=Message-Id:Date:From:Subject:Content-Type: MIME-Version; bh=uOCjhyKM44D4O1N6bvbfLR6ItLnIBhIDi49IbwXFkag=; b=nAde+coLnkJW 3kTQsrRtNaJ0By2kbLy+2iFbsR9+1swNdDZhMhP/Um1UivjNLxQ/WeVXfOnJiyo/jO+wS/6nHmFe8 cVzBF396FVqac78a2dDjGncGc0znOny9IgrZmuZLfL9czbTQ4Z2lXJFIM4/ttEI0253aOaavnJf0y t9iuYoEmg+wmujiWUucH1f7FARjcsBxdSA03Fh4J9zU3mGlndQ0UV180mFYsA1oWiKc1ZdjcYtyEe QbRmFRZYY1tmlmlRcx5ndTV5Ccx7ISiJtV6r1xL+hW93pgbXMQdXJ2PevWwG3fjdEk0Rdq8H16ryU ZJHYLIUCcVwN3a0nd8T6cQ==; Received: from ch-demo-asa.virtuozzo.com ([130.117.225.8] helo=f0.sw.ru) by relay.virtuozzo.com with esmtp (Exim 4.96) (envelope-from ) id 1x1mMd-003Iec-1a; Wed, 02 Sep 2026 16:57:27 +0200 MIME-Version: 1.0 From: Konstantin Khorenko To: Eva Kurchatova In-Reply-To: <20260831234748.1650449-1-eva.kurchatova@virtuozzo.com> References: <20260831234748.1650449-1-eva.kurchatova@virtuozzo.com> Date: Wed, 02 Sep 2026 16:57:25 +0200 Message-Id: <178836104577.1229139.14970935934239587173.b4-review@b4> X-Mailer: b4 0.16.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=3188; i=khorenko@virtuozzo.com; h=from:subject:message-id; bh=/A9h5Xm19zCCCXukEufphdzFdA4+Lt1H15aAOJjpH88=; b=owEBbQKS/ZANAwAKAVGWCkf5YVwqAcsmYgBqmDlYHplhF46ctju+U+duY2oIAFfN+bXKcysoP pqkGXQ1nNWJAjMEAAEKAB0WIQRWD23IPcXT0GO9CCxRlgpH+WFcKgUCapg5WAAKCRBRlgpH+WFc Kj04D/4zhqttF7IIdinNzWpGXlGgg4tlKJRlq+T1AFysNEzH79wjmWmNOjBkw5t0WFpXg75P9AL nFSzYQqHls9sabG+DQcNfbkazb7+J8gxIhFIuXETQ5o+jDGpf5p6t1Yzj85eHUQMp5W2LTVyBj3 OICTu8I3cdE6dEl+wL0lBGPwQzV+zIz5T5I6L3LtKjbj6Qp6JcaWmbtdvWpu5tCVzhJ2bykUt3A b4zy+GOXrNY/wmc8Z8AKk5TuPcDfwiaPf8Pc1sdBaYBPHK10cl8uY99E296ZZf8QDR7EGw/T+1b rK5BeJKn22MIcziAYCXr0hDq1jMWeXZMHA/J1BYoquBLla1iJozcHQAnw17BlIr7b93chRM2W8g pzyBuHLJva0homorgziAB58FA9LuqzIOYL9IFXZgLYhVRgOZ7X3IWkJGm9iIZOkTO7m+PndWAFl XVe2TTnFO4dKieZQf9IFyNwKiSafNsDnO1sqnjbcZUJ8W21DV/2JuDel2RJ/YL5Lb8jUtcVSyI7 Jc6yTffWJhYoBYuDDqi4p6rNnYtnRg6s3s8z05b21t/v1qbdsuoSbv10LzUUPa4uE7kaAmVIYsI SzRg49eqFWewqC2r7P1NjMAIH2YqjDPPYW4J3/67QDXHz8tSMkfHDDaNGz6AXjO/bDMbcBr5c2o +po6R5BxLrWYueg== X-Developer-Key: i=khorenko@virtuozzo.com; a=openpgp; fpr=560F6DC83DC5D3D063BD082C51960A47F9615C2A X-OZ-Fwd: true Cc: devel@openvz.org Subject: Re: [Devel] [PATCH vz10] selftests: pci_endpoint: skip when the test device is absent X-BeenThere: devel@openvz.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: OpenVZ development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: devel-bounces@openvz.org Errors-To: devel-bounces@openvz.org > Every fixture opens /dev/pci-endpoint-test.0 without checking, so on a > machine that has no PCI endpoint test device each case fails on the > first ioctl against fd -1 rather than saying the hardware is not there. > The commit message describes a different bug than the one that exists: Every fixture opens /dev/pci-endpoint-test.0 without checking, so on a machine that has no PCI endpoint test device each case fails on the first ioctl against fd -1 Every fixture does check: FIXTURE_SETUP(pci_ep_bar) { self->fd = open(test_device, O_RDWR); ASSERT_NE(-1, self->fd) TH_LOG("Can't open PCI Endpoint Test device"); } at pci_endpoint_test.c:43 (pci_ep_bar), :82 (pci_ep_basic), :153 (pci_ep_data_transfer) and :232 (pcie_ep_doorbell). No ioctl is ever reached - what fails is the assertion in the fixture setup ("Test terminated by assertion" in the output above). Please reword: each of the 17 cases fails on the fixture setup assertion. Otherwise the next reader goes looking for an ioctl(-1, ...) bug that is not there. The "four fixtures" part is correct. > Check for the device once before handing over to the harness. Doing it > there rather than in each of the four fixtures keeps it to a single skip. > > https://virtuozzo.atlassian.net/browse/VSTOR-142446 > Feature: fix selftests > Signed-off-by: Eva Kurchatova > > diff --git a/tools/testing/selftests/pci_endpoint/pci_endpoint_test.c b/tools/testing/selftests/pci_endpoint/pci_endpoint_test.c > index da0db0e7c9693..640c74fd5b780 100644 > --- a/tools/testing/selftests/pci_endpoint/pci_endpoint_test.c > +++ b/tools/testing/selftests/pci_endpoint/pci_endpoint_test.c > @@ -257,4 +257,15 @@ TEST_F(pcie_ep_doorbell, DOORBELL_TEST) > pci_ep_ioctl(PCITEST_DOORBELL, 0); > EXPECT_FALSE(ret) TH_LOG("Test failed for Doorbell\n"); > } > -TEST_HARNESS_MAIN An empty line to be here. > +static bool test_device_available(void) > +{ > + return access(test_device, F_OK) == 0; > +} > + > +int main(int argc, char **argv) > +{ > + if (!test_device_available()) > + ksft_exit_skip("no PCI endpoint test device %s\n", test_device); > + > + return test_harness_run(argc, argv); > +} The check runs before test_harness_run(), while argv parsing happens inside it (test_harness_argv_check(), kselftest_harness.h:1119). So on a machine without the device, "./pci_endpoint_test -l" (list tests) and "-h" (usage) now print the skip message instead of their own output. Please limit the skip to the plain invocation, which is the one kselftest uses: int main(int argc, char **argv) { /* * Only the plain invocation - the one kselftest uses - turns into a * skip, so that -l and -h keep working without the hardware. */ if (argc == 1 && !test_device_available()) ksft_exit_skip("no PCI endpoint test device %s\n", test_device); return test_harness_run(argc, argv); } -- Konstantin Khorenko _______________________________________________ Devel mailing list Devel@openvz.org https://lists.openvz.org/mailman/listinfo/devel