Date: Wed, 8 Aug 2007 06:42:09 GMT From: Zhouyi ZHOU <zhouzhouyi@FreeBSD.org> To: Perforce Change Reviews <perforce@FreeBSD.org> Subject: PERFORCE change 124879 for review Message-ID: <200708080642.l786g9EI001846@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=124879 Change 124879 by zhouzhouyi@zhouzhouyi_mactest on 2007/08/08 06:41:33 Test case for fifo, it is strange that there is no hooks for fifo io directly only checked via open Affected files ... .. //depot/projects/soc2007/zhouzhouyi_mactest_soc/regression/mactest/Makefile#4 edit .. //depot/projects/soc2007/zhouzhouyi_mactest_soc/regression/mactest/fifo_io.c#1 add .. //depot/projects/soc2007/zhouzhouyi_mactest_soc/regression/mactest/macconf.c#1 add .. //depot/projects/soc2007/zhouzhouyi_mactest_soc/regression/mactest/tests/fifo/00.t#1 add .. //depot/projects/soc2007/zhouzhouyi_mactest_soc/regression/mactest/tests/misc.sh#14 edit Differences ... ==== //depot/projects/soc2007/zhouzhouyi_mactest_soc/regression/mactest/Makefile#4 (text+ko) ==== @@ -6,16 +6,20 @@ #CFLAGS+=-DHAS_TRUNCATE64 #CFLAGS+=-DHAS_STAT64 -all: macproc mactest mdconfigopenrdonly +all: macproc mactest mdconfigopenrdonly fifo_io macproc: macproc.c gcc -Wall ${CFLAGS} macproc.c -o macproc -lutil mactest: mactest.c mactestparser.tab.c - gcc ${CFLAGS} mactest.c mactestparser.tab.c -o mactest + gcc ${CFLAGS} mactest.c mactestparser.tab.c macconf.c -o mactest mdconfigopenrdonly: mdconfig.c gcc ${CFLAGS} -o mdconfigopenrdonly mdconfig.c -lutil -lgeom -lbsdxml -lsbuf +fifo_io: fifo_io.c + gcc ${CFLAGS} -o fifo_io fifo_io.c mactestparser.tab.c macconf.c clean: rm -f macproc rm -f mactest + rm -f mdconfigopenrdonly + rm -f fifo_io ==== //depot/projects/soc2007/zhouzhouyi_mactest_soc/regression/mactest/tests/misc.sh#14 (text+ko) ==== @@ -18,6 +18,7 @@ macproc="${maindir}/macproc" mactest="${maindir}/mactest" mdconfigopenrdonly="${maindir}/mdconfigopenrdonly" +fifo_io="${maindir}/fifo_io" . ${maindir}/tests/conf @@ -111,6 +112,74 @@ } +fifotestexpect() +{ + + e="${1}" + shift + + e1="${1}" + shift + + if [ -f ${tmp_file} ]; then + rm ${tmp_file} + fi + touch ${tmp_file} + + if [ -f ${tmp_file1} ]; then + rm ${tmp_file1} + fi + touch ${tmp_file1} + + touch /var/log/mactest + +#set equal label to above files +# label=`getfmac "."| sed 's/\(\.:\ \)\([a-z\,\/]*\)/\2/` +# label1=`echo ${label}|sed 's/\/[a-z:0-9\+]*/\/equal/g` + label1="mls/equal,biba/equal" + setfmac ${label1} ${tmp_file} ${tmp_file1} /var/log/mactest + + ${fifo_io} $* 2>${tmp_file1} 1>>${tmp_file} + + c=1 + b=1 + + r=`cat ${tmp_file1}|tail -1` + echo "${r}" | egrep '^'${e}'$' >/dev/null 2>&1 + + if [ $? -eq 0 ]; then + c=0 + fi + + s=`cat ${tmp_file}|tail -1` + echo "${s}" | egrep '^'${e1}'$' >/dev/null 2>&1 + + if [ $? -eq 0 ]; then + b=0 + fi + + if [ ${c} -eq 0 ] && [ ${b} -eq 0 ]; then + echo "ok ${ntest}" + else + if [ ${c} != 0 ]; then + cat ${tmp_file1} + fi + + if [ ${b} != 0 ]; then + cat ${tmp_file} + fi + + echo "not ok ${ntest}" + fi + ntest=`expr $ntest + 1` + ret=`cat ${tmp_file}|tail -1` + + rm ${tmp_file} + rm ${tmp_file1} + +} + + maclabelexpect() { e="${1}"
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200708080642.l786g9EI001846>