Lines Matching refs:open

237         fbl::unique_fd fd(open(ramdisk_path_, O_RDWR));
238 ASSERT_TRUE(fd, "[FAILED]: Could not open test disk");
250 fbl::unique_fd fvm_fd(open(fvm_path_, O_RDWR));
251 ASSERT_GE(fvm_fd.get(), 0, "[FAILED]: Could not open FVM driver");
345 ASSERT_NONNULL(dir, "Unable to open FVM dir");
414 fbl::unique_fd fd(open(mount_path, O_RDONLY | O_DIRECTORY));
436 fbl::unique_fd fd(open(ramdisk_path_, flags));
437 ASSERT_TRUE(fd.get(), "Could not open ramdisk");
493 // Creates an open blob with the provided Merkle tree + Data, and
496 fbl::unique_fd fd(open(info->path, O_CREAT | O_RDWR));
507 fbl::unique_fd fd(open(info->path, O_CREAT | O_RDWR));
530 fbl::unique_fd fd(open(info->path, O_CREAT | O_RDWR));
607 fbl::unique_fd fd(open(MOUNT_PATH, O_RDONLY | O_DIRECTORY));
650 // We can re-open and verify the Blob as read-only
651 fd.reset(open(info->path, O_RDONLY));
656 // We cannot re-open the blob as writable
657 fd.reset(open(info->path, O_RDWR | O_CREAT));
659 fd.reset(open(info->path, O_RDWR));
660 ASSERT_FALSE(fd, "Shouldn't be able to re-open blob as writable");
661 fd.reset(open(info->path, O_WRONLY));
662 ASSERT_FALSE(fd, "Shouldn't be able to re-open blob as writable");
674 fbl::unique_fd fd(open(info->path, O_CREAT | O_EXCL | O_RDWR));
681 fd.reset(open(info->path, O_CREAT | O_EXCL | O_RDWR));
683 fd.reset(open(info->path, O_CREAT | O_RDWR));
686 fd.reset(open(info->path, O_RDONLY));
714 // We can re-open and verify the Blob as read-only
715 fd.reset(open(info->path, O_RDONLY));
720 // We cannot re-open the blob as writable
721 fd.reset(open(info->path, O_RDWR | O_CREAT));
723 fd.reset(open(info->path, O_RDWR));
724 ASSERT_FALSE(fd, "Shouldn't be able to re-open blob as writable");
725 fd.reset(open(info->path, O_WRONLY));
726 ASSERT_FALSE(fd, "Shouldn't be able to re-open blob as writable");
730 fd.reset(open(info->path, O_RDONLY));
750 fd.reset(open(info->path, O_RDONLY));
773 fd.reset(open(info->path, O_RDONLY));
783 // We should be able to re-open and remap the file.
789 fd.reset(open(info->path, O_RDONLY));
825 fd.reset(open(info[i]->path, O_RDONLY));
972 // After closing the fd, however, we should not be able to re-open the blob
974 ASSERT_LT(open(info->path, O_RDONLY), 0, "Expected blob to be deleted");
1013 fbl::unique_fd fd(open(info->path, O_CREAT | O_RDWR));
1020 ASSERT_LT(open(info->path, O_RDONLY), 0);
1061 ASSERT_LT(open(MOUNT_PATH "/00112233445566778899AABBCCDDEEFFGGHHIIJJKKLLMMNNOOPPQQRRSSTTUUVV",
1064 ASSERT_LT(open(MOUNT_PATH "/00112233445566778899AABBCCDDEEFF", O_CREAT | O_RDWR), 0,
1070 fbl::unique_fd fd(open(info->path, O_CREAT | O_RDWR));
1082 ASSERT_LT(open(info->path, O_RDWR), 0, "Cannot access partial blob");
1083 ASSERT_LT(open(info->path, O_RDONLY), 0, "Cannot access partial blob");
1086 fd.reset(open(info->path, O_CREAT | O_RDWR));
1092 ASSERT_LT(open(info->path, O_RDWR), 0, "Cannot access partial blob");
1183 fd.reset(open(info->path, O_RDONLY));
1184 ASSERT_TRUE(fd, "Failed to open blob");
1208 fd.reset(open(info->path, O_RDONLY));
1209 ASSERT_GE(fd.get(), 0, "Failed to open blob");
1234 fd.reset(open(info->path, O_RDONLY));
1235 ASSERT_GE(fd.get(), 0, "Failed to open blob");
1256 fd.reset(open(info->path, O_RDONLY));
1257 ASSERT_TRUE(fd, "Failed to open blob");
1300 fbl::unique_fd fd(open(info->path, O_CREAT | O_EXCL | O_RDWR));
1303 ASSERT_LT(open(info->path, O_CREAT | O_EXCL | O_RDWR), 0,
1307 fbl::unique_fd fd2(open(info->path, O_CREAT | O_RDWR));
1310 ASSERT_TRUE(check_not_readable(fd.get()), "Should not be readable after open");
1311 ASSERT_TRUE(check_not_readable(fd2.get()), "Should not be readable after open");
1348 fbl::unique_fd fd(open(info->path, O_CREAT | O_EXCL | O_RDWR));
1351 ASSERT_LT(open(info->path, O_CREAT | O_EXCL | O_RDWR), 0,
1376 ASSERT_TRUE(check_not_readable(fd.get()), "Should not be readable after open");
1402 fbl::unique_fd fd(open(info->path, O_CREAT | O_RDWR));
1425 // Unlink, close fd, re-open fd as new file
1430 fd.reset(open(path, O_CREAT | O_RDWR | O_EXCL));
1438 fbl::unique_fd fd(open(info->path, O_CREAT | O_RDWR));
1441 // Unlink after first open
1490 fbl::unique_fd dirfd(open(MOUNT_PATH "/.", O_RDONLY));
1491 ASSERT_TRUE(dirfd, "Cannot open root directory");
1518 fbl::unique_fd fd_partial(open(info_partial->path, O_CREAT | O_RDWR));
1547 fbl::unique_fd fd_partial(open(info_partial->path, O_CREAT | O_RDWR));
1563 fd_complete.reset(open(info_complete->path, O_RDONLY));
1564 ASSERT_TRUE(fd_complete, "Failed to re-open blob");
1571 fd_partial.reset(open(info_partial->path, O_RDONLY));
1572 ASSERT_FALSE(fd_partial, "Should not be able to open invalid blob");
1606 // Generate and open a new blob
1621 fbl::unique_fd fd(open(state->info->path, O_CREAT | O_RDWR));
1631 // Allocate space for an open, empty blob
1652 // Write the data for an open, partially written blob
1729 fbl::unique_fd fd(open(state->info->path, O_RDONLY));
1792 // We can re-open and verify the Blob as read-only
1793 fd.reset(open(info->path, O_RDONLY));
1798 // We cannot re-open the blob as writable
1799 fd.reset(open(info->path, O_RDWR | O_CREAT));
1801 fd.reset(open(info->path, O_RDWR));
1802 ASSERT_FALSE(fd, "Shouldn't be able to re-open blob as writable");
1803 fd.reset(open(info->path, O_WRONLY));
1804 ASSERT_FALSE(fd, "Shouldn't be able to re-open blob as writable");
1808 fd.reset(open(info->path, O_RDONLY));
1833 // We can re-open and verify the Blob as read-only
1834 fd.reset(open(info->path, O_RDONLY));
1839 // We cannot re-open the blob as writable
1840 fd.reset(open(info->path, O_RDWR | O_CREAT));
1842 fd.reset(open(info->path, O_RDWR));
1843 ASSERT_FALSE(fd, "Shouldn't be able to re-open blob as writable");
1844 fd.reset(open(info->path, O_WRONLY));
1845 ASSERT_FALSE(fd, "Shouldn't be able to re-open blob as writable");
1849 fd.reset(open(info->path, O_RDONLY));
1903 fbl::unique_fd fd(open(state.info->path, O_RDONLY));
1911 ASSERT_LT(open(state.info->path, O_RDONLY), 0);
1984 fbl::unique_fd fd(open(state.info->path, O_RDONLY));
1992 ASSERT_LT(open(state.info->path, O_RDONLY), 0);
2009 fbl::unique_fd fd(open(info->path, O_CREAT | O_RDWR));
2038 fbl::unique_fd dirfd(open(MOUNT_PATH "/.", O_RDONLY | O_ADMIN));
2039 ASSERT_TRUE(dirfd, "Cannot open root directory");
2058 dirfd.reset(open(MOUNT_PATH "/.", O_RDONLY));
2059 ASSERT_TRUE(dirfd, "Cannot open root directory");
2086 blob_fd.reset(open(info->path, O_RDONLY));
2093 ASSERT_LT(open(info->path, O_CREAT | O_RDWR), 0);
2157 ASSERT_TRUE(fd, "Could not open ramdisk");
2182 ASSERT_TRUE(fd, "Could not open ramdisk");
2201 ASSERT_TRUE(fd, "Could not open ramdisk");
2222 fbl::unique_fd fd(open(dat->path, O_RDONLY));
2371 fbl::unique_fd fd(open(argv[i + 1], O_RDWR));
2373 fprintf(stderr, "[fs] Could not open block device\n");