diff options
author | Maxim Cournoyer <maxim.cournoyer@gmail.com> | 2025-05-06 16:16:09 +0900 |
---|---|---|
committer | Maxim Cournoyer <maxim.cournoyer@gmail.com> | 2025-05-26 13:43:03 +0900 |
commit | 4c017ccfe56a8887bf26faaea62d60501d7cc4f6 (patch) | |
tree | 5c8a5efc2bd183db771f2ad6cafed857824f1063 /gnu/tests | |
parent | 42245040f683bf11688f3731037d0e933fa562fa (diff) |
services: Add etc-bashrc-d-service-type.
* gnu/services.scm (files->bashrc-d-directory) New procedure.
(etc-bashrc-d-service-type): New service type.
* doc/guix.texi (Service Reference): Document it.
* gnu/tests/base.scm (test-basic-os): Test it.
Change-Id: Ibbb0f684de7aee296adedbce5b1192786d661af2
Diffstat (limited to 'gnu/tests')
-rw-r--r-- | gnu/tests/base.scm | 39 |
1 files changed, 30 insertions, 9 deletions
diff --git a/gnu/tests/base.scm b/gnu/tests/base.scm index 09fc91383d..0f31c152e0 100644 --- a/gnu/tests/base.scm +++ b/gnu/tests/base.scm @@ -178,6 +178,19 @@ test -f /etc/profile.d/test_profile_d.sh test \"$PROFILE_D_OK\" = yes") marionette))) + (test-assert "/etc/bashrc.d is sourced" + (zero? (marionette-eval + '(system* "bash" + ;; Ensure Bash runs interactively. + "--init-file" + #$(plain-file "test_bashrc_d.sh" + "\ +. /etc/bashrc +set -e -x +test -f /etc/bashrc.d/test_bashrc_d.sh +test \"$BASHRC_D_OK\" = yes")) + marionette))) + (test-equal "special files" '#$special-files (marionette-eval @@ -585,15 +598,23 @@ functionality tests, using the given KERNEL.") (operating-system (inherit %simple-os) (kernel kernel) - (services (cons (service - etc-profile-d-service-type - (list (plain-file - "test_profile_d.sh" - "export PROFILE_D_OK=yes\n") - (plain-file - "invalid-name" - "not a POSIX script -- ignore me"))) - %base-services))) + (services (cons* (service + etc-profile-d-service-type + (list (plain-file + "test_profile_d.sh" + "export PROFILE_D_OK=yes\n") + (plain-file + "invalid-name" + "not a POSIX script -- ignore me"))) + (service + etc-bashrc-d-service-type + (list (plain-file + "test_bashrc_d.sh" + "export BASHRC_D_OK=yes\n") + (plain-file + "invalid-name" + "not a Bash script -- ignore me"))) + %base-services))) #:imported-modules '((gnu services herd) (guix combinators)))) (vm (virtual-machine os))) |