> >>> + (service-extension profile-service-type > >>> + (compose list rspamd-configuration-package)) > >> > >> What's the motivation for adding the rspamd package to the profile? > > > > That was also there when I picked up this patch. I assume it is added to > > the profile so that the `rspamadm` and `rspamc` programs are available > > and compatible with the daemon. I don't have strong feelings about this > > in either direction. > > I think it's better to omit this, users who are interested in the tools > can use 'guix shell rspamd'. Yes, except if the rspamd package in the configuration is incompatible with the one in the user's Guix. Anyway, this is now removed in v5. > > +(define (list-of-symbols? x) > > + (and (list? x) > > + (every symbol? x))) > > list-of-symbols? is already defined in (gnu services configuration), > you can omit this. Done after a rebase in v5. Apparently it also defines some other useful functions that I didn't know about. > > + (shepherd-action > > + (name 'reopenlog) > > + (documentation "Reopen log files.") > > Missed this in my previous reply, I'd prefer naming this action as > 'reopen instead. Done in v5. > > +(define %rspamd-os > > + (simple-operating-system > > + (service dhcp-client-service-type) > > […] > > > + (service rspamd-service-type > > + (rspamd-configuration > > + (shepherd-requirements '(networking)) > > + (local.d-files `(("worker-controller.inc" > > + ,(plain-file > > + "rspamd-public-web-controller.conf" > > + "bind_socket = \"0.0.0.0:11334\";")))))))) > > I wonder if you could remove dhcp-client-service-type and use the > loopback device for this test instead, by binding to '[::1]' or '127.0.0.1'. > (You don't need to add %loopback-static-networking here since it is already > included in %base-services.) I tried that but it didn't work because the vm does not have an IP route configured to the host... > > > +(define (run-rspamd-test) > > + "Return a test of an OS running Rspamd service." > > + > > + (define rspamd-ports > > + '((22668 . 11334))) ;; web controller > > […] > > > + > > + (define vm > > + (virtual-machine > > + (operating-system (marionette-operating-system > > + %rspamd-os > > + #:imported-modules '((gnu services herd)))) > > + (port-forwardings rspamd-ports))) > > […] > > > + ;; Check that we can access the web ui > > + > > + (test-equal "http-get" > > + 200 > > + (response-code (http-get "http://localhost:22668/"))) ; HEAD is unsupported > > Actually I've realized that these port-forwards are unnecessary > and it would be better to instead do: > > --8<---------------cut here---------------start------------->8--- > ;; Note: remove (web client) and (web response) in the imports above > ;; i.e. after the #~(begin (use-modules … > > (test-equal "http-get" > 200 > (marionette-eval > '(begin > (use-modules (web client) > (web response)) > (response-code (http-head "http://localhost:11334/"))) > marionette)) > --8<---------------cut here---------------end--------------->8--- ... However with changes like these it does work in v5.