about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2016-07-17 05:16:24 +0000
committerEric Wong <e@80x24.org>2016-07-17 05:16:42 +0000
commit360ef6aee6b1e4e0855377a343a6e39263b15daa (patch)
treece0da9f3a8174c0050ea48b965cfad4f7253f265
parent7389b9ba076ffd49d5c37113809f46c2bf1f38f3 (diff)
downloadcmogstored-360ef6aee6b1e4e0855377a343a6e39263b15daa.tar.gz
In the age of virtualized devices and fast solid-state storage,
iostat information isn't as useful at it was a decade ago and
probably less useful in tests.  So relax the tests.
-rw-r--r--test/mgmt.rb14
1 files changed, 11 insertions, 3 deletions
diff --git a/test/mgmt.rb b/test/mgmt.rb
index 64f7bfc..28ef255 100644
--- a/test/mgmt.rb
+++ b/test/mgmt.rb
@@ -347,7 +347,11 @@ class TestMgmt < Test::Unit::TestCase
       break if str =~ /^666\t/
     end
     util = RUBY_PLATFORM =~ /linux/ ? %r{\d+\.\d\d} : %r{\d+(?:\.\d+)?}
-    assert_match(/^666\t#{util}\n/, str, swarn(str.inspect))
+    if str =~ /^666\t-\n/
+      warn "'watch' may not work correctly on virtual disks\n"
+    else
+      assert_match(/^666\t#{util}\n/, str, swarn(str.inspect))
+    end
     assert_equal ".\n", @client.gets
   end if `which iostat 2>/dev/null`.chomp.size != 0 &&
          RUBY_PLATFORM !~ /kfreebsd-gnu/
@@ -363,8 +367,12 @@ class TestMgmt < Test::Unit::TestCase
     lines = []
     lines << @client.gets
     lines << @client.gets
-    assert_match(/^(666|999)\t#{util}\n/, lines[0], swarn(lines.inspect))
-    assert_match(/^(666|999)\t#{util}\n/, lines[1], swarn(lines.inspect))
+    if lines.grep(/^(666|999)\t-\n/)[0]
+      warn "'watch' may not work correctly on virtual disks\n"
+    else
+      assert_match(/^(666|999)\t#{util}\n/, lines[0], swarn(lines.inspect))
+      assert_match(/^(666|999)\t#{util}\n/, lines[1], swarn(lines.inspect))
+    end
     assert_not_equal(lines[0], lines[1])
 
     assert_equal ".\n", @client.gets