Date: Thu, 10 Jan 2008 07:31:04 GMT From: Zhouyi ZHOU <zhouzhouyi@FreeBSD.org> To: Perforce Change Reviews <perforce@FreeBSD.org> Subject: PERFORCE change 132955 for review Message-ID: <200801100731.m0A7V44v094409@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=132955 Change 132955 by zhouzhouyi@zhouzhouyi_mactest on 2008/01/10 07:30:46 style modication and error removing for sysvmsq test Affected files ... .. //depot/projects/soc2007/zhouzhouyi_mactest_soc/regression/mactest/tests/sysvmsg/00.t#2 edit Differences ... ==== //depot/projects/soc2007/zhouzhouyi_mactest_soc/regression/mactest/tests/sysvmsg/00.t#2 (text+ko) ==== @@ -1,76 +1,75 @@ #!/bin/sh -# $FreeBSD: src/tools/regression/mactest/tests/sysvmsg/00.t,v 1.2 2007/01/25 20:50:02 zhouzhouyi Exp $ +# $FreeBSD$ -desc="manipulate sysv share memory" +desc="manipulate sysv msg" dir=`dirname $0` . ${dir}/../misc.sh -echo "1..4" +case "${os}" in +FreeBSD) -#turn off all the switches -for i in `sysctl security.mac | grep "\.enabled"| - sed 's/\([a-z\.]*\.enabled\)\(:\ \)\([01]\)/\1/`; do -sysctl ${i}=0 -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` -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 +#turn off all the switches + for i in `sysctl security.mac | grep "\.enabled"| + sed 's/\([a-z\.]*\.enabled\)\(:\ \)\([01]\)/\1/`; do + sysctl ${i}=0 >/dev/null + done -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..4" - if [ -f ${mactest_conf} ]; then - rm ${mactest_conf} - fi - touch ${mactest_conf} - ############################################################# - t=`sysctl security.mac.mls.enabled=1` - echo "enforcing mac/mls!" - t=`sysctl security.mac.biba.enabled=1` - echo "enforcing mac/biba!" - t=`sysctl security.mac.mls.revocation_enabled=1` - t=`sysctl security.mac.biba.revocation_enabled=1` - echo "enabling revoking" -#option -c creator's label, option -s sender's label -#option -r receiver's label, option -t ipc stat label -#options -e ipc set label + sysctl security.mac.mls.enabled=1 >/dev/null + sysctl security.mac.biba.enabled=1 > /dev/null #case 1: check mls no read high - echo -n "pid = -2 mac_test_check_sysv_msqget:" > ${mactest_conf} - echo "biba/high(low-high),mls/4(low-high) biba/high,mls/5" >> ${mactest_conf} - bizarretestexpect ${msgtest} "msgtest:.receiver:.msgget:.Permission.denied"\ - "" -c "mls/5" -s "mls/5" \ - -r "mls/4" -t "mls/5" -e "mls/5" -f ${mactest_conf} + echo -n "pid = -2 sysvmsq_check_msqget:" > ${mactest_conf} + echo "biba/high,mls/5 biba/high(low-high),mls/4(low-high)" >> ${mactest_conf} + bizarretestexpect ${msgtest} "*receiver:.msgget*"\ + "" -c "mls/5" -s "mls/5" \ + -r "mls/4" -t "mls/5" -e "mls/5" -f ${mactest_conf} + #case 2: check biba no read low - truncate -s 0 ${mactest_conf} - bizarretestexpect ${msgtest} "msgtest:.receiver:.msgget:.Permission.denied"\ - "" -c "biba/5" -s "biba/5" \ - -r "biba/9" -t "biba/5" -e "biba/5" -f ${mactest_conf} + truncate -s 0 ${mactest_conf} + bizarretestexpect ${msgtest} "receiver:.msgget"\ + "" -c "biba/5" -s "biba/5" \ + -r "biba/9" -t "biba/5" -e "biba/5" -f ${mactest_conf} + #case 3: check biba no send high - echo -n "pid = -2 mac_test_check_sysv_msqget:" > ${mactest_conf} - echo "biba/4(low-high),mls/low(low-high) biba/5,mls/low" >> ${mactest_conf} - bizarretestexpect ${msgtest} "msgtest:.sender:.msgsnd.1:.Permission.denied"\ - "" -c "biba/5" -s "biba/4" \ - -r "biba/5" -t "biba/5" -e "biba/5" -f ${mactest_conf} + echo -n "pid = -2 sysvmsq_check_msqget:" > ${mactest_conf} + echo "biba/5,mls/low biba/4(low-high),mls/low(low-high)" >> ${mactest_conf} + bizarretestexpect ${msgtest} "sender:.msgsnd"\ + "" -c "biba/5" -s "biba/4" \ + -r "biba/5" -t "biba/5" -e "biba/5" -f ${mactest_conf} + #case 4: check mls no send low - echo -n "pid = -2 mac_test_check_sysv_msqsnd:" > ${mactest_conf} - echo "biba/high(low-high),mls/9(low-high) biba/high,mls/5" >> ${mactest_conf} - bizarretestexpect ${msgtest} "msgtest:.sender:.msgsnd.1:.Permission.denied"\ - "" -c "mls/5" -s "mls/9" \ - -r "mls/5" -t "mls/5" -e "mls/5" -f ${mactest_conf} + echo -n "pid = -2 sysvmsq_check_msqsnd:" > ${mactest_conf} + echo "biba/high,mls/5 biba/high(low-high),mls/9(low-high)" >> ${mactest_conf} + bizarretestexpect ${msgtest} "sender:.msgsnd"\ + "" -c "mls/5" -s "mls/9" \ + -r "mls/5" -t "mls/5" -e "mls/5" -f ${mactest_conf} #cleanup: - t=`sysctl security.mac.mls.enabled=0` - echo "disabling mac/mls!" - t=`sysctl security.mac.biba.enabled=0` - echo "disabling mac/biba!" + sysctl security.mac.mls.enabled=0 >/dev/null + sysctl security.mac.biba.enabled=0 > /dev/null + rm ${mactest_conf} + fi + ;; +*) + quick_exit + ;; +esac - rm ${mactest_conf} -fi
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200801100731.m0A7V44v094409>