Skip to content

Commit

Permalink
8261753: Test java/lang/System/OsVersionTest.java still failing on Bi…
Browse files Browse the repository at this point in the history
…gSur patch versions after JDK-8253702

Reviewed-by: rriggs
  • Loading branch information
RealCLanger committed Feb 16, 2021
1 parent 16bd7d3 commit 8ba390d
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions test/jdk/java/lang/System/OsVersionTest.java
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2015 SAP SE. All rights reserved.
* Copyright (c) 2015, 2021, SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand All @@ -24,6 +24,7 @@
import jdk.test.lib.Platform;
import jdk.test.lib.process.OutputAnalyzer;
import jdk.test.lib.process.ProcessTools;
import jtreg.SkippedException;

/*
* @test
Expand All @@ -49,8 +50,14 @@ public static void main(String args[]) throws Throwable {
}
else if (Platform.isOSX()) {
OutputAnalyzer output = ProcessTools.executeProcess("sw_vers", "-productVersion");
if (!osVersion.equals(output.getOutput().trim())) {
throw new Error(osVersion + " != " + output.getOutput().trim());
String swVersOutput = output.getOutput().trim();
if (!osVersion.equals(swVersOutput)) {
// This section can be removed if minimum build SDK is xcode 12+
if (swVersOutput.startsWith(osVersion)) {
throw new SkippedException("MacOS version only matches in parts, this is expected when " +
"JDK was built with Xcode < 12 and MacOS version patch is > 0");
}
throw new Error(osVersion + " != " + swVersOutput);
}
}
else if (Platform.isAix()) {
Expand Down

1 comment on commit 8ba390d

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.