1
0
mirror of git://git.sv.gnu.org/coreutils.git synced 2026-04-13 23:36:10 +02:00
Files
coreutils/tests/misc/chcon-fail

28 lines
438 B
Bash
Executable File

#!/bin/sh
# Ensure that chcon fails when it should.
# These tests don't use any actual SE Linux syscalls.
if test "$VERBOSE" = yes; then
set -x
chcon --version
fi
. $srcdir/test-lib.sh
fail=0
# neither context nor file
chcon 2> /dev/null && fail=1
# No file
chcon CON 2> /dev/null && fail=1
# No file
touch f
chcon --reference=f 2> /dev/null && fail=1
# No file
chcon -u anyone 2> /dev/null && fail=1
(exit $fail); exit $fail