From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55105) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ese3t-0008Cl-JA for guix-patches@gnu.org; Sun, 04 Mar 2018 19:33:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ese3r-0000UL-7j for guix-patches@gnu.org; Sun, 04 Mar 2018 19:33:05 -0500 Received: from debbugs.gnu.org ([208.118.235.43]:36985) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ese3r-0000UG-3y for guix-patches@gnu.org; Sun, 04 Mar 2018 19:33:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ese3q-0003U2-Tx for guix-patches@gnu.org; Sun, 04 Mar 2018 19:33:02 -0500 Subject: [bug#30701] [PATCH 3/4] tests: databases: Add a system test for PostgreSQL. Resent-Message-ID: References: <20180304191633.20262-1-mail@cbaines.net> <20180304191633.20262-3-mail@cbaines.net> From: =?UTF-8?Q?Cl=C3=A9ment?= Lassieur In-reply-to: <20180304191633.20262-3-mail@cbaines.net> Date: Mon, 05 Mar 2018 01:32:32 +0100 Message-ID: <87inabz7j3.fsf@lassieur.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit 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: Christopher Baines Cc: 30701@debbugs.gnu.org Christopher Baines writes: > * gnu/tests/databases.scm (%postgresql-os, %test-postgresql): New variables. > (run-postgresql-test): New procedure. > --- > gnu/tests/databases.scm | 59 +++++++++++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 59 insertions(+) ... > + (test-assert "service running" > + (marionette-eval > + '(begin > + (use-modules (gnu services herd)) > + (match (start-service 'postgres) > + (#f #f) > + (('service response-parts ...) > + (match (assq-ref response-parts 'running) > + ((pid) (number? pid)))))) > + marionette)) I don't understand the point of the PID check here. pg_ctl will ensure that the daemon has started (by checking its PID), so I don't think there is any need to redo its work. I guess the PID you'll get here is the one of pg_ctl, which is probably not what you want. I believe that (start-service 'postgres) returning true means pg_ctl succeeded in its check that the daemon is running. So this is probably enough: (test-assert "service running" (marionette-eval '(begin (use-modules (gnu services herd)) (start-service 'postgres)) marionette)) Clément