[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH XTF 2/3] xtf-runner: provide a set of exit codes for different states



Signed-off-by: Wei Liu <wei.liu2@xxxxxxxxxx>
---
 xtf-runner | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/xtf-runner b/xtf-runner
index ad7dcf9..17ce933 100755
--- a/xtf-runner
+++ b/xtf-runner
@@ -21,6 +21,14 @@ except ImportError:
 # Note that warning is not a state on its own.
 all_states = [ 'SUCCESS', 'SKIP', 'ERROR', 'FAILURE' ]
 
+# Return the exit code for different states.
+# Avoid using 1 and 2 because python interpreter uses them.
+def exit_code(state):
+    if state == 'SUCCESS': return 0
+    if state == 'SKIP':    return 3
+    if state == 'ERROR':   return 4
+    if state == 'FAILURE': return 5
+
 # All test categories and configurations
 all_categories   = ("special", "functional", "xsa", "utility")
 pv_environments  = ("pv64", "pv32pae")
-- 
2.1.4


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.