summaryrefslogtreecommitdiff
path: root/worker/tests
diff options
context:
space:
mode:
authorSteve Kemp <steve@steve.org.uk>2012-11-13 15:15:01 +0000
committerSteve Kemp <steve@steve.org.uk>2012-11-13 15:15:01 +0000
commita2e588e508272c704121b4d1c5a3984ab884ebcb (patch)
tree0b109a53233c03b79d4738287697bd2b404b0498 /worker/tests
parent5fd15341264b5aae31d41afcd09affea0df6ee24 (diff)
Validate we have a port and a host to probe
Diffstat (limited to 'worker/tests')
-rwxr-xr-xworker/tests/ssh.rb18
1 files changed, 18 insertions, 0 deletions
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