diff options
Diffstat (limited to 'lib/custodian/protocoltest')
-rw-r--r-- | lib/custodian/protocoltest/ftp.rb | 14 | ||||
-rw-r--r-- | lib/custodian/protocoltest/jabber.rb | 15 | ||||
-rw-r--r-- | lib/custodian/protocoltest/rsync.rb | 15 | ||||
-rw-r--r-- | lib/custodian/protocoltest/smtp.rb | 15 | ||||
-rw-r--r-- | lib/custodian/protocoltest/ssh.rb | 16 | ||||
-rw-r--r-- | lib/custodian/protocoltest/tcp.rb | 16 |
6 files changed, 91 insertions, 0 deletions
diff --git a/lib/custodian/protocoltest/ftp.rb b/lib/custodian/protocoltest/ftp.rb index 8894de0..1d60e43 100644 --- a/lib/custodian/protocoltest/ftp.rb +++ b/lib/custodian/protocoltest/ftp.rb @@ -59,6 +59,20 @@ class FTPTest < TCPTest # + # Convert this class to JSON such that it may be serialized. + # + def to_json + hash = { + :test_type => 'ftp', + :test_target => @host, + :test_port => @port, + } + hash.to_json + end + + + + # Run the TCP-protocol test. # def run_test diff --git a/lib/custodian/protocoltest/jabber.rb b/lib/custodian/protocoltest/jabber.rb index a9920f0..1aef8b5 100644 --- a/lib/custodian/protocoltest/jabber.rb +++ b/lib/custodian/protocoltest/jabber.rb @@ -58,6 +58,21 @@ class JABBERTest < TCPTest # + # Convert this class to JSON such that it may be serialized. + # + def to_json + hash = { + :test_type => 'jabber', + :test_target => @host, + :test_port => @port, + } + hash.to_json + end + + + + + # # Run the TCP-protocol test. # def run_test diff --git a/lib/custodian/protocoltest/rsync.rb b/lib/custodian/protocoltest/rsync.rb index 3b63465..c35758e 100644 --- a/lib/custodian/protocoltest/rsync.rb +++ b/lib/custodian/protocoltest/rsync.rb @@ -59,6 +59,21 @@ class RSYNCTest < TCPTest # + # Convert this class to JSON such that it may be serialized. + # + def to_json + hash = { + :test_type => 'rsync', + :test_target => @host, + :test_port => @port, + } + hash.to_json + end + + + + + # # Run the protocol test. # def run_test diff --git a/lib/custodian/protocoltest/smtp.rb b/lib/custodian/protocoltest/smtp.rb index 3a38f5a..dce5ddf 100644 --- a/lib/custodian/protocoltest/smtp.rb +++ b/lib/custodian/protocoltest/smtp.rb @@ -59,6 +59,21 @@ class SMTPTest < TCPTest # + # Convert this class to JSON such that it may be serialized. + # + def to_json + hash = { + :test_type => 'smtp', + :test_target => @host, + :test_port => @port, + } + hash.to_json + end + + + + + # # Run the TCP-protocol test. # def run_test diff --git a/lib/custodian/protocoltest/ssh.rb b/lib/custodian/protocoltest/ssh.rb index ec7752f..18f13bc 100644 --- a/lib/custodian/protocoltest/ssh.rb +++ b/lib/custodian/protocoltest/ssh.rb @@ -60,6 +60,22 @@ class SSHTest < TCPTest # + # Convert this class to JSON such that it may be + # serialized. + # + def to_json + hash = { + :test_type => 'ssh', + :test_target => @host, + :test_port => @port + } + hash.to_json + end + + + + + # # Run the TCP-protocol test. # def run_test diff --git a/lib/custodian/protocoltest/tcp.rb b/lib/custodian/protocoltest/tcp.rb index 9e141fe..5f29b7f 100644 --- a/lib/custodian/protocoltest/tcp.rb +++ b/lib/custodian/protocoltest/tcp.rb @@ -87,6 +87,22 @@ class TCPTest < ProtocolTest # + # Convert this class to JSON such that it may be serialized. + # + def to_json + hash = { + :test_type => 'tcp', + :test_target => @host, + :test_port => @port, + :banner => @banner + } + hash.to_json + end + + + + + # # Run the TCP-protocol test. # def run_test |