[systemd-devel] [PATCH 1/1] tests: skip test for test-unit-file when executed without privileges

Zbigniew Jędrzejewski-Szmek zbyszek at in.waw.pl
Tue Jul 30 09:50:10 PDT 2013

On Tue, Jul 30, 2013 at 02:17:30PM +0200, Kay Sievers wrote:
> On Tue, Jul 30, 2013 at 1:52 PM, Zbigniew Jędrzejewski-Szmek
> <zbyszek at in.waw.pl> wrote:
> > On Tue, Jul 30, 2013 at 11:50:54AM +0200, Christian Hesse wrote:
> >> Hello everybody,
> >>
> >> for me this test fails and I think it is correct to skip it in case
> >> permission is denied. Patch attached.
> > It *is* an error in the installation or environment if
> > unit files cannot be read. In almost all circumstances,
> > reducing permissions on unit files doesn't introduce any
> > extra security because later on they are all accessible
> > from PID 1 over dbus. I agree that failing an assertion
> > is not nice from the view of the user, what about
> > exit(EXIT_FAILURE)?
> Hmm, we assert() most of the test failures to see where things went wrong.
> Would exit() make much of a difference in that case? Is it worth to
> distinguish different types of failures in the test?
assert dumps core, which means that it get processed by abrt
or journald or dumped to disk, and looks like a big error, but
the core is totally useless for determining the cause, since
once the error has been detected, all interesting state is gone.

I think we should maybe add an assert_exit(), which does exit(EXIT_FAILURE),
and use that instead of normal assert in many places.

they are not broken. they are refucktored
                           -- alxchk

More information about the systemd-devel mailing list