cmogstored dev/user discussion/issues/patches/etc
 help / color / mirror / code / Atom feed
From: Eric Wong <e@80x24.org>
To: cmogstored-public@bogomips.org
Cc: Eric Wong <e@80x24.org>
Subject: [PATCH] test/mgmt: relax checks for iostat mapping
Date: Sun, 17 Jul 2016 05:16:24 +0000	[thread overview]
Message-ID: <20160717051624.8792-1-e@80x24.org> (raw)

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.
---
 test/mgmt.rb | 14 +++++++++++---
 1 file 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
-- 
EW


                 reply	other threads:[~2016-07-17  5:16 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://yhbt.net/cmogstored/README

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160717051624.8792-1-e@80x24.org \
    --to=e@80x24.org \
    --cc=cmogstored-public@bogomips.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhbt.net/cmogstored.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).