| 1 |
#! /bin/sh |
| 2 |
set -e |
| 3 |
|
| 4 |
dir=$(pwd)/debian/tests |
| 5 |
. $dir/textutils.sh |
| 6 |
|
| 7 |
frame "Here we are testing the patch" \ |
| 8 |
"features/dry-run.patch" \ |
| 9 |
"New crontab options -h and -n should be implemented implemented" |
| 10 |
|
| 11 |
echo "================= adding user 'dummy' =====================" |
| 12 |
getent passwd dummy || adduser --disabled-password --gecos "" dummy |
| 13 |
|
| 14 |
|
| 15 |
echo "========== testing that option -h is implemented' =============" |
| 16 |
|
| 17 |
# crontab -h has return code 1, exactly as crontab -foo :( |
| 18 |
|
| 19 |
if su dummy -c "crontab -h" 2>&1 | grep -q "unrecognized option"; then |
| 20 |
abort "-h unrecognised option" |
| 21 |
fi |
| 22 |
|
| 23 |
echo "========== testing that option -n is implemented' =============" |
| 24 |
|
| 25 |
echo "* * * * * /bin/ls" > somefile |
| 26 |
su dummy -c "crontab -n somefile" |
| 27 |
rm somefile |
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
frame "Now we test features/Prompt-on-crontab-deletion.patch" |
| 32 |
|
| 33 |
echo "========== testing that option -i is implemented' =============" |
| 34 |
|
| 35 |
if su dummy -c "crontab -i -r " 2>&1 | grep -q "unrecognized option"; then |
| 36 |
abort "-i unrecognised option" |
| 37 |
fi |
| 38 |
|
| 39 |
echo "========== test ok =========================================" |
| 40 |
|