3 .
"${TEST_SCRIPTS_DIR}/unit.sh"
5 define_test
"TDB check, bad TDB multiple times"
9 db
="${CTDB_DBDIR}/foo.tdb.0"
14 _date
="[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]"
15 _time
="[0-9][0-9][0-9][0-9][0-9][0-9]"
16 _nanos
="[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]"
17 _date_time
="${_date}\.${_time}\.${_nanos}"
18 sed -e "s|\.${_date_time}\.|.DATE.TIME.|"
21 required_result_tdbcheck
()
24 WARNING: database ${db} is corrupted.
25 Moving to backup ${db}.DATE.TIME.corrupt for later analysis.
29 # List the corrupt databases
32 (cd "$CTDB_DBDIR" && ls foo.tdb
.0.
*.corrupt
)
35 # Required result is a list of up to 10 corrupt databases
36 required_result_num_corrupt
()
40 if [ "$_num" -gt 10 ] ; then
45 for _x
in $
(seq 1 $_num) ; do
47 }foo.tdb.0.DATE.TIME.corrupt"
53 for i
in $
(seq 1 15) ; do
55 required_result_tdbcheck
57 required_result_num_corrupt
"$i"
58 simple_test_command test_num_corrupt