Skip to content

Commit

Permalink
change 'fuse_client' to 'curve-fuse'
Browse files Browse the repository at this point in the history
  • Loading branch information
xu-chaojie committed Oct 11, 2021
1 parent 91f9615 commit 2bf3916
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 9 deletions.
2 changes: 1 addition & 1 deletion curvefs/devops/vars/client.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ project_config_src: "{{ playbook_dir | dirname }}/conf"
project_config_dsv: "="
project_core_method: "{{ curvefs_core_method }}"
project_mount_command: >
{{ project_root_dest }}/sbin/fuse_client
{{ project_root_dest }}/sbin/curve-fuse
{{ curvefs_client_mount_args | trim }}
-o conf={{ project_root_dest }}/conf/client.conf
{{ curvefs_client_mount_path }}
Expand Down
2 changes: 1 addition & 1 deletion curvefs/src/client/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ load(
)

cc_binary(
name = "fuse_client",
name = "curve-fuse",
srcs = glob([
"*.cpp",
"*.c",
Expand Down
2 changes: 1 addition & 1 deletion curvefs/test/client/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ cc_binary(
)

cc_test(
name = "fuse_client_test",
name = "curve_fuse_test",
srcs = glob([
"*.cpp",
"*.c",
Expand Down
36 changes: 36 additions & 0 deletions curvefs/test/client/test_fuse_client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1758,6 +1758,42 @@ TEST_F(TestFuseS3Client, FuseOpWriteAndFlushInode) {
ASSERT_EQ(false, inodeWrapper->isDirty());
}

TEST_F(TestFuseS3Client, FuseOpWriteAndFlushInodeFailed) {
fuse_req_t req;
fuse_ino_t ino = 1;
const char *buf = "xxx";
size_t size = 4;
off_t off = 0;
struct fuse_file_info fi;
fi.flags = O_WRONLY;
size_t wSize = 0;

Inode inode;
inode.set_inodeid(ino);
inode.set_length(0);
auto inodeWrapper = std::make_shared<InodeWrapper>(inode, metaClient_);

EXPECT_CALL(*inodeManager_, GetInode(ino, _))
.WillOnce(DoAll(SetArgReferee<1>(inodeWrapper),
Return(CURVEFS_ERROR::OK)));

EXPECT_CALL(*s3ClientAdaptor_, Write(_, _, _, _))
.WillOnce(Return(size));

CURVEFS_ERROR ret = client_->FuseOpWrite(
req, ino, buf, size, off, &fi, &wSize);

ASSERT_EQ(CURVEFS_ERROR::OK, ret);
ASSERT_EQ(size, wSize);
ASSERT_EQ(true, inodeWrapper->isDirty());

EXPECT_CALL(*metaClient_, UpdateInode(_))
.WillOnce(Return(MetaStatusCode::UNKNOWN_ERROR));

client_->FlushInode();
ASSERT_EQ(true, inodeWrapper->isDirty());
}

TEST_F(TestFuseS3Client, FuseOpWriteSmallSize) {
fuse_req_t req;
fuse_ino_t ino = 1;
Expand Down
12 changes: 6 additions & 6 deletions startfs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ stop(){
sudo killall -9 curve_fs_space_allocator_main
sudo killall -9 curvefs_metaserver
sudo killall -9 curvefs_mds
sudo killall -9 fuse_client
sudo killall -9 curve-fuse
sudo umount ${mountdir}
echo "stoped"
}
Expand All @@ -21,17 +21,17 @@ start(){

if [ "$1" = "volume" ]
then
echo "start fuse_client volume"
LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libjemalloc.so.1 ./bazel-bin/curvefs/src/client/fuse_client -f -o default_permissions -o allow_other -o volume=/fs -o fstype=volume -o user=test -o conf=./curvefs/conf/curvefs_client.conf $2 &
echo "start curve-fuse volume"
LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libjemalloc.so.1 ./bazel-bin/curvefs/src/client/curve-fuse -f -o default_permissions -o allow_other -o volume=/fs -o fstype=volume -o user=test -o conf=./curvefs/conf/curvefs_client.conf $2 &
elif [ "$1" = "s3" ]
then
echo "start fuse_client s3"
LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libjemalloc.so.1 ./bazel-bin/curvefs/src/client/fuse_client -f -o default_permissions -o allow_other -o fsname=s3_1 -o fstype=s3 -o user=test -o conf=./curvefs/conf/curvefs_client.conf $2 &
echo "start curve-fuse s3"
LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libjemalloc.so.1 ./bazel-bin/curvefs/src/client/curve-fuse -f -o default_permissions -o allow_other -o fsname=s3_1 -o fstype=s3 -o user=test -o conf=./curvefs/conf/curvefs_client.conf $2 &
fi
ps -aux | grep -v grep | grep curve_fs_space_allocator_main
ps -aux | grep -v grep | grep curvefs_metaserver
ps -aux | grep -v grep | grep curvefs_mds
ps -aux | grep -v grep | grep fuse_client
ps -aux | grep -v grep | grep curve-fuse
}

restart(){
Expand Down

0 comments on commit 2bf3916

Please sign in to comment.