filecluster 0.5.8 → 0.5.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/fc/item.rb +1 -2
- data/lib/fc/version.rb +1 -1
- data/test/daemon_test.rb +4 -6
- data/test/storage_sync_test.rb +1 -6
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3f60e5ac0d24dbb13cd23102a51c0c044fb3cd01
|
4
|
+
data.tar.gz: 36808f3fbf80cb1af4149259d85dc409d3bf093a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 39e08fe5acf73bd152b30d68b74536dbabb57c30722ce7606a597d383680ff1b3db1432cec8467c9fce6d8e15a501035d0c61fe7a45a09deffb73b8e46509b52
|
7
|
+
data.tar.gz: 0499dfd3ab6bfa66cfc9589d937235d61d8578160184194d6e8afc2b98f3e3cc6737c3cc762d82bc3e8f2c5934c0bc95f0578cecd86a66fed5b779a5fc261b97
|
data/lib/fc/item.rb
CHANGED
@@ -78,8 +78,7 @@ module FC
|
|
78
78
|
FC::DB.query("UPDATE #{FC::ItemStorage.table_name} SET status='delete' WHERE item_id = #{item.id} AND storage_name <> '#{storage.name}'") if options[:replace]
|
79
79
|
|
80
80
|
item_storage = item.make_item_storage(storage)
|
81
|
-
|
82
|
-
item.copy_item_storage(local_path, storage, item_storage, options[:remove_local], speed_limit)
|
81
|
+
item.copy_item_storage(local_path, storage, item_storage, options[:remove_local], options[:speed_limit])
|
83
82
|
end
|
84
83
|
|
85
84
|
return item
|
data/lib/fc/version.rb
CHANGED
data/test/daemon_test.rb
CHANGED
@@ -23,7 +23,7 @@ class DaemonTest < Test::Unit::TestCase
|
|
23
23
|
FC::Var.set('daemon_global_error_items_ttl', 2)
|
24
24
|
@stotage_checks = 0
|
25
25
|
Thread.new do
|
26
|
-
Open3.popen2e("#{daemon_bin} -c #{db_config_file} -l debug -h
|
26
|
+
Open3.popen2e("#{daemon_bin} -c #{db_config_file} -l debug -h localhost") do |stdin, stdout, t|
|
27
27
|
@@pid = t.pid
|
28
28
|
while line = stdout.readline
|
29
29
|
@stotage_checks += 1 if line =~ /Finish stotage check/i
|
@@ -47,21 +47,21 @@ class DaemonTest < Test::Unit::TestCase
|
|
47
47
|
@@storages = []
|
48
48
|
@@storages << FC::Storage.new(
|
49
49
|
:name => 'host1-sda',
|
50
|
-
:host => '
|
50
|
+
:host => 'localhost',
|
51
51
|
:path => '/tmp/host1-sda/',
|
52
52
|
:copy_storages => 'host1-sdb,host1-sdc',
|
53
53
|
:size_limit => 1_000_000_000
|
54
54
|
)
|
55
55
|
@@storages << FC::Storage.new(
|
56
56
|
:name => 'host1-sdb',
|
57
|
-
:host => '
|
57
|
+
:host => 'localhost',
|
58
58
|
:path => '/tmp/host1-sdb/',
|
59
59
|
:copy_storages => 'host1-sda,host1-sdc',
|
60
60
|
:size_limit => 1_000_000_000
|
61
61
|
)
|
62
62
|
@@storages << FC::Storage.new(
|
63
63
|
:name => 'host1-sdc',
|
64
|
-
:host => '
|
64
|
+
:host => 'localhost',
|
65
65
|
:path => '/tmp/host1-sdc/',
|
66
66
|
:copy_storages => 'host1-sda,host1-sdb',
|
67
67
|
:size_limit => 1_000_000_000
|
@@ -104,8 +104,6 @@ class DaemonTest < Test::Unit::TestCase
|
|
104
104
|
assert @@storages[1].up?, "Storage #{@@storages[1].name} down"
|
105
105
|
assert @@storages[2].up?, "Storage #{@@storages[2].name} down"
|
106
106
|
|
107
|
-
FC::Storage.any_instance.stubs(:host).returns('host1')
|
108
|
-
FC::Storage.stubs(:curr_host).returns('host1')
|
109
107
|
assert_nothing_raised { @item1 = make_file_item('bla/bla/test1', 'test1') }
|
110
108
|
assert_nothing_raised { @item2 = make_file_item('bla/bla/test2', 'test2') }
|
111
109
|
assert_nothing_raised { @item3 = make_dir_item('bla/bla/test3', 'test3') }
|
data/test/storage_sync_test.rb
CHANGED
@@ -12,7 +12,7 @@ class StorageSyncTest < Test::Unit::TestCase
|
|
12
12
|
@@test_file_path = '/tmp/fc_test_file'
|
13
13
|
`dd if=/dev/urandom of=#{@@test_file_path} bs=1M count=1 2>&1`
|
14
14
|
|
15
|
-
@@storage = FC::Storage.new(:name => 'host1-sda', :host => '
|
15
|
+
@@storage = FC::Storage.new(:name => 'host1-sda', :host => 'localhost', :path => '/tmp/host1-sda/', :size_limit => 1000000000, :check_time => Time.new.to_i)
|
16
16
|
@@storage.save
|
17
17
|
@@policy = FC::Policy.new(:create_storages => 'host1-sda', :copies => 1, :name => 'policy 1')
|
18
18
|
@@policy.save
|
@@ -28,11 +28,6 @@ class StorageSyncTest < Test::Unit::TestCase
|
|
28
28
|
end
|
29
29
|
end
|
30
30
|
|
31
|
-
def setup
|
32
|
-
FC::Storage.any_instance.stubs(:host).returns('host1')
|
33
|
-
FC::Storage.stubs(:curr_host).returns('host1')
|
34
|
-
end
|
35
|
-
|
36
31
|
should "sync_all" do
|
37
32
|
assert_nothing_raised { @item1 = FC::Item.create_from_local(@@test_file_path, 'a/test1', @@policy, {:tag => 'test'}) }
|
38
33
|
assert_nothing_raised { @item2 = FC::Item.create_from_local(@@test_file_path, 'a/b/test2', @@policy, {:tag => 'test'}) }
|