PERFORCE change 133026 for review
Zhouyi ZHOU
zhouzhouyi at FreeBSD.org
Thu Jan 10 23:31:21 PST 2008
http://perforce.freebsd.org/chv.cgi?CH=133026
Change 133026 by zhouzhouyi at zhouzhouyi_mactest on 2008/01/11 07:30:47
Style Modification
Affected files ...
.. //depot/projects/soc2007/zhouzhouyi_mactest_soc/regression/mactest/tests/signal/00.t#4 edit
.. //depot/projects/soc2007/zhouzhouyi_mactest_soc/regression/mactest/tests/signal/01.t#4 edit
Differences ...
==== //depot/projects/soc2007/zhouzhouyi_mactest_soc/regression/mactest/tests/signal/00.t#4 (text+ko) ====
@@ -1,5 +1,5 @@
#!/bin/sh
-# $FreeBSD: src/tools/regression/mactest/tests/signal/00.t,v 1.1 2007/06/04 01:42:08 zhouzhouyi Exp $
+# $FreeBSD$
desc="sending signal to a process"
@@ -9,31 +9,32 @@
#turn off all the switches
for i in `sysctl security.mac | grep "\.enabled"|
sed 's/\([a-z\.]*\.enabled\)\(:\ \)\([01]\)/\1/`; do
-sysctl ${i}=0
+sysctl ${i}=0 > /dev/null
done
mac_mls_support=`sysctl -n security.mac.mls.enabled 2>/dev/null`
#following test case is to show, when subject's effective mls level does not dominate
#object's effective mls level, a ESRCH is returned when signaling
if [ "${mac_mls_support}" != "" ] ; then
+ echo "1..6"
maccmdnotexpectanyerror "mls/3(2-7)" ${macproc} -w 20 -f "${pid_file}"
getmacprocpid
- t=`sysctl security.mac.mls.enabled=1`
+ sysctl security.mac.mls.enabled=1 > /dev/null
maccmdexpect "No such process" "mls/low" kill ${pid}
maccmdnotexpectanyerror "mls/3(2-7)" kill ${pid}
- t=`sysctl security.mac.mls.enabled=0`
+ sysctl security.mac.mls.enabled=0 > /dev/null
rm ${pid_file}
rm ${tmp_file}
#following test case is to show, when object's effective mls level does not dominate
#subject's effective mls level, a EACCES is returned when signaling
- t=`sysctl security.mac.mls.enabled=0`
+ sysctl security.mac.mls.enabled=0 > /dev/null
maccmdnotexpectanyerror "mls/low(low-high)" ${macproc} -w 20 -f "${pid_file}"
getmacprocpid
- t=`sysctl security.mac.mls.enabled=1`
+ sysctl security.mac.mls.enabled=1 > /dev/null
maccmdexpect "Permission denied" "mls/3(2-7)" kill ${pid}
maccmdnotexpectanyerror "mls/low(low-high)" kill ${pid}
- t=`sysctl security.mac.mls.enabled=0`
+ sysctl security.mac.mls.enabled=0 > /dev/null
rm ${pid_file}
rm ${tmp_file}
fi
==== //depot/projects/soc2007/zhouzhouyi_mactest_soc/regression/mactest/tests/signal/01.t#4 (text+ko) ====
@@ -1,5 +1,5 @@
#!/bin/sh
-# $FreeBSD: src/tools/regression/mactest/tests/signal/01.t,v 1.1 2007/06/04 01:42:08 zhouzhouyi Exp $
+# $FreeBSD$
desc="sending signal to a process, check whether mac_test_check_proc_signal is got called \
properly"
@@ -12,17 +12,29 @@
#turn off all the switches
for i in `sysctl security.mac | grep "\.enabled"|
sed 's/\([a-z\.]*\.enabled\)\(:\ \)\([01]\)/\1/`; do
-sysctl ${i}=0
+sysctl ${i}=0 > /dev/null
done
mac_mls_support=`sysctl -n security.mac.mls.enabled 2>/dev/null`
mac_biba_support=`sysctl -n security.mac.biba.enabled 2>/dev/null`
+mac_test_support=`sysctl -n security.mac.test.pseudoinit 2>/dev/null`
+
+if [ "${mac_mls_support}" != "" ] && [ "${mac_biba_support}" != "" ] \
+ && [ "${mac_test_support}" != "" ]; then
+
+ if [ -f ${mactest_conf} ]; then
+ rm ${mactest_conf}
+ fi
+ touch ${mactest_conf}
+ setfmac "mls/equal,biba/equal" ${mactest_conf}
+
+ echo "1..2"
-if [ "${mac_mls_support}" != "" ] && [ "${mac_biba_support}" != "" ] ; then
maccmdnotexpectanyerror "mls/3(2-7)" ${macproc} -w 100 -f "${pid_file}"
getmacprocpid
- echo "pid = -1 mac_test_check_proc_signal with cr_label and proc label: biba/high(low-high),mls/9(low-high) mls/3(2-7),biba/high(low-high)" > ${mactest_conf}
+ echo -n "pid = -1 proc_check_signal:" > ${mactest_conf}
+ echo "biba/high(low-high),mls/9(low-high) mls/3(2-7),biba/high(low-high)" >> ${mactest_conf}
mactestexpect "" 0 -m "mls/9" -f ${mactest_conf} kill ${pid} 9
More information about the p4-projects
mailing list