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

Manuel Traut manut at linutronix.de
Fri Dec 1 16:51:01 CET 2017


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)
+
+
 if not sys.argv[1] in cmd_list:
     print "Unknown subcommand !\n"
     usage()
-- 
2.15.1




More information about the elbe-devel mailing list