[elbe-devel] [PATCH 04/25] elbe: implement a hidden --test-commands parameter

Torben Hohn torben.hohn at linutronix.de
Tue Dec 5 17:41:59 CET 2017


On Fri, Dec 01, 2017 at 04:51:01PM +0100, Manuel Traut wrote:
> it can be used by test-sytems to identify if all commands are runnable,
> e.g. can resolve their imports.
> 
> Signed-off-by: Manuel Traut <manut at linutronix.de>
> ---
>  elbe | 10 +++++++++-
>  1 file changed, 9 insertions(+), 1 deletion(-)
> 
> diff --git a/elbe b/elbe
> index 269b1920..48056013 100755
> --- a/elbe
> +++ b/elbe
> @@ -18,13 +18,13 @@
>  # You should have received a copy of the GNU General Public License
>  # along with ELBE.  If not, see <http://www.gnu.org/licenses/>.
>  
> +import os
>  import sys
>  
>  import elbepack.commands
>  from elbepack.version import elbe_version, running_os
>  from elbepack.directories import init_directories, get_cmdlist
>  
> -
>  def usage():
>      print 'elbe v' + elbe_version
>      print 'need a subcommand: e.g. \'elbe initvm\'. \n\
> @@ -48,6 +48,14 @@ if sys.argv[1] == "--version":
>  
>  cmd_list = get_cmdlist()
>  
> +if sys.argv[1] == "--test-commands":
> +    for cmd in cmd_list:
> +        os.system ("./elbe %s" % cmd)
> +
> +    print("all commands tested")
> +    sys.exit(0)

What does this test ?
it will return sucess in any case, it relies on the current path.

please remove.

It might make sense to implement elbe get_commands. so that we could do:

for i in `elbe get_commands`; do
    elbe $i
done

or something.

testing command modules requires a bit more delicate code to make that
more useful. and this code should not reside in the elbe porcelain.

> +
> +
>  if not sys.argv[1] in cmd_list:
>      print "Unknown subcommand !\n"
>      usage()
> -- 
> 2.15.1
> 
> 
> _______________________________________________
> elbe-devel mailing list
> elbe-devel at linutronix.de
> https://lists.linutronix.de/mailman/listinfo/elbe-devel

-- 
Mit freundlichen Grüßen
Torben Hohn

Linutronix GmbH

Standort: Bremen

Phone: +49 7556 25 999 18; Fax.: +49 7556 25 999 99

Firmensitz / Registered Office: D-88690 Uhldingen, Bahnhofstr. 3
Registergericht / Local District Court: Amtsgericht Freiburg i. Br.; HRB
Nr. / Trade register no.: 700 806

Geschäftsführer / Managing Directors: Heinz Egger, Thomas Gleixner

Eine Bitte von uns: Sollten Sie diese E-Mail irrtümlich erhalten haben,
benachrichtigen Sie uns in diesem Falle bitte sobald wie es Ihnen
möglich ist, durch Antwort-Mail. Vielen Dank!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: Digital signature
URL: <http://lists.linutronix.de/pipermail/elbe-devel/attachments/20171205/62845d61/attachment.sig>


More information about the elbe-devel mailing list