hotspot/test/runtime/CDSCompressedKPtrs/XShareAuto.java
changeset 23442 be6bd2c1f2a8
parent 21769 61c68af507c9
child 25332 de966f7475d6
--- a/hotspot/test/runtime/CDSCompressedKPtrs/XShareAuto.java	Wed Mar 05 12:31:09 2014 -0500
+++ b/hotspot/test/runtime/CDSCompressedKPtrs/XShareAuto.java	Mon Mar 10 14:50:20 2014 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2014, Oracle and/or its affiliates. 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
@@ -22,7 +22,6 @@
  */
 
 /*
- * @ignore 8026154
  * @test
  * @bug 8005933
  * @summary Test that -Xshare:auto uses CDS when explicitly specified with -server.
@@ -50,21 +49,15 @@
 
         pb = ProcessTools.createJavaProcessBuilder(
             "-server", "-Xshare:auto", "-XX:+UnlockDiagnosticVMOptions",
-            "-XX:SharedArchiveFile=./sample.jsa", "-version");
+            "-XX:SharedArchiveFile=./sample.jsa", "-XX:+PrintSharedSpaces", "-version");
         output = new OutputAnalyzer(pb.start());
         try {
             output.shouldContain("sharing");
-            output.shouldHaveExitValue(0);
         } catch (RuntimeException e) {
-            // If this failed then check that it would also be unable
-            // to share even if -Xshare:on is specified.  If so, then
-            // return a success status.
-            pb = ProcessTools.createJavaProcessBuilder(
-                "-server", "-Xshare:on", "-XX:+UnlockDiagnosticVMOptions",
-                "-XX:SharedArchiveFile=./sample.jsa", "-version");
-            output = new OutputAnalyzer(pb.start());
-            output.shouldContain("Unable to use shared archive");
-            output.shouldHaveExitValue(1);
+            // if sharing failed due to ASLR or similar reasons,
+            // check whether sharing was attempted at all (UseSharedSpaces)
+            output.shouldContain("UseSharedSpaces:");
         }
+        output.shouldHaveExitValue(0);
     }
 }