summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorSteve Kemp <steve@steve.org.uk>2012-11-22 15:38:07 +0000
committerSteve Kemp <steve@steve.org.uk>2012-11-22 15:38:07 +0000
commit918d964adee64d0a14fc80797def1070c39061b3 (patch)
tree25662cfd3ca6e73855d16ef8937f0ba2ff97603e /t
parentc3a3f054ada31db25db4194ecb4a17db7fdb1c47 (diff)
Parse the configuration file into arrays of jobs, via our test-factory
Diffstat (limited to 't')
-rwxr-xr-xt/test-protocol-ftp.rb91
-rwxr-xr-xt/test-protocol-http.rb98
-rwxr-xr-xt/test-protocol-jabber.rb91
-rwxr-xr-xt/test-protocol-ldap.rb91
-rwxr-xr-xt/test-protocol-rsync.rb91
-rwxr-xr-xt/test-protocol-smtp.rb91
-rwxr-xr-xt/test-protocol-ssh.rb90
-rwxr-xr-xt/test-protocol-tcp.rb94
8 files changed, 0 insertions, 737 deletions
diff --git a/t/test-protocol-ftp.rb b/t/test-protocol-ftp.rb
deleted file mode 100755
index 4d237c4..0000000
--- a/t/test-protocol-ftp.rb
+++ /dev/null
@@ -1,91 +0,0 @@
-#!/usr/bin/ruby -I../lib/ -Ilib/
-
-
-require 'test/unit'
-require 'custodian/protocol-tests/ftp.rb'
-
-
-
-
-#
-# Unit test for the FTP-protocol probe.
-#
-class TestFTPProtocolProbe < Test::Unit::TestCase
-
- #
- # Create the test suite environment: NOP.
- #
- def setup
- end
-
- #
- # Destroy the test suite environment: NOP.
- #
- def teardown
- end
-
-
- #
- # Test we can create a new FTPTest object.
- #
- def test_init
- test_data_good = {
- "target_host" => "mirror.bytemark.co.uk",
- "test_type" => "ftp",
- "verbose" => 1,
- "test_port" => 21,
- "test_alert" => "FTP service down",
- }
-
- #
- # Missing a port number
- #
- test_data_bad_one = {
- "target_host" => "mirror.bytemark.co.uk",
- "test_type" => "ftp",
- "verbose" => 1,
- "test_alert" => "FTP service down",
- }
-
- #
- # Missing URL to probe
- #
- test_data_bad_two = {
- "test_type" => "ftp",
- "verbose" => 1,
- "test_port" => 21,
- "test_alert" => "FTP service down",
- }
-
-
- #
- # Create a new FTPTest object. This should succeed
- #
- good = FTPTest.new( test_data_good )
- assert( good )
-
- #
- # There will be no error setup
- #
- assert( good.error().nil? )
-
- #
- # Now create a probe with a missing port.
- #
- assert_raise ArgumentError do
- bad = FTPTest.new( test_data_bad_one )
- end
-
-
- #
- # Now create a probe with a missing host.
- #
- assert_raise ArgumentError do
- bad = FTPTest.new( test_data_bad_two )
- end
-
- end
-
-
-
-end
diff --git a/t/test-protocol-http.rb b/t/test-protocol-http.rb
deleted file mode 100755
index 422415c..0000000
--- a/t/test-protocol-http.rb
+++ /dev/null
@@ -1,98 +0,0 @@
-#!/usr/bin/ruby -I../lib/ -Ilib/
-
-
-require 'test/unit'
-require 'custodian/protocol-tests/http.rb'
-
-
-
-
-
-#
-# Unit test for the HTTP-protocol probe.
-#
-class TestHTTPProtocolProbe < Test::Unit::TestCase
-
- #
- # Create the test suite environment: NOP.
- #
- def setup
- end
-
-
- #
- # Destroy the test suite environment: NOP.
- #
- def teardown
- end
-
-
- #
- # Test we can create a new HTTPTest object.
- #
- def test_init
-
- test_data_good = {
- "target_host" => "http://www.steve.org.uk/",
- "test_type" => "http",
- "verbose" => 1,
- "test_port" => 80,
- "test_alert" => "Steve's website is unavailable",
- "http_text" => "Steve Kemp",
- "http_status" => "200"
- }
-
- #
- # Missing a port number
- #
- test_data_bad_one = {
- "target_host" => "http://www.steve.org.uk/",
- "test_type" => "http",
- "verbose" => 1,
- "test_alert" => "Steve's website is unavailable",
- "http_text" => "Steve Kemp",
- "http_status" => "200"
- }
-
- #
- # Missing URL to probe
- #
- test_data_bad_two = {
- "test_type" => "http",
- "test_port" => 80,
- "verbose" => 1,
- "test_alert" => "Steve's website is unavailable",
- "http_text" => "Steve Kemp",
- "http_status" => "200"
- }
-
-
- #
- # Create a new HTTPTest object. This should succeed
- #
- good = HTTPTest.new( test_data_good )
- assert( good )
-
- #
- # There will be no error setup
- #
- assert( good.error().nil? )
-
- #
- # Now create a probe with a missing port.
- #
- assert_raise ArgumentError do
- bad = HTTPTest.new( test_data_bad_one )
- end
-
-
- #
- # Now create a probe with a missing URL.
- #
- assert_raise ArgumentError do
- bad = HTTPTest.new( test_data_bad_two )
- end
- end
-
-
-end
diff --git a/t/test-protocol-jabber.rb b/t/test-protocol-jabber.rb
deleted file mode 100755
index 50db803..0000000
--- a/t/test-protocol-jabber.rb
+++ /dev/null
@@ -1,91 +0,0 @@
-#!/usr/bin/ruby -I../lib/ -Ilib/
-
-
-require 'test/unit'
-require 'custodian/protocol-tests/jabber.rb'
-
-
-
-
-#
-# Unit test for the Jabber-protocol probe.
-#
-class TestJABBERProtocolProbe < Test::Unit::TestCase
-
- #
- # Create the test suite environment: NOP.
- #
- def setup
- end
-
- #
- # Destroy the test suite environment: NOP.
- #
- def teardown
- end
-
-
- #
- # Test we can create a new JABBERTest object.
- #
- def test_init
- test_data_good = {
- "target_host" => "chat.bytemark.co.uk",
- "test_type" => "jabber",
- "test_port" => 5222,
- "verbose" => 1,
- "test_alert" => "Chat server is down",
- }
-
- #
- # Missing a port number
- #
- test_data_bad_one = {
- "target_host" => "chat.bytemark.co.uk",
- "test_type" => "jabber",
- "verbose" => 1,
- "test_alert" => "Chat server is down",
- }
-
- #
- # Missing a host to probe
- #
- test_data_bad_two = {
- "test_type" => "jabber",
- "test_port" => 5222,
- "verbose" => 1,
- "test_alert" => "Chat server is down",
- }
-
-
- #
- # Create a new test object. This should succeed
- #
- good = JABBERTest.new( test_data_good )
- assert( good )
-
- #
- # There will be no error setup
- #
- assert( good.error().nil? )
-
- #
- # Now create a probe with a missing port.
- #
- assert_raise ArgumentError do
- bad = JABBERTest.new( test_data_bad_one )
- end
-
-
- #
- # Now create a probe with a missing host.
- #
- assert_raise ArgumentError do
- bad = JABBERTest.new( test_data_bad_two )
- end
-
- end
-
-
-
-end
diff --git a/t/test-protocol-ldap.rb b/t/test-protocol-ldap.rb
deleted file mode 100755
index b7948ad..0000000
--- a/t/test-protocol-ldap.rb
+++ /dev/null
@@ -1,91 +0,0 @@
-#!/usr/bin/ruby -I../lib/ -Ilib/
-
-
-require 'test/unit'
-require 'custodian/protocol-tests/ldap.rb'
-
-
-
-
-#
-# Unit test for the LDAP-protocol probe.
-#
-class TestLDAPProtocolProbe < Test::Unit::TestCase
-
- #
- # Create the test suite environment: NOP.
- #
- def setup
- end
-
- #
- # Destroy the test suite environment: NOP.
- #
- def teardown
- end
-
-
- #
- # Test we can create a new LDAPTest object.
- #
- def test_init
- test_data_good = {
- "target_host" => "auth.bytemark.co.uk",
- "test_type" => "ldap",
- "verbose" => 1,
- "test_port" => 389,
- "test_alert" => "LDAP server gone away?",
- }
-
- #
- # Missing a port number
- #
- test_data_bad_one = {
- "target_host" => "auth.bytemark.co.uk",
- "test_type" => "ldap",
- "verbose" => 1,
- "test_alert" => "LDAP server gone away?",
- }
-
- #
- # Missing URL to probe
- #
- test_data_bad_two = {
- "test_type" => "ldap",
- "verbose" => 1,
- "test_port" => 389,
- "test_alert" => "LDAP server gone away?",
- }
-
-
- #
- # Create a new test object. This should succeed
- #
- good = LDAPTest.new( test_data_good )
- assert( good )
-
- #
- # There will be no error setup
- #
- assert( good.error().nil? )
-
- #
- # Now create a probe with a missing port.
- #
- assert_raise ArgumentError do
- bad = LDAPTest.new( test_data_bad_one )
- end
-
-
- #
- # Now create a probe with a missing host.
- #
- assert_raise ArgumentError do
- bad = LDAPTest.new( test_data_bad_two )
- end
-
- end
-
-
-
-end
diff --git a/t/test-protocol-rsync.rb b/t/test-protocol-rsync.rb
deleted file mode 100755
index 9bafd10..0000000
--- a/t/test-protocol-rsync.rb
+++ /dev/null
@@ -1,91 +0,0 @@
-#!/usr/bin/ruby -I../lib/ -Ilib/
-
-
-require 'test/unit'
-require 'custodian/protocol-tests/rsync.rb'
-
-
-
-
-#
-# Unit test for the RSYNC-protocol probe.
-#
-class TestRSYNCProtocolProbe < Test::Unit::TestCase
-
- #
- # Create the test suite environment: NOP.
- #
- def setup
- end
-
- #
- # Destroy the test suite environment: NOP.
- #
- def teardown
- end
-
-
- #
- # Test we can create a new RSYNCTest object.
- #
- def test_init
- test_data_good = {
- "target_host" => "upload.ns.bytemark.co.uk",
- "test_type" => "rsync",
- "verbose" => 1,
- "test_port" => 873,
- "test_alert" => "DNS upload service is down",
- }
-
- #
- # Missing a port number
- #
- test_data_bad_one = {
- "target_host" => "upload.ns.bytemark.co.uk",
- "test_type" => "rsync",
- "verbose" => 1,
- "test_alert" => "DNS upload service is down",
- }
-
- #
- # Missing host to probe
- #
- test_data_bad_two = {
- "test_type" => "rsync",
- "verbose" => 1,
- "test_port" => 873,
- "test_alert" => "DNS upload service is down",
- }
-
-
- #
- # Create a new test object. This should succeed
- #
- good = RSYNCTest.new( test_data_good )
- assert( good )
-
- #
- # There will be no error setup
- #
- assert( good.error().nil? )
-
- #
- # Now create a probe with a missing port.
- #
- assert_raise ArgumentError do
- bad = RSYNCTest.new( test_data_bad_one )
- end
-
-
- #
- # Now create a probe with a missing host.
- #
- assert_raise ArgumentError do
- bad = RSYNCTest.new( test_data_bad_two )
- end
-
- end
-
-
-
-end
diff --git a/t/test-protocol-smtp.rb b/t/test-protocol-smtp.rb
deleted file mode 100755
index b456d30..0000000
--- a/t/test-protocol-smtp.rb
+++ /dev/null
@@ -1,91 +0,0 @@
-#!/usr/bin/ruby -I../lib/ -Ilib/
-
-
-require 'test/unit'
-require 'custodian/protocol-tests/smtp.rb'
-
-
-
-
-#
-# Unit test for the SMTP-protocol probe.
-#
-class TestSMTPProtocolProbe < Test::Unit::TestCase
-
- #
- # Create the test suite environment: NOP.
- #
- def setup
- end
-
- #
- # Destroy the test suite environment: NOP.
- #
- def teardown
- end
-
-
- #
- # Test we can create a new SMTPTest object.
- #
- def test_init
- test_data_good = {
- "target_host" => "statler.bytemark.co.uk",
- "test_type" => "smtp",
- "test_port" => 25,
- "verbose" => 1,
- "test_alert" => "SMTP service down",
- }
-
- #
- # Missing a port number
- #
- test_data_bad_one = {
- "target_host" => "statler.bytemark.co.uk",
- "test_type" => "smtp",
- "verbose" => 1,
- "test_alert" => "SMTP service down",
- }
-
- #
- # Missing host to probe
- #
- test_data_bad_two = {
- "test_type" => "smtp",
- "verbose" => 1,
- "test_port" => 25,
- "test_alert" => "SMTP service down",
- }
-
-
- #
- # Create a new SMTPTest object. This should succeed
- #
- good = SMTPTest.new( test_data_good )
- assert( good )
-
- #
- # There will be no error setup
- #
- assert( good.error().nil? )
-
- #
- # Now create a probe with a missing port.
- #
- assert_raise ArgumentError do
- bad = SMTPTest.new( test_data_bad_one )
- end
-
-
- #
- # Now create a probe with a missing host.
- #
- assert_raise ArgumentError do
- bad = SMTPTest.new( test_data_bad_two )
- end
-
- end
-
-
-
-end
diff --git a/t/test-protocol-ssh.rb b/t/test-protocol-ssh.rb
deleted file mode 100755
index 9086eac..0000000
--- a/t/test-protocol-ssh.rb
+++ /dev/null
@@ -1,90 +0,0 @@
-#!/usr/bin/ruby -I../lib/ -I./lib/
-
-
-require 'test/unit'
-require 'custodian/protocol-tests/ssh.rb'
-
-
-
-#
-# Unit test for the SSH-protocol probe.
-#
-class TestSSHProtocolProbe < Test::Unit::TestCase
-
- #
- # Create the test suite environment: NOP.
- #
- def setup
- end
-
- #
- # Destroy the test suite environment: NOP.
- #
- def teardown
- end
-
-
- #
- # Test we can create a new SSHTest object.
- #
- def test_init
- test_data_good = {
- "target_host" => "127.0.0.1",
- "test_type" => "ssh",
- "verbose" => 1,
- "test_port" => 22,
- "test_alert" => "SSH service down",
- }
-
- #
- # Missing a port number
- #
- test_data_bad_one = {
- "target_host" => "127.0.0.1",
- "test_type" => "ssh",
- "verbose" => 1,
- "test_alert" => "SSH service down",
- }
-
- #
- # Missing a host to probe
- #
- test_data_bad_two = {
- "test_type" => "ssh",
- "verbose" => 1,
- "test_port" => 22,
- "test_alert" => "SSH service down",
- }
-
-
- #
- # Create a new test object. This should succeed
- #
- good = SSHTest.new( test_data_good )
- assert( good )
-
- #
- # There will be no error setup
- #
- assert( good.error().nil? )
-
- #
- # Now create a probe with a missing port.
- #
- assert_raise ArgumentError do
- bad = SSHTest.new( test_data_bad_one )
- end
-
-
- #
- # Now create a probe with a missing host.
- #
- assert_raise ArgumentError do
- bad = SSHTest.new( test_data_bad_two )
- end
-
- end
-
-
-
-end
diff --git a/t/test-protocol-tcp.rb b/t/test-protocol-tcp.rb
deleted file mode 100755
index 655b6a1..0000000
--- a/t/test-protocol-tcp.rb
+++ /dev/null
@@ -1,94 +0,0 @@
-#!/usr/bin/ruby -I../lib/ -Ilib/
-
-
-require 'test/unit'
-require 'custodian/protocol-tests/tcp.rb'
-
-
-
-
-#
-# Unit test for the TCP-protocol probe.
-#
-class TestTCPProtocolProbe < Test::Unit::TestCase
-
- #
- # Create the test suite environment: NOP.
- #
- def setup
- end
-
- #
- # Destroy the test suite environment: NOP.
- #
- def teardown
- end
-
-
- #
- # Test we can create a new TCPTest object.
- #
- def test_init
- test_data_good = {
- "target_host" => "smtp.bytemark.co.uk",
- "test_type" => "tcp",
- "banner" => 220,
- "verbose" => 1,
- "test_port" => 25,
- "test_alert" => "SMTP service down",
- }
-
- #
- # Missing a port number
- #
- test_data_bad_one = {
- "target_host" => "smtp.bytemark.co.uk",
- "test_type" => "tcp",
- "banner" => 220,
- "verbose" => 1,
- "test_alert" => "SMTP service down",
- }
-
- #
- # Missing a target host to probe
- #
- test_data_bad_two = {
- "test_type" => "tcp",
- "banner" => 220,
- "verbose" => 1,
- "test_port" => 25,
- "test_alert" => "SMTP service down",
- }
-
-
- #
- # Create a new FTPTest object. This should succeed
- #
- good = TCPTest.new( test_data_good )
- assert( good )
-
- #
- # There will be no error setup
- #
- assert( good.error().nil? )
-
- #
- # Now create a probe with a missing port.
- #
- assert_raise ArgumentError do
- bad = TCPTest.new( test_data_bad_one )
- end
-
-
- #
- # Now create a probe with a missing host.
- #
- assert_raise ArgumentError do
- bad = TCPTest.new( test_data_bad_two )
- end
-
- end
-
-
-
-end