* [LTP] [PATCH v1] Delete getdtablesize01 test
@ 2023-11-20 15:48 Andrea Cervesato
2023-11-28 12:59 ` Petr Vorel
0 siblings, 1 reply; 4+ messages in thread
From: Andrea Cervesato @ 2023-11-20 15:48 UTC (permalink / raw)
To: ltp
From: Andrea Cervesato <andrea.cervesato@suse.com>
The getdtablesize syscall has been created in the early Linux versions
and it has been replaced by getrlimit, which is now tested by its own
testing suite. For this reason we don't need this test anymore, since
its refactoring to new API can be considered a waste of time.
Signed-off-by: Andrea Cervesato <andrea.cervesato@suse.com>
---
runtest/syscalls | 2 -
.../kernel/syscalls/getdtablesize/.gitignore | 1 -
.../kernel/syscalls/getdtablesize/Makefile | 8 --
.../syscalls/getdtablesize/getdtablesize01.c | 119 ------------------
4 files changed, 130 deletions(-)
delete mode 100644 testcases/kernel/syscalls/getdtablesize/.gitignore
delete mode 100644 testcases/kernel/syscalls/getdtablesize/Makefile
delete mode 100644 testcases/kernel/syscalls/getdtablesize/getdtablesize01.c
diff --git a/runtest/syscalls b/runtest/syscalls
index c98992d44..4dc7c8ddc 100644
--- a/runtest/syscalls
+++ b/runtest/syscalls
@@ -449,8 +449,6 @@ getdents02 getdents02
getdomainname01 getdomainname01
-getdtablesize01 getdtablesize01
-
getegid01 getegid01
getegid01_16 getegid01_16
getegid02 getegid02
diff --git a/testcases/kernel/syscalls/getdtablesize/.gitignore b/testcases/kernel/syscalls/getdtablesize/.gitignore
deleted file mode 100644
index 67a71b5e2..000000000
--- a/testcases/kernel/syscalls/getdtablesize/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-/getdtablesize01
diff --git a/testcases/kernel/syscalls/getdtablesize/Makefile b/testcases/kernel/syscalls/getdtablesize/Makefile
deleted file mode 100644
index 044619fb8..000000000
--- a/testcases/kernel/syscalls/getdtablesize/Makefile
+++ /dev/null
@@ -1,8 +0,0 @@
-# SPDX-License-Identifier: GPL-2.0-or-later
-# Copyright (c) International Business Machines Corp., 2001
-
-top_srcdir ?= ../../../..
-
-include $(top_srcdir)/include/mk/testcases.mk
-
-include $(top_srcdir)/include/mk/generic_leaf_target.mk
diff --git a/testcases/kernel/syscalls/getdtablesize/getdtablesize01.c b/testcases/kernel/syscalls/getdtablesize/getdtablesize01.c
deleted file mode 100644
index d25cac261..000000000
--- a/testcases/kernel/syscalls/getdtablesize/getdtablesize01.c
+++ /dev/null
@@ -1,119 +0,0 @@
-/*
- * Copyright (c) International Business Machines Corp., 2005
- * Copyright (c) Wipro Technologies Ltd, 2005. All Rights Reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of version 2 of the GNU General Public License as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it would be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- */
-/**********************************************************
- *
- * TEST IDENTIFIER : getdtablesize01
- *
- * EXECUTED BY : root / superuser
- *
- * TEST TITLE : Basic tests for getdtablesize01(2)
- *
- * TEST CASE TOTAL : 1
- *
- * AUTHOR : Prashant P Yendigeri
- * <prashant.yendigeri@wipro.com>
- * Robbie Williamson
- * <robbiew@us.ibm.com>
- *
- * DESCRIPTION
- * This is a Phase I test for the getdtablesize01(2) system call.
- * It is intended to provide a limited exposure of the system call.
- *
- **********************************************************/
-
-#include <stdio.h>
-#include <errno.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <sys/time.h>
-#include <sys/resource.h>
-#include <unistd.h>
-#include "test.h"
-
-void setup();
-void cleanup();
-
-char *TCID = "getdtablesize01";
-int TST_TOTAL = 1;
-
-int main(void)
-{
- int table_size, fd = 0, count = 0;
- int max_val_opfiles;
- struct rlimit rlp;
-
- setup();
- table_size = getdtablesize();
- getrlimit(RLIMIT_NOFILE, &rlp);
- max_val_opfiles = (rlim_t) rlp.rlim_cur;
-
- tst_resm(TINFO,
- "Maximum number of files a process can have opened is %d",
- table_size);
- tst_resm(TINFO,
- "Checking with the value returned by getrlimit...RLIMIT_NOFILE");
-
- if (table_size == max_val_opfiles)
- tst_resm(TPASS, "got correct dtablesize, value is %d",
- max_val_opfiles);
- else {
- tst_resm(TFAIL, "got incorrect table size, value is %d",
- max_val_opfiles);
- cleanup();
- }
-
- tst_resm(TINFO,
- "Checking Max num of files that can be opened by a process.Should be: RLIMIT_NOFILE - 1");
- for (;;) {
- fd = open("/etc/hosts", O_RDONLY);
-
- if (fd == -1)
- break;
- count = fd;
-
-#ifdef DEBUG
- printf("Opened file num %d\n", fd);
-#endif
- }
-
-//Now the max files opened should be RLIMIT_NOFILE - 1 , why ? read getdtablesize man page
-
- if (count > 0)
- close(count);
- if (count == (max_val_opfiles - 1))
- tst_resm(TPASS, "%d = %d", count, (max_val_opfiles - 1));
- else if (fd < 0 && errno == ENFILE)
- tst_brkm(TCONF, cleanup, "Reached maximum number of open files for the system");
- else
- tst_resm(TFAIL, "%d != %d", count, (max_val_opfiles - 1));
-
- cleanup();
- tst_exit();
-}
-
-void setup(void)
-{
- tst_sig(NOFORK, DEF_HANDLER, cleanup);
-
- TEST_PAUSE;
-}
-
-void cleanup(void)
-{
-}
--
2.35.3
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [LTP] [PATCH v1] Delete getdtablesize01 test
2023-11-20 15:48 [LTP] [PATCH v1] Delete getdtablesize01 test Andrea Cervesato
@ 2023-11-28 12:59 ` Petr Vorel
2023-11-28 13:58 ` Jan Stancek
0 siblings, 1 reply; 4+ messages in thread
From: Petr Vorel @ 2023-11-28 12:59 UTC (permalink / raw)
To: Andrea Cervesato; +Cc: ltp
Hi Andrea,
> The getdtablesize syscall has been created in the early Linux versions
> and it has been replaced by getrlimit, which is now tested by its own
> testing suite. For this reason we don't need this test anymore, since
> its refactoring to new API can be considered a waste of time.
Acked-by: Petr Vorel <pvorel@suse.cz>
I'd like to get more ack for this.
Kind regards,
Petr
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [LTP] [PATCH v1] Delete getdtablesize01 test
2023-11-28 12:59 ` Petr Vorel
@ 2023-11-28 13:58 ` Jan Stancek
2023-11-30 14:11 ` Petr Vorel
0 siblings, 1 reply; 4+ messages in thread
From: Jan Stancek @ 2023-11-28 13:58 UTC (permalink / raw)
To: Petr Vorel; +Cc: ltp
On Tue, Nov 28, 2023 at 1:59 PM Petr Vorel <pvorel@suse.cz> wrote:
>
> Hi Andrea,
>
> > The getdtablesize syscall has been created in the early Linux versions
> > and it has been replaced by getrlimit, which is now tested by its own
> > testing suite. For this reason we don't need this test anymore, since
> > its refactoring to new API can be considered a waste of time.
>
> Acked-by: Petr Vorel <pvorel@suse.cz>
>
> I'd like to get more ack for this.
Acked-by: Jan Stancek <jstancek@redhat.com>
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [LTP] [PATCH v1] Delete getdtablesize01 test
2023-11-28 13:58 ` Jan Stancek
@ 2023-11-30 14:11 ` Petr Vorel
0 siblings, 0 replies; 4+ messages in thread
From: Petr Vorel @ 2023-11-30 14:11 UTC (permalink / raw)
To: Jan Stancek; +Cc: ltp
Hi Andrea, Jan,
thanks, merged!
Kind regards,
Petr
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2023-11-30 14:12 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-20 15:48 [LTP] [PATCH v1] Delete getdtablesize01 test Andrea Cervesato
2023-11-28 12:59 ` Petr Vorel
2023-11-28 13:58 ` Jan Stancek
2023-11-30 14:11 ` Petr Vorel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox