From: Subrata <sub...@us...> - 2009-04-21 09:40:05
|
Update of /cvsroot/ltp/ltp/testcases/kernel/security/selinux-testsuite/tests/fdreceive In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv13004/ltp/testcases/kernel/security/selinux-testsuite/tests/fdreceive Modified Files: selinux_fdreceive.sh Log Message: Jiri Palecek <jpa...@we...> wrote: While running the selinux tests, I was contemplating the way the $SELINUXTMPDIR is created. It seems to me that creating it in each test individually would allow running the tests in parallel, make some hacks needed to prevent interference of the tests unnecessary, allow the tests to be run directly from ltpmenu et al., and wouldn't add much more code. What do you think about this? Signed-off-by: Jiri Palecek <jpa...@we...>. "Serge E. Hallyn" <se...@us...> replied: If the motivation is to support multiple concurrent ltp runs, wouldn't it be better to have selinux-testsuite/tests/runtest.sh set/export SELINUXTMPDIR to a per-run tempdir? Even as simple as /tmp/selinux-$pid. Well, and testscripts/test_selinux.sh I guess. Hmm, no, bc at that level you can't easily support multiple policy module loads anyway. Never mind. Jiri Palecek <jpa...@we...> replied back: No, the motivation was mostly to allow running these tests directly from PAN, without any supporting scripts. The ability to run the tests concurrently is just a pleasant bonus. I chose this way, because I find the needed changes pretty small. "Serge E. Hallyn" <se...@us...> finally replied: Yeah - seems like a good idea. If the directories sometimes don't get deleted, then you might help out the admin by giving the directories easy to spot names so they can manually clean up... i.e. use mktemp -d /tmp/ltpselinuxXXXX or maybe even better mkdir -p /tmp/ltpselinux; mktemp -d -p /tmp/ltpselinux. Index: selinux_fdreceive.sh =================================================================== RCS file: /cvsroot/ltp/ltp/testcases/kernel/security/selinux-testsuite/tests/fdreceive/selinux_fdreceive.sh,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** selinux_fdreceive.sh 8 Nov 2005 16:49:34 -0000 1.3 --- selinux_fdreceive.sh 21 Apr 2009 09:39:58 -0000 1.4 *************** *** 16,21 **** export TST_TOTAL=3 ! # Remove any leftover test file from prior failed runs. ! rm -rf $SELINUXTMPDIR/test_file $SELINUXTMPDIR/test_file2 $SELINUXTMPDIR/test_sock # Create and label the test files. --- 16,21 ---- export TST_TOTAL=3 ! SELINUXTMPDIR=$(mktemp -d) ! chcon -t test_file_t $SELINUXTMPDIR # Create and label the test files. *************** *** 101,106 **** kill -s TERM $PID ! # Cleanup. ! rm -rf $SELINUXTMPDIR/test_file $SELINUXTMPDIR/test_file2 $SELINUXTMPDIR/test_sock } --- 101,105 ---- kill -s TERM $PID ! rm -rf $SELINUXTMPDIR } |