summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobin Raymond <robin@robinraymond.de>2017-12-22 16:58:49 +0100
committerRobin Raymond <robin@robinraymond.de>2017-12-22 16:58:49 +0100
commit6dd51d6e8835ddbaf1be495188ae7fe69a22bb8d (patch)
tree60ead9b2ba85e21f757a951566061903530a4e85
parenteeb7fd64afa0203d537eb903519b77971ac56e02 (diff)
add quota testv2.1-rc1
-rw-r--r--tests/extern.nix27
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/extern.nix b/tests/extern.nix
index 28fff3b..d407a5d 100644
--- a/tests/extern.nix
+++ b/tests/extern.nix
@@ -25,6 +25,7 @@ import <nixpkgs/nixos/tests/make-test.nix> {
mailserver = {
enable = true;
+ debug = true;
fqdn = "mail.example.com";
domains = [ "example.com" "example2.com" ];
@@ -41,6 +42,10 @@ import <nixpkgs/nixos/tests/make-test.nix> {
"user@example2.com" = {
hashedPassword = "$6$u61JrAtuI0a$nGEEfTP5.eefxoScUGVG/Tl0alqla2aGax4oTd85v3j3xSmhv/02gNfSemv/aaMinlv9j/ZABosVKBrRvN5Qv0";
};
+ "lowquota@example.com" = {
+ hashedPassword = "$6$u61JrAtuI0a$nGEEfTP5.eefxoScUGVG/Tl0alqla2aGax4oTd85v3j3xSmhv/02gNfSemv/aaMinlv9j/ZABosVKBrRvN5Qv0";
+ quota = "1B";
+ };
};
enableImap = true;
@@ -62,6 +67,12 @@ import <nixpkgs/nixos/tests/make-test.nix> {
user 'user1\@example.com' there with password 'user1' is 'root' here
mda procmail
'';
+ fetchmailRcLowQuota =
+ ''
+ poll SERVER with proto IMAP
+ user 'lowquota\@example.com' there with password 'user1' is 'root' here
+ mda procmail
+ '';
procmailRc =
''
@@ -231,6 +242,22 @@ import <nixpkgs/nixos/tests/make-test.nix> {
$client->fail("fetchmail -v");
};
+ subtest "quota", sub {
+ $client->succeed("rm mail.txt");
+
+ $client->succeed("echo '${fetchmailRcLowQuota}' > ~/.fetchmailrc");
+ $client->succeed("sed -i s/SERVER/`getent hosts server | awk '{ print \$1 }'`/g ~/.fetchmailrc");
+
+ $client->succeed("chmod 0700 ~/.fetchmailrc");
+ $client->succeed("echo '${email2}' > mail.txt");
+ # send email from chuck to non exsitent account
+ $client->succeed("msmtp -a test3 --tls=on --tls-certcheck=off --auth=on lowquota\@example.com < mail.txt >&2");
+ $client->succeed("sleep 5");
+ # fetchmail returns EXIT_CODE 0 when it retrieves mail
+ $client->fail("fetchmail -v");
+
+ };
+
'';