Skip to content
Permalink
Browse files

8261753: Test java/lang/System/OsVersionTest.java still failing on Bi…

…gSur patch versions after JDK-8253702

Reviewed-by: rriggs
  • Loading branch information
RealCLanger committed Feb 16, 2021
1 parent 16bd7d3 commit 8ba390d1e243c5ec2e637263fa44907b664e8ceb
Showing with 10 additions and 3 deletions.
  1. +10 −3 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
@@ -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
@@ -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()) {

1 comment on commit 8ba390d

@openjdk-notifier

This comment has been minimized.

Copy link

@openjdk-notifier openjdk-notifier bot commented on 8ba390d Feb 16, 2021

Please sign in to comment.