2 # Test SELinux-related options.
4 if test "$VERBOSE" = yes; then
16 skip_if_mcstransd_is_running_
18 # Create a regular file, dir, fifo.
19 touch f || framework_failure
20 mkdir d s1 s2 || framework_failure
21 mkfifo p || framework_failure
25 # special context that works both with and without mcstransd
26 ctx
=root
:object_r
:tmp_t
:s0
29 skip_test_
'"chcon '$ctx' ..." failed'
31 # inspect that context with both ls -Z and stat.
33 c
=`ls -dogZ $i|cut -d' ' -f3`; test x
$c = x
$ctx || fail
=1
34 c
=`stat --printf %C $i`; test x
$c = x
$ctx || fail
=1
37 # ensure that ls -l output includes the ".".
38 c
=`ls -l f|cut -c11`; test "$c" = . || fail
=1
40 # Copy each to a new directory and ensure that context is preserved.
41 cp -r --preserve=all d f p s1 || fail
=1
43 c
=`stat --printf %C s1/$i`; test x
$c = x
$ctx || fail
=1
46 # Now, move each to a new directory and ensure that context is preserved.
49 c
=`stat --printf %C s2/$i`; test x
$c = x
$ctx || fail
=1