1 # -*- encoding: binary -*-
2 require './test/integration'
5 class TestMogileFSLargePipe< TestMogIntegration
8 @client = MogileFS::MogileFS.new(:hosts => @trackers, :domain => @domain)
11 def test_large_pipe_test
12 junk = File.open("/dev/urandom") { |fp| fp.read(1024) }
16 sha1 = Digest::SHA1.new
24 assert_equal(nr * junk.size, @client.store_file("a", nil, r))
26 @client.get_file_data("a") do |rd|
27 assert_equal(nr * junk.size, @client.store_file("b", nil, rd))
29 a = Thread.new { @client.get_file_data("a") { |rd| sha1read(rd) } }
30 b = Thread.new { @client.get_file_data("b") { |rd| sha1read(rd) } }
40 while rd.read(16384, buf)