[Fuego] Add NEED_PROGRAM to need_check

Daniel Sangorrin daniel.sangorrin at toshiba.co.jp
Fri Feb 2 07:30:12 UTC 2018


Hi Tim,

> -----Original Message-----
> From: fuego-bounces at lists.linuxfoundation.org [mailto:fuego-bounces at lists.linuxfoundation.org] On Behalf Of Liu, Wenlong
> > In general, I prefer things to be done as check_needs, which means they
> > are declarative, rather than in test_pre_check, which, strictly speaking,
> > is imperative.
> >
> > Having declarative dependencies means you can do a static dependency
> > checker.

But many times we want a dynamic check as well. For example, we may want to 
skip some tests if we don't have root permissions but still run the other tests.

I was wondering if we could kill 2 birds (no pun intended) with one shot:
- during the pre_check phase a script checks for variables that start with NEED_FOO
- then, the script calls check_FOO() for each need.

NEED_ROOT is currently being checked in a function called check_needs. Instead,
we could define a functiona called "check_ROOT" and have it called automatically
when NEED_ROOT=1 is declared on the script. The advantage of this approach, is
that tests can still call "check_ROOT" dynamically.

What do you think?

Thanks,
Daniel











More information about the Fuego mailing list