]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Support ISO timestamps with timezone information
authorAlessio Podda <alessio@isc.org>
Wed, 25 Sep 2024 14:46:16 +0000 (16:46 +0200)
committerAlessio Podda <alessio@isc.org>
Tue, 1 Oct 2024 15:09:43 +0000 (15:09 +0000)
This commit adds support for timestamps in iso8601 format with timezone
when logging. This is exposed through the iso8601-tzinfo printtime
suboption.
It also makes the new logging format the default for -g output,
hopefully removing the need for custom timestamp parsing in scripts.

19 files changed:
bin/named/include/named/globals.h
bin/named/log.c
bin/named/logconf.c
bin/named/main.c
bin/tests/system/cacheclean/tests.sh
bin/tests/system/checkconf/good-printtime.conf
bin/tests/system/kasp/tests.sh
bin/tests/system/mkeys/tests.sh
bin/tests/system/notify/tests.sh
bin/tests/system/start.pl
bin/tests/system/xfer/tests.sh
doc/arm/reference.rst
doc/misc/options
lib/isc/include/isc/log.h
lib/isc/include/isc/time.h
lib/isc/log.c
lib/isc/time.c
lib/isccfg/namedconf.c
tests/isc/time_test.c

index 6b978d1eb8d78b940b252decffce20856f62dd45..9ada34a768f7d57ae6fd5927368c7f4d6ae81025 100644 (file)
@@ -111,6 +111,7 @@ EXTERN const char *named_g_chrootdir INIT(NULL);
 EXTERN bool named_g_foreground      INIT(false);
 EXTERN bool named_g_logstderr       INIT(false);
 EXTERN bool named_g_nosyslog        INIT(false);
+EXTERN unsigned int named_g_logflags INIT(0);
 EXTERN const char *named_g_logfile   INIT(NULL);
 
 EXTERN const char *named_g_defaultsessionkeyfile INIT(NAMED_LOCALSTATEDIR
index e477bd43ff644345a60b3f501f4b9942753c6bbe..ffa916b569856709d45ca7f7b82e0c26f7f544af 100644 (file)
@@ -79,6 +79,16 @@ named_log_setdefaultchannels(isc_logconfig_t *lcfg) {
                isc_log_createchannel(lcfg, "default_debug", ISC_LOG_TOFILE,
                                      ISC_LOG_DYNAMIC, &destination,
                                      ISC_LOG_PRINTTIME | ISC_LOG_DEBUGONLY);
+       } else if (named_g_logstderr && (named_g_logflags != 0)) {
+               /*
+                * If the option -g is given, but we also requested iso
+                * timestamps, we'll still need to override the "default_debug"
+                * logger with a new one.
+                */
+               isc_log_createchannel(lcfg, "default_debug", ISC_LOG_TOFILEDESC,
+                                     ISC_LOG_DYNAMIC,
+                                     ISC_LOGDESTINATION_STDERR,
+                                     ISC_LOG_PRINTTIME | named_g_logflags);
        }
 
        if (named_g_logfile != NULL) {
@@ -118,6 +128,16 @@ named_log_setsafechannels(isc_logconfig_t *lcfg) {
                 * discarded a bit faster.
                 */
                isc_log_setdebuglevel(0);
+       } else if (named_g_logstderr && (named_g_logflags != 0)) {
+               /*
+                * If the option -g is given, but we also requested iso
+                * timestamps, we'll still need to override the "default_debug"
+                * logger with a new one.
+                */
+               isc_log_createchannel(lcfg, "default_debug", ISC_LOG_TOFILEDESC,
+                                     ISC_LOG_DYNAMIC,
+                                     ISC_LOGDESTINATION_STDERR,
+                                     ISC_LOG_PRINTTIME | named_g_logflags);
        } else {
                isc_log_setdebuglevel(named_g_debuglevel);
        }
index c27e672b8a05e42c3e0963578f40ce43773aa992..f923722bf381499f4c975a7a69bd9d977ad06583 100644 (file)
@@ -239,6 +239,8 @@ channel_fromconf(const cfg_obj_t *channel, isc_logconfig_t *logconfig) {
                                flags |= ISC_LOG_ISO8601;
                        } else if (strcasecmp(s, "iso8601-utc") == 0) {
                                flags |= ISC_LOG_ISO8601 | ISC_LOG_UTC;
+                       } else if (strcasecmp(s, "iso8601-tzinfo") == 0) {
+                               flags |= ISC_LOG_ISO8601 | ISC_LOG_TZINFO;
                        }
                }
        }
index 98418bfbe34a7831e32ca340d56ed571a74ddf00..91b46592b0ba41630663de1a0e880f42d397865f 100644 (file)
@@ -889,6 +889,8 @@ parse_command_line(int argc, char *argv[]) {
                case 'g':
                        named_g_foreground = true;
                        named_g_logstderr = true;
+                       named_g_logflags = ISC_LOG_PRINTTIME | ISC_LOG_ISO8601 |
+                                          ISC_LOG_TZINFO;
                        break;
                case 'L':
                        named_g_logfile = isc_commandline_argument;
index 9b27ec2cf097828cc58a5b58af4dda56a6f1fb25..5359107508d27c3c4f4a65d7fe13917a335f6813 100755 (executable)
@@ -101,7 +101,7 @@ digcomp --lc dig.out.ns2 knowngood.dig.out || status=1
 
 n=$((n + 1))
 echo_i "only one tcp socket was used ($n)"
-tcpclients=$(awk '$3 == "client" && $5 ~ /10.53.0.7#[0-9]*:/ {print $5}' ns2/named.run | sort | uniq -c | wc -l)
+tcpclients=$(awk '$2 == "client" && $4 ~ /10.53.0.7#[0-9]*:/ {print $4}' ns2/named.run | sort | uniq -c | wc -l)
 
 test $tcpclients -eq 1 || {
   status=1
index 06bb7beece5aafa75fa81c8e2d72e992e6774cc0..3ec3e3b2f543b63d39156a817d6485814954f049 100644 (file)
@@ -32,4 +32,8 @@ logging {
                file "five.out";
                print-time iso8601-utc;
        };
+       channel six {
+               file "six.out";
+               print-time iso8601-tzinfo;
+       };
 };
index f2479e6368cd9c76b6e741377677c379a9d8dbed..724785c5fbd49300e8275d9c81be7dec4643ce86 100644 (file)
@@ -2412,10 +2412,10 @@ _check_next_key_event() {
 
   # Get the latest next key event.
   if [ "${DYNAMIC}" = "yes" ]; then
-    _time=$(awk '{print $9}' <"keyevent.out.$ZONE.test$n" | tail -1)
+    _time=$(awk '{print $8}' <"keyevent.out.$ZONE.test$n" | tail -1)
   else
     # inline-signing zone adds "(signed)"
-    _time=$(awk '{print $10}' <"keyevent.out.$ZONE.test$n" | tail -1)
+    _time=$(awk '{print $9}' <"keyevent.out.$ZONE.test$n" | tail -1)
   fi
 
   # The next key event time must within threshold of the
index b460121b04112ea21b5c60ef727e309bbf789caf..952667df758df404ec3e2be5d6914f6fb8ec726f 100644 (file)
@@ -733,7 +733,7 @@ echo_i "check that trust-anchor-telemetry queries contain the correct key ($n)"
 ret=0
 # convert the hexadecimal key from the TAT query into decimal and
 # compare against the known key.
-tathex=$(grep "query '_ta-[0-9a-f][0-9a-f]*/NULL/IN' approved" ns1/named.run | awk '{print $6; exit 0}' | sed -e 's/(_ta-\([0-9a-f][0-9a-f]*\)):/\1/') || true
+tathex=$(grep "query '_ta-[0-9a-f][0-9a-f]*/NULL/IN' approved" ns1/named.run | awk '{print $5; exit 0}' | sed -e 's/(_ta-\([0-9a-f][0-9a-f]*\)):/\1/') || true
 tatkey=$($PERL -e 'printf("%d\n", hex(@ARGV[0]));' "$tathex")
 realkey=$(rndccmd 10.53.0.2 secroots - | sed -n "s#.*${DEFAULT_ALGORITHM}/\([0-9][0-9]*\) ; .*managed.*#\1#p")
 [ "$tatkey" -eq "$realkey" ] || ret=1
index 08ee243562e6f0828d82d55e56749dd1b2b349e2..a827e6da5c230f5085d7832400d7799459d13309 100644 (file)
@@ -65,7 +65,8 @@ test_end
 
 test_start "checking startup notify rate limit"
 awk '/x[0-9].*sending notify to/ {
-       split($2, a, ":");
+  split($1, ts, "T");
+       split(ts[2], a, ":");
        this = a[1] * 3600 + a[2] * 60 + a[3];
        if (lasta1 && lasta1 > a[1]) {
                fix = 3600 * 24;
index 67c33b86f24c8366ab3c18eb0a12e8edd9a1be43..f8faac91a76855604cb05b3a1bea0ce4bc58752a 100755 (executable)
@@ -373,9 +373,9 @@ sub count_running_lines {
        # the shell *ought* to have created the file immediately, but this
        # logic allows the creation to be delayed without issues
        if (open(my $fh, "<", $runfile)) {
-               # the two non-whitespace blobs should be the date and time
+               # the whitespace blob should be an ISO timestamp
                # but we don't care about them really, only that they are there
-               return scalar(grep /^\S+ \S+ running\R/, <$fh>);
+               return scalar(grep /^\S+[ T]\S+ running\R/, <$fh>);
        } else {
                return 0;
        }
index f75e1d9caf01e89b34c1812591bfad5c1206400c..5818870b603607077a573730b9f1f31fa2a820d6 100755 (executable)
@@ -528,7 +528,7 @@ $RNDCCMD 10.53.0.7 refresh edns-expire 2>&1 | sed 's/^/ns7 /' | cat_i
 sleep 10
 
 # there may be multiple log entries so get the last one.
-expire=$(awk '/edns-expire\/IN: got EDNS EXPIRE of/ { x=$9 } END { print x }' ns7/named.run)
+expire=$(awk '/edns-expire\/IN: got EDNS EXPIRE of/ { x=$8 } END { print x }' ns7/named.run)
 test ${expire:-0} -gt 0 -a ${expire:-0} -lt 1814400 || {
   echo_i "failed (expire=${expire:-0})"
   status=$((status + 1))
index 1c363f6662d91290447b41da4ec1de335136ce14..119c8686fa088ce9c634cc50e03bb3c1131c1e21 100644 (file)
@@ -812,13 +812,16 @@ what messages to print.
    :short: Specifies the time format for log messages.
 
    :any:`print-time` can be set to ``yes``, ``no``, or a time format
-   specifier, which may be one of ``local``, ``iso8601``, or
-   ``iso8601-utc``. If set to ``no``, the date and time are not
-   logged. If set to ``yes`` or ``local``, the date and time are logged in
-   a human-readable format, using the local time zone. If set to
-   ``iso8601``, the local time is logged in ISO 8601 format. If set to
+   specifier, which may be one of ``local``, ``iso8601``, ``iso8601-utc``
+   or ``iso8601-tzinfo``.  If set to ``no``, the date and time are
+   not logged. If set to ``yes`` or ``local``, the date and time are
+   logged in a human-readable format, using the local time zone. If
+   set to ``iso8601``, the local time is logged in ISO 8601 format,
+   but no timezone information is included in the timestamp.  If set to
    ``iso8601-utc``, the date and time are logged in ISO 8601 format,
-   with time zone set to UTC. The default is ``no``.
+   with time zone set to UTC. If set to ``iso8601-tzinfo``, the local
+   time is logged in ISO 8601 format, with timezone information included
+   at the end of the timestamp. The default is ``no``.
 
    :any:`print-time` may be specified for a :any:`syslog` channel, but it is
    usually pointless since :any:`syslog` also logs the date and time.
index b3714e4d38aaee959a457b553ff1f43806a4ef6c..4e54305b58188617c97a039b123aa3a13e80fc59 100644 (file)
@@ -57,7 +57,7 @@ logging {
                null;
                print-category <boolean>;
                print-severity <boolean>;
-               print-time ( iso8601 | iso8601-utc | local | <boolean> );
+               print-time ( iso8601 | iso8601-utc | iso8601-tzinfo | local | <boolean> );
                severity <log_severity>;
                stderr;
                syslog [ <syslog_facility> ];
index c7d02cce9617e7a51a6193c9a4e8fbafd8b03da2..f7b357c8fb12a0ce38ac7d434d46f6f6295482e4 100644 (file)
@@ -72,6 +72,7 @@ typedef struct isc_logconfig isc_logconfig_t; /*%< Log Configuration */
 #define ISC_LOG_OPENERR              0x08000 /* internal */
 #define ISC_LOG_ISO8601              0x10000 /* if PRINTTIME, use ISO8601 */
 #define ISC_LOG_UTC          0x20000 /* if PRINTTIME, use UTC */
+#define ISC_LOG_TZINFO       0x40000 /* if PRINTTIME, output TZ info */
 /*@}*/
 
 /*@{*/
index ad74be92705ae8ba30065f7c7ca858e7fbd13133..f08cd2e112d79a1f955f6067bf851785069107d4 100644 (file)
@@ -395,20 +395,6 @@ isc_time_parsehttptimestamp(char *input, isc_time_t *t);
  *\li      'buf' and 't' are not NULL.
  */
 
-void
-isc_time_formatISO8601L(const isc_time_t *t, char *buf, unsigned int len);
-/*%<
- * Format the time 't' into the buffer 'buf' of length 'len',
- * using the ISO8601 format: "yyyy-mm-ddThh:mm:ss"
- * If the text does not fit in the buffer, the result is indeterminate,
- * but is always guaranteed to be null terminated.
- *
- *  Requires:
- *\li      'len' > 0
- *\li      'buf' points to an array of at least len chars
- *
- */
-
 void
 isc_time_formatISO8601Lms(const isc_time_t *t, char *buf, unsigned int len);
 /*%<
@@ -424,10 +410,10 @@ isc_time_formatISO8601Lms(const isc_time_t *t, char *buf, unsigned int len);
  */
 
 void
-isc_time_formatISO8601Lus(const isc_time_t *t, char *buf, unsigned int len);
+isc_time_formatISO8601TZms(const isc_time_t *t, char *buf, unsigned int len);
 /*%<
  * Format the time 't' into the buffer 'buf' of length 'len',
- * using the ISO8601 format: "yyyy-mm-ddThh:mm:ss.ssssss"
+ * using the ISO8601 format: "yyyy-mm-ddThh:mm:ss.sss+hhmm"
  * If the text does not fit in the buffer, the result is indeterminate,
  * but is always guaranteed to be null terminated.
  *
index 53dcb479213288ae9bfb4400fb44be74b323b759..7b65a6094ca272233c69bc99c3fb2086cdbb73c7 100644 (file)
@@ -477,7 +477,7 @@ isc_log_createchannel(isc_logconfig_t *lcfg, const char *name,
        isc_mem_t *mctx;
        unsigned int permitted = ISC_LOG_PRINTALL | ISC_LOG_DEBUGONLY |
                                 ISC_LOG_BUFFERED | ISC_LOG_ISO8601 |
-                                ISC_LOG_UTC;
+                                ISC_LOG_UTC | ISC_LOG_TZINFO;
 
        REQUIRE(VALID_CONFIG(lcfg));
        REQUIRE(name != NULL);
@@ -486,6 +486,7 @@ isc_log_createchannel(isc_logconfig_t *lcfg, const char *name,
        REQUIRE(destination != NULL || type == ISC_LOG_TONULL);
        REQUIRE(level >= ISC_LOG_CRITICAL);
        REQUIRE((flags & ~permitted) == 0);
+       REQUIRE(!(flags & ISC_LOG_UTC) || !(flags & ISC_LOG_TZINFO));
 
        /* FIXME: find duplicate names? */
 
@@ -1256,13 +1257,14 @@ isc_log_doit(isc_logcategory_t category, isc_logmodule_t module, int level,
             const char *format, va_list args) {
        int syslog_level;
        const char *time_string;
-       char local_time[64];
-       char iso8601z_string[64];
-       char iso8601l_string[64];
+       char local_time[64] = { 0 };
+       char iso8601z_string[64] = { 0 };
+       char iso8601l_string[64] = { 0 };
+       char iso8601tz_string[64] = { 0 };
        char level_string[24] = { 0 };
        struct stat statbuf;
        bool matched = false;
-       bool printtime, iso8601, utc, printtag, printcolon;
+       bool printtime, iso8601, utc, tzinfo, printtag, printcolon;
        bool printcategory, printmodule, printlevel, buffered;
        isc_logchannel_t *channel;
        isc_logchannellist_t *category_channels;
@@ -1280,10 +1282,6 @@ isc_log_doit(isc_logcategory_t category, isc_logmodule_t module, int level,
                return;
        }
 
-       local_time[0] = '\0';
-       iso8601l_string[0] = '\0';
-       iso8601z_string[0] = '\0';
-
        rcu_read_lock();
        LOCK(&isc__lctx->lock);
 
@@ -1368,6 +1366,8 @@ isc_log_doit(isc_logcategory_t category, isc_logmodule_t module, int level,
                                                 sizeof(iso8601z_string));
                        isc_time_formatISO8601Lms(&isctime, iso8601l_string,
                                                  sizeof(iso8601l_string));
+                       isc_time_formatISO8601TZms(&isctime, iso8601tz_string,
+                                                  sizeof(iso8601tz_string));
                }
 
                if ((channel->flags & ISC_LOG_PRINTLEVEL) != 0 &&
@@ -1396,6 +1396,7 @@ isc_log_doit(isc_logcategory_t category, isc_logmodule_t module, int level,
                }
 
                utc = ((channel->flags & ISC_LOG_UTC) != 0);
+               tzinfo = ((channel->flags & ISC_LOG_TZINFO) != 0);
                iso8601 = ((channel->flags & ISC_LOG_ISO8601) != 0);
                printtime = ((channel->flags & ISC_LOG_PRINTTIME) != 0);
                printtag = ((channel->flags &
@@ -1412,6 +1413,8 @@ isc_log_doit(isc_logcategory_t category, isc_logmodule_t module, int level,
                        if (iso8601) {
                                if (utc) {
                                        time_string = iso8601z_string;
+                               } else if (tzinfo) {
+                                       time_string = iso8601tz_string;
                                } else {
                                        time_string = iso8601l_string;
                                }
index cff17645548ca6512a2a36b4518236bdcedf2cbf..1a4eae228df5503280d39eb108bb3f876625f45a 100644 (file)
@@ -382,22 +382,6 @@ isc_time_parsehttptimestamp(char *buf, isc_time_t *t) {
        return (ISC_R_SUCCESS);
 }
 
-void
-isc_time_formatISO8601L(const isc_time_t *t, char *buf, unsigned int len) {
-       time_t now;
-       unsigned int flen;
-       struct tm tm;
-
-       REQUIRE(t != NULL);
-       INSIST(t->nanoseconds < NS_PER_SEC);
-       REQUIRE(buf != NULL);
-       REQUIRE(len > 0);
-
-       now = (time_t)t->seconds;
-       flen = strftime(buf, len, "%Y-%m-%dT%H:%M:%S", localtime_r(&now, &tm));
-       INSIST(flen < len);
-}
-
 void
 isc_time_formatISO8601Lms(const isc_time_t *t, char *buf, unsigned int len) {
        time_t now;
@@ -419,7 +403,9 @@ isc_time_formatISO8601Lms(const isc_time_t *t, char *buf, unsigned int len) {
 }
 
 void
-isc_time_formatISO8601Lus(const isc_time_t *t, char *buf, unsigned int len) {
+isc_time_formatISO8601TZms(const isc_time_t *t, char *buf, unsigned int len) {
+       char strftime_buf[64] = { 0 };
+       char ms_buf[8] = { 0 };
        time_t now;
        unsigned int flen;
        struct tm tm;
@@ -430,14 +416,20 @@ isc_time_formatISO8601Lus(const isc_time_t *t, char *buf, unsigned int len) {
        REQUIRE(len > 0);
 
        now = (time_t)t->seconds;
-       flen = strftime(buf, len, "%Y-%m-%dT%H:%M:%S", localtime_r(&now, &tm));
+       flen = strftime(strftime_buf, len, "%Y-%m-%dT%H:%M:%S.xxx%z",
+                       localtime_r(&now, &tm));
+       snprintf(ms_buf, sizeof(ms_buf), ".%03u", t->nanoseconds / NS_PER_MS);
+
        INSIST(flen < len);
-       if (flen > 0U && len - flen >= 6) {
-               snprintf(buf + flen, len - flen, ".%06u",
-                        t->nanoseconds / NS_PER_US);
-       }
+       size_t local_date_len = sizeof("yyyy-mm-ddThh:mm:ss") - 1ul;
+       size_t ms_date_len = local_date_len + 4;
+
+       memmove(buf, strftime_buf, local_date_len);
+       memmove(buf + local_date_len, ms_buf, 4);
+       memmove(buf + ms_date_len, strftime_buf + ms_date_len, 3);
+       buf[ms_date_len + 3] = ':';
+       memmove(buf + ms_date_len + 4, strftime_buf + ms_date_len + 3, 3);
 }
-
 void
 isc_time_formatISO8601(const isc_time_t *t, char *buf, unsigned int len) {
        time_t now;
index dbb787e518972540e1974095feef1227eb5f9dcd..e6aace10db002ddfefbf568e4e9ba71ef5e19d14 100644 (file)
@@ -2631,8 +2631,8 @@ static cfg_type_t cfg_type_server = { "server",        cfg_parse_netprefix_map,
  *  - There must exactly one of file/syslog/null/stderr
  */
 
-static const char *printtime_enums[] = { "iso8601", "iso8601-utc", "local",
-                                        NULL };
+static const char *printtime_enums[] = { "iso8601", "iso8601-utc",
+                                        "iso8601-tzinfo", "local", NULL };
 static isc_result_t
 parse_printtime(cfg_parser_t *pctx, const cfg_type_t *type, cfg_obj_t **ret) {
        return (cfg_parse_enum_or_other(pctx, type, &cfg_type_boolean, ret));
index 18b42e5098cd51f9147c1cf3afb87f3af972d16e..d3a7c016f4206603e1e28d4b1ec3c444457328da 100644 (file)
@@ -256,9 +256,9 @@ ISC_RUN_TEST_IMPL(isc_time_formatISO8601us_test) {
        assert_string_equal(buf, "2015-12-13T09:46:40.123456Z");
 }
 
-/* print local time in ISO8601 */
+/* print local time in ISO8601 with milliseconds and timezone */
 
-ISC_RUN_TEST_IMPL(isc_time_formatISO8601L_test) {
+ISC_RUN_TEST_IMPL(isc_time_formatISO8601TZms_test) {
        isc_time_t t;
        char buf[64];
 
@@ -267,28 +267,34 @@ ISC_RUN_TEST_IMPL(isc_time_formatISO8601L_test) {
        setenv("TZ", "America/Los_Angeles", 1);
        t = isc_time_now();
 
-       /* check formatting: yyyy-mm-ddThh:mm:ss */
+       /* check formatting: yyyy-mm-ddThh:mm:ss.sss */
        memset(buf, 'X', sizeof(buf));
-       isc_time_formatISO8601L(&t, buf, sizeof(buf));
-       assert_int_equal(strlen(buf), 19);
+       buf[63] = '\0';
+       isc_time_formatISO8601TZms(&t, buf, sizeof(buf));
+       assert_int_equal(strlen(buf), strlen("yyyy-mm-ddThh:mm:ss.sss+hh:mm"));
+
        assert_int_equal(buf[4], '-');
        assert_int_equal(buf[7], '-');
        assert_int_equal(buf[10], 'T');
        assert_int_equal(buf[13], ':');
        assert_int_equal(buf[16], ':');
+       assert_int_equal(buf[19], '.');
+
+       size_t plus_minus[2] = { '+', '-' };
+       assert_in_set(buf[23], plus_minus, sizeof(plus_minus));
+       assert_int_equal(buf[26], ':');
 
        /* check time conversion correctness */
        memset(buf, 'X', sizeof(buf));
        isc_time_settoepoch(&t);
-       isc_time_formatISO8601L(&t, buf, sizeof(buf));
-       assert_string_equal(buf, "1969-12-31T16:00:00");
+       isc_time_formatISO8601Lms(&t, buf, sizeof(buf));
+       assert_string_equal(buf, "1969-12-31T16:00:00.000");
 
        memset(buf, 'X', sizeof(buf));
        isc_time_set(&t, 1450000000, 123000000);
-       isc_time_formatISO8601L(&t, buf, sizeof(buf));
-       assert_string_equal(buf, "2015-12-13T01:46:40");
+       isc_time_formatISO8601Lms(&t, buf, sizeof(buf));
+       assert_string_equal(buf, "2015-12-13T01:46:40.123");
 }
-
 /* print local time in ISO8601 with milliseconds */
 
 ISC_RUN_TEST_IMPL(isc_time_formatISO8601Lms_test) {
@@ -323,40 +329,6 @@ ISC_RUN_TEST_IMPL(isc_time_formatISO8601Lms_test) {
        assert_string_equal(buf, "2015-12-13T01:46:40.123");
 }
 
-/* print local time in ISO8601 with microseconds */
-
-ISC_RUN_TEST_IMPL(isc_time_formatISO8601Lus_test) {
-       isc_time_t t;
-       char buf[64];
-
-       UNUSED(state);
-
-       setenv("TZ", "America/Los_Angeles", 1);
-       t = isc_time_now_hires();
-
-       /* check formatting: yyyy-mm-ddThh:mm:ss.ssssss */
-       memset(buf, 'X', sizeof(buf));
-       isc_time_formatISO8601Lus(&t, buf, sizeof(buf));
-       assert_int_equal(strlen(buf), 26);
-       assert_int_equal(buf[4], '-');
-       assert_int_equal(buf[7], '-');
-       assert_int_equal(buf[10], 'T');
-       assert_int_equal(buf[13], ':');
-       assert_int_equal(buf[16], ':');
-       assert_int_equal(buf[19], '.');
-
-       /* check time conversion correctness */
-       memset(buf, 'X', sizeof(buf));
-       isc_time_settoepoch(&t);
-       isc_time_formatISO8601Lus(&t, buf, sizeof(buf));
-       assert_string_equal(buf, "1969-12-31T16:00:00.000000");
-
-       memset(buf, 'X', sizeof(buf));
-       isc_time_set(&t, 1450000000, 123456000);
-       isc_time_formatISO8601Lus(&t, buf, sizeof(buf));
-       assert_string_equal(buf, "2015-12-13T01:46:40.123456");
-}
-
 /* print UTC time as yyyymmddhhmmsssss */
 
 ISC_RUN_TEST_IMPL(isc_time_formatshorttimestamp_test) {
@@ -393,9 +365,8 @@ ISC_TEST_ENTRY(isc_time_parsehttptimestamp_test)
 ISC_TEST_ENTRY(isc_time_formatISO8601_test)
 ISC_TEST_ENTRY(isc_time_formatISO8601ms_test)
 ISC_TEST_ENTRY(isc_time_formatISO8601us_test)
-ISC_TEST_ENTRY(isc_time_formatISO8601L_test)
 ISC_TEST_ENTRY(isc_time_formatISO8601Lms_test)
-ISC_TEST_ENTRY(isc_time_formatISO8601Lus_test)
+ISC_TEST_ENTRY(isc_time_formatISO8601TZms_test)
 ISC_TEST_ENTRY(isc_time_formatshorttimestamp_test)
 
 ISC_TEST_LIST_END