diff options
Diffstat (limited to 'test/test_mogilefs_integration.rb')
-rw-r--r-- | test/test_mogilefs_integration.rb | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/test/test_mogilefs_integration.rb b/test/test_mogilefs_integration.rb index 3c79308..6d16cd7 100644 --- a/test/test_mogilefs_integration.rb +++ b/test/test_mogilefs_integration.rb @@ -1,12 +1,16 @@ # -*- encoding: binary -*- -require './test/integration' +require './test/fresh' -class TestMogileFSIntegration < TestMogIntegration +class TestMogileFSIntegration < Test::Unit::TestCase + include TestFreshSetup def setup - super + setup_mogilefs + add_host_device_domain @client = MogileFS::MogileFS.new(:hosts => @trackers, :domain => @domain) end + alias teardown teardown_mogilefs + def test_CRUD assert ! @client.exist?("CRUD") assert_equal 4, @client.store_content("CRUD", "default", "DATA") @@ -157,9 +161,14 @@ class TestMogileFSIntegration < TestMogIntegration end end - # TODO: move this to a fresh instance def test_admin_each_fid admin = MogileFS::Admin.new(:hosts => @trackers) + input = %w(a b c d e) + input.each do |k| + rv = @client.new_file(k) + rv.write(k) + assert_nil rv.close + end seen = {} count = admin.each_fid do |info| seen[info["fid"]] = true @@ -171,7 +180,8 @@ class TestMogileFSIntegration < TestMogIntegration assert_kind_of String, info["domain"] end assert_equal count, seen.size - end if ENV["TEST_EXPENSIVE"] + assert_equal count, input.size + end def test_new_file_no_block rv = @client.new_file("no_block") |