8171366: macOS: Do not run failure handler commands that require Developer mode access
authorsla
Mon, 19 Dec 2016 10:47:26 +0100
changeset 42535 a270040dcd31
parent 42534 f489cf041782
child 42537 ad06f6358d51
8171366: macOS: Do not run failure handler commands that require Developer mode access Reviewed-by: erikj, iignatyev
test/failure_handler/src/share/conf/mac.properties
--- a/test/failure_handler/src/share/conf/mac.properties	Sun Dec 18 15:57:40 2016 +0100
+++ b/test/failure_handler/src/share/conf/mac.properties	Mon Dec 19 10:47:26 2016 +0100
@@ -29,6 +29,7 @@
 # process info to gather
 ################################################################################
 onTimeout=\
+  native.DevToolsSecurity \
   native.vmmap native.heap native.leaks native.spindump \
   native.stack native.core
 ################################################################################
@@ -36,22 +37,34 @@
 native.javaOnly=false
 native.args=%p
 
-# Some of them require root privileges
-native.vmmap.app=vmmap
-native.heap.app=heap
-native.leaks.app=leaks
+native.DevToolsSecurity.app=DevToolsSecurity
+native.DevToolsSecurity.args=--status
+
+# spindump requires root privileges
 native.spindump.app=spindump
 native.spindump.args=%p -stdout
 
-native.stack.app=lldb
+native.vmmap.app=bash
+native.vmmap.delimiter=\0
+native.vmmap.args=-c\0DevToolsSecurity --status | grep -q enabled && vmmap %p
+
+native.leaks.app=bash
+native.leaks.delimiter=\0
+native.leaks.args=-c\0DevToolsSecurity --status | grep -q enabled && leaks %p
+
+native.heap.app=bash
+native.heap.delimiter=\0
+native.heap.args=-c\0DevToolsSecurity --status | grep -q enabled && heap %p
+
+native.stack.app=bash
 native.stack.delimiter=\0
 native.stack.params.repeat=6
-native.stack.args=-o\0attach %p\0-o\0thread backtrace all\0-o\0detach\0-o\0quit
+native.stack.args=-c\0DevToolsSecurity --status | grep -q enabled && lldb -o 'attach %p' -o 'thread backtrace all' -o 'detach' -o 'quit'
 
 native.core.app=bash
 native.core.delimiter=\0
 native.core.args=-c\0gcore -o ./core.%p %p || \
-  lldb -o 'attach %p' -o 'process save-core core.%p' -o 'detach' -o 'quit'
+  (DevToolsSecurity --status | grep -q enabled && lldb -o 'attach %p' -o 'process save-core core.%p' -o 'detach' -o 'quit')
 native.core.params.timeout=3600000
 ################################################################################
 # environment info to gather
@@ -89,7 +102,6 @@
 memory.vmstat.app=vm_stat
 memory.vmstat.args=-c 3 3
 
-
 netstat.app=netstat
 netstat.av.args=-av
 netstat.aL.args=-aL