Gentoo Archives: gentoo-commits

From: "Anthony G. Basile" <blueness@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/elfix:elfix-0.8.x commit in: tests/pxtpax/
Date: Mon, 20 May 2013 20:02:47
Message-Id: 1369080038.25dcf9d0f02b6c2cc8a09543963161f195e7f766.blueness@gentoo
1 commit: 25dcf9d0f02b6c2cc8a09543963161f195e7f766
2 Author: Anthony G. Basile <blueness <AT> gentoo <DOT> org>
3 AuthorDate: Mon May 20 13:48:08 2013 +0000
4 Commit: Anthony G. Basile <blueness <AT> gentoo <DOT> org>
5 CommitDate: Mon May 20 20:00:38 2013 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/elfix.git;a=commit;h=25dcf9d0
7
8 tests/pxtpax/daemontest.sh: clean up bash
9
10 ---
11 tests/pxtpax/daemontest.sh | 24 ++++++++++++------------
12 1 files changed, 12 insertions(+), 12 deletions(-)
13
14 diff --git a/tests/pxtpax/daemontest.sh b/tests/pxtpax/daemontest.sh
15 index 66ec946..b292c62 100755
16 --- a/tests/pxtpax/daemontest.sh
17 +++ b/tests/pxtpax/daemontest.sh
18 @@ -51,7 +51,7 @@ echo " CONFIG_PAX_RANDMMAP"
19 echo " CONFIG_PAX_SEGMEXEC"
20 echo
21
22 -if [ "$unamem" != "i686" -a "$unamem" != "x86_64" ]; then
23 +if [[ "$unamem" != "i686" && "$unamem" != "x86_64" ]]; then
24 echo "This test is only for i686 or x86_64"
25 echo
26 echo "================================================================================"
27 @@ -65,16 +65,16 @@ for pf in "p" "P" "-"; do
28 for sf in "s" "S" "-"; do
29
30 pflags="${pf}${ef}${mf}${rf}${sf}"
31 - if [ "${verbose}" != 0 ] ;then
32 + if [[ "${verbose}" != 0 ]] ;then
33 echo "SET TO :" ${pflags}
34 fi
35
36 flags="${pf/-/Pp}${ef/-/Ee}${mf/-/Mm}${rf/-/Rr}${sf/-/Ss}"
37 ${PAXCTLNG} -"${flags}" ${DAEMON} >/dev/null 2>&1
38
39 - if [ "${verbose}" != 0 ] ;then
40 + if [[ "${verbose}" != 0 ]] ;then
41 sflags=$(${PAXCTLNG} -v ${DAEMON})
42 - if [ "${dotest}" = "0" ]; then
43 + if [[ "${dotest}" = "0" ]]; then
44 sflags=$(echo ${sflags} | awk '{print $3}')
45 echo "GOT :" ${sflags}
46 else
47 @@ -86,22 +86,22 @@ for pf in "p" "P" "-"; do
48 fi
49
50 ${INITSH} start
51 - if [ -f "${PIDFILE}" ]
52 + if [[ -f "${PIDFILE}" ]]
53 then
54 rflags=$(cat /proc/$(cat ${PIDFILE})/status | grep ^PaX | awk '{ print $2 }')
55 - if [ "${verbose}" != 0 ] ;then
56 + if [[ "${verbose}" != 0 ]] ;then
57 echo "RUNNING: "${rflags}
58 fi
59 ${INITSH} stop
60 else
61 - if [ "${verbose}" != 0 ] ;then
62 + if [[ "${verbose}" != 0 ]] ;then
63 echo "RUNNING: no daemon"
64 fi
65 rflags="-----"
66 fi
67
68
69 - if [ "$unamem" = "i686" ]; then
70 + if [[ "$unamem" = "i686" ]]; then
71 # Skip i = 0 which is P which is not set on i686
72 list="1 2 3 4"
73 else
74 @@ -112,15 +112,15 @@ for pf in "p" "P" "-"; do
75 for i in $list; do
76 p=${pflags:$i:1}
77 r=${rflags:$i:1}
78 - if [ $p != "-" ]; then
79 - if [ $p != $r -a $r != "-" ]; then
80 + if [[ $p != "-" ]]; then
81 + if [[ $p != $r && $r != "-" ]]; then
82 (( count = count + 1 ))
83 echo "Mismatch: ${pflags} ${rflags}"
84 fi
85 fi
86 done
87
88 - if [ "${verbose}" != 0 ] ;then
89 + if [[ "${verbose}" != 0 ]] ;then
90 echo
91 else
92 echo -n "."
93 @@ -132,7 +132,7 @@ for pf in "p" "P" "-"; do
94 done
95 done
96
97 -if [ "${verbose}" = 0 ] ;then
98 +if [[ "${verbose}" = 0 ]] ;then
99 echo
100 echo
101 fi