rfuse 1.1.2 → 1.2.0.rc202009.69
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -13
- data/CHANGES.md +6 -0
- data/README.md +3 -2
- data/ext/rfuse/rfuse.c +1 -1
- data/lib/rfuse/version.rb +1 -1
- metadata +24 -42
- data/.gitignore +0 -5
- data/.travis.yml +0 -20
- data/Gemfile +0 -4
- data/Rakefile +0 -17
- data/ext/.gitignore +0 -2
- data/rfuse.gemspec +0 -31
- data/sample/test-ruby.rb +0 -310
- data/spec/basic_spec.rb +0 -243
- data/spec/fuse_file_info_spec.rb +0 -119
- data/spec/main_spec.rb +0 -161
- data/spec/options_spec.rb +0 -143
- data/spec/ruby_loop_spec.rb +0 -63
- data/spec/run_spec.rb +0 -60
- data/spec/signals_spec.rb +0 -108
- data/spec/spec_helper.rb +0 -109
- data/spec/xattr_spec.rb +0 -49
data/spec/xattr_spec.rb
DELETED
@@ -1,49 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
require 'ffi-xattr'
|
3
|
-
|
4
|
-
describe RFuse::Fuse do
|
5
|
-
it "should handle extended attributes" do
|
6
|
-
mockfs = mock("fuse")
|
7
|
-
|
8
|
-
file_stat = RFuse::Stat.file(0444,:size => 11)
|
9
|
-
|
10
|
-
mockfs.stub(:getattr).and_return(file_stat)
|
11
|
-
mockfs.stub(:getxattr) { |ctx,path,name|
|
12
|
-
case name
|
13
|
-
when "user.one"
|
14
|
-
"1"
|
15
|
-
when "user.two"
|
16
|
-
"2"
|
17
|
-
when "user.large"
|
18
|
-
"x" * 1000
|
19
|
-
else
|
20
|
-
""
|
21
|
-
end
|
22
|
-
}
|
23
|
-
|
24
|
-
mockfs.stub(:listxattr).with(anything(),"/myfile").and_return([ "user.one","user.two","user.large" ])
|
25
|
-
mockfs.should_receive(:setxattr).with(anything(),"/myfile","user.three","updated",anything())
|
26
|
-
mockfs.should_receive(:removexattr).with(anything(),"/myfile","user.one")
|
27
|
-
|
28
|
-
mountpoint = tempmount()
|
29
|
-
|
30
|
-
with_fuse(mountpoint,mockfs) do
|
31
|
-
xattr = Xattr.new("#{mountpoint}/myfile")
|
32
|
-
xattr.list.should include("user.one")
|
33
|
-
xattr.list.should include("user.two")
|
34
|
-
xattr.list.size.should == 3
|
35
|
-
|
36
|
-
xattr['user.one'].should == "1"
|
37
|
-
xattr['user.two'].should == "2"
|
38
|
-
xattr['user.three']= "updated"
|
39
|
-
xattr['xxxxx'].should be_nil
|
40
|
-
xattr.remove('user.one')
|
41
|
-
# And now with a non-ruby system #TODO. There'd be a way to guard this properly
|
42
|
-
if system("getfattr --version")
|
43
|
-
system("getfattr -d #{mountpoint}/myfile > /dev/null").should be(true)
|
44
|
-
else
|
45
|
-
puts "Warning Skipping getfattr test"
|
46
|
-
end
|
47
|
-
end
|
48
|
-
end
|
49
|
-
end
|