about summary refs log tree commit homepage
path: root/test/mgmt-iostat.rb
diff options
context:
space:
mode:
authorEric Wong <normlaperson@yhbt.net>2012-02-06 10:22:14 +0000
committerEric Wong <normalperson@yhbt.net>2012-02-06 10:22:32 +0000
commit24473e914df84078ae62b220c635b209b0c4e03c (patch)
tree702b5da47a30d87de3ddbe0158d287fa9837bf47 /test/mgmt-iostat.rb
parenta927ee3e17907332aac243a94e19e3f40f754c09 (diff)
downloadcmogstored-24473e914df84078ae62b220c635b209b0c4e03c.tar.gz
The ruby executable name is "ruby19" on some systems, so
"/usr/bin/env ruby" will do bad things to us.
Diffstat (limited to 'test/mgmt-iostat.rb')
-rw-r--r--test/mgmt-iostat.rb9
1 files changed, 7 insertions, 2 deletions
diff --git a/test/mgmt-iostat.rb b/test/mgmt-iostat.rb
index a6365ec..944661c 100644
--- a/test/mgmt-iostat.rb
+++ b/test/mgmt-iostat.rb
@@ -6,6 +6,11 @@ require 'test/test_helper'
 
 class TestMgmtIostat < Test::Unit::TestCase
   TEST_PATH = File.dirname(__FILE__) + ":#{ENV['PATH']}"
+  RUBY = ENV["RUBY"] || "ruby"
+
+  def iostat_mock
+    "#{RUBY} #{File.dirname(__FILE__)}/iostat-mock.rb"
+  end
 
   def setup
     @iostat_pid = Tempfile.new('testt-iostat-pid')
@@ -46,7 +51,7 @@ class TestMgmtIostat < Test::Unit::TestCase
     Dir.mkdir "#@tmpdir/dev666"
     @pid = fork do
       ENV["PATH"] = TEST_PATH
-      ENV["MOG_IOSTAT_CMD"] = "iostat-mock.rb #{@iostat_pid.path} fast"
+      ENV["MOG_IOSTAT_CMD"] = "#{iostat_mock} #{@iostat_pid.path} fast"
       exec(*@cmd)
     end
 
@@ -93,7 +98,7 @@ class TestMgmtIostat < Test::Unit::TestCase
     Dir.mkdir "#@tmpdir/dev666"
     @pid = fork do
       ENV["PATH"] = TEST_PATH
-      ENV["MOG_IOSTAT_CMD"] = "iostat-mock.rb #{@iostat_pid.path} #{type}"
+      ENV["MOG_IOSTAT_CMD"] = "#{iostat_mock} #{@iostat_pid.path} #{type}"
       exec(*@cmd)
     end