Debian Codegraph @

debian/tests/step-size-out-of-bound

raw
1 #! /bin/sh
2
3 set -e
4
5 dir=$(pwd)/debian/tests
6 . $dir/textutils.sh
7
8 frame "Here we are testing the patch" \
9 "fixes/Step-size_out_of_bound_handling.patch"
10
11 echo "================= adding user 'dummy' ====================="
12 getent passwd dummy || adduser --disabled-password --gecos "" dummy
13
14 echo "========= make user 'dummy' fill his crontab =============="
15
16 # stderr is redirected towards stdout so the variable warning can catch it
17 warning=$(su dummy -c "(export LINES=' * */25 * * * echo hello'; EDITOR=$(pwd)/debian/tests/cronfiller.py crontab -e)" 2>&1 | grep Warning)
18
19 echo "====== check that */25 is disallowed in crontabs =========="
20 expected="Warning: Step size 25 higher than possible maximum of 23"
21 (echo "$warning" | grep -q "$expected") || (echo "variable warning = $warning"; \
22 echo "The expected warning about out-of-bound steps was not issued" >&2)
23