History

selftests: openat2: add RESOLVE_ conflict test

Now that we reject conflicting RESOLVE_ flags, add a selftest to avoid regressions.

Aleksa Sarai committed 6 years ago

Commit 4e62d551 parent 398840f1 file · +7 −1Browse files

Unified · Split

tools/testing/selftests/openat2/openat2_test.c+7−1
@@ -155,7 +155,7 @@ struct flag_test { · 154 unmodified lines
155155 int err;
156156 };
157157
158−#define NUM_OPENAT2_FLAG_TESTS 23
158+#define NUM_OPENAT2_FLAG_TESTS 24
159159
160160 void test_openat2_flags(void)
161161 {
@@ -210,6 +210,12 @@ void test_openat2_flags(void) · 48 unmodified lines
210210 .how.flags = O_TMPFILE | O_RDWR,
211211 .how.mode = 0x0000A00000000000ULL, .err = -EINVAL },
212212
213+ /* ->resolve flags must not conflict. */
214+ { .name = "incompatible resolve flags (BENEATH | IN_ROOT)",
215+ .how.flags = O_RDONLY,
216+ .how.resolve = RESOLVE_BENEATH | RESOLVE_IN_ROOT,
217+ .err = -EINVAL },
218+
213219 /* ->resolve must only contain RESOLVE_* flags. */
214220 { .name = "invalid how.resolve and O_RDONLY",
215221 .how.flags = O_RDONLY,

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t