Debian Codegraph @

tests/log/faillog/54_faillog-t-r_exclusive/faillog.test

raw
1 #!/bin/sh
2
3 set -e
4
5 cd $(dirname $0)
6
7 . ../../../common/config.sh
8 . ../../../common/log.sh
9
10 log_start "$0" "faillog does not accept -r and -t at the same time"
11
12 save_config
13
14 # restore the files on exit
15 trap 'log_status "$0" "FAILURE"; restore_config' 0
16
17 change_config
18
19 echo -n "Bad faillog usage (faillog -t -r)..."
20 faillog -t 1 -r 2>tmp/usage.out && exit 1 || {
21 status=$?
22 }
23 echo "OK"
24
25 echo -n "Check returned status ($status)..."
26 test "$status" = "2"
27 echo "OK"
28
29 echo "faillog reported:"
30 echo "======================================================================="
31 cat tmp/usage.out
32 echo "======================================================================="
33 echo -n "Check the usage message..."
34 diff -au data/usage.out tmp/usage.out
35 echo "usage message OK."
36 rm -f tmp/usage.out
37
38 log_status "$0" "SUCCESS"
39 restore_config
40 trap '' 0
41