summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Levon <john.levon@joyent.com>2019-10-31 12:10:26 +0000
committerJohn Levon <john.levon@joyent.com>2019-11-04 21:14:13 +0000
commite5ace2968d69e625f7153013243d710d96efad76 (patch)
tree659388a0960614107d85135bb48d6e59b28dcabf
parent3349e36e2896c71806ddaed726d65171a3045358 (diff)
downloadillumos-joyent-e5ace2968d69e625f7153013243d710d96efad76.tar.gz
11903 secflags_elfdump.sh test needs coreadm setting
Reviewed by: Paul Winder <paul@winders.demon.co.uk> Approved by: Dan McDonald <danmcd@joyent.com>
-rw-r--r--usr/src/test/os-tests/tests/secflags/secflags_elfdump.sh13
1 files changed, 12 insertions, 1 deletions
diff --git a/usr/src/test/os-tests/tests/secflags/secflags_elfdump.sh b/usr/src/test/os-tests/tests/secflags/secflags_elfdump.sh
index 334ebc16a9..64233ab317 100644
--- a/usr/src/test/os-tests/tests/secflags/secflags_elfdump.sh
+++ b/usr/src/test/os-tests/tests/secflags/secflags_elfdump.sh
@@ -21,12 +21,21 @@ cd /tmp/secflags-test.$$
/usr/bin/psecflags -s aslr -e sleep 100000 &
pid=$!
-coreadm -p core $pid # We need to be able to reliably find the core
+# Make sure we generate a kernel core we can find
+coreadm -p core $pid
+enabled=$(/usr/bin/svcprop -p config_params/process_enabled coreadm)
+coreadm_restore=""
+if [[ "$enabled" = "false" ]]; then
+ coreadm_restore="/usr/bin/coreadm -d process"
+ coreadm -e process
+fi
cleanup() {
kill $pid >/dev/null 2>&1
cd /
rm -fr /tmp/secflags-test.$$
+
+ $coreadm_restore
}
trap cleanup EXIT
@@ -54,12 +63,14 @@ EOF
/usr/bin/elfdump -n core.${pid} | grep -B5 -A5 prsecflags_t > gcore-output.$$
if ! diff -u gcore-expected.$$ gcore-output.$$; then
+ $coreadm_restore
exit 1;
fi
## kernel-produced core
kill -SEGV $pid
wait $pid >/dev/null 2>&1
+$coreadm_restore
cat > core-expected.$$ <<EOF
namesz: 0x5