Lines Matching +full:auto +full:- +full:mode
1 /*-
2 * SPDX-License-Identifier: BSD-2-Clause
43 void expect_create(const char *relpath, mode_t mode, ProcessMockerT r) in expect_create() argument
49 ResultOf([=](auto in) { in expect_create()
53 in.body.create.mode == mode && in expect_create()
71 void expect_create(const char *relpath, mode_t mode, ProcessMockerT r) in expect_create() argument
74 ResultOf([=](auto in) { in expect_create()
78 in.body.create.mode == mode && in expect_create()
95 void expect_create(const char *relpath, mode_t mode, ProcessMockerT r) in expect_create() argument
98 ResultOf([=](auto in) { in expect_create()
102 in.body.create.mode == mode && in expect_create()
120 mode_t mode = S_IFREG | 0755; in TEST_F() local
126 expect_create(RELPATH, mode, in TEST_F()
127 ReturnImmediate([=](auto in __unused, auto& out) { in TEST_F()
129 out.body.create.entry.attr.mode = mode; in TEST_F()
136 ResultOf([=](auto in) { in TEST_F()
143 fd = open(FULLPATH, O_CREAT | O_EXCL, mode); in TEST_F()
153 mode_t mode = S_IFREG | 0755; in TEST_F() local
161 ResultOf([=](auto in) { in TEST_F()
167 .WillRepeatedly(Invoke(ReturnImmediate([=](auto i __unused, auto& out) { in TEST_F()
170 out.body.attr.attr.mode = S_IFDIR | 0755; in TEST_F()
174 expect_create(RELPATH, mode, in TEST_F()
175 ReturnImmediate([=](auto in __unused, auto& out) { in TEST_F()
177 out.body.create.entry.attr.mode = mode; in TEST_F()
184 fd = open(FULLPATH, O_CREAT | O_EXCL, mode); in TEST_F()
200 mode_t mode = S_IFREG | 0755; in TEST_F() local
204 expect_create(RELPATH, mode, ReturnErrno(EEXIST)); in TEST_F()
205 EXPECT_EQ(-1, open(FULLPATH, O_CREAT | O_EXCL, mode)); in TEST_F()
217 mode_t mode = S_IFREG | 0755; in TEST_F() local
223 expect_create(RELPATH, mode, ReturnErrno(ENOSYS)); in TEST_F()
226 ResultOf([=](auto in) { in TEST_F()
230 in.body.mknod.mode == (S_IFREG | mode) && in TEST_F()
235 ).WillOnce(Invoke(ReturnImmediate([=](auto in __unused, auto& out) { in TEST_F()
237 out.body.entry.attr.mode = mode; in TEST_F()
244 ResultOf([=](auto in) { in TEST_F()
249 ).WillOnce(Invoke(ReturnImmediate([](auto in __unused, auto& out) { in TEST_F()
254 fd = open(FULLPATH, O_CREAT | O_EXCL, mode); in TEST_F()
266 mode_t mode = S_IFREG | 0755; in TEST_F() local
279 expect_create(RELPATH, mode, in TEST_F()
280 ReturnImmediate([=](auto in __unused, auto& out) { in TEST_F()
282 out.body.create.entry.attr.mode = mode; in TEST_F()
288 fd = open(FULLPATH, O_CREAT | O_EXCL, mode); in TEST_F()
300 mode_t mode = S_IFREG | 0755; in TEST_F() local
311 expect_create(RELPATH, mode, in TEST_F()
312 ReturnImmediate([=](auto in __unused, auto& out) { in TEST_F()
314 out.body.create.entry.attr.mode = mode; in TEST_F()
319 fd = open(FULLPATH, O_CREAT | O_EXCL, mode); in TEST_F()
323 expect_lookup(RELPATH, ino, S_IFREG | mode, 0, 1); in TEST_F()
337 mode_t mode = S_IFREG | 0755; in TEST_F() local
341 expect_create(RELPATH, mode, ReturnErrno(EPERM)); in TEST_F()
343 EXPECT_EQ(-1, open(FULLPATH, O_CREAT | O_EXCL, mode)); in TEST_F()
351 mode_t mode = S_IFREG | 0755; in TEST_F() local
357 expect_create(RELPATH, mode, in TEST_F()
358 ReturnImmediate([=](auto in __unused, auto& out) { in TEST_F()
360 out.body.create.entry.attr.mode = mode; in TEST_F()
366 fd = open(FULLPATH, O_CREAT | O_EXCL, mode); in TEST_F()
381 mode_t mode = 0755; in TEST_F() local
385 expect_lookup(RELDIRPATH, ino, S_IFDIR | mode, 0, 1); in TEST_F()
388 expect_create(RELPATH, S_IFREG | mode, in TEST_F()
389 ReturnImmediate([=](auto in __unused, auto& out) { in TEST_F()
391 out.body.create.entry.attr.mode = S_IFREG | mode; in TEST_F()
400 ResultOf([=](auto in) { in TEST_F()
405 .WillOnce(Invoke([=](auto in __unused, auto &out __unused) { })); in TEST_F()
407 fd = open(FULLPATH, O_CREAT | O_EXCL, mode); in TEST_F()
408 ASSERT_EQ(-1, fd); in TEST_F()
418 * https://bugs.launchpad.net/ubuntu/+source/sshfs-fuse/+bug/44886
424 mode_t mode = S_IFREG | 0444; in TEST_F() local
430 expect_create(RELPATH, mode, in TEST_F()
431 ReturnImmediate([=](auto in __unused, auto& out) { in TEST_F()
433 out.body.create.entry.attr.mode = mode; in TEST_F()
439 fd = open(FULLPATH, O_CREAT | O_WRONLY, mode); in TEST_F()
448 mode_t mode = S_IFREG | 0755; in TEST_F() local
454 expect_create(RELPATH, mode, in TEST_F()
455 ReturnImmediate([=](auto in __unused, auto& out) { in TEST_F()
457 out.body.create_7_8.entry.attr.mode = mode; in TEST_F()
466 fd = open(FULLPATH, O_CREAT | O_EXCL, mode); in TEST_F()
475 mode_t mode = S_IFREG | 0755; in TEST_F() local
481 expect_create(RELPATH, mode, in TEST_F()
482 ReturnImmediate([=](auto in __unused, auto& out) { in TEST_F()
484 out.body.create.entry.attr.mode = mode; in TEST_F()
490 fd = open(FULLPATH, O_CREAT | O_EXCL, mode); in TEST_F()