Major overhaul of oftest command interface
Added tests/oft as top level executable
Support command line options for many config params
Use logging module for output
Got rid of oft_config.py; consolidate configuration in
oft (top level script) and pass around as a dictionary
Add oft_assert.py (the one useful piece of oft_config that
remained).
diff --git a/src/python/oftest/oft_assert.py b/src/python/oftest/oft_assert.py
new file mode 100644
index 0000000..d773c84
--- /dev/null
+++ b/src/python/oftest/oft_assert.py
@@ -0,0 +1,28 @@
+"""
+OpenFlow Test Framework
+
+Framework assert definition
+"""
+
+import sys
+import logging
+
+def oft_assert(condition, string):
+ """
+ Test framework assertion check
+
+ @param condition The boolean condition to check
+ @param string String to print if error
+
+ If condition is not true, it is considered a test framework
+ failure and exit is called.
+
+ This assert is meant to represent a violation in the
+ assumptions of how the test framework is supposed to work
+ (for example, an inconsistent packet queue state) rather than
+ a test failure.
+ """
+ if not condition:
+ logging.critical("Internal error: " + string)
+ sys.exit(1)
+