summaryrefslogtreecommitdiff
path: root/t/test-ldap-probe.rb
diff options
context:
space:
mode:
authorPatrick J Cherry <patrick@bytemark.co.uk>2014-12-11 12:41:38 +0000
committerPatrick J Cherry <patrick@bytemark.co.uk>2014-12-11 12:41:38 +0000
commit47fbebd14f0bd67a05e3a433d2b48e991e41020b (patch)
tree68ec84527a99d40bca13b834bd3b2a58f2749d82 /t/test-ldap-probe.rb
parent38f6cfd44c2df433dbcaf85a7395589f4f09b8b5 (diff)
Renamed ldap test so it gets included in the test suite
--HG-- rename : t/test-ldap-probe.t => t/test-ldap-probe.rb
Diffstat (limited to 't/test-ldap-probe.rb')
-rwxr-xr-xt/test-ldap-probe.rb64
1 files changed, 64 insertions, 0 deletions
diff --git a/t/test-ldap-probe.rb b/t/test-ldap-probe.rb
new file mode 100755
index 0000000..4e552b4
--- /dev/null
+++ b/t/test-ldap-probe.rb
@@ -0,0 +1,64 @@
+#!/usr/bin/ruby -Ilib/ -I../lib/
+
+
+require 'test/unit'
+
+require 'custodian/protocoltests'
+
+
+
+class TestLDAPProbe < Test::Unit::TestCase
+
+ #
+ # Create the test suite environment: NOP.
+ #
+ def setup
+ end
+
+ #
+ # Destroy the test suite environment: NOP.
+ #
+ def teardown
+ end
+
+
+ #
+ # Test the sanity of a good test.
+ #
+ def test_expected_usage
+ test = nil
+
+ assert_nothing_raised do
+ test = Custodian::TestFactory.create( "auth.bytemark.co.uk must run ldap on 389 with username 'testing' with password 'bob' otherwise 'LDAP dead?'." )
+ end
+
+ assert( test )
+ assert_equal( test.get_type, "ldap" )
+ end
+
+
+
+ #
+ # Ensure missing a test raises an error.
+ #
+ def test_missing_ldap()
+ #
+ # test data
+ #
+ data = [
+ "foo.example.com must run ldap on 389.",
+ "foo.example.com must run ldap with username 'test'.",
+ "foo.example.com must run ldap with uername 'test' with password 'x'."
+ ]
+
+ #
+ # For each test
+ #
+ data.each do |str|
+ assert_raise ArgumentError do
+ test = Custodian::TestFactory.create( str )
+ end
+ end
+ end
+
+end