From: Jinseok Kim <always.starving0@gmail.com>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH v2 1/2] open: remove O_DIRECTORY case (move to fstat test)
Date: Tue, 24 Feb 2026 19:07:17 +0900 [thread overview]
Message-ID: <20260224100723.42877-1-always.starving0@gmail.com> (raw)
In-Reply-To: <DGN1LFH0ULK0.3D30H8MFVV9GM@suse.com>
The O_DIRECTORY test case was mostly verifying fstat() behavior on an
existing directory rather than testing any specific open() behavior.
Following review suggestion, remove it from open01.c. A separate fstat
test will be added in a follow-up patch to cover file type checks
(S_ISDIR, etc.) more comprehensively.
Signed-off-by: Jinseok Kim <always.starving0@gmail.com>
---
testcases/kernel/syscalls/open/open01.c | 12 ------------
1 file changed, 12 deletions(-)
diff --git a/testcases/kernel/syscalls/open/open01.c b/testcases/kernel/syscalls/open/open01.c
index baf73ab11..329c52586 100644
--- a/testcases/kernel/syscalls/open/open01.c
+++ b/testcases/kernel/syscalls/open/open01.c
@@ -8,16 +8,12 @@
/*
* DESCRIPTION
* Open a file with oflag = O_CREAT set, does it set the sticky bit off?
- * Open a dir with O_DIRECTORY, does it set the S_IFDIR bit on?
*
* ALGORITHM
* 1. open a new file with O_CREAT, fstat.st_mode should not have the
* 01000 bit on. In Linux, the save text bit is *NOT* cleared.
- * 2. open a new dir with O_DIRECTORY, fstat.st_mode should have the
- * 040000 bit on.
*/
-#define _GNU_SOURCE /* for O_DIRECTORY */
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
@@ -25,7 +21,6 @@
#include "tst_test.h"
#define TEST_FILE "testfile"
-#define TEST_DIR "testdir"
static int fd;
@@ -37,7 +32,6 @@ static struct tcase {
char *desc;
} tcases[] = {
{TEST_FILE, O_RDWR | O_CREAT, 01444, S_ISVTX, "sticky bit"},
- {TEST_DIR, O_DIRECTORY, 0, S_IFDIR, "sirectory bit"}
};
static void verify_open(unsigned int n)
@@ -63,11 +57,6 @@ static void verify_open(unsigned int n)
SAFE_UNLINK(tc->filename);
}
-static void setup(void)
-{
- SAFE_MKDIR(TEST_DIR, 0755);
-}
-
static void cleanup(void)
{
if (fd > 0)
@@ -77,7 +66,6 @@ static void cleanup(void)
static struct tst_test test = {
.tcnt = ARRAY_SIZE(tcases),
.needs_tmpdir = 1,
- .setup = setup,
.cleanup = cleanup,
.test = verify_open,
};
--
2.43.0
--
Mailing list info: https://lists.linux.it/listinfo/ltp
next prev parent reply other threads:[~2026-02-24 10:08 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-11 17:16 [LTP] [PATCH] open: fix directory verification and misleading test description Jinseok Kim
2026-02-17 13:21 ` Andrea Cervesato via ltp
2026-02-19 10:31 ` Cyril Hrubis
2026-02-19 14:57 ` Jinseok Kim
2026-02-20 10:49 ` Cyril Hrubis
2026-02-24 7:37 ` [LTP] [PATCH 1/2] open: remove O_DIRECTORY case (move to fstat test) Jinseok Kim
2026-02-24 7:37 ` [LTP] [PATCH 2/2] Add test for multiple file types using fstat Jinseok Kim
2026-02-24 8:17 ` [LTP] [PATCH 1/2] open: remove O_DIRECTORY case (move to fstat test) Andrea Cervesato via ltp
2026-02-24 10:07 ` Jinseok Kim [this message]
2026-02-24 10:07 ` [LTP] [PATCH v2 2/2] fstat: add test for multiple file types using fstat Jinseok Kim
2026-02-24 14:17 ` Andrea Cervesato via ltp
2026-02-25 13:19 ` [LTP] [PATCH v3 1/2] open: remove O_DIRECTORY case (move to fstat test) Jinseok Kim
2026-02-25 13:19 ` [LTP] [PATCH v3 2/2] fstat: add test for multiple file types using fstat Jinseok Kim
2026-02-25 14:30 ` Andrea Cervesato via ltp
2026-02-26 15:32 ` Jinseok Kim
2026-02-26 15:44 ` Andrea Cervesato via ltp
2026-03-03 13:32 ` [LTP] [PATCH v4 1/2] open: remove O_DIRECTORY case (move to fstat test) Jinseok Kim
2026-03-03 13:32 ` [LTP] [PATCH v4 2/2] fstat: add test for multiple file types using fstat Jinseok Kim
2026-03-12 11:22 ` Andrea Cervesato via ltp
2026-03-13 14:07 ` Jinseok Kim
2026-03-13 15:36 ` Andrea Cervesato via ltp
2026-03-15 7:27 ` [LTP] [PATCH v5 1/2] open: remove O_DIRECTORY case (move to fstat test) Jinseok Kim
2026-03-15 7:27 ` [LTP] [PATCH v5 2/2] fstat: add test for multiple file types using fstat Jinseok Kim
2026-03-16 7:38 ` [LTP] [PATCH v5 1/2] open: remove O_DIRECTORY case (move to fstat test) Andrea Cervesato via ltp
2026-03-16 15:00 ` [LTP] [PATCH v6 " Jinseok Kim
2026-03-16 15:00 ` [LTP] [PATCH v6 2/2] fstat: add test for multiple file types using fstat Jinseok Kim
2026-03-24 12:17 ` Andrea Cervesato via ltp
2026-03-27 15:27 ` [LTP] [PATCH v7] " Jinseok Kim
2026-03-30 8:07 ` Andrea Cervesato via ltp
2026-04-17 10:57 ` Petr Vorel
2026-04-21 15:24 ` Jinseok Kim
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260224100723.42877-1-always.starving0@gmail.com \
--to=always.starving0@gmail.com \
--cc=ltp@lists.linux.it \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.