diff options
author | Steve Kemp <steve@steve.org.uk> | 2012-11-21 21:19:07 +0000 |
---|---|---|
committer | Steve Kemp <steve@steve.org.uk> | 2012-11-21 21:19:07 +0000 |
commit | 6d32858783eec69f626ed267f3bb1e52f9b4349c (patch) | |
tree | 8587dc0915b2a8a0e2ed91beb3c9b6cba3eb68b8 /bin | |
parent | 4e2d4ede385a86917b07be7b919d77bfdd445401 (diff) |
Added utility method.
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/custodian-parse-execute | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/bin/custodian-parse-execute b/bin/custodian-parse-execute new file mode 100755 index 0000000..5e12e70 --- /dev/null +++ b/bin/custodian-parse-execute @@ -0,0 +1,48 @@ +#!/usr/bin/ruby -Ilib/ -I../lib +# +# This is simple test code which will parse a line from the configuration +# file and execute it via our class-factory +# +# +# Simple test code. Will be folded into the test-suite. +# +# + +require 'custodian/protocoltest.rb' +require 'custodian/protocoltest/tcp.rb' +require 'custodian/protocoltest/ftp.rb' +require 'custodian/protocoltest/rsync.rb' +require 'custodian/protocoltest/ssh.rb' + + + + +# +# The line is in the first agument +# +txt = ARGV.shift + + +if ( txt.nil? ) + puts "#{$0} 'foo must run service ..'" + exit 1 +end + + + +# +# Create the object +# +begin + c = ProtocolTest.create( txt ) + + puts "created object: #{c.to_s}" + + if ( c.run_test ) + puts "Test succeeded" + else + puts "Test failed: #{c.error()}" + end +rescue => ex + puts "Exception: #{ex}" +end |