]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Add tests for DSYNC
authorMark Andrews <marka@isc.org>
Sat, 26 Jul 2025 10:27:33 +0000 (12:27 +0200)
committerMark Andrews <marka@isc.org>
Tue, 5 Aug 2025 07:27:44 +0000 (17:27 +1000)
bin/tests/system/doth/example.axfr.good
bin/tests/system/doth/example8.axfr.good
bin/tests/system/genzone.sh
bin/tests/system/xfer/dig1.good
bin/tests/system/xfer/dig2.good
tests/dns/rdata_test.c

index a5ec1f257082969a85fa9ce14535d1e1d2ec4f4c..4561d59b1e2b130fb311deb74551b99ad36eab24 100644 (file)
@@ -2548,6 +2548,7 @@ ds01.example.             3600    IN      NS      ns42.example.
 ds01.example.          3600    IN      DS      12892 5 2 26584835CA80C81C91999F31CFAF2A0E89D4FF1C8FAFD0DDB31A85C7 19277C13
 ds02.example.          3600    IN      NS      ns43.example.
 ds02.example.          3600    IN      DS      12892 5 1 7AA4A3F416C2F2391FB7AB0D434F762CD62D1390
+dsync01.example.       3600    IN      DSYNC   CDS NOTIFY 53 .
 eid01.example.         3600    IN      EID     1289AB
 eui48.example.         3600    IN      EUI48   01-23-45-67-89-ab
 eui64.example.         3600    IN      EUI64   01-23-45-67-89-ab-cd-ef
index 39d70e202193f595384f3b33da4aed01eb51daa2..3e20efe43de9b0981c536ee3ff87ec509e2f4142 100644 (file)
@@ -2548,6 +2548,7 @@ ds01.example8.            3600    IN      DS      12892 5 2 26584835CA80C81C91999F31CFAF2A0E89D4FF1C8FA
 ds01.example8.         3600    IN      NS      ns42.example8.
 ds02.example8.         3600    IN      DS      12892 5 1 7AA4A3F416C2F2391FB7AB0D434F762CD62D1390
 ds02.example8.         3600    IN      NS      ns43.example8.
+dsync01.example8.      3600    IN      DSYNC   CDS NOTIFY 53 .
 eid01.example8.                3600    IN      EID     1289AB
 eui48.example8.                3600    IN      EUI48   01-23-45-67-89-ab
 eui64.example8.                3600    IN      EUI64   01-23-45-67-89-ab-cd-ef
index 892209230bfdad5c43eeebfd91a62899415ef115..4920bc5c91f3dce2ae26749264b5e45a95cfb3e6 100644 (file)
@@ -389,7 +389,10 @@ svcb1                      SVCB    1 . port=60
 https0                 HTTPS   0 example.net.
 https1                 HTTPS   1 . port=60
 
-; type 66 -- 98 (unassigned)
+; type 66
+dsync01                        DSYNC   CDS NOTIFY 53 .
+
+; type 68 -- 98 (unassigned)
 
 ; type 99
 spf01                  SPF     "v=spf1 -all"
index d44fcda9d264e6193a44e7df8627378646511156..4cad0c9f025567bf1fe05e3ebcec12a74a6d1d27 100644 (file)
@@ -49,6 +49,7 @@ ds01.example.         3600    IN      DS      12892 5 2 26584835CA80C81C91999F31CFAF2A0E89D4FF1C8FAF
 ds01.example.          3600    IN      NS      ns42.example.
 ds02.example.          3600    IN      DS      12892 5 1 7AA4A3F416C2F2391FB7AB0D434F762CD62D1390
 ds02.example.          3600    IN      NS      ns43.example.
+dsync01.example.       3600    IN      DSYNC   CDS NOTIFY 53 .
 eid01.example.         3600    IN      EID     1289AB
 eui48.example.         3600    IN      EUI48   01-23-45-67-89-ab
 eui64.example.         3600    IN      EUI64   01-23-45-67-89-ab-cd-ef
index 4b090f83fec69b31ac71c590aca595d306f37a32..795381be59ddd4325f589ff2c882c5c547a2e13f 100644 (file)
@@ -49,6 +49,7 @@ ds01.example.         3600    IN      NS      ns42.example.
 ds01.example.          3600    IN      DS      12892 5 2 26584835CA80C81C91999F31CFAF2A0E89D4FF1C8FAFD0DDB31A85C7 19277C13
 ds02.example.          3600    IN      NS      ns43.example.
 ds02.example.          3600    IN      DS      12892 5 1 7AA4A3F416C2F2391FB7AB0D434F762CD62D1390
+dsync01.example.       3600    IN      DSYNC   CDS NOTIFY 53 .
 eid01.example.         3600    IN      EID     1289AB
 eui48.example.         3600    IN      EUI48   01-23-45-67-89-ab
 eui64.example.         3600    IN      EUI64   01-23-45-67-89-ab-cd-ef
index 106e9e9a4bdb97675674c785ab6ca7fc81b1cec8..48090d25b6ca5699f7fe1e84ce38e50f252d429d 100644 (file)
@@ -1712,6 +1712,113 @@ ISC_RUN_TEST_IMPL(ds) {
                    dns_rdatatype_ds, sizeof(dns_rdata_ds_t));
 }
 
+/*
+ * DSYNC tests.
+ *
+ * draft-ietf-dnsop-generalized-notify-09
+ *
+ * 2.1.  Wire Format
+ *
+ *    The DSYNC RDATA wire format is encoded as follows:
+ *
+ *                         1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 3 3
+ *     0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+ *    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ *    | RRtype                        | Scheme        | Port
+ *    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ *                    | Target ...  /
+ *    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-/
+ *
+ *    RRtype  The type of generalized NOTIFY that this DSYNC RR defines the
+ *       desired target address for (see "Resource Record (RR) TYPEs" IANA
+ *       registry).  For now, only CDS and CSYNC are supported values, with
+ *       the former indicating an updated CDS or CDNSKEY record set.
+ *
+ *    Scheme  The mode used for contacting the desired notification
+ *       address.  This is an 8-bit unsigned integer.  Records with value 0
+ *       (null scheme) are ignored by consumers.  Value 1 is described in
+ *       this document, and values 128-255 are reserved for private use.
+ *       All other values are currently unassigned.
+ *
+ *    Port  The port on the target host of the notification service.  This
+ *       is a 16-bit unsigned integer in network byte order.  Records with
+ *       value 0 are ignored by consumers.
+ *
+ *    Target  The fully-qualified, uncompressed domain name of the target
+ *       host providing the service of listening for generalized
+ *       notifications of the specified type.  This name MUST resolve to
+ *       one or more address records.
+ *
+ * 2.2.  Presentation Format
+ *
+ *    The presentation format of the RDATA portion is as follows:
+ *
+ *    *  The RRtype field is represented as a mnemonic from the "Resource
+ *       Record (RR) TYPEs" registry.
+ *
+ *    *  The Scheme field is represented by its mnemonic if assigned (see
+ *       Section 6.2), otherwise as an unsigned decimal integer.
+ *
+ *    *  The Port field is represented as an unsigned decimal integer.
+ *
+ *    *  The Target field is represented as a <domain-name> ([RFC1035],
+ *       Section 5.1).
+ */
+ISC_RUN_TEST_IMPL(dsync) {
+       text_ok_t text_ok[] = {
+               /*
+                * Invalid, empty record.
+                */
+               TEXT_INVALID(""),
+               /*
+                * Known type and known scheme.
+                */
+               TEXT_VALID("CDS NOTIFY 0 example.com"),
+               /*
+                * Known type and unknown scheme.
+                */
+               TEXT_VALID("CDS 3 0 example.com"),
+               /*
+                * Unknown type and known scheme.
+                */
+               TEXT_VALID("TYPE1000 NOTIFY 0 example.com"),
+               /*
+                * Unknown type and unknown scheme.
+                */
+               TEXT_VALID("TYPE1000 3 0 example.com"),
+               /*
+                * Unknown type and unknown scheme, max port.
+                */
+               TEXT_VALID("TYPE1000 3 65535 example.com"),
+               /*
+                * Unknown type and max scheme, max port.
+                */
+               TEXT_VALID("TYPE64000 255 65535 example.com"),
+               /*
+                * Invalid type and max scheme, max port.
+                */
+               TEXT_INVALID("INVALID 255 65536 example.com"),
+               /*
+                * Unknown type and too big scheme, max port.
+                */
+               TEXT_INVALID("TYPE1000 256 65536 example.com"),
+               /*
+                * Unknown type and unknown scheme, port too big.
+                */
+               TEXT_INVALID("TYPE1000 3 65536 example.com"),
+               /*
+                * Unknown type and bad scheme, max port.
+                */
+               TEXT_INVALID("TYPE1000 UNKNOWN 65535 example.com"),
+               /*
+                * Sentinel.
+                */
+               TEXT_SENTINEL()
+       };
+       check_rdata(text_ok, NULL, NULL, false, dns_rdataclass_in,
+                   dns_rdatatype_dsync, sizeof(dns_rdata_dsync_t));
+}
+
 /*
  * EDNS Client Subnet tests.
  *