GNU bug report logs -
#31911
[PATCH] services: Add prometheus-node-exporter-service-type.
Previous Next
Reported by: Gábor Boskovits <boskovits <at> gmail.com>
Date: Wed, 20 Jun 2018 13:01:01 UTC
Severity: normal
Tags: patch
Done: Gábor Boskovits <boskovits <at> gmail.com>
Bug is archived. No further changes may be made.
Full log
Message #28 received at 31911-done <at> debbugs.gnu.org (full text, mbox):
Hi Gábor,
Gábor Boskovits <boskovits <at> gmail.com> writes:
> Pushed to master as a33652ee336ae9a5d2ab5fd54bf2397caec42a0e.
> + (test-assert "prometheus-node-exporter running"
> + (marionette-eval
> + '(begin
> + (use-modules (gnu services herd))
> + (match (start-service 'prometheus-node-exporter)
> + (#f #f)
> + (('service response-parts ...)
> + (match (assq-ref response-parts 'running)
> + ((pid) (number? pid))))))
> + marionette))
The PID check is useless because START-SERVICE will return #f if the
service fails to start. Instead, I'd use:
(test-assert "prometheus-node-exporter running"
(marionette-eval
'(begin
(use-modules (gnu services herd))
(start-service 'prometheus-node-exporter))
marionette))
This would also make the test more robust to service changes (e.g. it
would still work if MAKE-FORKEXEC-CONSTRUCTOR is removed).
Clément
This bug report was last modified 6 years and 318 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.