From owner-p4-projects@FreeBSD.ORG Wed Jul 11 05:28:05 2007 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 263D416A46B; Wed, 11 Jul 2007 05:28:05 +0000 (UTC) X-Original-To: perforce@FreeBSD.org Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E7D9416A400 for ; Wed, 11 Jul 2007 05:28:04 +0000 (UTC) (envelope-from zhouzhouyi@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [69.147.83.41]) by mx1.freebsd.org (Postfix) with ESMTP id D98E013C465 for ; Wed, 11 Jul 2007 05:28:04 +0000 (UTC) (envelope-from zhouzhouyi@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.8/8.13.8) with ESMTP id l6B5S4KS042419 for ; Wed, 11 Jul 2007 05:28:04 GMT (envelope-from zhouzhouyi@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.8/8.13.8/Submit) id l6B5S4Ad042416 for perforce@freebsd.org; Wed, 11 Jul 2007 05:28:04 GMT (envelope-from zhouzhouyi@FreeBSD.org) Date: Wed, 11 Jul 2007 05:28:04 GMT Message-Id: <200707110528.l6B5S4Ad042416@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to zhouzhouyi@FreeBSD.org using -f From: Zhouyi ZHOU To: Perforce Change Reviews Cc: Subject: PERFORCE change 123308 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jul 2007 05:28:05 -0000 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 ..