all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: guix@twilken.net
To: 63877@debbugs.gnu.org
Cc: "Ludovic Courtès" <ludo@gnu.org>,
	"Bruno Victal" <mirai@makinata.eu>,
	"Timo Wilken" <guix@twilken.net>
Subject: [bug#63877] [PATCH 2/2] tests: web: Test environment variables are set for php-fpm.
Date: Sun, 18 Feb 2024 00:21:47 +0100	[thread overview]
Message-ID: <20240217232151.12507-4-guix@twilken.net> (raw)
In-Reply-To: <20240217232151.12507-1-guix@twilken.net>

From: Timo Wilken <guix@twilken.net>

Test the new `environment-variables' field of <php-fpm-configuration> 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))
-- 
2.41.0





      parent reply	other threads:[~2024-02-17 23:24 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-03 18:25 [bug#63877] [PATCH] gnu: services: web: Set SSL_CERT_DIR in php-fpm environment Timo Wilken
2023-06-03 22:18 ` Bruno Victal
2023-06-04 13:59 ` [bug#63877] [PATCH v2] gnu: services: web: Allow specifying extra php-fpm environment variables Timo Wilken
2023-06-05  3:44   ` Bruno Victal
2023-07-01 14:40     ` [bug#63877] [PATCH] gnu: services: web: Set SSL_CERT_DIR in php-fpm environment Ludovic Courtès
2023-10-15 20:54     ` [bug#63877] [PATCH v2] gnu: services: web: Allow specifying extra php-fpm environment variables Timo Wilken
2023-10-19 14:32       ` Bruno Victal
2024-02-17 23:21         ` [bug#63877] Reworked patch for setting " guix
2024-02-17 23:21           ` [bug#63877] [PATCH 1/2] gnu: services: web: Allow specifying extra " guix
2024-02-17 23:21           ` guix [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240217232151.12507-4-guix@twilken.net \
    --to=guix@twilken.net \
    --cc=63877@debbugs.gnu.org \
    --cc=ludo@gnu.org \
    --cc=mirai@makinata.eu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.