From 7b4b8a0b37c8f772175438b0e05ea0b83b5ae718 Mon Sep 17 00:00:00 2001 From: Steve Kemp Date: Tue, 13 Nov 2012 15:16:42 +0000 Subject: Test that we have a host + port to test. --- worker/tests/rsync.rb | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'worker/tests/rsync.rb') 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'] ) -- cgit v1.2.1