summaryrefslogtreecommitdiff
path: root/worker/tests/jabber.rb
diff options
context:
space:
mode:
authorSteve Kemp <steve@steve.org.uk>2012-11-13 15:20:54 +0000
committerSteve Kemp <steve@steve.org.uk>2012-11-13 15:20:54 +0000
commit58b71405c03e5344b43993e75984174407a74ac6 (patch)
treeaafd21dca23899c8bc083d4dc795db111d61d33b /worker/tests/jabber.rb
parentd5f77dd9c7a272d0912e4fcbd2e05cca0bc62147 (diff)
Validate we have a host + port
Diffstat (limited to 'worker/tests/jabber.rb')
-rwxr-xr-xworker/tests/jabber.rb21
1 files changed, 20 insertions, 1 deletions
diff --git a/worker/tests/jabber.rb b/worker/tests/jabber.rb
index bc4a5ec..ab628d5 100755
--- a/worker/tests/jabber.rb
+++ b/worker/tests/jabber.rb
@@ -29,6 +29,25 @@ class JABBERTest
#
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
@@ -48,7 +67,7 @@ class JABBERTest
# Get the hostname & port to test against.
#
host = @test_data['target_host']
- port = 5222
+ port = @test_data['test_port']
puts "Jabber testing host #{host}:#{port}" if ( @test_data['verbose'] )