1
1
/*
2
- * Copyright (c) 2011, 2020 , 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
/*
@@ -57,6 +58,7 @@ public static void main(String[] args) throws Exception {
57
58
testJcmdPid_f ();
58
59
testJcmdPidPerfCounterPrint ();
59
60
testJcmdPidBigScript ();
61
+ testJcmdPidVMinfo ();
60
62
}
61
63
62
64
/**
@@ -164,4 +166,21 @@ private static void verifyOutputAgainstFile(OutputAnalyzer output) throws IOExce
164
166
"The ouput should contain all content of " + path .toAbsolutePath ());
165
167
}
166
168
169
+ /**
170
+ * Sanity check for VM.info
171
+ */
172
+ private static void testJcmdPidVMinfo () throws Exception {
173
+ OutputAnalyzer output = JcmdBase .jcmd (VM_ARGS , new String [] {"VM.info" });
174
+ output .shouldHaveExitValue (0 );
175
+ output .shouldContain (Long .toString (ProcessTools .getProcessId ()) + ":" );
176
+
177
+ // Should find the signal handler summary (except on Windows):
178
+ if (!Platform .isWindows ()) {
179
+ output .shouldContain ("Signal Handlers:" );
180
+ // Should not find any of the possible signal handler modification warnings:
181
+ output .shouldNotContain (" handler modified!" ); // e.g. Warning: SIGILL handler modified!
182
+ output .shouldNotContain ("*** Handler was modified!" );
183
+ output .shouldNotContain ("*** Expected: " ); // e.g. *** Expected: javaSignalHandler in ...
184
+ }
185
+ }
167
186
}
0 commit comments