From 534034580c8ed6e0c03dcb488f20f2c526e9848b Mon Sep 17 00:00:00 2001 From: Neels Hofmeyr Date: Tue, 28 Feb 2017 02:38:43 +0100 Subject: 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 --- openbsc/tests/vty_test_runner.py | 1 + 1 file changed, 1 insertion(+) (limited to 'openbsc') 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) -- cgit v1.2.3