Print this page
sync further changes from uts/aslr
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/test/os-tests/tests/secflags/secflags_core.sh
+++ new/usr/src/test/os-tests/tests/secflags/secflags_core.sh
1 1 #! /usr/bin/ksh
2 2 #
3 3 #
4 4 # This file and its contents are supplied under the terms of the
5 5 # Common Development and Distribution License ("CDDL"), version 1.0.
6 6 # You may only use this file in accordance with the terms of version
7 7 # 1.0 of the CDDL.
8 8 #
9 9 # A full copy of the text of the CDDL should have accompanied this
10 10 # source. A copy of the CDDL is also available via the Internet at
11 11 # http://www.illumos.org/license/CDDL.
12 12 #
13 13
14 14 #
15 15 # Copyright 2015, Richard Lowe.
16 16 #
17 17
18 18 mkdir /tmp/secflags-test.$$
19 19 cd /tmp/secflags-test.$$
20 20
21 21 /usr/bin/psecflags -s aslr -e sleep 100000 &
22 22 pid=$!
23 23 coreadm -p core $pid # We need to be able to reliably find the core
24 24
25 25 cleanup() {
26 26 kill $pid >/dev/null 2>&1
27 27 cd /
28 28 rm -fr /tmp/secflags-test.$$
29 29 }
30 30
31 31 trap cleanup EXIT
32 32
33 33 ## gcore-produced core
34 34 gcore $pid >/dev/null
35 35
36 36 cat > gcore-expected.$$ <<EOF
37 37 core 'core.$pid' of $pid: sleep 100000
38 38 E: aslr
39 39 I: aslr
↓ open down ↓ |
39 lines elided |
↑ open up ↑ |
40 40 EOF
41 41
42 42 /usr/bin/psecflags core.${pid} | grep -v '[LU]:' > gcore-output.$$
43 43
44 44 if ! diff -u gcore-expected.$$ gcore-output.$$; then
45 45 exit 1;
46 46 fi
47 47
48 48 ## kernel-produced core
49 49 kill -SEGV $pid
50 +wait $pid >/dev/null 2>&1
50 51
51 52 cat > core-expected.$$ <<EOF
52 53 core 'core' of $pid: sleep 100000
53 54 E: aslr
54 55 I: aslr
55 56 EOF
56 57
57 58 /usr/bin/psecflags core | grep -v '[LU]:' > core-output.$$
58 59
59 60 if ! diff -u core-expected.$$ core-output.$$; then
60 61 exit 1;
61 62 fi
62 63
63 64 exit 0
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX