|
1 | 1 | /*
|
2 |
| - * Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved. |
| 2 | + * Copyright (c) 2011, 2022, Oracle and/or its affiliates. All rights reserved. |
3 | 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
4 | 4 | *
|
5 | 5 | * This code is free software; you can redistribute it and/or modify it
|
|
32 | 32 |
|
33 | 33 | import jdk.test.lib.process.OutputAnalyzer;
|
34 | 34 | import jdk.test.lib.process.ProcessTools;
|
| 35 | +import jdk.test.lib.Platform; |
35 | 36 | import jdk.test.lib.Utils;
|
36 | 37 |
|
37 | 38 | /*
|
@@ -59,6 +60,7 @@ public static void main(String[] args) throws Exception {
|
59 | 60 | testJcmdPid_f();
|
60 | 61 | testJcmdPidPerfCounterPrint();
|
61 | 62 | testJcmdPidBigScript();
|
| 63 | + testJcmdPidVMinfo(); |
62 | 64 | }
|
63 | 65 |
|
64 | 66 | /**
|
@@ -166,4 +168,21 @@ private static void verifyOutputAgainstFile(OutputAnalyzer output) throws IOExce
|
166 | 168 | "The ouput should contain all content of " + path.toAbsolutePath());
|
167 | 169 | }
|
168 | 170 |
|
| 171 | + /** |
| 172 | + * Sanity check for VM.info |
| 173 | + */ |
| 174 | + private static void testJcmdPidVMinfo() throws Exception { |
| 175 | + OutputAnalyzer output = JcmdBase.jcmd(VM_ARGS, new String[] {"VM.info"}); |
| 176 | + output.shouldHaveExitValue(0); |
| 177 | + output.shouldContain(Long.toString(ProcessTools.getProcessId()) + ":"); |
| 178 | + |
| 179 | + // Should find the signal handler summary (except on Windows): |
| 180 | + if (!Platform.isWindows()) { |
| 181 | + output.shouldContain("Signal Handlers:"); |
| 182 | + // Should not find any of the possible signal handler modification warnings: |
| 183 | + output.shouldNotContain(" handler modified!"); // e.g. Warning: SIGILL handler modified! |
| 184 | + output.shouldNotContain("*** Handler was modified!"); |
| 185 | + output.shouldNotContain("*** Expected: "); // e.g. *** Expected: javaSignalHandler in ... |
| 186 | + } |
| 187 | + } |
169 | 188 | }
|
0 commit comments