tests: factor 350 fail=0 initializations into test-lib.sh
[platform/upstream/coreutils.git] / tests / misc / chcon-fail
1 #!/bin/sh
2 # Ensure that chcon fails when it should.
3 # These tests don't use any actual SE Linux syscalls.
4
5 if test "$VERBOSE" = yes; then
6   set -x
7   chcon --version
8 fi
9
10 . $srcdir/test-lib.sh
11
12
13 # neither context nor file
14 chcon 2> /dev/null && fail=1
15
16 # No file
17 chcon CON 2> /dev/null && fail=1
18
19 # No file
20 touch f
21 chcon --reference=f 2> /dev/null && fail=1
22
23 # No file
24 chcon -u anyone 2> /dev/null && fail=1
25
26 Exit $fail