controller: prevent switch from reconnecting
If a switch disconnects during a test we want to make sure we catch it.
diff --git a/src/python/oftest/controller.py b/src/python/oftest/controller.py
index 41ac927..1191c37 100644
--- a/src/python/oftest/controller.py
+++ b/src/python/oftest/controller.py
@@ -344,6 +344,10 @@
if self.initial_hello:
self.message_send(ofp.message.hello())
self.connect_cv.notify() # Notify anyone waiting
+
+ # Prevent further connections
+ self.listen_socket.close()
+ self.listen_socket = None
elif s and s == self.switch_socket:
for idx in range(3): # debug: try a couple of times
try: