From: Martin R. <mr...@us...> - 2005-07-14 18:22:17
|
Update of /cvsroot/ltp/ltp/testcases/kernel/security/selinux-testsuite/tests/sem In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7805/tests/sem Modified Files: selinux_sem.sh Log Message: Updates and testcase cleanup from Joy Index: selinux_sem.sh =================================================================== RCS file: /cvsroot/ltp/ltp/testcases/kernel/security/selinux-testsuite/tests/sem/selinux_sem.sh,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** selinux_sem.sh 20 Apr 2005 16:09:14 -0000 1.1 --- selinux_sem.sh 14 Jul 2005 18:21:36 -0000 1.2 *************** *** 14,17 **** --- 14,25 ---- # ================================================================= # + setup() + { + LTPTMP="/tmp/selinux" + export TCID="setup" + export TST_COUNT=0 + export TST_TOTAL=13 + } + test01() { *************** *** 25,31 **** if [ $RC -eq 0 ] then ! echo "Test #1: sem passed." else ! echo "Test #1: sem failed." return $RC fi --- 33,39 ---- if [ $RC -eq 0 ] then ! tst_resm TPASS "Test #1: sem passed." else ! tst_resm TFAIL "Test #1: sem failed." return $RC fi *************** *** 34,38 **** if [ ! $ipcid ] then ! echo "Test #1: Invalid output from selinux_semget." fi return $RC --- 42,46 ---- if [ ! $ipcid ] then ! tst_brk TBROK "Test #1: Invalid output from selinux_semget." fi return $RC *************** *** 50,56 **** if [ $RC -eq 0 ] then ! echo "Test #2: sem passed." else ! echo "Test #2: sem failed." fi return $RC --- 58,64 ---- if [ $RC -eq 0 ] then ! tst_resm TPASS "Test #2: sem passed." else ! tst_resm TFAIL "Test #2: sem failed." fi return $RC *************** *** 67,74 **** if [ $RC -ne 0 ] then ! echo "Test #3: sem passed." RC=0 else ! echo "Test #3: sem failed." RC=1 fi --- 75,82 ---- if [ $RC -ne 0 ] then ! tst_resm TPASS "Test #3: sem passed." RC=0 else ! tst_resm TFAIL "Test #3: sem failed." RC=1 fi *************** *** 87,93 **** if [ $RC -eq 0 ] then ! echo "Test #4: sem passed." else ! echo "Test #4: sem failed." fi return $RC --- 95,101 ---- if [ $RC -eq 0 ] then ! tst_resm TPASS "Test #4: sem passed." else ! tst_resm TFAIL "Test #4: sem failed." fi return $RC *************** *** 105,111 **** if [ $RC -eq 0 ] then ! echo "Test #5: sem passed." else ! echo "Test #5: sem failed." return $RC fi --- 113,119 ---- if [ $RC -eq 0 ] then ! tst_resm TPASS "Test #5: sem passed." else ! tst_resm TFAIL "Test #5: sem failed." return $RC fi *************** *** 114,118 **** if [ ! $ipcid ] then ! echo "Test #5: Invalid output from selinux_semget." fi return $RC --- 122,126 ---- if [ ! $ipcid ] then ! tst_brk TBROK "Test #5: Invalid output from selinux_semget." fi return $RC *************** *** 130,136 **** if [ $RC -eq 0 ] then ! echo "Test #6: sem passed." else ! echo "Test #6: sem failed." return $RC fi --- 138,144 ---- if [ $RC -eq 0 ] then ! tst_resm TPASS "Test #6: sem passed." else ! tst_resm TFAIL "Test #6: sem failed." return $RC fi *************** *** 139,143 **** if [ ! $ipcid2 ] then ! echo "Test #6: Invalid output from selinux_semget." fi return $RC --- 147,151 ---- if [ ! $ipcid2 ] then ! tst_brk TBROK "Test #6: Invalid output from selinux_semget." fi return $RC *************** *** 153,160 **** if [ $ipcid = $ipcid2 ] then ! echo "Test #7: sem passed." RC=0 else ! echo "Test #7: sem failed." RC=1 fi --- 161,168 ---- if [ $ipcid = $ipcid2 ] then ! tst_resm TPASS "Test #7: sem passed." RC=0 else ! tst_resm TFAIL "Test #7: sem failed." RC=1 fi *************** *** 173,179 **** if [ $RC -eq 0 ] then ! echo "Test #8: sem passed." else ! echo "Test #8: sem failed." return $RC fi --- 181,187 ---- if [ $RC -eq 0 ] then ! tst_resm TPASS "Test #8: sem passed." else ! tst_resm TFAIL "Test #8: sem failed." return $RC fi *************** *** 181,185 **** if [ ! $ipcid ] then ! echo "Test #8: Invalid output from selinux_semget." fi return $RC --- 189,193 ---- if [ ! $ipcid ] then ! tst_brk TBROK "Test #8: Invalid output from selinux_semget." fi return $RC *************** *** 197,204 **** if [ $RC -ne 0 ] then ! echo "Test #9: sem passed." RC=0 else ! echo "Test #9: sem failed." RC=1 fi --- 205,212 ---- if [ $RC -ne 0 ] then ! tst_resm TPASS "Test #9: sem passed." RC=0 else ! tst_resm TFAIL "Test #9: sem failed." RC=1 fi *************** *** 227,234 **** if [ $result = "-$number" ] then ! echo "Test #10: sem passed." RC=0 else ! echo "Test #10: sem failed." RC=1 fi --- 235,242 ---- if [ $result = "-$number" ] then ! tst_resm TPASS "Test #10: sem passed." RC=0 else ! tst_resm TFAIL "Test #10: sem failed." RC=1 fi *************** *** 253,260 **** if [ $result = 0 ] then ! echo "Test #11: sem passed." RC=0 else ! echo "Test #11: sem failed." RC=1 fi --- 261,268 ---- if [ $result = 0 ] then ! tst_resm TPASS "Test #11: sem passed." RC=0 else ! tst_resm TFAIL "Test #11: sem failed." RC=1 fi *************** *** 276,282 **** if [ $RC -eq 0 ] then ! echo "Test #12: sem passed." else ! echo "Test #12: sem failed." fi return $RC --- 284,290 ---- if [ $RC -eq 0 ] then ! tst_resm TPASS "Test #12: sem passed." else ! tst_resm TFAIL "Test #12: sem failed." fi return $RC *************** *** 293,300 **** if [ $RC -ne 0 ] then ! echo "Test #13: sem passed." RC=0 else ! echo "Test #13: sem failed." RC=1 fi --- 301,308 ---- if [ $RC -ne 0 ] then ! tst_resm TPASS "Test #13: sem passed." RC=0 else ! tst_resm TFAIL "Test #13: sem failed." RC=1 fi *************** *** 310,314 **** if [ ! $ipcid ] then ! echo "cleanup: Invalid output from selinux_semget." fi runcon -t test_ipc_base_t ipcrm sem $ipcid --- 318,322 ---- if [ ! $ipcid ] then ! tst_brk TBROK "cleanup: Invalid output from selinux_semget." fi runcon -t test_ipc_base_t ipcrm sem $ipcid *************** *** 323,340 **** # RC=0 # Return value from setup, and test functions. ! test01 || exit $RC ! test02 || exit $RC ! test03 || exit $RC ! test04 || exit $RC ! test05 || exit $RC ! test06 || exit $RC ! test07 || exit $RC ! test08 || exit $RC ! test09 || exit $RC ! test10 || exit $RC ! test11 || exit $RC ! test12 || exit $RC ! test13 || exit $RC cleanup ! exit 0 --- 331,350 ---- # RC=0 # Return value from setup, and test functions. + EXIT_VAL=0 ! setup ! test01 || EXIT_VAL=$RC ! test02 || EXIT_VAL=$RC ! test03 || EXIT_VAL=$RC ! test04 || EXIT_VAL=$RC ! test05 || EXIT_VAL=$RC ! test06 || EXIT_VAL=$RC ! test07 || EXIT_VAL=$RC ! test08 || EXIT_VAL=$RC ! test09 || EXIT_VAL=$RC ! test10 || EXIT_VAL=$RC ! test11 || EXIT_VAL=$RC ! test12 || EXIT_VAL=$RC ! test13 || EXIT_VAL=$RC cleanup ! exit $EXIT_VAL |