From: Martin R. <mr...@us...> - 2005-07-14 18:22:15
|
Update of /cvsroot/ltp/ltp/testcases/kernel/security/selinux-testsuite/tests/msg In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7805/tests/msg Modified Files: selinux_msg.sh selinux_msgsnd.c Log Message: Updates and testcase cleanup from Joy Index: selinux_msgsnd.c =================================================================== RCS file: /cvsroot/ltp/ltp/testcases/kernel/security/selinux-testsuite/tests/msg/selinux_msgsnd.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** selinux_msgsnd.c 14 Jun 2005 13:03:51 -0000 1.2 --- selinux_msgsnd.c 14 Jul 2005 18:21:35 -0000 1.3 *************** *** 14,17 **** --- 14,18 ---- #include <getopt.h> #include <sys/msg.h> + #include <string.h> #define MSGMAX 1024 Index: selinux_msg.sh =================================================================== RCS file: /cvsroot/ltp/ltp/testcases/kernel/security/selinux-testsuite/tests/msg/selinux_msg.sh,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** selinux_msg.sh 20 Apr 2005 16:09:11 -0000 1.1 --- selinux_msg.sh 14 Jul 2005 18:21:35 -0000 1.2 *************** *** 13,16 **** --- 13,24 ---- # ================================================================= # + setup() + { + LTPTMP="/tmp/selinux" + export TCID="setup" + export TST_COUNT=0 + export TST_TOTAL=15 + } + # First time should just get the resource test01() *************** *** 24,30 **** if [ $RC -eq 0 ] then ! echo "Test #1: msg passed." else ! echo "Test #1: msg failed." fi return $RC --- 32,38 ---- if [ $RC -eq 0 ] then ! tst_resm TPASS "Test #1: msg passed." else ! tst_resm TFAIL "Test #1: msg failed." fi return $RC *************** *** 40,44 **** if [ ! $ipcid ] then ! echo "Test #2:msg failed:Invalid output from selinux_msgget." return 1 fi --- 48,52 ---- if [ ! $ipcid ] then ! tst_brk TBROK "Test #2:msg failed:Invalid output from selinux_msgget." return 1 fi *************** *** 49,55 **** if [ $RC -eq 0 ] then ! echo "Test #2: msg passed." else ! echo "Test #2: msg failed." fi return $RC --- 57,63 ---- if [ $RC -eq 0 ] then ! tst_resm TPASS "Test #2: msg passed." else ! tst_resm TFAIL "Test #2: msg failed." fi return $RC *************** *** 67,73 **** if [ $RC -eq 0 ] then ! echo "Test #3: msg passed." else ! echo "Test #3: msg failed." fi return $RC --- 75,81 ---- if [ $RC -eq 0 ] then ! tst_resm TPASS "Test #3: msg passed." else ! tst_resm TFAIL "Test #3: msg failed." fi return $RC *************** *** 83,87 **** if [ ! $ipcid ] then ! echo "Test #4:msg failed:Invalid output from selinux_msgget." return 1 fi --- 91,95 ---- if [ ! $ipcid ] then ! tst_brk TBROK "Test #4:msg failed:Invalid output from selinux_msgget." return 1 fi *************** *** 92,96 **** if [ $RC -ne 0 ] then ! echo "Test #4: msg failed." return $RC fi --- 100,104 ---- if [ $RC -ne 0 ] then ! tst_resm TFAIL "Test #4: msg failed." return $RC fi *************** *** 99,103 **** if [ ! $ipcid2 ] then ! echo "Test#4:msg failed:Invalid output from selinux_msgget." RC=1 return $RC --- 107,111 ---- if [ ! $ipcid2 ] then ! tst_brk TBROK "Test#4:msg failed:Invalid output from selinux_msgget." RC=1 return $RC *************** *** 107,114 **** if [ $ipcid2 = $ipcid ] then ! echo "Test #4: msg passed" RC=0 else ! echo "Test #4: msg failed" RC=1 fi --- 115,122 ---- if [ $ipcid2 = $ipcid ] then ! tst_resm TPASS "Test #4: msg passed" RC=0 else ! tst_resm TFAIL "Test #4: msg failed" RC=1 fi *************** *** 127,133 **** if [ $RC -eq 0 ] then ! echo "Test #5: msg passed." else ! echo "Test #5: msg failed." fi return $RC --- 135,141 ---- if [ $RC -eq 0 ] then ! tst_resm TPASS "Test #5: msg passed." else ! tst_resm TFAIL "Test #5: msg failed." fi return $RC *************** *** 145,152 **** if [ $RC -ne 0 ] then ! echo "Test #6: msg passed." RC=0 else ! echo "Test #6: msg failed." RC=1 fi --- 153,160 ---- if [ $RC -ne 0 ] then ! tst_resm TPASS "Test #6: msg passed." RC=0 else ! tst_resm TFAIL "Test #6: msg failed." RC=1 fi *************** *** 175,182 **** if [ $result = "-$number" ] then ! echo "Test #7: msg passed." RC=0 else ! echo "Test #7: msg failed." RC=1 fi --- 183,190 ---- if [ $result = "-$number" ] then ! tst_resm TPASS "Test #7: msg passed." RC=0 else ! tst_resm TFAIL "Test #7: msg failed." RC=1 fi *************** *** 201,208 **** if [ $result = 0 ] then ! echo "Test #8: msg passed." RC=0 else ! echo "Test #8: msg failed." RC=1 fi --- 209,216 ---- if [ $result = 0 ] then ! tst_resm TPASS "Test #8: msg passed." RC=0 else ! tst_resm TFAIL "Test #8: msg failed." RC=1 fi *************** *** 226,230 **** if [ $RC -ne 0 ] then ! echo "Test #9: msg failed." return $RC fi --- 234,238 ---- if [ $RC -ne 0 ] then ! tst_resm TFAIL "Test #9: msg failed." return $RC fi *************** *** 235,239 **** if [ ! $ipcid ] then ! echo "Test #9:msg failed:Invalid output from selinux_msgget." RC=1 return $RC --- 243,247 ---- if [ ! $ipcid ] then ! tst_brk TBROK "Test #9:msg failed:Invalid output from selinux_msgget." RC=1 return $RC *************** *** 244,248 **** if [ $RC -ne 0 ] then ! echo "Test #9: msg failed." return $RC fi --- 252,256 ---- if [ $RC -ne 0 ] then ! tst_resm TFAIL "Test #9: msg failed." return $RC fi *************** *** 253,259 **** if [ $RC -eq 0 ] then ! echo "Test #9: msg passed." else ! echo "Test #9: msg failed." fi return $RC --- 261,267 ---- if [ $RC -eq 0 ] then ! tst_resm TPASS "Test #9: msg passed." else ! tst_resm TFAIL "Test #9: msg failed." fi return $RC *************** *** 270,276 **** if [ $RC -eq 0 ] then ! echo "Test #10: msg passed." else ! echo "Test #10: msg failed." fi return $RC --- 278,284 ---- if [ $RC -eq 0 ] then ! tst_resm TPASS "Test #10: msg passed." else ! tst_resm TFAIL "Test #10: msg failed." fi return $RC *************** *** 288,295 **** if [ $RC -ne 0 ] #write denied then ! echo "Test #11: msg passed." RC=0 else ! echo "Test #11: msg failed." RC=1 fi --- 296,303 ---- if [ $RC -ne 0 ] #write denied then ! tst_resm TPASS "Test #11: msg passed." RC=0 else ! tst_resm TFAIL "Test #11: msg failed." RC=1 fi *************** *** 307,313 **** if [ $RC -eq 0 ] then ! echo "Test #12: msg passed." else ! echo "Test #12: msg failed." fi return $RC --- 315,321 ---- if [ $RC -eq 0 ] then ! tst_resm TPASS "Test #12: msg passed." else ! tst_resm TFAIL "Test #12: msg failed." fi return $RC *************** *** 324,330 **** if [ $RC -eq 0 ] then ! echo "Test #13: msg passed." else ! echo "Test #13: msg failed." fi return $RC --- 332,338 ---- if [ $RC -eq 0 ] then ! tst_resm TPASS "Test #13: msg passed." else ! tst_resm TFAIL "Test #13: msg failed." fi return $RC *************** *** 342,348 **** if [ $RC -eq 0 ] then ! echo "Test #14: msg passed." else ! echo "Test #14: msg failed." fi return $RC --- 350,356 ---- if [ $RC -eq 0 ] then ! tst_resm TPASS "Test #14: msg passed." else ! tst_resm TFAIL "Test #14: msg failed." fi return $RC *************** *** 359,366 **** if [ $RC -ne 0 ] then ! echo "Test #15: msg passed." RC=0 else ! echo "Test #15: msg failed." RC=1 fi --- 367,374 ---- if [ $RC -ne 0 ] then ! tst_resm TPASS "Test #15: msg passed." RC=0 else ! tst_resm TFAIL "Test #15: msg failed." RC=1 fi *************** *** 375,379 **** if [ ! $ipcid ] then ! echo "cleanup in msg failed:Invalid output from selinux_msgget." return fi --- 383,387 ---- if [ ! $ipcid ] then ! tst_brk TBROK "cleanup in msg failed:Invalid output from selinux_msgget." return fi *************** *** 390,409 **** # 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 ! test14 || exit $RC ! test15 || exit $RC cleanup ! exit 0 --- 398,419 ---- # 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 ! test14 || EXIT_VAL=$RC ! test15 || EXIT_VAL=$RC cleanup ! exit $EXIT_VAL |