Date: Wed, 11 Jul 2007 05:28:04 GMT From: Zhouyi ZHOU <zhouzhouyi@FreeBSD.org> To: Perforce Change Reviews <perforce@FreeBSD.org> Subject: PERFORCE change 123308 for review Message-ID: <200707110528.l6B5S4Ad042416@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=123308 Change 123308 by zhouzhouyi@zhouzhouyi_mactest on 2007/07/11 05:27:42 The order of the MAC items appears in the test cases does not matter Affected files ... .. //depot/projects/soc2007/zhouzhouyi_mactest_soc/regression/mactest/tests/misc.sh#6 edit .. //depot/projects/soc2007/zhouzhouyi_mactest_soc/regression/mactest/tests/open/01.t#3 edit Differences ... ==== //depot/projects/soc2007/zhouzhouyi_mactest_soc/regression/mactest/tests/misc.sh#6 (text+ko) ==== @@ -56,18 +56,30 @@ rm ${tmp_file} } -mactestexpect1() +maclabelexpect() { e="${1}" + err=0 shift ${mactest} $* 2>${tmp_file} 1>>${tmp_file} r=`cat ${tmp_file}` - echo "${r}" | grep ${e} >/dev/null 2>&1 - if [ $? -eq 0 ]; then - echo "ok ${ntest}" - else - echo ${r} - echo "not ok ${ntest}" + d=`echo ${e}|sed 'y/\,/\ /` + for item in ${d} + do + echo "${r}" | grep ${item} >/dev/null 2>&1 + if [ $? -eq 0 ]; then + else + err=1 + fi + done + if [ ${err} -eq 0 ]; then + echo "ok ${ntest}" + else + echo -n "The expected maclabel " + echo -n ${e} + echo " does not match" + echo ${r} + echo "not ok ${ntest}" fi ntest=`expr $ntest + 1` rm ${tmp_file} ==== //depot/projects/soc2007/zhouzhouyi_mactest_soc/regression/mactest/tests/open/01.t#3 (text+ko) ==== @@ -6,7 +6,7 @@ dir=`dirname $0` . ${dir}/../misc.sh -echo "1..4" +echo "1..5" n0=`namegen` n1=`namegen` @@ -97,14 +97,14 @@ #It is strange that there are no mac_check respect to get the vnode label echo -n "pid = -2 mac_test_copy_vnode_label with src label:" > ${mactest_conf} echo "biba/high,mls/7" >> ${mactest_conf} - mactestexpect1 "biba/high,mls/7" -f ${mactest_conf} system getfmac ${n0} + maclabelexpect "mls/7,biba/high" -f ${mactest_conf} system getfmac ${n0} ############################################################# #case ls -l -Z command: #Why ls need -l to work with -Z, this is not correspond to the manual page of ls echo -n "pid = -2 mac_test_copy_vnode_label with src label:" > ${mactest_conf} echo "biba/high,mls/7" >> ${mactest_conf} - mactestexpect1 "biba/high,mls/7" -f ${mactest_conf} system ls -l -Z ${n0} + maclabelexpect "biba/low,mls/7" -f ${mactest_conf} system ls -l -Z ${n0} #cleanup: cd ..
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200707110528.l6B5S4Ad042416>