From a2e588e508272c704121b4d1c5a3984ab884ebcb Mon Sep 17 00:00:00 2001 From: Steve Kemp Date: Tue, 13 Nov 2012 15:15:01 +0000 Subject: Validate we have a port and a host to probe --- worker/tests/ssh.rb | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'worker/tests') diff --git a/worker/tests/ssh.rb b/worker/tests/ssh.rb index 9f15860..18815b4 100755 --- a/worker/tests/ssh.rb +++ b/worker/tests/ssh.rb @@ -27,6 +27,24 @@ class SSHTest # def initialize( data ) @test_data = data + @error = nil + + + # + # Ensure we have a host to probe + # + if ( @test_data["target_host"].nil? ) + @error = "Missing target for the test." + raise ArgumentError, @error + end + + # + # Ensure we have a port to test. + # + if ( @test_data["test_port"].nil? ) + @error = "Missing port for the test." + raise ArgumentError, @error + end end -- cgit v1.2.1