- ok(stat(file_path, &statbuf) == -1 && errno == ENOENT, "%s no longer present on file system after unlink", file_path);
- ok(stat(unlinked_file_path, &statbuf) == 0, "%s exists on file system after unlink", unlinked_file_path);
+ ok(lttng_directory_handle_stat(dir_handle, file_name, &statbuf) == -1 &&
+ errno == ENOENT,
+ "%s no longer present on file system after unlink",
+ file_name);
+ ok(lttng_directory_handle_stat(
+ dir_handle, unlinked_file_zero, &statbuf) == 0,
+ "%s exists on file system after unlink",
+ unlinked_file_zero);
+
+ /*
+ * It should be possible to use the file descriptors of both handles.
+ * Since only one file descriptor can be opened at once, this should
+ * force the fd_tracker to suspend and restore the handles.
+ */
+ fd = fs_handle_get_fd(handles[0]);
+ ok(fd >= 0, "Got fd from first handle");
+
+ fd = fs_handle_get_fd(handles[1]);
+ ok (fd < 0, "fd tracker does not allow two fds to be used at once");
+
+ fs_handle_put_fd(handles[0]);
+ fd = fs_handle_get_fd(handles[1]);
+ ok(fd >= 0, "Got fd from second handle");
+ fs_handle_put_fd(handles[1]);