mirror of
https://github.com/falk-werner/webfuse-provider
synced 2026-03-02 04:09:18 +00:00
added unit tests for getattr operation (adapter)
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
#include "webfuse/adapter/impl/operation/close.h"
|
||||
#include "webfuse/adapter/impl/operation/read.h"
|
||||
#include "webfuse/adapter/impl/operation/readdir.h"
|
||||
#include "webfuse/adapter/impl/operation/getattr.h"
|
||||
#include "webfuse/adapter/impl/session.h"
|
||||
#include "webfuse/adapter/impl/mountpoint.h"
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#include "webfuse/adapter/impl/operation/getattr.h"
|
||||
#include "webfuse/adapter/impl/operations.h"
|
||||
|
||||
#include <errno.h>
|
||||
@@ -11,16 +12,7 @@
|
||||
#include "webfuse/core/json_util.h"
|
||||
#include "webfuse/core/util.h"
|
||||
|
||||
struct wf_impl_operation_getattr_context
|
||||
{
|
||||
fuse_req_t request;
|
||||
fuse_ino_t inode;
|
||||
double timeout;
|
||||
uid_t uid;
|
||||
gid_t gid;
|
||||
};
|
||||
|
||||
static void wf_impl_operation_getattr_finished(
|
||||
void wf_impl_operation_getattr_finished(
|
||||
void * user_data,
|
||||
json_t const * result,
|
||||
json_t const * error)
|
||||
@@ -33,8 +25,7 @@ static void wf_impl_operation_getattr_finished(
|
||||
{
|
||||
json_t * mode_holder = json_object_get(result, "mode");
|
||||
json_t * type_holder = json_object_get(result, "type");
|
||||
if ((NULL != mode_holder) && (json_is_integer(mode_holder)) &&
|
||||
(NULL != type_holder) && (json_is_string(type_holder)))
|
||||
if ((json_is_integer(mode_holder)) && (json_is_string(type_holder)))
|
||||
{
|
||||
memset(&buffer, 0, sizeof(struct stat));
|
||||
|
||||
|
||||
37
lib/webfuse/adapter/impl/operation/getattr.h
Normal file
37
lib/webfuse/adapter/impl/operation/getattr.h
Normal file
@@ -0,0 +1,37 @@
|
||||
#ifndef WF_ADAPTER_IMPL_OPERATION_GETATTR_H
|
||||
#define WF_ADAPTER_IMPL_OPERATION_GETATTR_H
|
||||
|
||||
#include "webfuse/adapter/impl/fuse_wrapper.h"
|
||||
|
||||
#include <jansson.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
struct wf_impl_operation_getattr_context
|
||||
{
|
||||
fuse_req_t request;
|
||||
fuse_ino_t inode;
|
||||
double timeout;
|
||||
uid_t uid;
|
||||
gid_t gid;
|
||||
};
|
||||
|
||||
extern void wf_impl_operation_getattr_finished(
|
||||
void * user_data,
|
||||
json_t const * result,
|
||||
json_t const * error);
|
||||
|
||||
extern void wf_impl_operation_getattr (
|
||||
fuse_req_t request,
|
||||
fuse_ino_t inode,
|
||||
struct fuse_file_info *file_info);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -22,18 +22,6 @@ extern void wf_impl_operation_lookup (
|
||||
fuse_ino_t parent,
|
||||
char const * name);
|
||||
|
||||
extern void wf_impl_operation_getattr (
|
||||
fuse_req_t request,
|
||||
fuse_ino_t inode,
|
||||
struct fuse_file_info *file_info);
|
||||
|
||||
extern void wf_impl_operation_readdir (
|
||||
fuse_req_t request,
|
||||
fuse_ino_t inode,
|
||||
size_t size,
|
||||
off_t offset,
|
||||
struct fuse_file_info *file_info);
|
||||
|
||||
extern struct wf_jsonrpc_proxy * wf_impl_operations_context_get_proxy(
|
||||
struct wf_impl_operations_context * context);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user