diff options
author | Neels Hofmeyr <nhofmeyr@sysmocom.de> | 2017-02-28 02:38:43 +0100 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2017-02-28 18:22:06 +0000 |
commit | 534034580c8ed6e0c03dcb488f20f2c526e9848b (patch) | |
tree | 288850d2d718a12766eaded044bac1545a00d904 /openbsc/tests/vty_test_runner.py | |
parent | d015cbd65d2547e813f361654b3059d4eefa3669 (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/vty_test_runner.py')
-rw-r--r-- | openbsc/tests/vty_test_runner.py | 1 |
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) |