diff options
| author | Jim Meyering <meyering@redhat.com> | 2008-05-05 15:17:42 +0200 |
|---|---|---|
| committer | Jim Meyering <meyering@redhat.com> | 2008-05-06 08:21:30 +0200 |
| commit | d3dc29c0bef01d16918dfb3b792ef6ed674f7eb9 (patch) | |
| tree | 2e1dc9c8ae1083cccdc2e11b00c2c41a96a105bc /tests/misc/selinux | |
| parent | tests: translate uniq-z-test-adding code to new framework (diff) | |
| download | coreutils-d3dc29c0bef01d16918dfb3b792ef6ed674f7eb9.tar.gz coreutils-d3dc29c0bef01d16918dfb3b792ef6ed674f7eb9.zip | |
tests: skip another test if mcstransd is running
* tests/test-lib.sh (skip_if_mcstransd_is_running_): New function,
extracted from...
* tests/misc/chcon: ...here. Use function, not open-coded test.
* tests/misc/selinux: Use the function here, too.
Require root, not non-root.
* tests/Makefile.am (root_tests): Add misc/selinux.
Diffstat (limited to 'tests/misc/selinux')
| -rwxr-xr-x | tests/misc/selinux | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/tests/misc/selinux b/tests/misc/selinux index e94666492..87b3af250 100755 --- a/tests/misc/selinux +++ b/tests/misc/selinux @@ -11,8 +11,9 @@ if test "$VERBOSE" = yes; then fi . $top_srcdir/tests/test-lib.sh -skip_if_root_ +require_root_ require_selinux_ +skip_if_mcstransd_is_running_ # Create a regular file, dir, fifo. touch f || framework_failure @@ -21,10 +22,10 @@ mkfifo p || framework_failure fail=0 -ctx=root:object_r:tmp_t -# FIXME, what if $ctx is no different from the default. Not likely. -# give each a different context, via chcon -chcon $ctx f d p 2>/dev/null || +# special context that works both with and without mcstransd +ctx=root:object_r:tmp_t:s0 + +chcon $ctx f d p || skip_test_ '"chcon '$ctx' ..." failed' # inspect that context with both ls -Z and stat. |
