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/basic.py b/tests/basic.py
index 465a3c9..5a2e26f 100644
--- a/tests/basic.py
+++ b/tests/basic.py
@@ -69,6 +69,7 @@
sys.exit(1)
def setUp(self):
+ self.logger = basic_logger
signal.signal(signal.SIGINT, self.sig_handler)
basic_logger.info("** START TEST CASE " + str(self))
self.controller = controller.Controller(
@@ -127,6 +128,36 @@
# self.dataplane.show()
# Would like an assert that checks the data plane
+class DataPlaneOnly(unittest.TestCase):
+ """
+ Root class that sets up only the dataplane
+ """
+
+ def sig_handler(self, v1, v2):
+ basic_logger.critical("Received interrupt signal; exiting")
+ print "Received interrupt signal; exiting"
+ self.clean_shutdown = False
+ self.tearDown()
+ sys.exit(1)
+
+ def setUp(self):
+ self.clean_shutdown = False
+ self.logger = basic_logger
+ signal.signal(signal.SIGINT, self.sig_handler)
+ basic_logger.info("** START DataPlaneOnly CASE " + str(self))
+ self.dataplane = dataplane.DataPlane()
+ for of_port, ifname in basic_port_map.items():
+ self.dataplane.port_add(ifname, of_port)
+
+ def tearDown(self):
+ basic_logger.info("Teardown for simple dataplane test")
+ self.dataplane.kill(join_threads=self.clean_shutdown)
+ basic_logger.info("Teardown done")
+
+ def runTest(self):
+ self.dataplane.show()
+ # Would like an assert that checks the data plane
+
class Echo(SimpleProtocol):
"""
Test echo response with no data