From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46756) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ePnd1-0007xV-FW for guix-patches@gnu.org; Fri, 15 Dec 2017 05:54:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ePncx-0005mu-AG for guix-patches@gnu.org; Fri, 15 Dec 2017 05:54:07 -0500 Received: from debbugs.gnu.org ([208.118.235.43]:54283) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ePncx-0005jn-6T for guix-patches@gnu.org; Fri, 15 Dec 2017 05:54:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ePncv-00051B-NS for guix-patches@gnu.org; Fri, 15 Dec 2017 05:54:01 -0500 Subject: [bug#28055] [WIP] Add knot tests Resent-Message-ID: From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) References: <20170811210341.10ab9965@lepiller.eu> <87tw17khg0.fsf@elephly.net> <87r2ut27cb.fsf@gnu.org> <878temiw5i.fsf@gnu.org> <20171202121815.553c0b93@lepiller.eu> Date: Fri, 15 Dec 2017 11:53:06 +0100 In-Reply-To: <20171202121815.553c0b93@lepiller.eu> (Julien Lepiller's message of "Sat, 2 Dec 2017 12:18:15 +0100") Message-ID: <87fu8cjm99.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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: Julien Lepiller Cc: 28055@debbugs.gnu.org Hello, Julien Lepiller skribis: > Here is a new version. The tests still don't pass though. It can't send > the request to the server. > > From ecc02fe8098d8763b95d2c71215a62e669f49568 Mon Sep 17 00:00:00 2001 > From: Julien Lepiller > Date: Sat, 2 Dec 2017 10:51:18 +0100 > Subject: [PATCH 1/2] guix: Add DNS implementation. > > * guix/dns.scm: New file. > * Makefile.am: Add it. [...] > +;;; Commentary: > +;;; > +;;; This module provides a DNS implementation. This modules helps constr= uct ^^^^^^^^^^^^ =E2=80=9CIt=E2=80=9D. :-) Maybe add that it=E2=80=99s primarily for test purposes. Very nice stuff! > From 5146714c6615161fe3e496909f5a157c24d57ea0 Mon Sep 17 00:00:00 2001 > From: Julien Lepiller > Date: Sat, 2 Dec 2017 12:15:28 +0100 > Subject: [PATCH 2/2] gnu: tests: Add knot test. > > * gnu/tests/dns.scm: New file. > * gnu/local.mk (GNU_SYSTEM_MODULES): Add it. [...] > +(define (run-knot-test) > + "Return a test of an OS running Knot service." > + (define vm > + (virtual-machine > + (operating-system (marionette-operating-system > + %knot-os > + #:imported-modules '((gnu services herd)))) > + (port-forwardings '((1053 . 53))))) Note that this creates *TCP* port forwardings (see =E2=80=98port-forwardings->qemu-options=E2=80=99 in (gnu system vm)). Perhaps you=E2=80=99ll want UDP forwarding? > + (test-eq "get the correct answer" > + #$%ip4-addr Should be =E2=80=98test-equal=E2=80=99 since you=E2=80=99re comparing strin= gs. > + (begin > + (format #t "test:\n") > + (let* ((query (simple-a-query "mail.guix-test.org")) > + (dns (socket AF_INET SOCK_STREAM 0)) > + (addr (make-socket-address AF_INET INADDR_LOOPBACK = 1053))) > + (connect dns addr) I learned from that DNS servers are now supposed to listen for TCP requests, but are we sure this is the case here? What error do you get? Does the =E2=80=98connect=E2=80=99 call fail? Does= the message go through? Thanks! Ludo=E2=80=99.