fix tests

This commit is contained in:
Robin Raymond 2018-02-18 12:57:06 +01:00
parent 436cf0513b
commit fd3754f43d
1 changed files with 13 additions and 10 deletions

View File

@ -73,6 +73,14 @@ import <nixpkgs/nixos/tests/make-test.nix> {
'';
mode = "0700";
};
"root/.fetchmailRcLowQuota" = {
text = ''
poll ${serverIP} with proto IMAP
user 'lowquota\@example.com' there with password 'user1' is 'root' here
mda procmail
'';
mode = "0700";
};
"root/.procmailrc" = {
text = "DEFAULT=$HOME/mail";
};
@ -232,15 +240,10 @@ import <nixpkgs/nixos/tests/make-test.nix> {
subtest "quota", sub {
$client->execute("rm ~/mail/*");
$client->execute("mv ~/.fetchmailRcLowQuota ~/.fetchmailrc");
$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");
$client->succeed("msmtp -a test3 --tls=on --tls-certcheck=off --auth=on lowquota\@example.com < /etc/root/email2 >&2");
$server->waitUntilFails('[ "$(postqueue -p)" != "Mail queue is empty" ]');
# fetchmail returns EXIT_CODE 0 when it retrieves mail
$client->fail("fetchmail -v");