unsub_bouncers_8 \
unsub_bouncers_9 \
unsub_bouncers_10 \
- basics
+ basics_0 \
+ basics_1 \
+ basics_2 \
+ basics_3 \
+ basics_4 \
+ basics_5 \
+ basics_6 \
+ basics_7 \
+ basics_8 \
+ basics_9 \
+ basics_10 \
+ basics_11
nolongerbouncing_body()
{
atf_check -s exit:0 -o empty -e empty test -f $f2
}
-basics_body()
+basics_0_body()
{
-
mlmmjmaintd=$(command -v mlmmj-maintd)
+ mkdir lists
+ init_ml lists/ml
+
helptxt="Usage: $mlmmjmaintd [-L | -d] /path/to/dir [-F]
-d: Full path to directory with listdirs
Use this to run maintenance on all list directories
This option should be used when one wants to
avoid running another daemon, and use e.g. cron to control it instead.
"
- mkdir lists
- init_ml lists/ml
atf_check -s exit:1 -e "inline:mlmmj-maintd: You have to specify -d or -L\n$mlmmjmaintd -h for help\n" $mlmmjmaintd
atf_check -s exit:1 -e "inline:mlmmj-maintd: You have to specify either -d or -L\n$mlmmjmaintd -h for help\n" $mlmmjmaintd -L lists/ml -d .
atf_check -s exit:0 -o "match:mlmmj-maintd version" $mlmmjmaintd -V
atf_check -s exit:0 -o "inline:$helptxt" $mlmmjmaintd -h
+}
+
+basics_1_body()
+{
+ mlmmjmaintd=$(command -v mlmmj-maintd)
+ mkdir lists
+ init_ml lists/ml
echo test@mlmmjtest > lists/ml/control/listaddress
+
atf_check -s exit:1 -e match:"Could not open the directory containing mailing lists.*: No such file or directory" $mlmmjmaintd -F -d nonexisting
+}
+
+basics_2_body()
+{
+ mlmmjmaintd=$(command -v mlmmj-maintd)
+ mkdir lists
+ init_ml lists/ml
+ echo test@mlmmjtest > lists/ml/control/listaddress
+
chmod -w lists/ml
atf_check -s exit:0 -e match:"Could not open maintdlog.* Permission denied" $mlmmjmaintd -F -L lists/ml
- chmod +w lists/ml
+}
+
+basics_3_body()
+{
+ mlmmjmaintd=$(command -v mlmmj-maintd)
+ mkdir lists
+ init_ml lists/ml
+ echo test@mlmmjtest > lists/ml/control/listaddress
+
atf_check -s exit:0 $mlmmjmaintd -L lists/ml -F
output="Starting maintenance run at
"
atf_check -o "inline:$output" sed -e "s/at .*/at/" lists/ml/mlmmj-maintd.lastrun.log
rm lists/ml/*.log
+}
+
+basics_4_body()
+{
+ mlmmjmaintd=$(command -v mlmmj-maintd)
+ mkdir lists
+ init_ml lists/ml
+ echo test@mlmmjtest > lists/ml/control/listaddress
+
+ output="Starting maintenance run at
+
+clean_moderation
+clean_discarded
+clean_subconf
+clean_unsubconf
+resend_queue
+resend_requeue
+clean_nolongerbouncing
+unsub_bouncers
+probe_bouncers
+run_digests
+ - No readable index file: no digest
+"
atf_check -s exit:0 $mlmmjmaintd -d lists -F
atf_check -o "inline:$output" sed -e "s/at .*/at/" lists/ml/mlmmj-maintd.lastrun.log
+}
+
+basics_5_body()
+{
+ mlmmjmaintd=$(command -v mlmmj-maintd)
+ mkdir lists
+ init_ml lists/ml
+ echo test@mlmmjtest > lists/ml/control/listaddress
+
rmdir lists/ml/queue/discarded
atf_check -s exit:0 -e match:"An error occured while cleaning discarded mails, see mlmmj-maintd.lastrun.log" $mlmmjmaintd -L lists/ml -F
output="Starting maintenance run at
- No readable index file: no digest
"
atf_check -o "inline:$output" sed -e "s/at .*/at/" lists/ml/mlmmj-maintd.lastrun.log
- mkdir lists/ml/queue/discarded
+}
+
+basics_6_body()
+{
+ mlmmjmaintd=$(command -v mlmmj-maintd)
+ mkdir lists
+ init_ml lists/ml
+ echo test@mlmmjtest > lists/ml/control/listaddress
rm -rf lists/ml/queue
atf_check -s exit:0 -e match:"An error occured while cleaning discarded mails, see mlmmj-maintd.lastrun.log" $mlmmjmaintd -L lists/ml -F
- No readable index file: no digest
"
atf_check -o "inline:$output" sed -e "s/at .*/at/" lists/ml/mlmmj-maintd.lastrun.log
- mkdir -p lists/ml/queue/discarded
+}
+
+basics_7_body()
+{
+ mlmmjmaintd=$(command -v mlmmj-maintd)
+ mkdir lists
+ init_ml lists/ml
+ echo test@mlmmjtest > lists/ml/control/listaddress
rm -rf lists/ml/requeue
atf_check -s exit:0 -e match:"An error occured while resending requeued mails, see mlmmj-maintd.lastrun.log" $mlmmjmaintd -L lists/ml -F
- No readable index file: no digest
"
atf_check -o "inline:$output" sed -e "s/at .*/at/" lists/ml/mlmmj-maintd.lastrun.log
- mkdir -p lists/ml/requeue
+}
+
+basics_8_body()
+{
+ mlmmjmaintd=$(command -v mlmmj-maintd)
+ mkdir lists
+ init_ml lists/ml
+ echo test@mlmmjtest > lists/ml/control/listaddress
rm -rf lists/ml/bounce
atf_check -s exit:0 -e match:"An error occured while cleaning no longer bouncing traces, see mlmmj-maintd.lastrun.log" $mlmmjmaintd -L lists/ml -F
- No readable index file: no digest
"
atf_check -o "inline:$output" sed -e "s/at .*/at/" lists/ml/mlmmj-maintd.lastrun.log
- mkdir -p lists/ml/bounce
+}
+
+basics_9_body()
+{
+ mlmmjmaintd=$(command -v mlmmj-maintd)
+ mkdir lists
+ init_ml lists/ml
+ echo test@mlmmjtest > lists/ml/control/listaddress
rm -rf lists/ml/subconf
atf_check -s exit:0 -e match:"An error occured while cleaning subscribtion confirmations, mails, see mlmmj-maintd.lastrun.log" $mlmmjmaintd -L lists/ml -F
- No readable index file: no digest
"
atf_check -o "inline:$output" sed -e "s/at .*/at/" lists/ml/mlmmj-maintd.lastrun.log
- mkdir -p lists/ml/subconf
+}
+
+basics_10_body()
+{
+ mlmmjmaintd=$(command -v mlmmj-maintd)
+ mkdir lists
+ init_ml lists/ml
+ echo test@mlmmjtest > lists/ml/control/listaddress
rm -rf lists/ml/unsubconf
atf_check -s exit:0 -e match:"An error occured while cleaning unsubscribtion confirmations, mails, see mlmmj-maintd.lastrun.log" $mlmmjmaintd -L lists/ml -F
- No readable index file: no digest
"
atf_check -o "inline:$output" sed -e "s/at .*/at/" lists/ml/mlmmj-maintd.lastrun.log
- mkdir -p lists/ml/unsubconf
+}
+
+basics_11_body()
+{
+ mlmmjmaintd=$(command -v mlmmj-maintd)
+ mkdir lists
+ init_ml lists/ml
+ echo test@mlmmjtest > lists/ml/control/listaddress
rm -rf lists/ml/moderation
atf_check -s exit:0 -e match:"An error occured while cleaning moderation, see mlmmj-maintd.lastrun.log" $mlmmjmaintd -L lists/ml -F
- No readable index file: no digest
"
atf_check -o "inline:$output" sed -e "s/at .*/at/" lists/ml/mlmmj-maintd.lastrun.log
- mkdir -p lists/ml/moderation
}
digests_body()