summaryrefslogtreecommitdiff
path: root/worker
diff options
context:
space:
mode:
authorSteve Kemp <steve@steve.org.uk>2012-11-13 15:16:42 +0000
committerSteve Kemp <steve@steve.org.uk>2012-11-13 15:16:42 +0000
commit7b4b8a0b37c8f772175438b0e05ea0b83b5ae718 (patch)
tree3bfc3e90781ebfd19593159f3863412f179b71fe /worker
parenta2e588e508272c704121b4d1c5a3984ab884ebcb (diff)
Test that we have a host + port to test.
Diffstat (limited to 'worker')
-rwxr-xr-xworker/tests/rsync.rb19
1 files changed, 18 insertions, 1 deletions
diff --git a/worker/tests/rsync.rb b/worker/tests/rsync.rb
index 1d4e49f..02f2dfa 100755
--- a/worker/tests/rsync.rb
+++ b/worker/tests/rsync.rb
@@ -29,6 +29,23 @@ class RSYNCTest
#
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 +65,7 @@ class RSYNCTest
# Get the hostname & port to test against.
#
host = @test_data['target_host']
- port = 873
+ port = @test_data['test_port']
puts "rsync testing host #{host}:#{port}" if ( @test_data['verbose'] )