]> xenbits.xensource.com Git - people/liuw/xtf.git/commitdiff
Add `./xtf-runner --list --environments` to obtain the full environment list
authorAndrew Cooper <andrew.cooper3@citrix.com>
Wed, 3 Aug 2016 14:28:41 +0000 (15:28 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Wed, 3 Aug 2016 14:28:41 +0000 (15:28 +0100)
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
xtf-runner

index 034393cc09c387b4bb2ea49062f5e27f7f783be0..c063699b55dafd745b1e234b99ba9a1a0e5e6d01 100755 (executable)
@@ -413,6 +413,12 @@ def interpret_selection(opts):
 def list_tests(opts):
     """ List tests """
 
+    if opts.environments:
+        # The caller only wants the environment list
+        for env in sorted(all_environments):
+            print env
+        return
+
     if not opts.selection:
         raise RunnerError("No tests selected")
 
@@ -543,6 +549,10 @@ def main():
                   "  without needing to explicitly name them.  --non-default\n"
                   "  is available to obtain the non-default categories.\n"
                   "\n"
+                  "  The special parameter --environments may be passed to\n"
+                  "  get the full list of environments.  This option does not\n"
+                  "  make sense combined with a selection.\n"
+                  "\n"
                   "Examples:\n"
                   "  Listing all tests implemented for hvm32 environment:\n"
                   "    ./xtf-runner --list hvm32\n"
@@ -578,6 +588,10 @@ def main():
                       dest = "non_default",
                       help = "Select all non default categories",
                       )
+    parser.add_option("--environments", action = "store_true",
+                      dest = "environments",
+                      help = "List all the known environments",
+                      )
     parser.add_option("--host", action = "store_true",
                       dest = "host", help = "Restrict selection to applicable"
                       " tests for the current host",