From patchwork Mon Nov 20 15:42:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrea Cervesato X-Patchwork-Id: 1866103 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.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=CJLqCqd0; dkim=fail reason="signature verification failed" header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=XTB0OF9l; 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 4SYsGW46v3z1yRg for ; Tue, 21 Nov 2023 02:42:57 +1100 (AEDT) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id 382EA3CE1D6 for ; Mon, 20 Nov 2023 16:42:54 +0100 (CET) X-Original-To: ltp@lists.linux.it Delivered-To: ltp@picard.linux.it Received: from in-4.smtp.seeweb.it (in-4.smtp.seeweb.it [IPv6:2001:4b78:1:20::4]) (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 659713CB683 for ; Mon, 20 Nov 2023 16:42:51 +0100 (CET) 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-4.smtp.seeweb.it (Postfix) with ESMTPS id 395B71000DEE for ; Mon, 20 Nov 2023 16:42:50 +0100 (CET) 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 AD99F1F898; Mon, 20 Nov 2023 15:42:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1700494969; 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=2Da2nDTe4ciCtwmIp0Ora7nQuQyTzq4w6azn1uDwrtU=; b=CJLqCqd0nYisgZyiCHfhMwySPM7uckK9akEp6Hg1SI41oV9UnC0QK9vVD39XeEtflm2LHm TZJBTHYLZVN+OVNy/+TVp0Ku9uyYyjQIJgYhaGa6wVatHeoV251+xBeg9QFem04heeUCFM Im0bdsfph0nbW1w3+h96WpvFJpAWKbU= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1700494969; 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=2Da2nDTe4ciCtwmIp0Ora7nQuQyTzq4w6azn1uDwrtU=; b=XTB0OF9lekkoXlSDfctb7nhGKhwZcs7cdAlSKnx/brLAGtIKGDsi7imfg28COhwvuXHmss YZOW3DtF1IHQU0Bg== 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 8FAA4134AD; Mon, 20 Nov 2023 15:42:49 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id koFNIXl+W2WTUQAAMHmgww (envelope-from ); Mon, 20 Nov 2023 15:42:49 +0000 From: Andrea Cervesato To: ltp@lists.linux.it Date: Mon, 20 Nov 2023 16:42:48 +0100 Message-Id: <20231120154248.15048-1-andrea.cervesato@suse.de> X-Mailer: git-send-email 2.35.3 MIME-Version: 1.0 Authentication-Results: smtp-out2.suse.de; none X-Spam-Level: X-Spam-Score: 0.70 X-Spamd-Result: default: False [0.70 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_MISSING_CHARSET(2.50)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; BROKEN_CONTENT_TYPE(1.50)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; NEURAL_HAM_SHORT(-0.20)[-1.000]; RCPT_COUNT_TWO(0.00)[2]; MID_CONTAINS_FROM(1.00)[]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; BAYES_HAM(-3.00)[100.00%] X-Virus-Scanned: clamav-milter 1.0.1 at in-4.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, T_SCC_BODY_TEXT_LINE shortcircuit=no autolearn=disabled version=4.0.0 X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on in-4.smtp.seeweb.it Subject: [LTP] [PATCH v1] Delete fork09 test 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: , Errors-To: ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it Sender: "ltp" From: Andrea Cervesato The fork09 test is actually testing what fork10 is already testing: accessing an open child's file from parent. For this reason, we delete it and let fork10 doing its job. Signed-off-by: Andrea Cervesato --- runtest/syscalls | 1 - testcases/kernel/syscalls/fork/.gitignore | 1 - testcases/kernel/syscalls/fork/fork09.c | 172 ---------------------- 3 files changed, 174 deletions(-) delete mode 100644 testcases/kernel/syscalls/fork/fork09.c diff --git a/runtest/syscalls b/runtest/syscalls index c98992d44..430d32e6a 100644 --- a/runtest/syscalls +++ b/runtest/syscalls @@ -383,7 +383,6 @@ fork05 fork05 fork06 fork_procs -n 1000 fork07 fork07 fork08 fork08 -fork09 fork09 fork10 fork10 fork11 fork_procs -n 100 fork13 fork13 diff --git a/testcases/kernel/syscalls/fork/.gitignore b/testcases/kernel/syscalls/fork/.gitignore index 55e30edb4..6a55df765 100644 --- a/testcases/kernel/syscalls/fork/.gitignore +++ b/testcases/kernel/syscalls/fork/.gitignore @@ -4,7 +4,6 @@ /fork05 /fork07 /fork08 -/fork09 /fork10 /fork12 /fork13 diff --git a/testcases/kernel/syscalls/fork/fork09.c b/testcases/kernel/syscalls/fork/fork09.c deleted file mode 100644 index 32bad89b3..000000000 --- a/testcases/kernel/syscalls/fork/fork09.c +++ /dev/null @@ -1,172 +0,0 @@ -/* - * Copyright (c) International Business Machines Corp., 2001 - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See - * the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * NAME - * fork09.c - * - * DESCRIPTION - * Check that child has access to a full set of files. - * - * ALGORITHM - * Parent opens a maximum number of files - * Child closes one and attempts to open another, it should be - * available - * - * USAGE - * fork09 - * - * HISTORY - * 07/2001 Ported by Wayne Boyer - * - * 10/2008 Suzuki K P - * Fix maximum number of files open logic. - * - * RESTRICTIONS - * None - */ - -#include -#include -#include -#include -#include -#include -#include /* for _SC_OPEN_MAX */ -#include "test.h" -#include "safe_macros.h" - -char *TCID = "fork09"; -int TST_TOTAL = 1; - -static void setup(void); -static void cleanup(void); - -static char filname[40], childfile[40]; -static int first; -static FILE **fildeses; /* file streams */ -static int mypid, nfiles; - -#define OPEN_MAX (sysconf(_SC_OPEN_MAX)) - -int main(int ac, char **av) -{ - int pid, status, nf; - - int lc; - - tst_parse_opts(ac, av, NULL, NULL); - - setup(); - - fildeses = malloc((OPEN_MAX + 10) * sizeof(FILE *)); - if (fildeses == NULL) - tst_brkm(TBROK, cleanup, "malloc failed"); - - for (lc = 0; TEST_LOOPING(lc); lc++) { - tst_count = 0; - mypid = getpid(); - - tst_resm(TINFO, "OPEN_MAX is %ld", OPEN_MAX); - - /* establish first free file */ - sprintf(filname, "fork09.%d", mypid); - first = SAFE_CREAT(cleanup, filname, 0660); - close(first); - - tst_resm(TINFO, "first file descriptor is %d ", first); - - SAFE_UNLINK(cleanup, filname); - - /* - * now open all the files for the test - */ - for (nfiles = first; nfiles < OPEN_MAX; nfiles++) { - sprintf(filname, "file%d.%d", nfiles, mypid); - fildeses[nfiles] = fopen(filname, "a"); - if (fildeses[nfiles] == NULL) { - /* Did we already reach OPEN_MAX ? */ - if (errno == EMFILE) - break; - tst_brkm(TBROK, cleanup, "Parent: cannot open " - "file %d %s errno = %d", nfiles, - filname, errno); - } -#ifdef DEBUG - tst_resm(TINFO, "filname: %s", filname); -#endif - } - - tst_resm(TINFO, "Parent reporting %d files open", nfiles - 1); - - pid = fork(); - if (pid == -1) - tst_brkm(TBROK, cleanup, "Fork failed"); - - if (pid == 0) { /* child */ - nfiles--; - if (fclose(fildeses[nfiles]) == -1) { - tst_resm(TINFO, "Child could not close file " - "#%d, errno = %d", nfiles, errno); - exit(1); - } else { - sprintf(childfile, "cfile.%d", getpid()); - fildeses[nfiles] = fopen(childfile, "a"); - if (fildeses[nfiles] == NULL) { - tst_resm(TINFO, "Child could not open " - "file %s, errno = %d", - childfile, errno); - exit(1); - } else { - tst_resm(TINFO, "Child opened new " - "file #%d", nfiles); - unlink(childfile); - exit(0); - } - } - } else { /* parent */ - wait(&status); - if (status >> 8 != 0) - tst_resm(TFAIL, "test 1 FAILED"); - else - tst_resm(TPASS, "test 1 PASSED"); - } - - /* clean up things in case we are looping */ - for (nf = first; nf < nfiles; nf++) { - fclose(fildeses[nf]); - sprintf(filname, "file%d.%d", nf, mypid); - unlink(filname); - } - } - - cleanup(); - tst_exit(); -} - -static void setup(void) -{ - tst_sig(FORK, DEF_HANDLER, cleanup); - umask(0); - - TEST_PAUSE; - tst_tmpdir(); -} - -static void cleanup(void) -{ - tst_rmdir(); -}