Ludovic Courtès writes: > [..] > >> +@deffn {Procedure} user-environment-variables @ >> + [name-or-id (getuid)] @ >> + [environment-variables (default-environment-variables)] >> + >> +Take the list of environment variables, replace @env{HOME} with home > > “Take the list @var{environment-variables}, …” Done. > >> +(define-module (test-service) >> + #:use-module (shepherd service) >> + #:use-module (srfi srfi-64)) >> + >> + >> +(test-begin "user-environment-variables") > > (test-begin "service"), to create ‘service.log’. Well, I did the change, but I would just like to note that the `service.log' file was created (with expected content) even in the previous version. The runner in test-driver.scm used by Shepherd does not set the group-begin handler, so the value passed to test-begin is effectively ignored. At least it does not seem to be used for anything. > >> +(let ((environment-variables '("USER=foo" >> + "HOME=/foo" >> + "USER=bar" >> + "HOME=/bar"))) >> + ;; Pretty much any system should have root in /etc/passwd. >> + (test-equal "name sets variables" >> + '("HOME=/root" "USER=root") >> + (user-environment-variables "root" environment-variables)) > > Use (passwd:name (getpwuid (getuid))) rather than “root” because > /etc/passwd in the Guix build environment does not have “root”. (You > can test with ‘guix build -f guix.scm’.) I did not realize that, fixed. > > OK with these changes, thank you! v2 attached. :) Tomas