From patchwork Sat Feb 17 23:21:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Timo Wilken X-Patchwork-Id: 60469 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 582E227BBEA; Sat, 17 Feb 2024 23:24:05 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL, SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id A24E927BBE9 for ; Sat, 17 Feb 2024 23:24:02 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rbU24-0000rK-VT; Sat, 17 Feb 2024 18:23:45 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rbU23-0000r4-Bc for guix-patches@gnu.org; Sat, 17 Feb 2024 18:23:43 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rbU23-0001Is-3u for guix-patches@gnu.org; Sat, 17 Feb 2024 18:23:43 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rbU2N-0007JH-6T for guix-patches@gnu.org; Sat, 17 Feb 2024 18:24:03 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#63877] [PATCH 2/2] tests: web: Test environment variables are set for php-fpm. Resent-From: guix@twilken.net Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 17 Feb 2024 23:24:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63877 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: moreinfo patch To: 63877@debbugs.gnu.org Cc: Ludovic =?utf-8?q?Court=C3=A8s?= , Bruno Victal , Timo Wilken Received: via spool by 63877-submit@debbugs.gnu.org id=B63877.170821222828065 (code B ref 63877); Sat, 17 Feb 2024 23:24:03 +0000 Received: (at 63877) by debbugs.gnu.org; 17 Feb 2024 23:23:48 +0000 Received: from localhost ([127.0.0.1]:33999 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rbU28-0007Ib-GR for submit@debbugs.gnu.org; Sat, 17 Feb 2024 18:23:48 -0500 Received: from mx2.mythic-beasts.com ([46.235.227.24]:33979) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rbU27-0007IE-HK for 63877@debbugs.gnu.org; Sat, 17 Feb 2024 18:23:47 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=twilken.net ; s=mythic-beasts-k1; h=Date:Subject:To:From; bh=NTYaZ1EfojnAL+zCAVmY1BgWf5uhsUTC2oX96DK/LtA=; b=pnLFix5ZFRQyalXO0f+SWjO423 vQk6dpXdEk690T0h8PLtEUmZ17rZuqoBOGJKbR3D+ytrUGIDLUt6dEozzpcujdL0Ej8+BuFf9Siwa 1I5O4yqeCwhznGtVG+geTrzK4FQePjXRs4jx1H9oH3SpCq6xu1SXk93mUROQogWJQpLyzmHxzcOcR lVC9cNtZvycEyv2A+gJfud+iv214G/JUBwt7WzF8selb+2DQBlaJ+mM6EePpu67b9JKWOxKvlGbHy 9oP/BvtzuxqoHryolq+X5az2du8fKfnb/RWNVAtRckIk3r4F+l7luCi+GXTYAsdGizlgJw+Hf0l03 MFLKvtCA==; Received: by mailhub-hex-d.mythic-beasts.com with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rbU1h-00BbpP-C6; Sat, 17 Feb 2024 23:23:21 +0000 From: guix@twilken.net Date: Sun, 18 Feb 2024 00:21:47 +0100 Message-ID: <20240217232151.12507-4-guix@twilken.net> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240217232151.12507-1-guix@twilken.net> References: <7be3201e-af9b-4ad0-81d6-44ab316d2162@makinata.eu> <20240217232151.12507-1-guix@twilken.net> MIME-Version: 1.0 X-BlackCat-Spam-Score: 49 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches From: Timo Wilken Test the new `environment-variables' field of by looking for a sentinel variable and value in the output of `phpinfo()'. * gnu/tests/web.scm (run-php-fpm-test): Add test case. --- gnu/tests/web.scm | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/gnu/tests/web.scm b/gnu/tests/web.scm index 16dc6bea49..f1688bfd3a 100644 --- a/gnu/tests/web.scm +++ b/gnu/tests/web.scm @@ -272,7 +272,10 @@ (define %php-fpm-os ;; Operating system under test. (simple-operating-system (service dhcp-client-service-type) - (service php-fpm-service-type) + (service php-fpm-service-type + (php-fpm-configuration + (environment-variables + '(("GUIX_TEST_PHPFPM_ENV" . "sentinel"))))) (service nginx-service-type (nginx-configuration (server-blocks %php-fpm-nginx-server-blocks))) @@ -345,6 +348,13 @@ (define marionette (and matches (match:substring matches 0)))))) + (test-assert "php environment variable is applied" + (let-values (((response text) + (http-get "http://localhost:8080/index.php" + #:decode-body? #t))) + (and (string-contains text "GUIX_TEST_PHPFPM_ENV") + (string-contains text "sentinel")))) + (test-end)))) (gexp->derivation "php-fpm-test" test))