aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/tests
diff options
context:
space:
mode:
authorNeels Hofmeyr <nhofmeyr@sysmocom.de>2017-02-28 02:38:43 +0100
committerHarald Welte <laforge@gnumonks.org>2017-02-28 18:22:06 +0000
commit534034580c8ed6e0c03dcb488f20f2c526e9848b (patch)
tree288850d2d718a12766eaded044bac1545a00d904 /openbsc/tests
parentd015cbd65d2547e813f361654b3059d4eefa3669 (diff)
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
Diffstat (limited to 'openbsc/tests')
-rw-r--r--openbsc/tests/vty_test_runner.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/openbsc/tests/vty_test_runner.py b/openbsc/tests/vty_test_runner.py
index 821c6d342..5836cd4aa 100644
--- a/openbsc/tests/vty_test_runner.py
+++ b/openbsc/tests/vty_test_runner.py
@@ -1207,6 +1207,7 @@ def data2str(d):
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)