]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
selftest: Fix subunit reporting the time incorrectly
authorJoseph Sutton <josephsutton@catalyst.net.nz>
Thu, 17 Aug 2023 00:46:17 +0000 (12:46 +1200)
committerAndrew Bartlett <abartlet@samba.org>
Mon, 21 Aug 2023 23:37:29 +0000 (23:37 +0000)
Although report_time() would output the time in UTC, it neglected to
specify the timezone offset. Thus subunithelper.parse_results() would
interpret the time string it was given as being in local time.
TestProtocolClient.time() then converted that *back* into UTC, giving an
incorrect result (unless UTC is your local timezone).

Fix this by having report_time() indicate that the time zone is UTC.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15162

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
selftest/Subunit.pm

index 07f3ac28ddff437d514f16a83d0decd03c17a6a2..581af6246b3fe1faecc69f3e424ec7c9c6af8965 100644 (file)
@@ -55,7 +55,7 @@ sub report_time()
        if (substr($msg, 1, 1) eq ".") {
                $msg = "0" . $msg;
        }
-       printf "time: %04d-%02d-%02d %02d:%02d:%s\n", $year+1900, $mon+1, $mday, $hour, $min, $msg;
+       printf "time: %04d-%02d-%02d %02d:%02d:%sZ\n", $year+1900, $mon+1, $mday, $hour, $min, $msg;
 }
 
 sub progress_pop()