diff options
author | Eric Wong <normlaperson@yhbt.net> | 2012-02-06 10:22:14 +0000 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2012-02-06 10:22:32 +0000 |
commit | 24473e914df84078ae62b220c635b209b0c4e03c (patch) | |
tree | 702b5da47a30d87de3ddbe0158d287fa9837bf47 /test/mgmt-iostat.rb | |
parent | a927ee3e17907332aac243a94e19e3f40f754c09 (diff) | |
download | cmogstored-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.rb | 9 |
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 |