PERFORCE change 123308 for review

Zhouyi ZHOU zhouzhouyi at FreeBSD.org
Wed Jul 11 05:28:05 UTC 2007


http://perforce.freebsd.org/chv.cgi?CH=123308

Change 123308 by zhouzhouyi at 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 ..


More information about the p4-projects mailing list