From 088d88332564a5d09cf8a57695a53453ab59f686 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Tue, 8 Nov 2011 01:07:24 +0000 Subject: tests: include test for opening FIFO paths It's conceivable we'd need it. --- test/test_mogilefs_integration_large_pipe.rb | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/test/test_mogilefs_integration_large_pipe.rb b/test/test_mogilefs_integration_large_pipe.rb index 0ddffb2..afc62e5 100644 --- a/test/test_mogilefs_integration_large_pipe.rb +++ b/test/test_mogilefs_integration_large_pipe.rb @@ -33,6 +33,21 @@ class TestMogileFSLargePipe< TestMogIntegration b = b.value assert_equal a, b assert_equal sha1, a + + # We should be able to open FIFOs + tmp = tmpfile("fifo") + tmp_path = tmp.path + File.unlink(tmp_path) + x!("mkfifo", tmp_path) + th = Thread.new do + File.open(tmp_path, "wb") do |w| + nr.times { w.write(junk) } + end + end + assert_equal(nr * junk.size, @client.store_file("fifo", nil, tmp_path)) + th.join + fifo_sha1 = @client.get_file_data("fifo") { |rd| sha1read(rd) } + assert_equal sha1, fifo_sha1 end def sha1read(rd) -- cgit v1.2.3-24-ge0c7