summaryrefslogtreecommitdiff
path: root/lib/custodian/protocoltest
diff options
context:
space:
mode:
authorSteve Kemp <steve@steve.org.uk>2015-01-13 15:41:38 +0000
committerSteve Kemp <steve@steve.org.uk>2015-01-13 15:41:38 +0000
commit082a6861861852cf47a35e6a870ca2d22b6691dd (patch)
tree939493a66bf969f643b99f008541d9098a614923 /lib/custodian/protocoltest
parent58862662389f0e0be03d520df055740f9c6e31d5 (diff)
Stub MX-test.
This will perform a DNS-lookup AND SMTP-test for the given domain.
Diffstat (limited to 'lib/custodian/protocoltest')
-rw-r--r--lib/custodian/protocoltest/mx.rb67
1 files changed, 67 insertions, 0 deletions
diff --git a/lib/custodian/protocoltest/mx.rb b/lib/custodian/protocoltest/mx.rb
new file mode 100644
index 0000000..70fe465
--- /dev/null
+++ b/lib/custodian/protocoltest/mx.rb
@@ -0,0 +1,67 @@
+require 'custodian/protocoltest/tcp'
+
+#
+# The MX (DNS + smtp) test.
+#
+# This object is instantiated if the parser sees a line such as:
+#
+###
+### bytemark.co.uk must run mx otherwise 'mail fail'.
+###
+#
+#
+module Custodian
+
+ module ProtocolTest
+
+ class MXTest < TestFactory
+
+
+ #
+ # Constructor
+ #
+ def initialize( line )
+ @line = line
+ end
+
+
+ #
+ # Allow this test to be serialized.
+ #
+ def to_s
+ @line
+ end
+
+
+ #
+ # Run the test.
+ #
+ def run_test
+
+ # reset the error, in case we were previously executed.
+ @error = nil
+
+ return true;
+ end
+
+
+
+
+ #
+ # If the test fails then report the error.
+ #
+ def error
+ @error
+ end
+
+
+
+
+ register_test_type "mx"
+
+
+
+
+ end
+ end
+end