Create $SELINUXTMPDIR in each of the tests
PATCH 1/1 Create $SELINUXTMPDIR in each of the tests
Stephen,
Would you like to say something about the following Patch ?
Regards--
Subrata
-------- Forwarded Message --------
From: Jiri Palecek > <<[email protected]>
Cc: [email protected] <[email protected]>
Subject: [LTP] [PATCH] Create $SELINUXTMPDIR in each of the tests
Date: Thu, 16 Apr 2009 12:52:05 +0200
Hello,
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?
PS: This patch still has issues, namely, the cleanup is denied sometimes.
Regards
Jiri Palecek
--- .../tests/bounds/selinux_bounds.sh | 7 +++---- .../tests/capable_file/selinux_capable_file.sh | 8 +++----- .../tests/capable_sys/selinux_capable_sys.sh | 8 ++++---- .../tests/entrypoint/selinux_entrypoint.sh | 7 +++---- .../execute_no_trans/selinux_execute_no_trans.sh | 7 +++---- .../tests/fdreceive/selinux_fdreceive.sh | 7 +++---- .../selinux-testsuite/tests/file/selinux_file.sh | 14 ++++---------- .../tests/inherit/selinux_inherit.sh | 8 +++----- .../selinux-testsuite/tests/ioctl/selinux_ioctl.sh | 5 ++++- .../selinux-testsuite/tests/link/selinux_link.sh | 7 +++---- .../selinux-testsuite/tests/mkdir/selinux_mkdir.sh | 7 +++---- .../selinux-testsuite/tests/open/selinux_open.sh | 7 +++---- .../tests/readlink/selinux_readlink.sh | 7 +++---- .../tests/relabel/selinux_relabel.sh | 7 +++---- .../tests/rename/selinux_rename.sh | 7 +++---- .../selinux-testsuite/tests/rxdir/selinux_rxdir.sh | 7 +++---- .../tests/setattr/selinux_setattr.sh | 7 +++---- .../selinux-testsuite/tests/stat/selinux_stat.sh | 7 +++---- 18 files changed, 57 insertions(+), 77 deletions(-)
testcases/kernel/security/selinux-testsuite/tests/bounds/selinux_bounds.sh +3 -4
@@ -14,8 +14,8 @@ setup() export TST_COUNT=0 export TST_TOTAL=4 - # Remove any leftover test directories from prior failed runs. - rm -rf $SELINUXTMPDIR/bounds_file* + SELINUXTMPDIR=$(mktemp -d) + chcon -t test_file_t $SELINUXTMPDIR # Create test files dd if=/dev/zero of=$SELINUXTMPDIR/bounds_file count=1
@@ -141,8 +141,7 @@ test06() cleanup() { - # Cleanup - rm -rf $SELINUXTMPDIR/bounds_file* + rm -rf $SELINUXTMPDIR } # Function: main
testcases/kernel/security/selinux-testsuite/tests/capable_file/selinux_capable_file.sh +3 -5
@@ -17,9 +17,8 @@ setup() export TST_COUNT=0 export TST_TOTAL=10 - # Clean up from a previous run - rm -f $SELINUXTMPDIR/temp_file 2>&1 - rm -f $SELINUXTMPDIR/temp_file2 2>&1 + SELINUXTMPDIR=$(mktemp -d) + chcon -t test_file_t $SELINUXTMPDIR } #
@@ -233,8 +232,7 @@ test10() cleanup() { - rm -f $SELINUXTMPDIR/temp_file 2>&1 - rm -f $SELINUXTMPDIR/temp_file2 2>&1 + rm -rf $SELINUXTMPDIR } # Function: main
testcases/kernel/security/selinux-testsuite/tests/capable_sys/selinux_capable_sys.sh +4 -4
@@ -17,8 +17,8 @@ setup() export TST_COUNT=0 export TST_TOTAL=8 - # Clean up from a previous run - rm -f $SELINUXTMPDIR/temp_file 2>&1 + SELINUXTMPDIR=$(mktemp -d) + chcon -t test_file_t $SELINUXTMPDIR } #
@@ -195,8 +195,7 @@ test08() cleanup() { - # Remove files - rm -f $SELINUXTMPDIR/temp_file 2>&1 + rm -rf $SELINUXTMPDIR } # Function: main
@@ -215,6 +214,7 @@ test02 || EXIT_VAL=$RC test03 || EXIT_VAL=$RC test04 || EXIT_VAL=$RC cleanup +setup test05 || EXIT_VAL=$RC test06 || EXIT_VAL=$RC test07 || EXIT_VAL=$RC
testcases/kernel/security/selinux-testsuite/tests/entrypoint/selinux_entrypoint.sh +3 -4
@@ -15,8 +15,8 @@ setup() export TST_COUNT=0 export TST_TOTAL=2 - # Clean up from a previous run - rm -f $SELINUXTMPDIR/true 2>&1 + SELINUXTMPDIR=$(mktemp -d) + chcon -t test_file_t $SELINUXTMPDIR } test01()
@@ -63,8 +63,7 @@ test02() cleanup() { - # Cleanup. - rm -f $SELINUXTMPDIR/true + rm -rf $SELINUXTMPDIR } # Function: main
testcases/kernel/security/selinux-testsuite/tests/execute_no_trans/selinux_execute_no_trans.sh +3 -4
@@ -15,8 +15,8 @@ setup() export TST_COUNT=0 export TST_TOTAL=2 - # Clean up from a previous run - rm -f $SELINUXTMPDIR/true 2>&1 + SELINUXTMPDIR=$(mktemp -d) + chcon -t test_file_t $SELINUXTMPDIR } test01()
@@ -66,8 +66,7 @@ test02() cleanup() { - # Cleanup. - rm -f $SELINUXTMPDIR/true + rm -rf $SELINUXTMPDIR } # Function: main
testcases/kernel/security/selinux-testsuite/tests/fdreceive/selinux_fdreceive.sh +3 -4
@@ -15,8 +15,8 @@ setup() export TST_COUNT=0 export TST_TOTAL=3 - # Remove any leftover test file from prior failed runs. - rm -rf $SELINUXTMPDIR/test_file $SELINUXTMPDIR/test_file2 $SELINUXTMPDIR/test_sock + SELINUXTMPDIR=$(mktemp -d) + chcon -t test_file_t $SELINUXTMPDIR # Create and label the test files. touch $SELINUXTMPDIR/test_file $SELINUXTMPDIR/test_file2
@@ -100,8 +100,7 @@ cleanup() # Kill the server. kill -s TERM $PID - # Cleanup. - rm -rf $SELINUXTMPDIR/test_file $SELINUXTMPDIR/test_file2 $SELINUXTMPDIR/test_sock + rm -rf $SELINUXTMPDIR } # Function: main
testcases/kernel/security/selinux-testsuite/tests/file/selinux_file.sh +4 -10
@@ -17,10 +17,9 @@ setup() export TST_COUNT=0 export TST_TOTAL=14 - # Clean up from a previous run - rm -f $SELINUXTMPDIR/temp_file 2>&1 - rm -f $SELINUXTMPDIR/temp_file2 2>&1 - rm -f $SELINUXTMPDIR/temp_file3 2>&1 + LTPBIN=$LTPROOT/testcases/bin + SELINUXTMPDIR=$(mktemp -d) + chcon -t test_file_t $SELINUXTMPDIR # # Create the temp files
@@ -361,12 +360,7 @@ test14() cleanup() { - # - # Delete the temp files - # - rm -f $basedir/temp_file 2>&1 - rm -f $basedir/temp_file2 2>&1 - rm -f $basedir/temp_file3 2>&1 + rm -rf $SELINUXTMPDIR } #
testcases/kernel/security/selinux-testsuite/tests/inherit/selinux_inherit.sh +3 -5
@@ -15,8 +15,8 @@ setup() export TST_COUNT=0 export TST_TOTAL=3 - # Clean up from a previous run - rm -f $SELINUXTMPDIR/test_file 2>&1 + SELINUXTMPDIR=$(mktemp -d) + chcon -t test_file_t $SELINUXTMPDIR # Create a test file with the test_inherit_file_t type # for use in the tests.
@@ -97,9 +97,7 @@ test03() cleanup() { - # Cleanup. - rm -rf $SELINUXTMPDIR/test_file - cd $SAVEPWD + rm -rf $SELINUXTMPDIR } # Function: main
testcases/kernel/security/selinux-testsuite/tests/ioctl/selinux_ioctl.sh +4 -1
@@ -17,6 +17,9 @@ setup() export TST_COUNT=0 export TST_TOTAL=2 + SELINUXTMPDIR=$(mktemp -d) + chcon -t test_file_t $SELINUXTMPDIR + # Create a temporary file for testing rm -f $SELINUXTMPDIR/temp_file 2>&1 touch $SELINUXTMPDIR/temp_file 2>&1
@@ -65,7 +68,7 @@ test02() cleanup() { - rm -f $SELINUXTMPDIR/temp_file 2>&1 + rm -rf $SELINUXTMPDIR } # Function: main
testcases/kernel/security/selinux-testsuite/tests/link/selinux_link.sh +3 -4
@@ -15,8 +15,8 @@ setup() export TST_COUNT=0 export TST_TOTAL=6 - # Clean up from a previous run - rm -f $SELINUXTMPDIR/test_dir 2>&1 + SELINUXTMPDIR=$(mktemp -d) + chcon -t test_file_t $SELINUXTMPDIR # Create a test directory with the test_addname_dir_t type # for use in the tests.
@@ -157,8 +157,7 @@ test06() cleanup() { - # Cleanup. - rm -rf $SELINUXTMPDIR/test_dir + rm -rf $SELINUXTMPDIR } # Function: main
testcases/kernel/security/selinux-testsuite/tests/mkdir/selinux_mkdir.sh +3 -4
@@ -15,8 +15,8 @@ setup() export TST_COUNT=0 export TST_TOTAL=5 - # Remove any leftover test directory from prior failed runs. - rm -rf $SELINUXTMPDIR/test_dir + SELINUXTMPDIR=$(mktemp -d) + chcon -t test_file_t $SELINUXTMPDIR # Create a test directory with the test_mkdir_dir_t type # for use in the tests.
@@ -129,8 +129,7 @@ test05() cleanup() { - # Cleanup. - rm -rf $SELINUXTMPDIR/test_dir + rm -rf $SELINUXTMPDIR } # Function: main
testcases/kernel/security/selinux-testsuite/tests/open/selinux_open.sh +3 -4
@@ -15,8 +15,8 @@ setup() export TST_COUNT=0 export TST_TOTAL=8 - # Remove any leftover test directories from prior failed runs. - rm -rf $SELINUXTMPDIR/test_file + SELINUXTMPDIR=$(mktemp -d) + chcon -t test_file_t $SELINUXTMPDIR # Create a test file. touch $SELINUXTMPDIR/test_file
@@ -180,8 +180,7 @@ test08() cleanup() { - # Cleanup. - rm -rf $SELINUXTMPDIR/test_file + rm -rf $SELINUXTMPDIR } # Function: main
testcases/kernel/security/selinux-testsuite/tests/readlink/selinux_readlink.sh +3 -4
@@ -15,8 +15,8 @@ setup() export TST_COUNT=0 export TST_TOTAL=3 - # Remove any leftover test files from prior failed runs. - rm -rf $SELINUXTMPDIR/test_file $SELINUXTMPDIR/test_symlink + SELINUXTMPDIR=$(mktemp -d) + chcon -t test_file_t $SELINUXTMPDIR # Create a test file. touch $SELINUXTMPDIR/test_file 2>&1
@@ -86,8 +86,7 @@ test03() cleanup() { - # Cleanup. - rm -rf $SELINUXTMPDIR/test_file $SELINUXTMPDIR/test_symlink + rm -rf $SELINUXTMPDIR } # Function: main
testcases/kernel/security/selinux-testsuite/tests/relabel/selinux_relabel.sh +3 -4
@@ -15,8 +15,8 @@ setup() export TST_COUNT=0 export TST_TOTAL=3 - # Remove any leftover test file from prior failed runs. - rm -rf $SELINUXTMPDIR/test_file + SELINUXTMPDIR=$(mktemp -d) + chcon -t test_file_t $SELINUXTMPDIR # Create a test file with the test_relabel_oldtype_t # type for use in the tests.
@@ -90,8 +90,7 @@ test03() cleanup() { - # Cleanup. - rm -rf $SELINUXTMPDIR/test_file + rm -rf $SELINUXTMPDIR } # Function: main
testcases/kernel/security/selinux-testsuite/tests/rename/selinux_rename.sh +3 -4
@@ -15,8 +15,8 @@ setup() export TST_COUNT=0 export TST_TOTAL=9 - # Remove any leftover test directories from prior failed runs. - rm -rf $SELINUXTMPDIR/src_dir $SELINUXTMPDIR/dst_dir + SELINUXTMPDIR=$(mktemp -d) + chcon -t test_file_t $SELINUXTMPDIR # Create the source and destination test directories for the rename. mkdir --context=system_u:object_r:test_rename_src_dir_t $SELINUXTMPDIR/src_dir 2>&1
@@ -231,8 +231,7 @@ test09() cleanup() { - # Cleanup. - rm -rf $SELINUXTMPDIR/src_dir $SELINUXTMPDIR/dst_dir + rm -rf $SELINUXTMPDIR } # Function: main
testcases/kernel/security/selinux-testsuite/tests/rxdir/selinux_rxdir.sh +3 -4
@@ -15,8 +15,8 @@ setup() export TST_COUNT=0 export TST_TOTAL=4 - # Remove any leftover test directory from prior failed runs. - rm -rf $SELINUXTMPDIR/test_dir + SELINUXTMPDIR=$(mktemp -d) + chcon -t test_file_t $SELINUXTMPDIR # Create a test dir with the test_rxdir_dir_t type # for use in the tests.
@@ -102,8 +102,7 @@ test04() cleanup() { - # Cleanup. - rm -rf $SELINUXTMPDIR/test_dir + rm -rf $SELINUXTMPDIR } # Function: main
testcases/kernel/security/selinux-testsuite/tests/setattr/selinux_setattr.sh +3 -4
@@ -15,8 +15,8 @@ setup() export TST_COUNT=0 export TST_TOTAL=4 - # Remove any leftover test file from prior failed runs. - rm -rf $SELINUXTMPDIR/test_file + SELINUXTMPDIR=$(mktemp -d) + chcon -t test_file_t $SELINUXTMPDIR # Create a test file with the test_setattr_file_t type # for use in the tests.
@@ -100,8 +100,7 @@ test04() cleanup() { - # Cleanup. - rm -rf $SELINUXTMPDIR/test_file + rm -rf $SELINUXTMPDIR } # Function: main
testcases/kernel/security/selinux-testsuite/tests/stat/selinux_stat.sh +3 -4
@@ -15,8 +15,8 @@ setup() export TST_COUNT=0 export TST_TOTAL=2 - # Remove any leftover test file from prior failed runs. - rm -rf $SELINUXTMPDIR/test_file + SELINUXTMPDIR=$(mktemp -d) + chcon -t test_file_t $SELINUXTMPDIR # Create a test file with the test_stat_file_t type # for use in the tests.
@@ -64,8 +64,7 @@ test02() cleanup() { - # Cleanup. - rm -rf $SELINUXTMPDIR/test_file + rm -rf $SELINUXTMPDIR } # Function: main
--
This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.
Quoted 3 lines · Subrata Modak
Stephen,
Would you like to say something about the following Patch ?
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...
-serge
--
This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.
Quoted 11 lines · Serge E. Hallyn
Quoted 3 lines · Subrata Modak
Stephen,
Would you like to say something about the following Patch ?
If the motivation is to support multiple concurrent ltp runs, wouldn't it be better to have
selinux-testsuite/tests/runtest.shset/export SELINUXTMPDIR to a per-run tempdir? Even as simple as/tmp/selinux-$pid.Well, and
testscripts/test_selinux.shI guess...
Hmm, no, bc at that level you can't easily support multiple policy module loads anyway. Never mind.
-serge
--
This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.
A message that is not in the archive (sent off-list or not yet received): op.usoj4f1cu2flwt@marcela-gaxm89c
Quoted 5 lines · Jiří Paleček
Quoted 3 lines · Serge E. Hallyn
Quoted 2 lines · Subrata Modak
Stephen,
Quoted 8 lines
Quoted 6 lines
Quoted 1 line
Would you like to say something about the following Patch ?
If the motivation is to support multiple concurrent ltp runs, wouldn't it be better to have
selinux-testsuite/tests/runtest.shset/export SELINUXTMPDIR to a per-run tempdir? Even as simple as/tmp/selinux-$pid.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.
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
thanks,
-serge
--
This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.
Quoted 3 lines · Subrata Modak
Stephen,
Would you like to say something about the following Patch ?
Yes, it breaks the selinux testsuite for me. Please revert.
Quoted 519 lines
Regards--
Subrata-------- Forwarded Message --------
From: Jiri Palecek > <<[email protected]>
Cc: [email protected] <[email protected]>
Subject: [LTP] [PATCH] Create $SELINUXTMPDIR in each of the tests
Date: Thu, 16 Apr 2009 12:52:05 +0200Hello,
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?
PS: This patch still has issues, namely, the cleanup is denied sometimes.
Regards
Jiri PalecekSigned-off-by Jiri Palecek <[email protected]>--- .../tests/bounds/selinux_bounds.sh | 7 +++---- .../tests/capable_file/selinux_capable_file.sh | 8 +++----- .../tests/capable_sys/selinux_capable_sys.sh | 8 ++++---- .../tests/entrypoint/selinux_entrypoint.sh | 7 +++---- .../execute_no_trans/selinux_execute_no_trans.sh | 7 +++---- .../tests/fdreceive/selinux_fdreceive.sh | 7 +++---- .../selinux-testsuite/tests/file/selinux_file.sh | 14 ++++---------- .../tests/inherit/selinux_inherit.sh | 8 +++----- .../selinux-testsuite/tests/ioctl/selinux_ioctl.sh | 5 ++++- .../selinux-testsuite/tests/link/selinux_link.sh | 7 +++---- .../selinux-testsuite/tests/mkdir/selinux_mkdir.sh | 7 +++---- .../selinux-testsuite/tests/open/selinux_open.sh | 7 +++---- .../tests/readlink/selinux_readlink.sh | 7 +++---- .../tests/relabel/selinux_relabel.sh | 7 +++---- .../tests/rename/selinux_rename.sh | 7 +++---- .../selinux-testsuite/tests/rxdir/selinux_rxdir.sh | 7 +++---- .../tests/setattr/selinux_setattr.sh | 7 +++---- .../selinux-testsuite/tests/stat/selinux_stat.sh | 7 +++---- 18 files changed, 57 insertions(+), 77 deletions(-)testcases/kernel/security/selinux-testsuite/tests/bounds/selinux_bounds.sh +3
-4@@ -14,8 +14,8 @@ setup() export TST_COUNT=0 export TST_TOTAL=4 - # Remove any leftover test directories from prior failed runs. - rm -rf $SELINUXTMPDIR/bounds_file* + SELINUXTMPDIR=$(mktemp -d) + chcon -t test_file_t $SELINUXTMPDIR # Create test files dd if=/dev/zero of=$SELINUXTMPDIR/bounds_file count=1@@ -141,8 +141,7 @@ test06() cleanup() { - # Cleanup - rm -rf $SELINUXTMPDIR/bounds_file* + rm -rf $SELINUXTMPDIR } # Function: maintestcases/kernel/security/selinux-testsuite/tests/capable_file/selinux_capable_file.sh +3
-5@@ -17,9 +17,8 @@ setup() export TST_COUNT=0 export TST_TOTAL=10 - # Clean up from a previous run - rm -f $SELINUXTMPDIR/temp_file 2>&1 - rm -f $SELINUXTMPDIR/temp_file2 2>&1 + SELINUXTMPDIR=$(mktemp -d) + chcon -t test_file_t $SELINUXTMPDIR } #@@ -233,8 +232,7 @@ test10() cleanup() { - rm -f $SELINUXTMPDIR/temp_file 2>&1 - rm -f $SELINUXTMPDIR/temp_file2 2>&1 + rm -rf $SELINUXTMPDIR } # Function: maintestcases/kernel/security/selinux-testsuite/tests/capable_sys/selinux_capable_sys.sh +4
-4@@ -17,8 +17,8 @@ setup() export TST_COUNT=0 export TST_TOTAL=8 - # Clean up from a previous run - rm -f $SELINUXTMPDIR/temp_file 2>&1 + SELINUXTMPDIR=$(mktemp -d) + chcon -t test_file_t $SELINUXTMPDIR } #@@ -195,8 +195,7 @@ test08() cleanup() { - # Remove files - rm -f $SELINUXTMPDIR/temp_file 2>&1 + rm -rf $SELINUXTMPDIR } # Function: main@@ -215,6 +214,7 @@ test02 || EXIT_VAL=$RC test03 || EXIT_VAL=$RC test04 || EXIT_VAL=$RC cleanup +setup test05 || EXIT_VAL=$RC test06 || EXIT_VAL=$RC test07 || EXIT_VAL=$RCtestcases/kernel/security/selinux-testsuite/tests/entrypoint/selinux_entrypoint.sh +3
-4@@ -15,8 +15,8 @@ setup() export TST_COUNT=0 export TST_TOTAL=2 - # Clean up from a previous run - rm -f $SELINUXTMPDIR/true 2>&1 + SELINUXTMPDIR=$(mktemp -d) + chcon -t test_file_t $SELINUXTMPDIR } test01()@@ -63,8 +63,7 @@ test02() cleanup() { - # Cleanup. - rm -f $SELINUXTMPDIR/true + rm -rf $SELINUXTMPDIR } # Function: maintestcases/kernel/security/selinux-testsuite/tests/execute_no_trans/selinux_execute_no_trans.sh +3
-4@@ -15,8 +15,8 @@ setup() export TST_COUNT=0 export TST_TOTAL=2 - # Clean up from a previous run - rm -f $SELINUXTMPDIR/true 2>&1 + SELINUXTMPDIR=$(mktemp -d) + chcon -t test_file_t $SELINUXTMPDIR } test01()@@ -66,8 +66,7 @@ test02() cleanup() { - # Cleanup. - rm -f $SELINUXTMPDIR/true + rm -rf $SELINUXTMPDIR } # Function: maintestcases/kernel/security/selinux-testsuite/tests/fdreceive/selinux_fdreceive.sh +3
-4@@ -15,8 +15,8 @@ setup() export TST_COUNT=0 export TST_TOTAL=3 - # Remove any leftover test file from prior failed runs. - rm -rf $SELINUXTMPDIR/test_file $SELINUXTMPDIR/test_file2 $SELINUXTMPDIR/test_sock + SELINUXTMPDIR=$(mktemp -d) + chcon -t test_file_t $SELINUXTMPDIR # Create and label the test files. touch $SELINUXTMPDIR/test_file $SELINUXTMPDIR/test_file2@@ -100,8 +100,7 @@ cleanup() # Kill the server. kill -s TERM $PID - # Cleanup. - rm -rf $SELINUXTMPDIR/test_file $SELINUXTMPDIR/test_file2 $SELINUXTMPDIR/test_sock + rm -rf $SELINUXTMPDIR } # Function: maintestcases/kernel/security/selinux-testsuite/tests/file/selinux_file.sh +4
-10@@ -17,10 +17,9 @@ setup() export TST_COUNT=0 export TST_TOTAL=14 - # Clean up from a previous run - rm -f $SELINUXTMPDIR/temp_file 2>&1 - rm -f $SELINUXTMPDIR/temp_file2 2>&1 - rm -f $SELINUXTMPDIR/temp_file3 2>&1 + LTPBIN=$LTPROOT/testcases/bin + SELINUXTMPDIR=$(mktemp -d) + chcon -t test_file_t $SELINUXTMPDIR # # Create the temp files@@ -361,12 +360,7 @@ test14() cleanup() { - # - # Delete the temp files - # - rm -f $basedir/temp_file 2>&1 - rm -f $basedir/temp_file2 2>&1 - rm -f $basedir/temp_file3 2>&1 + rm -rf $SELINUXTMPDIR } #testcases/kernel/security/selinux-testsuite/tests/inherit/selinux_inherit.sh +3
-5@@ -15,8 +15,8 @@ setup() export TST_COUNT=0 export TST_TOTAL=3 - # Clean up from a previous run - rm -f $SELINUXTMPDIR/test_file 2>&1 + SELINUXTMPDIR=$(mktemp -d) + chcon -t test_file_t $SELINUXTMPDIR # Create a test file with the test_inherit_file_t type # for use in the tests.@@ -97,9 +97,7 @@ test03() cleanup() { - # Cleanup. - rm -rf $SELINUXTMPDIR/test_file - cd $SAVEPWD + rm -rf $SELINUXTMPDIR } # Function: maintestcases/kernel/security/selinux-testsuite/tests/ioctl/selinux_ioctl.sh +4
-1@@ -17,6 +17,9 @@ setup() export TST_COUNT=0 export TST_TOTAL=2 + SELINUXTMPDIR=$(mktemp -d) + chcon -t test_file_t $SELINUXTMPDIR + # Create a temporary file for testing rm -f $SELINUXTMPDIR/temp_file 2>&1 touch $SELINUXTMPDIR/temp_file 2>&1@@ -65,7 +68,7 @@ test02() cleanup() { - rm -f $SELINUXTMPDIR/temp_file 2>&1 + rm -rf $SELINUXTMPDIR } # Function: maintestcases/kernel/security/selinux-testsuite/tests/link/selinux_link.sh +3
-4@@ -15,8 +15,8 @@ setup() export TST_COUNT=0 export TST_TOTAL=6 - # Clean up from a previous run - rm -f $SELINUXTMPDIR/test_dir 2>&1 + SELINUXTMPDIR=$(mktemp -d) + chcon -t test_file_t $SELINUXTMPDIR # Create a test directory with the test_addname_dir_t type # for use in the tests.@@ -157,8 +157,7 @@ test06() cleanup() { - # Cleanup. - rm -rf $SELINUXTMPDIR/test_dir + rm -rf $SELINUXTMPDIR } # Function: maintestcases/kernel/security/selinux-testsuite/tests/mkdir/selinux_mkdir.sh +3
-4@@ -15,8 +15,8 @@ setup() export TST_COUNT=0 export TST_TOTAL=5 - # Remove any leftover test directory from prior failed runs. - rm -rf $SELINUXTMPDIR/test_dir + SELINUXTMPDIR=$(mktemp -d) + chcon -t test_file_t $SELINUXTMPDIR # Create a test directory with the test_mkdir_dir_t type # for use in the tests.@@ -129,8 +129,7 @@ test05() cleanup() { - # Cleanup. - rm -rf $SELINUXTMPDIR/test_dir + rm -rf $SELINUXTMPDIR } # Function: maintestcases/kernel/security/selinux-testsuite/tests/open/selinux_open.sh +3
-4@@ -15,8 +15,8 @@ setup() export TST_COUNT=0 export TST_TOTAL=8 - # Remove any leftover test directories from prior failed runs. - rm -rf $SELINUXTMPDIR/test_file + SELINUXTMPDIR=$(mktemp -d) + chcon -t test_file_t $SELINUXTMPDIR # Create a test file. touch $SELINUXTMPDIR/test_file@@ -180,8 +180,7 @@ test08() cleanup() { - # Cleanup. - rm -rf $SELINUXTMPDIR/test_file + rm -rf $SELINUXTMPDIR } # Function: maintestcases/kernel/security/selinux-testsuite/tests/readlink/selinux_readlink.sh +3
-4@@ -15,8 +15,8 @@ setup() export TST_COUNT=0 export TST_TOTAL=3 - # Remove any leftover test files from prior failed runs. - rm -rf $SELINUXTMPDIR/test_file $SELINUXTMPDIR/test_symlink + SELINUXTMPDIR=$(mktemp -d) + chcon -t test_file_t $SELINUXTMPDIR # Create a test file. touch $SELINUXTMPDIR/test_file 2>&1@@ -86,8 +86,7 @@ test03() cleanup() { - # Cleanup. - rm -rf $SELINUXTMPDIR/test_file $SELINUXTMPDIR/test_symlink + rm -rf $SELINUXTMPDIR } # Function: maintestcases/kernel/security/selinux-testsuite/tests/relabel/selinux_relabel.sh +3
-4@@ -15,8 +15,8 @@ setup() export TST_COUNT=0 export TST_TOTAL=3 - # Remove any leftover test file from prior failed runs. - rm -rf $SELINUXTMPDIR/test_file + SELINUXTMPDIR=$(mktemp -d) + chcon -t test_file_t $SELINUXTMPDIR # Create a test file with the test_relabel_oldtype_t # type for use in the tests.@@ -90,8 +90,7 @@ test03() cleanup() { - # Cleanup. - rm -rf $SELINUXTMPDIR/test_file + rm -rf $SELINUXTMPDIR } # Function: maintestcases/kernel/security/selinux-testsuite/tests/rename/selinux_rename.sh +3
-4@@ -15,8 +15,8 @@ setup() export TST_COUNT=0 export TST_TOTAL=9 - # Remove any leftover test directories from prior failed runs. - rm -rf $SELINUXTMPDIR/src_dir $SELINUXTMPDIR/dst_dir + SELINUXTMPDIR=$(mktemp -d) + chcon -t test_file_t $SELINUXTMPDIR # Create the source and destination test directories for the rename. mkdir --context=system_u:object_r:test_rename_src_dir_t $SELINUXTMPDIR/src_dir 2>&1@@ -231,8 +231,7 @@ test09() cleanup() { - # Cleanup. - rm -rf $SELINUXTMPDIR/src_dir $SELINUXTMPDIR/dst_dir + rm -rf $SELINUXTMPDIR } # Function: maintestcases/kernel/security/selinux-testsuite/tests/rxdir/selinux_rxdir.sh +3
-4@@ -15,8 +15,8 @@ setup() export TST_COUNT=0 export TST_TOTAL=4 - # Remove any leftover test directory from prior failed runs. - rm -rf $SELINUXTMPDIR/test_dir + SELINUXTMPDIR=$(mktemp -d) + chcon -t test_file_t $SELINUXTMPDIR # Create a test dir with the test_rxdir_dir_t type # for use in the tests.@@ -102,8 +102,7 @@ test04() cleanup() { - # Cleanup. - rm -rf $SELINUXTMPDIR/test_dir + rm -rf $SELINUXTMPDIR } # Function: maintestcases/kernel/security/selinux-testsuite/tests/setattr/selinux_setattr.sh +3
-4@@ -15,8 +15,8 @@ setup() export TST_COUNT=0 export TST_TOTAL=4 - # Remove any leftover test file from prior failed runs. - rm -rf $SELINUXTMPDIR/test_file + SELINUXTMPDIR=$(mktemp -d) + chcon -t test_file_t $SELINUXTMPDIR # Create a test file with the test_setattr_file_t type # for use in the tests.@@ -100,8 +100,7 @@ test04() cleanup() { - # Cleanup. - rm -rf $SELINUXTMPDIR/test_file + rm -rf $SELINUXTMPDIR } # Function: maintestcases/kernel/security/selinux-testsuite/tests/stat/selinux_stat.sh +3
-5@@ -15,8 +15,8 @@ setup() export TST_COUNT=0 export TST_TOTAL=2 - # Remove any leftover test file from prior failed runs. - rm -rf $SELINUXTMPDIR/test_file + SELINUXTMPDIR=$(mktemp -d) + chcon -t test_file_t $SELINUXTMPDIR # Create a test file with the test_stat_file_t type # for use in the tests.@@ -64,8 +64,7 @@ test02() cleanup() { - # Cleanup. - rm -rf $SELINUXTMPDIR/test_file + rm -rf $SELINUXTMPDIR } # Function: main ------------------------------------------------------------------------------Stay on top of everything new and different, both inside and around Java (TM) technology - register by April 22, and save $200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco. 300 plus technical and hands-on sessions. Register today. Use priority code J9JMT32. http://p.sf.net/sfu/p
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
Signature · 8 lines
Stephen Smalley National Security Agency -- This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.
A message that is not in the archive (sent off-list or not yet received): op.us5xofaeu2flwt@debian
Quoted 11 lines · Jiří Paleček
Quoted 6 lines · Stephen Smalley
Quoted 3 lines · Subrata Modak
Stephen,
Would you like to say something about the following Patch ?
Yes, it breaks the selinux testsuite for me. Please revert.
How exactly does it break it?
Running it via test_selinux.sh was generating errors like:
cd: /testcases/bin: No such file or directory
in selinux.outfile, producing a couple bogus FAILs.
After backing out your setcurrent change and your SELINUXTMPDIR changes and Chris' patch and running it via test_selinux.sh, I'm down to 6 remaining FAILs, likely due to further tightening of refpolicy since we last updated the test policy. I'll have to go through them one by one and examine the exact denials and error messages.
Quoted 602 lines
Quoted 599 lines
Quoted 599 lines
-------- Forwarded Message --------
From: Jiri Palecek > <<[email protected]>
Cc: [email protected] <[email protected]>
Subject: [LTP] [PATCH] Create $SELINUXTMPDIR in each of the tests
Date: Thu, 16 Apr 2009 12:52:05 +0200Hello,
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?
PS: This patch still has issues, namely, the cleanup is denied sometimes.
Regards
Jiri PalecekSigned-off-by Jiri Palecek <[email protected]>--- .../tests/bounds/selinux_bounds.sh | 7 +++---- .../tests/capable_file/selinux_capable_file.sh | 8 +++----- .../tests/capable_sys/selinux_capable_sys.sh | 8 ++++---- .../tests/entrypoint/selinux_entrypoint.sh | 7 +++---- .../execute_no_trans/selinux_execute_no_trans.sh | 7 +++---- .../tests/fdreceive/selinux_fdreceive.sh | 7 +++---- .../selinux-testsuite/tests/file/selinux_file.sh | 14 ++++---------- .../tests/inherit/selinux_inherit.sh | 8 +++----- .../selinux-testsuite/tests/ioctl/selinux_ioctl.sh | 5 ++++- .../selinux-testsuite/tests/link/selinux_link.sh | 7 +++---- .../selinux-testsuite/tests/mkdir/selinux_mkdir.sh | 7 +++---- .../selinux-testsuite/tests/open/selinux_open.sh | 7 +++---- .../tests/readlink/selinux_readlink.sh | 7 +++---- .../tests/relabel/selinux_relabel.sh | 7 +++---- .../tests/rename/selinux_rename.sh | 7 +++---- .../selinux-testsuite/tests/rxdir/selinux_rxdir.sh | 7 +++---- .../tests/setattr/selinux_setattr.sh | 7 +++---- .../selinux-testsuite/tests/stat/selinux_stat.sh | 7 +++---- 18 files changed, 57 insertions(+), 77 deletions(-)(quoted diff) +0
-0
a/testcases/kernel/security/selinux-testsuite/tests/bounds/selinux_bounds.shb/testcases/kernel/security/selinux-testsuite/tests/bounds/selinux_bounds.shindex fb0876e..5a3fa06 100755
---a/testcases/kernel/security/selinux-testsuite/tests/bounds/selinux_bounds.sh
+++b/testcases/kernel/security/selinux-testsuite/tests/bounds/selinux_bounds.shtestcases/kernel/security/selinux-testsuite/tests/bounds/selinux_bounds.sh +3
-4@@ -14,8 +14,8 @@ setup() export TST_COUNT=0 export TST_TOTAL=4 - # Remove any leftover test directories from prior failed runs. - rm -rf $SELINUXTMPDIR/bounds_file* + SELINUXTMPDIR=$(mktemp -d) + chcon -t test_file_t $SELINUXTMPDIR # Create test files dd if=/dev/zero of=$SELINUXTMPDIR/bounds_file count=1@@ -141,8 +141,7 @@ test06() cleanup() { - # Cleanup - rm -rf $SELINUXTMPDIR/bounds_file* + rm -rf $SELINUXTMPDIR } # Function: main(quoted diff) +0
-0
a/testcases/kernel/security/selinux-testsuite/tests/capable_file/selinux_capable_file.shb/testcases/kernel/security/selinux-testsuite/tests/capable_file/selinux_capable_file.shindex 86d89a1..f5f1040 100755
---a/testcases/kernel/security/selinux-testsuite/tests/capable_file/selinux_capable_file.sh
+++b/testcases/kernel/security/selinux-testsuite/tests/capable_file/selinux_capable_file.shtestcases/kernel/security/selinux-testsuite/tests/capable_file/selinux_capable_file.sh +3
-5@@ -17,9 +17,8 @@ setup() export TST_COUNT=0 export TST_TOTAL=10 - # Clean up from a previous run - rm -f $SELINUXTMPDIR/temp_file 2>&1 - rm -f $SELINUXTMPDIR/temp_file2 2>&1 + SELINUXTMPDIR=$(mktemp -d) + chcon -t test_file_t $SELINUXTMPDIR } #@@ -233,8 +232,7 @@ test10() cleanup() { - rm -f $SELINUXTMPDIR/temp_file 2>&1 - rm -f $SELINUXTMPDIR/temp_file2 2>&1 + rm -rf $SELINUXTMPDIR } # Function: main(quoted diff) +0
-0
a/testcases/kernel/security/selinux-testsuite/tests/capable_sys/selinux_capable_sys.shb/testcases/kernel/security/selinux-testsuite/tests/capable_sys/selinux_capable_sys.shindex da880b3..1965142 100755
---a/testcases/kernel/security/selinux-testsuite/tests/capable_sys/selinux_capable_sys.sh
+++b/testcases/kernel/security/selinux-testsuite/tests/capable_sys/selinux_capable_sys.shtestcases/kernel/security/selinux-testsuite/tests/capable_sys/selinux_capable_sys.sh +4
-4@@ -17,8 +17,8 @@ setup() export TST_COUNT=0 export TST_TOTAL=8 - # Clean up from a previous run - rm -f $SELINUXTMPDIR/temp_file 2>&1 + SELINUXTMPDIR=$(mktemp -d) + chcon -t test_file_t $SELINUXTMPDIR } #@@ -195,8 +195,7 @@ test08() cleanup() { - # Remove files - rm -f $SELINUXTMPDIR/temp_file 2>&1 + rm -rf $SELINUXTMPDIR } # Function: main@@ -215,6 +214,7 @@ test02 || EXIT_VAL=$RC test03 || EXIT_VAL=$RC test04 || EXIT_VAL=$RC cleanup +setup test05 || EXIT_VAL=$RC test06 || EXIT_VAL=$RC test07 || EXIT_VAL=$RC(quoted diff) +0
-0
a/testcases/kernel/security/selinux-testsuite/tests/entrypoint/selinux_entrypoint.shb/testcases/kernel/security/selinux-testsuite/tests/entrypoint/selinux_entrypoint.shindex 4ae880a..bd58845 100755
---a/testcases/kernel/security/selinux-testsuite/tests/entrypoint/selinux_entrypoint.sh
+++b/testcases/kernel/security/selinux-testsuite/tests/entrypoint/selinux_entrypoint.shtestcases/kernel/security/selinux-testsuite/tests/entrypoint/selinux_entrypoint.sh +3
-4@@ -15,8 +15,8 @@ setup() export TST_COUNT=0 export TST_TOTAL=2 - # Clean up from a previous run - rm -f $SELINUXTMPDIR/true 2>&1 + SELINUXTMPDIR=$(mktemp -d) + chcon -t test_file_t $SELINUXTMPDIR } test01()@@ -63,8 +63,7 @@ test02() cleanup() { - # Cleanup. - rm -f $SELINUXTMPDIR/true + rm -rf $SELINUXTMPDIR } # Function: main(quoted diff) +0
-0
a/testcases/kernel/security/selinux-testsuite/tests/execute_no_trans/selinux_execute_no_trans.shb/testcases/kernel/security/selinux-testsuite/tests/execute_no_trans/selinux_execute_no_trans.shindex 2c58fe1..67bfe6f 100755
---a/testcases/kernel/security/selinux-testsuite/tests/execute_no_trans/selinux_execute_no_trans.sh
+++b/testcases/kernel/security/selinux-testsuite/tests/execute_no_trans/selinux_execute_no_trans.shtestcases/kernel/security/selinux-testsuite/tests/entrypoint/selinux_entrypoint.sh +3
-4@@ -15,8 +15,8 @@ setup() export TST_COUNT=0 export TST_TOTAL=2 - # Clean up from a previous run - rm -f $SELINUXTMPDIR/true 2>&1 + SELINUXTMPDIR=$(mktemp -d) + chcon -t test_file_t $SELINUXTMPDIR } test01()@@ -66,8 +66,7 @@ test02() cleanup() { - # Cleanup. - rm -f $SELINUXTMPDIR/true + rm -rf $SELINUXTMPDIR } # Function: main(quoted diff) +0
-0
a/testcases/kernel/security/selinux-testsuite/tests/fdreceive/selinux_fdreceive.shb/testcases/kernel/security/selinux-testsuite/tests/fdreceive/selinux_fdreceive.shindex 4ec7f2e..76bbedd 100755
---a/testcases/kernel/security/selinux-testsuite/tests/fdreceive/selinux_fdreceive.sh
+++b/testcases/kernel/security/selinux-testsuite/tests/fdreceive/selinux_fdreceive.shtestcases/kernel/security/selinux-testsuite/tests/fdreceive/selinux_fdreceive.sh +0
-2@@ -15,8 +15,8 @@ setup() export TST_COUNT=0 export TST_TOTAL=3 - # Remove any leftover test file from prior failed runs. - rm -rf $SELINUXTMPDIR/test_file $SELINUXTMPDIR/test_file2$SELINUXTMPDIR/test_sock
testcases/kernel/security/selinux-testsuite/tests/fdreceive/selinux_fdreceive.sh +2
-2+ SELINUXTMPDIR=$(mktemp -d) + chcon -t test_file_t $SELINUXTMPDIR # Create and label the test files. touch $SELINUXTMPDIR/test_file $SELINUXTMPDIR/test_file2@@ -100,8 +100,7 @@ cleanup() # Kill the server. kill -s TERM $PID - # Cleanup. - rm -rf $SELINUXTMPDIR/test_file $SELINUXTMPDIR/test_file2$SELINUXTMPDIR/test_sock
testcases/kernel/security/selinux-testsuite/tests/bounds/selinux_bounds.sh +1
-0+ rm -rf $SELINUXTMPDIR } # Function: main(quoted diff) +0
-0
a/testcases/kernel/security/selinux-testsuite/tests/file/selinux_file.shb/testcases/kernel/security/selinux-testsuite/tests/file/selinux_file.shindex 0c88e9b..71b09dd 100755
---a/testcases/kernel/security/selinux-testsuite/tests/file/selinux_file.sh
+++b/testcases/kernel/security/selinux-testsuite/tests/file/selinux_file.shtestcases/kernel/security/selinux-testsuite/tests/file/selinux_file.sh +4
-10@@ -17,10 +17,9 @@ setup() export TST_COUNT=0 export TST_TOTAL=14 - # Clean up from a previous run - rm -f $SELINUXTMPDIR/temp_file 2>&1 - rm -f $SELINUXTMPDIR/temp_file2 2>&1 - rm -f $SELINUXTMPDIR/temp_file3 2>&1 + LTPBIN=$LTPROOT/testcases/bin + SELINUXTMPDIR=$(mktemp -d) + chcon -t test_file_t $SELINUXTMPDIR # # Create the temp files@@ -361,12 +360,7 @@ test14() cleanup() { - # - # Delete the temp files - # - rm -f $basedir/temp_file 2>&1 - rm -f $basedir/temp_file2 2>&1 - rm -f $basedir/temp_file3 2>&1 + rm -rf $SELINUXTMPDIR } #(quoted diff) +0
-0
a/testcases/kernel/security/selinux-testsuite/tests/inherit/selinux_inherit.shb/testcases/kernel/security/selinux-testsuite/tests/inherit/selinux_inherit.shindex 8a48185..13defc8 100755
---a/testcases/kernel/security/selinux-testsuite/tests/inherit/selinux_inherit.sh
+++b/testcases/kernel/security/selinux-testsuite/tests/inherit/selinux_inherit.shtestcases/kernel/security/selinux-testsuite/tests/inherit/selinux_inherit.sh +3
-5@@ -15,8 +15,8 @@ setup() export TST_COUNT=0 export TST_TOTAL=3 - # Clean up from a previous run - rm -f $SELINUXTMPDIR/test_file 2>&1 + SELINUXTMPDIR=$(mktemp -d) + chcon -t test_file_t $SELINUXTMPDIR # Create a test file with the test_inherit_file_t type # for use in the tests.@@ -97,9 +97,7 @@ test03() cleanup() { - # Cleanup. - rm -rf $SELINUXTMPDIR/test_file - cd $SAVEPWD + rm -rf $SELINUXTMPDIR } # Function: main(quoted diff) +0
-0
a/testcases/kernel/security/selinux-testsuite/tests/ioctl/selinux_ioctl.shb/testcases/kernel/security/selinux-testsuite/tests/ioctl/selinux_ioctl.shindex a46a8f9..61bfacd 100755
---a/testcases/kernel/security/selinux-testsuite/tests/ioctl/selinux_ioctl.sh
+++b/testcases/kernel/security/selinux-testsuite/tests/ioctl/selinux_ioctl.shtestcases/kernel/security/selinux-testsuite/tests/ioctl/selinux_ioctl.sh +4
-1@@ -17,6 +17,9 @@ setup() export TST_COUNT=0 export TST_TOTAL=2 + SELINUXTMPDIR=$(mktemp -d) + chcon -t test_file_t $SELINUXTMPDIR + # Create a temporary file for testing rm -f $SELINUXTMPDIR/temp_file 2>&1 touch $SELINUXTMPDIR/temp_file 2>&1@@ -65,7 +68,7 @@ test02() cleanup() { - rm -f $SELINUXTMPDIR/temp_file 2>&1 + rm -rf $SELINUXTMPDIR } # Function: main(quoted diff) +0
-0
a/testcases/kernel/security/selinux-testsuite/tests/link/selinux_link.shb/testcases/kernel/security/selinux-testsuite/tests/link/selinux_link.shindex b78a2df..b666320 100755
---a/testcases/kernel/security/selinux-testsuite/tests/link/selinux_link.sh
+++b/testcases/kernel/security/selinux-testsuite/tests/link/selinux_link.shtestcases/kernel/security/selinux-testsuite/tests/link/selinux_link.sh +3
-4@@ -15,8 +15,8 @@ setup() export TST_COUNT=0 export TST_TOTAL=6 - # Clean up from a previous run - rm -f $SELINUXTMPDIR/test_dir 2>&1 + SELINUXTMPDIR=$(mktemp -d) + chcon -t test_file_t $SELINUXTMPDIR # Create a test directory with the test_addname_dir_t type # for use in the tests.@@ -157,8 +157,7 @@ test06() cleanup() { - # Cleanup. - rm -rf $SELINUXTMPDIR/test_dir + rm -rf $SELINUXTMPDIR } # Function: main(quoted diff) +0
-0
a/testcases/kernel/security/selinux-testsuite/tests/mkdir/selinux_mkdir.shb/testcases/kernel/security/selinux-testsuite/tests/mkdir/selinux_mkdir.shindex 79f1c57..a8b8eb7 100755
---a/testcases/kernel/security/selinux-testsuite/tests/mkdir/selinux_mkdir.sh
+++b/testcases/kernel/security/selinux-testsuite/tests/mkdir/selinux_mkdir.shtestcases/kernel/security/selinux-testsuite/tests/mkdir/selinux_mkdir.sh +3
-4@@ -15,8 +15,8 @@ setup() export TST_COUNT=0 export TST_TOTAL=5 - # Remove any leftover test directory from prior failed runs. - rm -rf $SELINUXTMPDIR/test_dir + SELINUXTMPDIR=$(mktemp -d) + chcon -t test_file_t $SELINUXTMPDIR # Create a test directory with the test_mkdir_dir_t type # for use in the tests.@@ -129,8 +129,7 @@ test05() cleanup() { - # Cleanup. - rm -rf $SELINUXTMPDIR/test_dir + rm -rf $SELINUXTMPDIR } # Function: main(quoted diff) +0
-0
a/testcases/kernel/security/selinux-testsuite/tests/open/selinux_open.shb/testcases/kernel/security/selinux-testsuite/tests/open/selinux_open.shindex de7be4c..edd5922 100755
---a/testcases/kernel/security/selinux-testsuite/tests/open/selinux_open.sh
+++b/testcases/kernel/security/selinux-testsuite/tests/open/selinux_open.shtestcases/kernel/security/selinux-testsuite/tests/open/selinux_open.sh +3
-4@@ -15,8 +15,8 @@ setup() export TST_COUNT=0 export TST_TOTAL=8 - # Remove any leftover test directories from prior failed runs. - rm -rf $SELINUXTMPDIR/test_file + SELINUXTMPDIR=$(mktemp -d) + chcon -t test_file_t $SELINUXTMPDIR # Create a test file. touch $SELINUXTMPDIR/test_file@@ -180,8 +180,7 @@ test08() cleanup() { - # Cleanup. - rm -rf $SELINUXTMPDIR/test_file + rm -rf $SELINUXTMPDIR } # Function: main(quoted diff) +0
-0
a/testcases/kernel/security/selinux-testsuite/tests/readlink/selinux_readlink.shb/testcases/kernel/security/selinux-testsuite/tests/readlink/selinux_readlink.shindex 2c4a885..11e6c29 100755
---a/testcases/kernel/security/selinux-testsuite/tests/readlink/selinux_readlink.sh
+++b/testcases/kernel/security/selinux-testsuite/tests/readlink/selinux_readlink.shtestcases/kernel/security/selinux-testsuite/tests/readlink/selinux_readlink.sh +3
-4@@ -15,8 +15,8 @@ setup() export TST_COUNT=0 export TST_TOTAL=3 - # Remove any leftover test files from prior failed runs. - rm -rf $SELINUXTMPDIR/test_file $SELINUXTMPDIR/test_symlink + SELINUXTMPDIR=$(mktemp -d) + chcon -t test_file_t $SELINUXTMPDIR # Create a test file. touch $SELINUXTMPDIR/test_file 2>&1@@ -86,8 +86,7 @@ test03() cleanup() { - # Cleanup. - rm -rf $SELINUXTMPDIR/test_file $SELINUXTMPDIR/test_symlink + rm -rf $SELINUXTMPDIR } # Function: main(quoted diff) +0
-0
a/testcases/kernel/security/selinux-testsuite/tests/relabel/selinux_relabel.shb/testcases/kernel/security/selinux-testsuite/tests/relabel/selinux_relabel.shindex 8d8bad3..076228d 100755
---a/testcases/kernel/security/selinux-testsuite/tests/relabel/selinux_relabel.sh
+++b/testcases/kernel/security/selinux-testsuite/tests/relabel/selinux_relabel.shtestcases/kernel/security/selinux-testsuite/tests/relabel/selinux_relabel.sh +3
-4@@ -15,8 +15,8 @@ setup() export TST_COUNT=0 export TST_TOTAL=3 - # Remove any leftover test file from prior failed runs. - rm -rf $SELINUXTMPDIR/test_file + SELINUXTMPDIR=$(mktemp -d) + chcon -t test_file_t $SELINUXTMPDIR # Create a test file with the test_relabel_oldtype_t # type for use in the tests.@@ -90,8 +90,7 @@ test03() cleanup() { - # Cleanup. - rm -rf $SELINUXTMPDIR/test_file + rm -rf $SELINUXTMPDIR } # Function: main(quoted diff) +0
-0
a/testcases/kernel/security/selinux-testsuite/tests/rename/selinux_rename.shb/testcases/kernel/security/selinux-testsuite/tests/rename/selinux_rename.shindex 36e2485..ca9e409 100755
---a/testcases/kernel/security/selinux-testsuite/tests/rename/selinux_rename.sh
+++b/testcases/kernel/security/selinux-testsuite/tests/rename/selinux_rename.shtestcases/kernel/security/selinux-testsuite/tests/rename/selinux_rename.sh +2
-2@@ -15,8 +15,8 @@ setup() export TST_COUNT=0 export TST_TOTAL=9 - # Remove any leftover test directories from prior failed runs. - rm -rf $SELINUXTMPDIR/src_dir $SELINUXTMPDIR/dst_dir + SELINUXTMPDIR=$(mktemp -d) + chcon -t test_file_t $SELINUXTMPDIR # Create the source and destination test directories for the rename. mkdir --context=system_u:object_r:test_rename_src_dir_t$SELINUXTMPDIR/src_dir 2>&1
testcases/kernel/security/selinux-testsuite/tests/rename/selinux_rename.sh +1
-2@@ -231,8 +231,7 @@ test09() cleanup() { - # Cleanup. - rm -rf $SELINUXTMPDIR/src_dir $SELINUXTMPDIR/dst_dir + rm -rf $SELINUXTMPDIR } # Function: main(quoted diff) +0
-0
a/testcases/kernel/security/selinux-testsuite/tests/rxdir/selinux_rxdir.shb/testcases/kernel/security/selinux-testsuite/tests/rxdir/selinux_rxdir.shindex 82c335e..7d836ce 100755
---a/testcases/kernel/security/selinux-testsuite/tests/rxdir/selinux_rxdir.sh
+++b/testcases/kernel/security/selinux-testsuite/tests/rxdir/selinux_rxdir.shtestcases/kernel/security/selinux-testsuite/tests/rxdir/selinux_rxdir.sh +3
-4@@ -15,8 +15,8 @@ setup() export TST_COUNT=0 export TST_TOTAL=4 - # Remove any leftover test directory from prior failed runs. - rm -rf $SELINUXTMPDIR/test_dir + SELINUXTMPDIR=$(mktemp -d) + chcon -t test_file_t $SELINUXTMPDIR # Create a test dir with the test_rxdir_dir_t type # for use in the tests.@@ -102,8 +102,7 @@ test04() cleanup() { - # Cleanup. - rm -rf $SELINUXTMPDIR/test_dir + rm -rf $SELINUXTMPDIR } # Function: main(quoted diff) +0
-0
a/testcases/kernel/security/selinux-testsuite/tests/setattr/selinux_setattr.shb/testcases/kernel/security/selinux-testsuite/tests/setattr/selinux_setattr.shindex dd30179..2ab6070 100755
---a/testcases/kernel/security/selinux-testsuite/tests/setattr/selinux_setattr.sh
+++b/testcases/kernel/security/selinux-testsuite/tests/setattr/selinux_setattr.shtestcases/kernel/security/selinux-testsuite/tests/setattr/selinux_setattr.sh +3
-4@@ -15,8 +15,8 @@ setup() export TST_COUNT=0 export TST_TOTAL=4 - # Remove any leftover test file from prior failed runs. - rm -rf $SELINUXTMPDIR/test_file + SELINUXTMPDIR=$(mktemp -d) + chcon -t test_file_t $SELINUXTMPDIR # Create a test file with the test_setattr_file_t type # for use in the tests.@@ -100,8 +100,7 @@ test04() cleanup() { - # Cleanup. - rm -rf $SELINUXTMPDIR/test_file + rm -rf $SELINUXTMPDIR } # Function: main(quoted diff) +0
-0
a/testcases/kernel/security/selinux-testsuite/tests/stat/selinux_stat.shb/testcases/kernel/security/selinux-testsuite/tests/stat/selinux_stat.shindex 98ed91f..3a13122 100755
---a/testcases/kernel/security/selinux-testsuite/tests/stat/selinux_stat.sh
+++b/testcases/kernel/security/selinux-testsuite/tests/stat/selinux_stat.shtestcases/kernel/security/selinux-testsuite/tests/stat/selinux_stat.sh +3
-5@@ -15,8 +15,8 @@ setup() export TST_COUNT=0 export TST_TOTAL=2 - # Remove any leftover test file from prior failed runs. - rm -rf $SELINUXTMPDIR/test_file + SELINUXTMPDIR=$(mktemp -d) + chcon -t test_file_t $SELINUXTMPDIR # Create a test file with the test_stat_file_t type # for use in the tests.@@ -64,8 +64,7 @@ test02() cleanup() { - # Cleanup. - rm -rf $SELINUXTMPDIR/test_file + rm -rf $SELINUXTMPDIR } # Function: main ------------------------------------------------------------------------------Stay on top of everything new and different, both inside and around Java (TM) technology - register by April 22, and save $200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco. 300 plus technical and hands-on sessions. Register today. Use priority code J9JMT32. http://p.sf.net/sfu/p
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
Signature · 8 lines
Stephen Smalley National Security Agency -- This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.
Quoted 17 lines · Stephen Smalley
Quoted 11 lines · Jiří Paleček
Quoted 6 lines · Stephen Smalley
Quoted 3 lines · Subrata Modak
Stephen,
Would you like to say something about the following Patch ?
Yes, it breaks the selinux testsuite for me. Please revert.
How exactly does it break it?
Running it via
test_selinux.shwas generating errors like:
cd: /testcases/bin: No such file or directory
in selinux.outfile, producing a couple bogus FAILs.
Quoted 5 lines
After backing out your setcurrent change and your SELINUXTMPDIR changes and Chris' patch and running it via
test_selinux.sh, I'm down to 6 remaining FAILs, likely due to further tightening of refpolicy since we last updated the test policy. I'll have to go through them one by one and examine the exact denials and error messages.
Ah, 5 of the 6 were just due to not running mcstransd. Need to eliminate that as a dependency.
Last FAIL is ioctl, and that one is expected - kernel ioctl checking changed and no one rewrote the test yet.
Signature · 8 lines
Stephen Smalley National Security Agency -- This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.
A message that is not in the archive (sent off-list or not yet received): op.us51ezmiu2flwt@debian
Quoted 16 lines · Jiří Paleček
Quoted 13 lines · Stephen Smalley
Quoted 11 lines · Jiří Paleček
Quoted 6 lines · Stephen Smalley
Quoted 3 lines · Subrata Modak
Stephen,
Would you like to say something about the following Patch ?
Yes, it breaks the selinux testsuite for me. Please revert.
How exactly does it break it?
Quoted 7 lines
Quoted 3 lines
Running it via
test_selinux.shwas generating errors like:
cd: /testcases/bin: No such file or directory
in selinux.outfile, producing a couple bogus FAILs.This is probably caused by the line setting LTPBIN (which shouldn't have been there in the first place, my fault), does the attached patch fix it for you?
Your patch doesn't apply - looks like it is relative to further local changes you have made in your own git repo (extra args to mktemp). But applying the corresponding change here does fix that problem for me, yes. Diff below is relative to ltp cvs.
Fix LTPBIN definition in selinux_file.sh
---
testcases/kernel/security/selinux-testsuite/tests/file/selinux_file.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Index: testcases/kernel/security/selinux-testsuite/tests/file/selinux_file.sh
===================================================================
RCS file: /cvsroot/ltp/ltp/testcases/kernel/security/selinux-testsuite/tests/file/selinux_file.sh,v retrieving revision 1.5
kernel/security/selinux-testsuite/tests/file/selinux_file.sh +1 -1
@@ -17,7 +17,7 @@ export TST_COUNT=0 export TST_TOTAL=14 - LTPBIN=$LTPROOT/testcases/bin + LTPBIN=${LTPBIN:-$LTPROOT/testcases/bin} SELINUXTMPDIR=$(mktemp -d) chcon -t test_file_t $SELINUXTMPDIR
Signature · 8 lines
Stephen Smalley National Security Agency -- This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.
Quoted 25 lines · Stephen Smalley
Quoted 16 lines · Jiří Paleček
Quoted 13 lines · Stephen Smalley
Quoted 11 lines · Jiří Paleček
Quoted 6 lines · Stephen Smalley
Quoted 3 lines · Subrata Modak
Stephen,
Would you like to say something about the following Patch ?
Yes, it breaks the selinux testsuite for me. Please revert.
How exactly does it break it?
Quoted 7 lines
Quoted 3 lines
Running it via
test_selinux.shwas generating errors like:
cd: /testcases/bin: No such file or directory
in selinux.outfile, producing a couple bogus FAILs.This is probably caused by the line setting LTPBIN (which shouldn't have been there in the first place, my fault), does the attached patch fix it for you?
Quoted 8 lines
Your patch doesn't apply - looks like it is relative to further local changes you have made in your own git repo (extra args to mktemp). But applying the corresponding change here does fix that problem for me, yes. Diff below is relative to ltp cvs.
Fix LTPBIN definition in
selinux_file.shSigned-off-by Stephen Smalley <[email protected]>
Thanks.
Regards--
Subrata
Quoted 15 lines
---
testcases/kernel/security/selinux-testsuite/tests/file/selinux_file.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)Index:
testcases/kernel/security/selinux-testsuite/tests/file/selinux_file.sh
===================================================================
RCS file: /cvsroot/ltp/ltp/testcases/kernel/security/selinux-testsuite/tests/file/selinux_file.sh,v retrieving revision 1.5
diff -u -r1.5selinux_file.sh
kernel/security/selinux-testsuite/tests/file/selinux_file.sh line 23
Quoted 8 lines
kernel/security/selinux-testsuite/tests/file/selinux_file.sh +1
-1@@ -17,7 +17,7 @@ export TST_COUNT=0 export TST_TOTAL=14 - LTPBIN=$LTPROOT/testcases/bin + LTPBIN=${LTPBIN:-$LTPROOT/testcases/bin} SELINUXTMPDIR=$(mktemp -d) chcon -t test_file_t $SELINUXTMPDIR
--
This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.
PATCH 1/1 Fix MLS handling in selinux tests
In reply to a message not in the archiveSome of the selinux tests were using full security contexts but predated MCS/MLS and thus lacked a MLS field. This broke testing if MLS was enabled in the policy but mcstransd was not running. Change some of the tests to avoid the need to use full contexts at all, and others to conditionally append a MLS suffix if MLS is enabled.
testcases/kernel/security/selinux-testsuite/tests/file/selinux_file.sh | 2 - testcases/kernel/security/selinux-testsuite/tests/mkdir/selinux_mkdir.sh | 16 ++++++++-- testcases/kernel/security/selinux-testsuite/tests/relabel/selinux_relabel.sh | 2 - testcases/kernel/security/selinux-testsuite/tests/rename/selinux_rename.sh | 9 +++-- testcases/kernel/security/selinux-testsuite/tests/rxdir/selinux_rxdir.sh | 3 + 5 files changed, 24 insertions(+), 8 deletions(-)
Index: testcases/kernel/security/selinux-testsuite/tests/file/selinux_file.sh
===================================================================
RCS file: /cvsroot/ltp/ltp/testcases/kernel/security/selinux-testsuite/tests/file/selinux_file.sh,v retrieving revision 1.5
kernel/security/selinux-testsuite/tests/file/selinux_file.sh +1 -1
@@ -53,7 +53,7 @@ # # Get the SID of the good file. # - good_file_sid="system_u:object_r:fileop_file_t" + good_file_sid=`ls -Z $SELINUXTMPDIR/temp_file | awk '{print $4}'` } test01()
Index: testcases/kernel/security/selinux-testsuite/tests/mkdir/selinux_mkdir.sh
===================================================================
RCS file: /cvsroot/ltp/ltp/testcases/kernel/security/selinux-testsuite/tests/mkdir/selinux_mkdir.sh,v retrieving revision 1.4
kernel/security/selinux-testsuite/tests/mkdir/selinux_mkdir.sh +14 -2
@@ -89,12 +89,18 @@ TCID="test04" TST_COUNT=4 RC=0 + SUFFIX="" + MLS=x`cat /selinux/mls` + if [ "$MLS" == "x1" ] + then + SUFFIX=":s0" + fi # Verify that test_create_t can create a subdirectory # with a different type. # This requires add_name to test_mkdir_dir_t and create # to test_create_dir_t. - runcon -t test_create_t -- mkdir --context=system_u:object_r:test_create_dir_t $SELINUXTMPDIR/test_dir/test3 2>&1 + runcon -t test_create_t -- mkdir --context=system_u:object_r:test_create_dir_t$SUFFIX $SELINUXTMPDIR/test_dir/test3 2>&1 RC=$? if [ $RC -eq 0 ] then
@@ -110,11 +116,17 @@ TCID="test05" TST_COUNT=5 RC=0 + SUFFIX="" + MLS=x`cat /selinux/mls` + if [ "$MLS" == "x1" ] + then + SUFFIX=":s0" + fi # Verify that test_nocreate_t cannot create # a subdirectory with a different type. # Should fail on create check to the new type. - runcon -t test_nocreate_t -- mkdir --context=system_u:object_r:test_create_dir_t $SELINUXTMPDIR/test_dir/test4 2>&1 + runcon -t test_nocreate_t -- mkdir --context=system_u:object_r:test_create_dir_t$SUFFIX $SELINUXTMPDIR/test_dir/test4 2>&1 RC=$? if [ $RC -ne 0 ] then
Index: testcases/kernel/security/selinux-testsuite/tests/relabel/selinux_relabel.sh
===================================================================
RCS file: /cvsroot/ltp/ltp/testcases/kernel/security/selinux-testsuite/tests/relabel/selinux_relabel.sh,v retrieving revision 1.4
kernel/security/selinux-testsuite/tests/relabel/selinux_relabel.sh +1 -1
@@ -31,7 +31,7 @@ RC=0 # Verify that test_relabel_t can relabel the file. - runcon -t test_relabel_t chcon system_u:object_r:test_relabel_newtype_t $SELINUXTMPDIR/test_file 2>&1 + runcon -t test_relabel_t chcon -t test_relabel_newtype_t $SELINUXTMPDIR/test_file 2>&1 RC=$? if [ $RC -eq 0 ] then
Index: testcases/kernel/security/selinux-testsuite/tests/rename/selinux_rename.sh
===================================================================
RCS file: /cvsroot/ltp/ltp/testcases/kernel/security/selinux-testsuite/tests/rename/selinux_rename.sh,v retrieving revision 1.4
kernel/security/selinux-testsuite/tests/rename/selinux_rename.sh +6 -3
@@ -19,15 +19,18 @@ chcon -t test_file_t $SELINUXTMPDIR # Create the source and destination test directories for the rename. - mkdir --context=system_u:object_r:test_rename_src_dir_t $SELINUXTMPDIR/src_dir 2>&1 - mkdir --context=system_u:object_r:test_rename_dst_dir_t $SELINUXTMPDIR/dst_dir 2>&1 + mkdir $SELINUXTMPDIR/src_dir + chcon -t test_rename_src_dir_t $SELINUXTMPDIR/src_dir + mkdir $SELINUXTMPDIR/dst_dir + chcon -t test_rename_dst_dir_t $SELINUXTMPDIR/dst_dir # Create a test file to try renaming. touch $SELINUXTMPDIR/src_dir/test_file chcon -t test_rename_file_t $SELINUXTMPDIR/src_dir/test_file # Create a test directory to try renaming. - mkdir --context=system_u:object_r:test_rename_dir_t $SELINUXTMPDIR/src_dir/test_dir + mkdir $SELINUXTMPDIR/src_dir/test_dir + chcon -t test_rename_dir_t $SELINUXTMPDIR/src_dir/test_dir }
Index: testcases/kernel/security/selinux-testsuite/tests/rxdir/selinux_rxdir.sh
===================================================================
RCS file: /cvsroot/ltp/ltp/testcases/kernel/security/selinux-testsuite/tests/rxdir/selinux_rxdir.sh,v retrieving revision 1.4
kernel/security/selinux-testsuite/tests/rxdir/selinux_rxdir.sh +2 -1
@@ -20,7 +20,8 @@ # Create a test dir with the test_rxdir_dir_t type # for use in the tests. - mkdir --context=system_u:object_r:test_rxdir_dir_t $SELINUXTMPDIR/test_dir + mkdir $SELINUXTMPDIR/test_dir + chcon -t test_rxdir_dir_t $SELINUXTMPDIR/test_dir # Touch a file in the directory. touch $SELINUXTMPDIR/test_dir/test_file
Signature · 8 lines
Stephen Smalley National Security Agency -- This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.
Re: [PATCH] Fix MLS handling in selinux tests
Quoted 7 lines · Stephen Smalley
Some of the selinux tests were using full security contexts but predated MCS/MLS and thus lacked a MLS field. This broke testing if MLS was enabled in the policy but mcstransd was not running. Change some of the tests to avoid the need to use full contexts at all, and others to conditionally append a MLS suffix if MLS is enabled.
Signed-off-by Stephen Smalley <[email protected]>
Thanks. Merged.
Regards--
Subrata
Quoted 125 lines
testcases/kernel/security/selinux-testsuite/tests/file/selinux_file.sh | 2 - testcases/kernel/security/selinux-testsuite/tests/mkdir/selinux_mkdir.sh | 16 ++++++++-- testcases/kernel/security/selinux-testsuite/tests/relabel/selinux_relabel.sh | 2 - testcases/kernel/security/selinux-testsuite/tests/rename/selinux_rename.sh | 9 +++-- testcases/kernel/security/selinux-testsuite/tests/rxdir/selinux_rxdir.sh | 3 + 5 files changed, 24 insertions(+), 8 deletions(-)Index:
testcases/kernel/security/selinux-testsuite/tests/file/selinux_file.sh
===================================================================
RCS file: /cvsroot/ltp/ltp/testcases/kernel/security/selinux-testsuite/tests/file/selinux_file.sh,v retrieving revision 1.5
diff -u -r1.5selinux_file.shkernel/security/selinux-testsuite/tests/file/selinux_file.sh +1
-1@@ -53,7 +53,7 @@ # # Get the SID of the good file. # - good_file_sid="system_u:object_r:fileop_file_t" + good_file_sid=`ls -Z $SELINUXTMPDIR/temp_file | awk '{print $4}'` } test01()Index:
testcases/kernel/security/selinux-testsuite/tests/mkdir/selinux_mkdir.sh
===================================================================
RCS file: /cvsroot/ltp/ltp/testcases/kernel/security/selinux-testsuite/tests/mkdir/selinux_mkdir.sh,v retrieving revision 1.4
diff -u -r1.4selinux_mkdir.shkernel/security/selinux-testsuite/tests/mkdir/selinux_mkdir.sh +14
-2@@ -89,12 +89,18 @@ TCID="test04" TST_COUNT=4 RC=0 + SUFFIX="" + MLS=x`cat /selinux/mls` + if [ "$MLS" == "x1" ] + then + SUFFIX=":s0" + fi # Verify that test_create_t can create a subdirectory # with a different type. # This requires add_name to test_mkdir_dir_t and create # to test_create_dir_t. - runcon -t test_create_t -- mkdir --context=system_u:object_r:test_create_dir_t $SELINUXTMPDIR/test_dir/test3 2>&1 + runcon -t test_create_t -- mkdir --context=system_u:object_r:test_create_dir_t$SUFFIX $SELINUXTMPDIR/test_dir/test3 2>&1 RC=$? if [ $RC -eq 0 ] then@@ -110,11 +116,17 @@ TCID="test05" TST_COUNT=5 RC=0 + SUFFIX="" + MLS=x`cat /selinux/mls` + if [ "$MLS" == "x1" ] + then + SUFFIX=":s0" + fi # Verify that test_nocreate_t cannot create # a subdirectory with a different type. # Should fail on create check to the new type. - runcon -t test_nocreate_t -- mkdir --context=system_u:object_r:test_create_dir_t $SELINUXTMPDIR/test_dir/test4 2>&1 + runcon -t test_nocreate_t -- mkdir --context=system_u:object_r:test_create_dir_t$SUFFIX $SELINUXTMPDIR/test_dir/test4 2>&1 RC=$? if [ $RC -ne 0 ] thenIndex:
testcases/kernel/security/selinux-testsuite/tests/relabel/selinux_relabel.sh
===================================================================
RCS file: /cvsroot/ltp/ltp/testcases/kernel/security/selinux-testsuite/tests/relabel/selinux_relabel.sh,v retrieving revision 1.4
diff -u -r1.4selinux_relabel.shkernel/security/selinux-testsuite/tests/relabel/selinux_relabel.sh +1
-1@@ -31,7 +31,7 @@ RC=0 # Verify that test_relabel_t can relabel the file. - runcon -t test_relabel_t chcon system_u:object_r:test_relabel_newtype_t $SELINUXTMPDIR/test_file 2>&1 + runcon -t test_relabel_t chcon -t test_relabel_newtype_t $SELINUXTMPDIR/test_file 2>&1 RC=$? if [ $RC -eq 0 ] thenIndex:
testcases/kernel/security/selinux-testsuite/tests/rename/selinux_rename.sh
===================================================================
RCS file: /cvsroot/ltp/ltp/testcases/kernel/security/selinux-testsuite/tests/rename/selinux_rename.sh,v retrieving revision 1.4
diff -u -r1.4selinux_rename.shkernel/security/selinux-testsuite/tests/rename/selinux_rename.sh +6
-3@@ -19,15 +19,18 @@ chcon -t test_file_t $SELINUXTMPDIR # Create the source and destination test directories for the rename. - mkdir --context=system_u:object_r:test_rename_src_dir_t $SELINUXTMPDIR/src_dir 2>&1 - mkdir --context=system_u:object_r:test_rename_dst_dir_t $SELINUXTMPDIR/dst_dir 2>&1 + mkdir $SELINUXTMPDIR/src_dir + chcon -t test_rename_src_dir_t $SELINUXTMPDIR/src_dir + mkdir $SELINUXTMPDIR/dst_dir + chcon -t test_rename_dst_dir_t $SELINUXTMPDIR/dst_dir # Create a test file to try renaming. touch $SELINUXTMPDIR/src_dir/test_file chcon -t test_rename_file_t $SELINUXTMPDIR/src_dir/test_file # Create a test directory to try renaming. - mkdir --context=system_u:object_r:test_rename_dir_t $SELINUXTMPDIR/src_dir/test_dir + mkdir $SELINUXTMPDIR/src_dir/test_dir + chcon -t test_rename_dir_t $SELINUXTMPDIR/src_dir/test_dir }Index:
testcases/kernel/security/selinux-testsuite/tests/rxdir/selinux_rxdir.sh
===================================================================
RCS file: /cvsroot/ltp/ltp/testcases/kernel/security/selinux-testsuite/tests/rxdir/selinux_rxdir.sh,v retrieving revision 1.4
diff -u -r1.4selinux_rxdir.sh
kernel/security/selinux-testsuite/tests/rxdir/selinux_rxdir.sh line 27
Quoted 9 lines
kernel/security/selinux-testsuite/tests/rxdir/selinux_rxdir.sh +2
-1@@ -20,7 +20,8 @@ # Create a test dir with the test_rxdir_dir_t type # for use in the tests. - mkdir --context=system_u:object_r:test_rxdir_dir_t $SELINUXTMPDIR/test_dir + mkdir $SELINUXTMPDIR/test_dir + chcon -t test_rxdir_dir_t $SELINUXTMPDIR/test_dir # Touch a file in the directory. touch $SELINUXTMPDIR/test_dir/test_file
--
This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 31 lines · Stephen Smalley
Quoted 21 lines · Subrata Modak
Quoted 20 lines · Jiří Paleček
Quoted 16 lines · Stephen Smalley
Quoted 11 lines · Jiří Paleček
Quoted 6 lines · Stephen Smalley
Quoted 3 lines · Subrata Modak
Stephen,
Would you like to say something about the following Patch ?
Yes, it breaks the selinux testsuite for me. Please revert.
How exactly does it break it?
Running it via
test_selinux.shwas generating errors like:
cd: /testcases/bin: No such file or directory
in selinux.outfile, producing a couple bogus FAILs.Quoted 8 lines
Quoted 3 lines
This is probably caused by the line setting LTPBIN (which shouldn't have been there in the first place, my fault), does the attached patch fix it for you?
Nether applied this nor reverted the earlier one in this thread, as conclusion is yet to be made. But, i have to push the release today as i am going for a vacation for a couple of days. But, please send me the cleanups on consensus. I will do the needful when i return.
Quoted 8 lines
If you apply the re-based patch that I posted in response to his, then at least that problem is solved - no need to revert his original patch.
I'd like to fork the refpolicy directory so that we can stop maintaining diffs under selinux-testsuite/misc/ for post-rhel5 changes. So if you could create a copy of refpolicy under selinux-testsuite, say "rhel5-refpolicy", and cvs add that to the tree, then we can work from there.
Actually, I think I'd like to have a tree of test policies, e.g. refpolicy/trunk (test policy relative to refpolicy trunk) refpolicy/redhat/5 (test policy relative to rhel5) refpolicy/fedora/10 (test policy relative to fedora 10) refpolicy/debian/5 (test policy relative to debian 5.0)
Only I'm not sure we necessarily want one for every fedora release due to their short life cycles. But it looks like the test policy for f11 will be different than f10 (I have a patch to at least get it to build without warnings, but am still working through some test failures on f11).
Signature · 8 lines
Stephen Smalley National Security Agency -- This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.
Quoted 47 lines · Stephen Smalley
Quoted 31 lines · Stephen Smalley
Quoted 21 lines · Subrata Modak
Quoted 20 lines · Jiří Paleček
Quoted 16 lines · Stephen Smalley
Quoted 11 lines · Jiří Paleček
Quoted 6 lines · Stephen Smalley
Quoted 3 lines · Subrata Modak
Stephen,
Would you like to say something about the following Patch ?
Yes, it breaks the selinux testsuite for me. Please revert.
How exactly does it break it?
Running it via
test_selinux.shwas generating errors like:
cd: /testcases/bin: No such file or directory
in selinux.outfile, producing a couple bogus FAILs.Quoted 8 lines
Quoted 3 lines
This is probably caused by the line setting LTPBIN (which shouldn't have been there in the first place, my fault), does the attached patch fix it for you?
Nether applied this nor reverted the earlier one in this thread, as conclusion is yet to be made. But, i have to push the release today as i am going for a vacation for a couple of days. But, please send me the cleanups on consensus. I will do the needful when i return.
Quoted 8 lines
If you apply the re-based patch that I posted in response to his, then at least that problem is solved - no need to revert his original patch.
I'd like to fork the refpolicy directory so that we can stop maintaining diffs under selinux-testsuite/misc/ for post-rhel5 changes. So if you could create a copy of refpolicy under selinux-testsuite, say "rhel5-refpolicy", and cvs add that to the tree, then we can work from there.
Actually, I think I'd like to have a tree of test policies, e.g. refpolicy/trunk (test policy relative to refpolicy trunk) refpolicy/redhat/5 (test policy relative to rhel5) refpolicy/fedora/10 (test policy relative to fedora 10) refpolicy/debian/5 (test policy relative to debian 5.0)
Quoted 5 lines
Only I'm not sure we necessarily want one for every fedora release due to their short life cycles. But it looks like the test policy for f11 will be different than f10 (I have a patch to at least get it to build without warnings, but am still working through some test failures on f11).
Ok, I now have the selinux testsuite working on both f10 and f11 and have set up a separate subdirectory to keep a legacy copy of the test policy for rhel5. I'll send a patch under separate cover.
Signature · 8 lines
Stephen Smalley National Security Agency -- This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.