From patchwork Wed Oct 4 12:47:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cyril Hrubis X-Patchwork-Id: 1843330 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=suse.cz header.i=@suse.cz header.a=rsa-sha256 header.s=susede2_rsa header.b=vXeHv9qG; dkim=fail reason="signature verification failed" header.d=suse.cz header.i=@suse.cz header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=tBYCb8Dj; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.linux.it (client-ip=213.254.12.146; helo=picard.linux.it; envelope-from=ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it; receiver=patchwork.ozlabs.org) Received: from picard.linux.it (picard.linux.it [213.254.12.146]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4S0vZh26Jcz1yph for ; Wed, 4 Oct 2023 23:46:36 +1100 (AEDT) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id B5E263CDB05 for ; Wed, 4 Oct 2023 14:46:33 +0200 (CEST) X-Original-To: ltp@lists.linux.it Delivered-To: ltp@picard.linux.it Received: from in-3.smtp.seeweb.it (in-3.smtp.seeweb.it [IPv6:2001:4b78:1:20::3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by picard.linux.it (Postfix) with ESMTPS id DEC123CB78E for ; Wed, 4 Oct 2023 14:46:30 +0200 (CEST) Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by in-3.smtp.seeweb.it (Postfix) with ESMTPS id EA7131A00E2D for ; Wed, 4 Oct 2023 14:46:29 +0200 (CEST) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 3428D1F74C; Wed, 4 Oct 2023 12:46:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1696423589; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=BsF3UVfl/y6P+aPwJrRdOfdTj+gYUjFPOJgjlOhpAZg=; b=vXeHv9qGyT8I7aTXp06t/B9dAyii79ISLcyLxiLWa3y0cMUkJgx0z8mCXpYvFzJkt9LCoj sj5QMlmDjONJPqmJ0tnQmZ2QLU2IIPvge638t1VZtV04FIMuSE8fMV97jMXHxeDPFkzeki L2eL1hcERscCEnkGxlCa1Q2gTN//DNU= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1696423589; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=BsF3UVfl/y6P+aPwJrRdOfdTj+gYUjFPOJgjlOhpAZg=; b=tBYCb8DjuvBtW+7I7Rn4A1wqVSvZeV/OGL+6W121Kwhgc4UB4cdOa7ncqGu9BGCARJIXlY 4JvQcOwj8saXCDBw== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 1D57513A2E; Wed, 4 Oct 2023 12:46:29 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 7f8EBqVeHWXWPAAAMHmgww (envelope-from ); Wed, 04 Oct 2023 12:46:29 +0000 From: Cyril Hrubis To: ltp@lists.linux.it Date: Wed, 4 Oct 2023 14:47:09 +0200 Message-ID: <20231004124712.3833-1-chrubis@suse.cz> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 X-Virus-Scanned: clamav-milter 1.0.1 at in-3.smtp.seeweb.it X-Virus-Status: Clean X-Spam-Status: No, score=0.1 required=7.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS shortcircuit=no autolearn=disabled version=4.0.0 X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on in-3.smtp.seeweb.it Subject: [LTP] [PATCH 0/3] Add tst_iterate_fd() X-BeenThere: ltp@lists.linux.it X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux Test Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: mszeredi@redhat.com, brauner@kernel.org, Jan Kara , Matthew Wilcox , viro@zeniv.linux.org.uk, linux-fsdevel@vger.kernel.org Errors-To: ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it Sender: "ltp" - adds tst_iterate_fd() functionality - make use of tst_iterate_fd() in readahead01 - add accept03 test which uses tst_iterate_fd() This is a prototype for how the functionality to iterate over different file descriptors should look like it converts one tests and adds another. There is plenty of other syscalls that can use this kind of testing, e.g. all fooat() syscalls where we can pass invalid dir_fd, the plan is to add these if/once we agree on the API. Cyril Hrubis (3): lib: Add tst_fd_iterate() syscalls/readahead01: Make use of tst_fd_iterate() syscalls: accept: Add tst_fd_iterate() test include/tst_fd.h | 39 ++++++ include/tst_test.h | 1 + lib/tst_fd.c | 116 ++++++++++++++++++ runtest/syscalls | 1 + testcases/kernel/syscalls/accept/.gitignore | 1 + testcases/kernel/syscalls/accept/accept01.c | 8 -- testcases/kernel/syscalls/accept/accept03.c | 46 +++++++ .../kernel/syscalls/readahead/readahead01.c | 46 +++---- 8 files changed, 224 insertions(+), 34 deletions(-) create mode 100644 include/tst_fd.h create mode 100644 lib/tst_fd.c create mode 100644 testcases/kernel/syscalls/accept/accept03.c