diff options
Diffstat (limited to 'test/mgmt.rb')
-rw-r--r-- | test/mgmt.rb | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/test/mgmt.rb b/test/mgmt.rb index 373cd69..c03ec7a 100644 --- a/test/mgmt.rb +++ b/test/mgmt.rb @@ -288,6 +288,26 @@ class TestMgmt < Test::Unit::TestCase assert_match(%r{ERROR: unknown command}, @client.gets) end + def test_giant_devid_skip + max = 16777215 # devid is MEDIUMINT in DB + Dir.mkdir("#@tmpdir/dev#{max}") + Dir.mkdir("#@tmpdir/dev#{max + 1}") + @client.write "watch\n" + lines = [] + + 2.times do # 2 times in case we're slow + begin + line = @client.gets + lines << line + end until line == ".\n" + end + + assert lines.grep(/\b#{max}\b/)[0] + assert_nil lines.grep(/\b#{max + 1}\b/)[0] + assert File.exist?("#@tmpdir/dev#{max}/usage") + assert ! File.exist?("#@tmpdir/dev#{max + 1}/usage") + end + def test_iostat_watch Dir.mkdir("#@tmpdir/dev666") @client.write "watch\n" |