diff options
author | Jörg Thalheim <Mic92@users.noreply.github.com> | 2018-04-21 19:55:23 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-21 19:55:23 +0100 |
commit | dc0653f54f968ec4b362b3aec4db8d0dd426aeb3 (patch) | |
tree | 29cc851984781c688963ab5c5936d5445aad92c8 /nixos/tests | |
parent | 6f3b4bc14b3add5ec7649e27a0175ffe2aa72dc8 (diff) | |
parent | 4fddb8b9c3ee137f45ce3d3f79d5fb66c80843a0 (diff) | |
download | nixlib-dc0653f54f968ec4b362b3aec4db8d0dd426aeb3.tar nixlib-dc0653f54f968ec4b362b3aec4db8d0dd426aeb3.tar.gz nixlib-dc0653f54f968ec4b362b3aec4db8d0dd426aeb3.tar.bz2 nixlib-dc0653f54f968ec4b362b3aec4db8d0dd426aeb3.tar.lz nixlib-dc0653f54f968ec4b362b3aec4db8d0dd426aeb3.tar.xz nixlib-dc0653f54f968ec4b362b3aec4db8d0dd426aeb3.tar.zst nixlib-dc0653f54f968ec4b362b3aec4db8d0dd426aeb3.zip |
Merge pull request #38816 from Ekleog/dovecot-lda-test
dovecot module: test dovecot's LDA
Diffstat (limited to 'nixos/tests')
-rw-r--r-- | nixos/tests/dovecot.nix | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/nixos/tests/dovecot.nix b/nixos/tests/dovecot.nix index 3814855ed8e7..156079d1d585 100644 --- a/nixos/tests/dovecot.nix +++ b/nixos/tests/dovecot.nix @@ -18,6 +18,18 @@ import ./make-test.nix { MAIL ''; + sendTestMailViaDeliveryAgent = pkgs.writeScriptBin "send-lda" '' + #!${pkgs.stdenv.shell} + + exec ${pkgs.dovecot}/libexec/dovecot/deliver -d bob <<MAIL + From: root@localhost + To: bob@localhost + Subject: Something else... + + I'm running short of ideas! + MAIL + ''; + testImap = pkgs.writeScriptBin "test-imap" '' #!${pkgs.python3.interpreter} import imaplib @@ -39,24 +51,25 @@ import ./make-test.nix { pop = poplib.POP3('localhost') try: - pop.user('alice') + pop.user('bob') pop.pass_('foobar') assert len(pop.list()[1]) == 1 status, fullmail, size = pop.retr(1) assert status.startswith(b'+OK ') body = b"".join(fullmail[fullmail.index(b""):]).strip() - assert body == b'Hello world!' + assert body == b"I'm running short of ideas!" finally: pop.quit() ''; - in [ sendTestMail testImap testPop ]; + in [ sendTestMail sendTestMailViaDeliveryAgent testImap testPop ]; }; testScript = '' $machine->waitForUnit('postfix.service'); $machine->waitForUnit('dovecot2.service'); $machine->succeed('send-testmail'); + $machine->succeed('send-lda'); $machine->waitUntilFails('[ "$(postqueue -p)" != "Mail queue is empty" ]'); $machine->succeed('test-imap'); $machine->succeed('test-pop'); |