nat/vty: Remove second assumption about lo and binding

If we want to separate the BSCs we should separate based on
the source port and not the source ip (at least in the current
test setup).

Fixes:
======================================================================
ERROR: testBSCreload (__main__.TestVTYNAT)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "./vty_test_runner.py", line 658, in testBSCreload
    b0 = nat_bsc_sock_test(0, "lol")
  File "./vty_test_runner.py", line 1145, in nat_bsc_sock_test
    bsc.bind(('127.0.0.1' + str(nr), 0))
  File "<string>", line 1, in bind
error: [Errno 99] Cannot assign requested address

----------------------------------------------------------------------
This commit is contained in:
Holger Hans Peter Freyther 2016-04-14 21:13:51 -04:00
parent e98c9c7136
commit 2abf2b072d
1 changed files with 1 additions and 1 deletions

View File

@ -1142,7 +1142,7 @@ def nat_bsc_num_con(x):
def nat_bsc_sock_test(nr, tk, verbose = False):
bsc = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
bsc.bind(('127.0.0.1' + str(nr), 0))
bsc.bind(('127.0.0.1', 0))
bsc.connect(('127.0.0.1', 5000))
if (verbose):
print "BSC%d " %nr