[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug#31788] [PATCH] tests: Honor the return value of 'start-service'.

From: Ludovic Courtès
Subject: [bug#31788] [PATCH] tests: Honor the return value of 'start-service'.
Date: Tue, 12 Jun 2018 21:46:06 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux)

Hi Clément,

Clément Lassieur <address@hidden> skribis:

> Since commit dc7b3e56337ee9d8dcd8fe7d5cab71ef536d024f, 'start-service' returns
> the Shepherd's representation of the service as a sexp, and '#f' if the
> service fails to start.  Also, it doesn't throw an exception when the service
> fails to start, so relying on an exception instead of relying on its return
> value is a false positive.

Looking at ‘invoke-action’ (used by ‘start-service’) in (gnu services
herd), it seems that an exception is raised upon error:

      (('reply ('version 0 x ...) ('result y) ('error error)
               ('messages messages))
       (for-each display-message messages)
       (raise-shepherd-error error)

There’s one case where an exception isn’t raised, and that’s when
shepherd returns something completely bogus:

       ;; invalid reply

Am I missing something?


reply via email to

[Prev in Thread] Current Thread [Next in Thread]