]> gitweb.michael.orlitzky.com - haeredes.git/blobdiff - haeredes.cabal
Add a doctest suite.
[haeredes.git] / haeredes.cabal
index 2463a59d73d5f102af37d5baa392b1ac694dbff4..22743ca754724a73b0370c93a26770f328b9e8ef 100644 (file)
@@ -8,9 +8,64 @@ license-file:   doc/LICENSE
 homepage:       http://michael.orlitzky.com/code/haeredes.php
 bug-reports:    mailto:michael@orlitzky.com
 category:       DNS, Utils
+build-type:     Simple
+extra-source-files:
+  doc/man1/haeredes.1
 synopsis:
   Confirm delegation of NS and MX records.
-build-type:     Simple
+description:
+  Haeredes is primarily useful for ISP network administrators.
+  Customers will occasionally decide to switch hosts without alerting
+  the current host; this can cause two problems:
+  .
+    * With NS records, the previous host (at the very least) keeps
+      hosting a DNS zone that does nothing. If that host uses their
+      authoritative nameserver as a caching lookup server as well, it
+      may return incorrect results to queries about the domain in
+      question.
+  .
+    * For MX records, the situation is slightly worse. Most mail servers
+      will immediately accept mail for which the server thinks it is the
+      ultimate destination. If a mail server is configured as the
+      destination for a domain, but it is not the MX for that domain,
+      then mail submitted to that server may possibly be lost. It is
+      therefore important to remove domains from the old mail host as
+      soon as the MX record is changed.
+  .
+  Haeredes can alert administrators when NS/MX records are changed. More
+  detail can be found in the man page.
+  .
+  /Examples/:
+  .
+  Make sure example.com has the expected name servers,
+  [ab].iana-servers.net:
+  .
+  @
+  $ haeredes a.iana-servers.net b.iana-servers.net <<< \"example.com\"
+  @
+  .
+  Check orlitzky.com against the expected name servers, using
+  d.gtld-servers.net:
+  .
+  @
+  $ haeredes --server 199.7.91.13 dns1.viabit.com dns2.viabit.com \
+  &#x20;          <<< \"orlitzky.com\"
+  @
+  .
+  Check orlitzky.com against only one of the expected two nameservers:
+  .
+  @
+  $ haeredes dns1.viabit.com <<< \"orlitzky.com\"
+  Domain \"orlitzky.com.\" delegates somewhere else: \"dns2.viabit.com.\"
+  @
+  .
+  Check a nonexistent domain (we provide no delegates, since we
+  know .invalid will not be delegated):
+  .
+  @
+  $ haeredes <<< \"example.invalid\"
+  Domain \"example.invalid.\" not delegated.
+  @
 
 executable haeredes
   build-depends:
@@ -18,8 +73,15 @@ executable haeredes
     bytestring                  == 0.10.*,
     cmdargs                     == 0.10.*,
     dns                         >= 0.3.7,
+    iproute                     == 1.2.*,
     MissingH                    == 1.2.*,
-    parallel-io                 == 0.3.*
+    parallel-io                 == 0.3.*,
+    -- Test deps
+    HUnit                       == 1.2.*,
+    QuickCheck                  == 2.*,
+    test-framework              == 0.8.*,
+    test-framework-hunit        == 0.3.*,
+    test-framework-quickcheck2  == 0.3.*
 
   main-is:
     Main.hs
@@ -27,6 +89,74 @@ executable haeredes
   hs-source-dirs:
     src/
 
+  other-modules:
+    CommandLine
+    DNS
+    ExitCodes
+
+  ghc-options:
+    -Wall
+    -fwarn-hi-shadowing
+    -fwarn-missing-signatures
+    -fwarn-name-shadowing
+    -fwarn-orphans
+    -fwarn-type-defaults
+    -fwarn-tabs
+    -fwarn-incomplete-record-updates
+    -fwarn-monomorphism-restriction
+    -fwarn-unused-do-bind
+    -rtsopts
+    -threaded
+    -optc-O3
+    -optc-march=native
+
+test-suite testsuite
+  type: exitcode-stdio-1.0
+  hs-source-dirs: src test
+  main-is: TestSuite.hs
+  build-depends:
+    base                        == 4.*,
+    bytestring                  == 0.10.*,
+    cmdargs                     == 0.10.*,
+    dns                         >= 0.3.7,
+    iproute                     == 1.2.*,
+    MissingH                    == 1.2.*,
+    parallel-io                 == 0.3.*,
+    -- Test deps
+    HUnit                       == 1.2.*,
+    QuickCheck                  == 2.*,
+    test-framework              == 0.8.*,
+    test-framework-hunit        == 0.3.*,
+    test-framework-quickcheck2  == 0.3.*
+
+  -- It's not entirely clear to me why I have to reproduce all of this.
+  ghc-options:
+    -Wall
+    -fwarn-hi-shadowing
+    -fwarn-missing-signatures
+    -fwarn-name-shadowing
+    -fwarn-orphans
+    -fwarn-type-defaults
+    -fwarn-tabs
+    -fwarn-incomplete-record-updates
+    -fwarn-monomorphism-restriction
+    -fwarn-unused-do-bind
+    -rtsopts
+    -threaded
+    -optc-O3
+    -optc-march=native
+
+test-suite doctests
+  type: exitcode-stdio-1.0
+  hs-source-dirs: test
+  main-is: Doctests.hs
+  build-depends:
+    base      == 4.*,
+    -- Additional test dependencies.
+    doctest   == 0.9.*,
+    filemanip == 0.3.6.*
+
+  -- It's not entirely clear to me why I have to reproduce all of this.
   ghc-options:
     -Wall
     -fwarn-hi-shadowing