From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34329) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eslaP-0003v9-3Q for guix-patches@gnu.org; Mon, 05 Mar 2018 03:35:10 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eslaI-00037i-U8 for guix-patches@gnu.org; Mon, 05 Mar 2018 03:35:09 -0500 Received: from debbugs.gnu.org ([208.118.235.43]:37145) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eslaI-000379-Ql for guix-patches@gnu.org; Mon, 05 Mar 2018 03:35:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1eslaI-0006xa-F3 for guix-patches@gnu.org; Mon, 05 Mar 2018 03:35: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> <87inabz7j3.fsf@lassieur.org> From: Christopher Baines In-reply-to: <87inabz7j3.fsf@lassieur.org> Date: Mon, 05 Mar 2018 08:34:33 +0000 Message-ID: <87h8puq5t2.fsf@cbaines.net> 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: 30701@debbugs.gnu.org --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cl=C3=A9ment Lassieur writes: > Christopher Baines writes: > >> * gnu/tests/databases.scm (%postgresql-os, %test-postgresql): New variab= les. >> (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. Because of make-forkexec-constructor, it is the main PID as set in the external pid file created by PostgreSQL. > 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)) Sure, I'm happy with this. I'll send some new patches soonish. --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQKTBAEBCgB9FiEEPonu50WOcg2XVOCyXiijOwuE9XcFAlqdARlfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDNF ODlFRUU3NDU4RTcyMEQ5NzU0RTBCMjVFMjhBMzNCMEI4NEY1NzcACgkQXiijOwuE 9XdJsBAAoefkU/Hl1UwsPHIDFqQWfs/pHbhbu4X1BMrYcYx78GWwR3bCMaUd92dp ctQ3NT/RruWFmj3mfGxhAwTaIuBoe9Z5vnlafMnB3AJ0M+lgCmRtt/UYPQv9MGCR 6qwfkquMqEYxf9R4mhcTkOpt4rFGkQAzSeOiui9KEInbVe3tS9LcFUqL75FsI1rT H7KsVGF8mi8SD1oyZLBBsY+Z6fNOYwAFk+8NrRVZWxofyZKe/Y8qQueIq6oLJb5e nJGmCrHTQeQMPYLb06BI7QcBZr7skkwoBMqvT0VEsdZc37PP4xg0B/i4GzhGNcrc NsjOHpIUo83u63l+s5lIZbCWKZDo0RuPDCeMa1V4wvwA+Ti24nAAWBRtLvS5WVUm J0rYHRb9YmdWBZsBAdU3Hd1AQ13Qe4mPI81K1n5K+KSXvQVcB63/ExtHutoZgIaw H8ayyfrJp5ngwbIbAmleC0woXq9XybGpZ7XOz5+0PmthhWgVkqYksQCZNgh4QAJQ Uqbh056mY0TN7/pfGBOWPyDuju8HA5OAJ2KzCu+QcC27XhwgkdXObQrr6S9DhHCE ShtJqxgdP0o+TAi91IYSn2peqXfTzYo1iIOMejd9ujvU+iPGekJocQFBomzgtWjr rtU5Qu7CjWKTdIecybNuSDFTtO4FEVtp9HKzZ62Eep4nOwvUicY= =x3LN -----END PGP SIGNATURE----- --=-=-=--