test/hotspot/jtreg/runtime/os/TestUseCpuAllocPath.java
author ssahoo
Wed, 04 Jul 2018 03:44:32 -0700
changeset 50936 00b16d0457e4
parent 48466 08b8cc40cb61
permissions -rw-r--r--
8205653: test/jdk/sun/management/jmxremote/bootstrap/RmiRegistrySslTest.java and RmiSslBootstrapTest.sh fail with handshake_failure Summary: Test failure due to unsupported DSA keys Reviewed-by: dfuchs, xuelei
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
48466
08b8cc40cb61 8193509: Test dynamic path to retrieve active processor count.
goetz
parents:
diff changeset
     1
/*
08b8cc40cb61 8193509: Test dynamic path to retrieve active processor count.
goetz
parents:
diff changeset
     2
 * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
08b8cc40cb61 8193509: Test dynamic path to retrieve active processor count.
goetz
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
08b8cc40cb61 8193509: Test dynamic path to retrieve active processor count.
goetz
parents:
diff changeset
     4
 *
08b8cc40cb61 8193509: Test dynamic path to retrieve active processor count.
goetz
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
08b8cc40cb61 8193509: Test dynamic path to retrieve active processor count.
goetz
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
08b8cc40cb61 8193509: Test dynamic path to retrieve active processor count.
goetz
parents:
diff changeset
     7
 * published by the Free Software Foundation.
08b8cc40cb61 8193509: Test dynamic path to retrieve active processor count.
goetz
parents:
diff changeset
     8
 *
08b8cc40cb61 8193509: Test dynamic path to retrieve active processor count.
goetz
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
08b8cc40cb61 8193509: Test dynamic path to retrieve active processor count.
goetz
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
08b8cc40cb61 8193509: Test dynamic path to retrieve active processor count.
goetz
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
08b8cc40cb61 8193509: Test dynamic path to retrieve active processor count.
goetz
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
08b8cc40cb61 8193509: Test dynamic path to retrieve active processor count.
goetz
parents:
diff changeset
    13
 * accompanied this code).
08b8cc40cb61 8193509: Test dynamic path to retrieve active processor count.
goetz
parents:
diff changeset
    14
 *
08b8cc40cb61 8193509: Test dynamic path to retrieve active processor count.
goetz
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
08b8cc40cb61 8193509: Test dynamic path to retrieve active processor count.
goetz
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
08b8cc40cb61 8193509: Test dynamic path to retrieve active processor count.
goetz
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
08b8cc40cb61 8193509: Test dynamic path to retrieve active processor count.
goetz
parents:
diff changeset
    18
 *
08b8cc40cb61 8193509: Test dynamic path to retrieve active processor count.
goetz
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
08b8cc40cb61 8193509: Test dynamic path to retrieve active processor count.
goetz
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
08b8cc40cb61 8193509: Test dynamic path to retrieve active processor count.
goetz
parents:
diff changeset
    21
 * questions.
08b8cc40cb61 8193509: Test dynamic path to retrieve active processor count.
goetz
parents:
diff changeset
    22
 */
08b8cc40cb61 8193509: Test dynamic path to retrieve active processor count.
goetz
parents:
diff changeset
    23
08b8cc40cb61 8193509: Test dynamic path to retrieve active processor count.
goetz
parents:
diff changeset
    24
import jdk.test.lib.process.ProcessTools;
08b8cc40cb61 8193509: Test dynamic path to retrieve active processor count.
goetz
parents:
diff changeset
    25
import jdk.test.lib.process.OutputAnalyzer;
08b8cc40cb61 8193509: Test dynamic path to retrieve active processor count.
goetz
parents:
diff changeset
    26
08b8cc40cb61 8193509: Test dynamic path to retrieve active processor count.
goetz
parents:
diff changeset
    27
/**
08b8cc40cb61 8193509: Test dynamic path to retrieve active processor count.
goetz
parents:
diff changeset
    28
 * @test
08b8cc40cb61 8193509: Test dynamic path to retrieve active processor count.
goetz
parents:
diff changeset
    29
 * @summary If #processors > 1024 os_linux.cpp uses special coding.
08b8cc40cb61 8193509: Test dynamic path to retrieve active processor count.
goetz
parents:
diff changeset
    30
 *   Excercise this by forcing usage of this coding. If this fails, this
08b8cc40cb61 8193509: Test dynamic path to retrieve active processor count.
goetz
parents:
diff changeset
    31
 *   VM was either compiled on a platform which does not define CPU_ALLOC,
08b8cc40cb61 8193509: Test dynamic path to retrieve active processor count.
goetz
parents:
diff changeset
    32
 *   or it is executed on a platform that does not support it.
08b8cc40cb61 8193509: Test dynamic path to retrieve active processor count.
goetz
parents:
diff changeset
    33
 * @requires os.family == "linux"
08b8cc40cb61 8193509: Test dynamic path to retrieve active processor count.
goetz
parents:
diff changeset
    34
 * @modules java.base/jdk.internal.misc
08b8cc40cb61 8193509: Test dynamic path to retrieve active processor count.
goetz
parents:
diff changeset
    35
 * @library /test/lib
08b8cc40cb61 8193509: Test dynamic path to retrieve active processor count.
goetz
parents:
diff changeset
    36
 * @run driver TestUseCpuAllocPath
08b8cc40cb61 8193509: Test dynamic path to retrieve active processor count.
goetz
parents:
diff changeset
    37
 */
08b8cc40cb61 8193509: Test dynamic path to retrieve active processor count.
goetz
parents:
diff changeset
    38
public class TestUseCpuAllocPath {
08b8cc40cb61 8193509: Test dynamic path to retrieve active processor count.
goetz
parents:
diff changeset
    39
08b8cc40cb61 8193509: Test dynamic path to retrieve active processor count.
goetz
parents:
diff changeset
    40
    static final String SUCCESS_STRING = "active_processor_count: using dynamic path (forced)";
08b8cc40cb61 8193509: Test dynamic path to retrieve active processor count.
goetz
parents:
diff changeset
    41
08b8cc40cb61 8193509: Test dynamic path to retrieve active processor count.
goetz
parents:
diff changeset
    42
    public static void main(String[] args) throws Exception {
08b8cc40cb61 8193509: Test dynamic path to retrieve active processor count.
goetz
parents:
diff changeset
    43
        ProcessBuilder pb =
08b8cc40cb61 8193509: Test dynamic path to retrieve active processor count.
goetz
parents:
diff changeset
    44
            ProcessTools.createJavaProcessBuilder(false,
08b8cc40cb61 8193509: Test dynamic path to retrieve active processor count.
goetz
parents:
diff changeset
    45
                                                  "-Xlog:os=trace",
08b8cc40cb61 8193509: Test dynamic path to retrieve active processor count.
goetz
parents:
diff changeset
    46
                                                  "-XX:+UnlockDiagnosticVMOptions",
08b8cc40cb61 8193509: Test dynamic path to retrieve active processor count.
goetz
parents:
diff changeset
    47
                                                  "-XX:+UseCpuAllocPath",
08b8cc40cb61 8193509: Test dynamic path to retrieve active processor count.
goetz
parents:
diff changeset
    48
                                                  "-version");
08b8cc40cb61 8193509: Test dynamic path to retrieve active processor count.
goetz
parents:
diff changeset
    49
08b8cc40cb61 8193509: Test dynamic path to retrieve active processor count.
goetz
parents:
diff changeset
    50
        OutputAnalyzer output = new OutputAnalyzer(pb.start());
08b8cc40cb61 8193509: Test dynamic path to retrieve active processor count.
goetz
parents:
diff changeset
    51
        output.shouldContain(SUCCESS_STRING);
08b8cc40cb61 8193509: Test dynamic path to retrieve active processor count.
goetz
parents:
diff changeset
    52
    }
08b8cc40cb61 8193509: Test dynamic path to retrieve active processor count.
goetz
parents:
diff changeset
    53
}