[bug#63877,2/2] tests: web: Test environment variables are set for php-fpm.
Commit Message
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(-)
@@ -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))