]> git.ipfire.org Git - thirdparty/mlmmj.git/commitdiff
mlmmj-sub: add a test for auto unsubscription on subscruption
authorBaptiste Daroussin <bapt@FreeBSD.org>
Wed, 8 Dec 2021 16:29:38 +0000 (17:29 +0100)
committerBaptiste Daroussin <bapt@FreeBSD.org>
Wed, 8 Dec 2021 16:29:38 +0000 (17:29 +0100)
tests/mlmmj-sub.sh

index 6d513b4e36ea74a306ba304c7bc7200d296ae1e6..d02c9a2d59e88a708bac14cccf474fa0fb15eeba 100644 (file)
@@ -7,6 +7,7 @@ tests_init \
        add_normal_owner \
        add_nomail \
        add_digest \
+       add_normal_then_nomail \
        remove_normal \
        remove_normal_owner \
        remove_nomail \
@@ -24,6 +25,20 @@ add_normal_body()
        atf_check -o inline:"john@doe.org\njane@doe.org\n" cat ml/subscribers.d/j
 }
 
+add_normal_then_nomail_body()
+{
+       init_ml ml
+       mlmmjsub=$(command -v mlmmj-sub)
+       echo test@mlmmjtest > ml/control/listaddress
+       atf_check -s exit:0 $mlmmjsub -L ml -a john@doe.org
+       atf_check -o inline:"john@doe.org\n" cat ml/subscribers.d/j
+       atf_check -s exit:0 $mlmmjsub -L ml -n -a john@doe.org
+       atf_check -o inline:"john@doe.org\n" cat ml/nomailsubs.d/j
+       if [ -f ml/subscribers.d/j ]; then
+               atf_fail "John Doe still subscribed"
+       fi
+}
+
 add_normal_owner_body()
 {
        init_ml ml