Some major restructuring
Updated README with some warnings.
Added data-plane-only class to allow controlling the dataplane
ports without needing a controller connection.
Subclassed this to allow sending only a packet without doing
any flow mods; both tagged or untagged.
Added the ability to pass a parameter to a test through th
config structure. Use --param=N.
Used the above to set the VLAN id in a tagged pkt in the new test.
Break up description/name in --list when name is long
Restructured pktact.py into different routines, moving a lot of
the base functionality into testutils.py. This allows packet
modification tests to be done independently.
In the process, added support for using tagged and untagged
packets in the tests. Several tests remain to be implemented.
diff --git a/tests/oft b/tests/oft
index b4314fe..9bd9e40 100755
--- a/tests/oft
+++ b/tests/oft
@@ -150,6 +150,7 @@
##@var config_default
# The default configuration dictionary for OFT
config_default = {
+ "param" : None,
"platform" : "local",
"controller_host" : "127.0.0.1",
"controller_port" : 6633,
@@ -236,6 +237,8 @@
help="List all tests and exit")
parser.add_option("--verbose", action="store_true",
help="Short cut for --debug=verbose")
+ parser.add_option("--param", type="int",
+ help="Parameter sent to test (for debugging)")
# Might need this if other parsers want command line
# parser.allow_interspersed_args = False
(options, args) = parser.parse_args()
@@ -377,12 +380,17 @@
start_str = " Module " + mod.__name__ + ": "
print start_str + _space_to(22, start_str) + desc
for test in config["all_tests"][mod]:
- desc = eval('mod.' + test + '.__doc__.strip()')
- desc = desc.split('\n')[0]
+ try:
+ desc = eval('mod.' + test + '.__doc__.strip()')
+ desc = desc.split('\n')[0]
+ except:
+ desc = "No description"
if test_prio_get(mod, test) < 0:
start_str = " * " + test + ":"
else:
start_str = " " + test + ":"
+ if len(start_str) > 22:
+ desc = "\n" + _space_to(22, "") + desc
print start_str + _space_to(22, start_str) + desc
print
if not did_print: