fuse unit tests and fixes
Some checks failed
BlockStorage/repertory/pipeline/head There was a failure building this commit

This commit is contained in:
Scott E. Graves 2024-11-13 10:03:10 -06:00
parent 2e587fd897
commit 6300270a21

View File

@ -472,35 +472,23 @@ TYPED_TEST(fuse_test, create_fails_if_invalid) {
} }
TYPED_TEST(fuse_test, create_open_fails_if_path_is_directory) { TYPED_TEST(fuse_test, create_open_fails_if_path_is_directory) {
std::array<int, 10U> ops{ std::array<int, 9U> ops{
O_APPEND, O_APPEND, O_EXCL | O_WRONLY, O_RDWR | O_APPEND,
O_EXCL | O_WRONLY, O_RDWR | O_EXCL, O_RDWR | O_TRUNC, O_RDWR,
O_EXCL, O_TRUNC, O_WRONLY | O_APPEND, O_WRONLY,
O_RDWR | O_APPEND,
O_RDWR | O_EXCL,
O_RDWR | O_TRUNC,
O_RDWR,
O_TRUNC,
O_WRONLY | O_APPEND,
O_WRONLY,
}; };
std::string dir_name{"create_test"}; std::string dir_name{"create_test"};
auto dir_path = this->create_directory_and_test(dir_name); auto dir_path = this->create_directory_and_test(dir_name);
for (auto &&flags : ops) { for (auto &&flags : ops) {
auto handle = open(dir_path.c_str(), flags, ACCESSPERMS); auto handle = open(dir_path.c_str(), flags);
EXPECT_EQ(-1, handle); EXPECT_EQ(-1, handle);
if (handle != -1) {
std::cout << std::oct << flags << std::endl;
}
EXPECT_EQ(EISDIR, errno); EXPECT_EQ(EISDIR, errno);
} }
this->rmdir_and_test(dir_path); this->rmdir_and_test(dir_path);
} }
} // namespace repertory } // namespace repertory
#endif // !defined(_WIN32) #endif // !defined(_WIN32)