[PATCH] openbsc[master]: vty test: nat_msc_test: setsockopt REUSE to avoid TIME_WAIT ...

Neels Hofmeyr gerrit-no-reply at lists.osmocom.org
Tue Feb 28 02:08:04 UTC 2017


Review at  https://gerrit.osmocom.org/1932

vty test: nat_msc_test: setsockopt REUSE to avoid TIME_WAIT problems

When running the testBSCreload test in close succession, I get a "Connection
refused" error because the socket is still in TIME_WAIT state. Passing the
SO_REUSEADDR flag allows reusing the addr despite a TIME_WAIT socket.

Change-Id: I941851b062999ab4b962430f7b27c19935993e0a
---
M openbsc/tests/vty_test_runner.py
1 file changed, 1 insertion(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/32/1932/1

diff --git a/openbsc/tests/vty_test_runner.py b/openbsc/tests/vty_test_runner.py
index ba3db97..b4dec89 100644
--- a/openbsc/tests/vty_test_runner.py
+++ b/openbsc/tests/vty_test_runner.py
@@ -1206,6 +1206,7 @@
 
 def nat_msc_test(x, ip, port, verbose = False):
     msc = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
+    msc.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
     msc.settimeout(5)
     msc.bind((ip, port))
     msc.listen(5)

-- 
To view, visit https://gerrit.osmocom.org/1932
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I941851b062999ab4b962430f7b27c19935993e0a
Gerrit-PatchSet: 1
Gerrit-Project: openbsc
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr <nhofmeyr at sysmocom.de>


More information about the gerrit-log mailing list