Integrated: 8340116: test/jdk/sun/security/tools/jarsigner/PreserveRawManifestEntryAndDigest.java can fail due to regex

Fernando Guallini fguallini at openjdk.org
Fri Nov 1 13:14:34 UTC 2024


On Tue, 1 Oct 2024 08:51:29 GMT, Fernando Guallini <fguallini at openjdk.org> wrote:

> The test **sun/security/tools/jarsigner/PreserveRawManifestEntryAndDigest.java** may fail with the following exception:
> 
> 
> test PreserveRawManifestEntryAndDigest.testNameImmediatelyContinued(): failure
> java.lang.AssertionError: "s k 300 Tue Jun 25 10:20:16 GMT+07:00 2024 META-INF/MANIFEST.MF" should have matched "s k *\\d+ .{28,29} META-INF/MANIFEST[.]MF" expected [true] but found [false]
> 
> 
> The failure occurs due to a mismatch in the expected timestamp format, this happens because jarsigner uses the system's current timezone for output timestamps when signing. The current regular expression expects a timestamp length of 28 or 29 characters, which works if the test is run from a timezone like PST or CEST. However, it fails for longer timezone formats, such as 'GMT+07:00'.
> 
> This PR updates the regular expression ensuring that the test can handle a wider range of timezone strings. Also, removed a couple of unused params from a method.

This pull request has now been integrated.

Changeset: 7e87c071
Author:    Fernando Guallini <fguallini at openjdk.org>
Committer: Sean Mullan <mullan at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/7e87c071b0fd832473f17ec0f579df40bea62950
Stats:     3 lines in 1 file changed: 0 ins; 2 del; 1 mod

8340116: test/jdk/sun/security/tools/jarsigner/PreserveRawManifestEntryAndDigest.java can fail due to regex

Reviewed-by: mullan

-------------

PR: https://git.openjdk.org/jdk/pull/21280


More information about the security-dev mailing list