2011-08-23 11:01:48 +00:00
|
|
|
require 'test_helper'
|
2010-01-26 20:31:03 +00:00
|
|
|
|
2010-01-28 15:30:18 +00:00
|
|
|
class SSHTest < Test::Unit::TestCase
|
2010-02-05 20:54:48 +00:00
|
|
|
should "be able to execute a command over ssh" do
|
|
|
|
ssh = Hydra::SSH.new(
|
|
|
|
'localhost', # connect to this machine
|
|
|
|
File.expand_path(File.join(File.dirname(__FILE__))), # move to the test directory
|
2010-02-06 21:23:52 +00:00
|
|
|
"ruby fixtures/hello_world.rb"
|
2010-02-05 20:54:48 +00:00
|
|
|
)
|
2010-02-06 21:23:52 +00:00
|
|
|
response = ssh.gets
|
|
|
|
assert_equal "Hello World", response.text
|
2010-02-05 20:54:48 +00:00
|
|
|
ssh.close
|
2010-01-26 20:31:03 +00:00
|
|
|
end
|
2011-04-26 15:08:15 +00:00
|
|
|
|
|
|
|
should "be able to handle a large number of non-Hydra console output" do
|
|
|
|
ssh = Hydra::SSH.new(
|
|
|
|
'localhost', # connect to this machine
|
|
|
|
File.expand_path(File.join(File.dirname(__FILE__))), # move to the test directory
|
|
|
|
"ruby fixtures/many_outputs_to_console.rb"
|
|
|
|
)
|
|
|
|
response = ssh.gets
|
|
|
|
assert_equal "My message", response.text
|
|
|
|
ssh.close
|
|
|
|
end
|
2010-01-26 20:31:03 +00:00
|
|
|
end
|