diff options
author | Steve Kemp <steve@steve.org.uk> | 2012-11-13 15:16:42 +0000 |
---|---|---|
committer | Steve Kemp <steve@steve.org.uk> | 2012-11-13 15:16:42 +0000 |
commit | 7b4b8a0b37c8f772175438b0e05ea0b83b5ae718 (patch) | |
tree | 3bfc3e90781ebfd19593159f3863412f179b71fe /worker/tests | |
parent | a2e588e508272c704121b4d1c5a3984ab884ebcb (diff) |
Test that we have a host + port to test.
Diffstat (limited to 'worker/tests')
-rwxr-xr-x | worker/tests/rsync.rb | 19 |
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'] ) |