From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36671) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1etqrM-0006m8-FH for guix-patches@gnu.org; Thu, 08 Mar 2018 03:25:09 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1etqrG-0005De-II for guix-patches@gnu.org; Thu, 08 Mar 2018 03:25:08 -0500 Received: from debbugs.gnu.org ([208.118.235.43]:42247) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1etqrG-0005DW-Cl for guix-patches@gnu.org; Thu, 08 Mar 2018 03:25:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1etqrG-0006NS-6F for guix-patches@gnu.org; Thu, 08 Mar 2018 03:25:02 -0500 Subject: [bug#30744] [PATCH] tests: mail: Add test for dovecot. Resent-Message-ID: From: Oleg Pykhalov References: <20180307213030.30466-1-go.wigust@gmail.com> <20180307213243.31064-1-go.wigust@gmail.com> <87371bsbnu.fsf@lassieur.org> Date: Thu, 08 Mar 2018 11:24:45 +0300 In-Reply-To: <87371bsbnu.fsf@lassieur.org> ("=?UTF-8?Q?Cl=C3=A9ment?= Lassieur"'s message of "Thu, 08 Mar 2018 00:34:13 +0100") Message-ID: <87po4fug8i.fsf@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: =?UTF-8?Q?Cl=C3=A9ment?= Lassieur Cc: 30744@debbugs.gnu.org --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hello Cl=C3=A9ment, Cl=C3=A9ment Lassieur writes: > Oleg Pykhalov writes: > >> * gnu/tests/mail.scm (%dovecot-os, %test-dovecot): New variables. >> (run-dovecot-test): New procedure. >> --- >> gnu/tests/mail.scm | 113 ++++++++++++++++++++++++++++++++++++++++++++++= ++++++- >> 1 file changed, 112 insertions(+), 1 deletion(-) > > Thank you for these patches! Thank you for review! [=E2=80=A6] >> + (sleep 1) ; give the service time to start talking > > Here, it would probably be safer to wait for the PID file to arrive. > You could use 'wait-for-file' for this, there are examples in other > tests. Dovecot's PID file is /var/run/dovecot/master.pid. OK. >> + (test-eq "accept an email" >> + #t > > Could you use 'test-assert' here? OK. [=E2=80=A6] >> + ;; Get a message ID >> + (string->number >> + (match (scandir "/home/alice/Maildir/TESTBOX/new/") >> + ((_ _ message) > > Could you write "." ".." here instead of _ _? It makes it easier to > understand the code. Seems it's not possible for ".": =2D-8<---------------cut here---------------start------------->8--- natsu@magnolia ~/src/guix$ ./pre-inst-env make check-system TESTS=3D"doveco= t" Compiling Scheme modules... LOAD gnu/tests/mail.scm ERROR: In procedure read: In procedure scm_i_lreadparen: gnu/tests/mail.scm:378:28: missing close par= en make: *** [Makefile:5227: make-go] Error 1 =2D-8<---------------cut here---------------end--------------->8--- WDYT about replacing "." (or first =E2=80=98_=E2=80=99) with =E2=80=98cwd= =E2=80=99? I also rename =E2=80=98message=E2=80=99 to =E2=80=98message-file=E2=80=99 i= f you don't mind. So in the end we will have =E2=80=98(match =E2=80=A6 (cwd .. message-file) = =E2=80=A6)=E2=80=99. >> + (match (string-split message #\.) >> + ((message-id _ _) message-id)))))) > > Here I think it would be great to compare the arrived message and the > sent message to check that they are the same. If they are the same, > then the test succeeds. WDYT? OK. I'll attach the patch after this email. Oleg. --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEc+OyAXw1EaDPCmAPckbhHGm3lWkFAlqg800ACgkQckbhHGm3 lWnpIw/+KSk7XjwCYdR0GMSTvl18HPNMBo5Bs54pF4nvvMO1+ykkiY7FoONCvE4i mwyldAPs9bGX7ykaoPF4ObVm5fgb7HyJoEcaRWIwWObLIMY38bR5Cs2C0N28H0YB fdtvOigpVsU6dRLOIZ2T5F/oXpCxjT9ptcMjkCVHrct6TCcLfCacF/ZjGd6RjYFC 7WtArWce8xmhuQYMcqlUkSGl9UYBiOKXDtOMBWxDvfNPeYH0MSHUUa1BY4RshRqW QJUgyBoiEaNHdeWY7ozEizJF28f0Uylk7CrlJuxeIKPp7w5ZnfVYDY6MwPVZoc87 pceSsAK2TmUTv9QrE2dZwxU7TqUpjIWxYxzKiQDhIGAdeIapshZZY5FRZ6AyYhqs fFiyNnHvnTb5QlautXwCr+bpBDDAlh0HuWzmfpvWWqk8prYNKN7GW3RD1vvLT7aZ 3SX3boR8fAXRlQkCW089c4OejbOx0FQ1OLlu7hspauLOBCZA1qCwyMjGJEHRfzmZ Q8pVm7WuW3AquQDgfJ5BBo5cMGAieLNmLN2/MUbmdvLhMLsnG+Z/QaZ1nQUw8xTq WDIA9gkj0KEKcBGzo83HxEnV2OuFsUNOJEdNKz5Li4l1xwoub7VxtOYA7vkRlRn9 Ohrx+CpvkKO3XjF4VgMPnPGzyNQzkRYQe554XqZsvkQByKPu1D0= =yJH9 -----END PGP SIGNATURE----- --=-=-=--