Ignore errors from attempting to install a SIGINT handler from a thread
other than the main thread, e.g. if you use another harness (not oft)
to launch the test case
diff --git a/tests/basic.py b/tests/basic.py
index 7ddfdcd..c4d8036 100644
--- a/tests/basic.py
+++ b/tests/basic.py
@@ -72,7 +72,12 @@
def setUp(self):
self.logger = basic_logger
self.config = basic_config
- signal.signal(signal.SIGINT, self.sig_handler)
+ #@todo Test cases shouldn't monkey with signals; move SIGINT handler
+ # to top-level oft
+ try:
+ signal.signal(signal.SIGINT, self.sig_handler)
+ except ValueError, e:
+ basic_logger.info("Could not set SIGINT handler: %s" % e)
basic_logger.info("** START TEST CASE " + str(self))
self.controller = controller.Controller(
host=basic_config["controller_host"],
@@ -178,7 +183,12 @@
self.clean_shutdown = True
self.logger = basic_logger
self.config = basic_config
- signal.signal(signal.SIGINT, self.sig_handler)
+ #@todo Test cases shouldn't monkey with signals; move SIGINT handler
+ # to top-level oft
+ try:
+ signal.signal(signal.SIGINT, self.sig_handler)
+ except ValueError, e:
+ basic_logger.info("Could not set SIGINT handler: %s" % e)
basic_logger.info("** START DataPlaneOnly CASE " + str(self))
self.dataplane = dataplane.DataPlane(self.config)
for of_port, ifname in basic_port_map.items():
diff --git a/tests/serial_failover.py b/tests/serial_failover.py
index 600c50b..90a4236 100644
--- a/tests/serial_failover.py
+++ b/tests/serial_failover.py
@@ -141,7 +141,12 @@
def setUp(self):
self.logger = serial_failover_logger
self.config = serial_failover_config
- signal.signal(signal.SIGINT, self.sig_handler)
+ #@todo Test cases shouldn't monkey with signals; move SIGINT handler
+ # to top-level oft
+ try:
+ signal.signal(signal.SIGINT, self.sig_handler)
+ except ValueError, e:
+ serial_failover_logger.info("Could not set SIGINT handler: %s" % e)
serial_failover_logger.info("** START TEST CASE " + str(self))
self.test_timeout = test_param_get(serial_failover_config,