vty tests: close msc socket after nat_msc_test

Change-Id: Ib64cf8690627803e1b4a8497ea63f1e766960478
This commit is contained in:
Neels Hofmeyr 2017-02-28 02:37:39 +01:00 committed by Harald Welte
parent 6403811468
commit 339f179de6
1 changed files with 24 additions and 20 deletions

View File

@ -783,7 +783,8 @@ class TestVTYNAT(TestVTYGenericBSC):
self.vty.command("end")
nat_msc_ip(self, ip, port)
msc = nat_msc_test(self, ip, port, verbose=True)
msc_socket, msc = nat_msc_test(self, ip, port, verbose=True)
try:
b0 = nat_bsc_sock_test(0, "lol", verbose=True, proc=self.proc)
b1 = nat_bsc_sock_test(1, "xyu", verbose=True, proc=self.proc)
b2 = nat_bsc_sock_test(5, "key", verbose=True, proc=self.proc)
@ -805,6 +806,9 @@ class TestVTYNAT(TestVTYGenericBSC):
# remaining connection is authorized
self.assertEquals('1', rem[4])
self.assertEquals("MSC is connected: 1", self.vty.command("show msc connection"))
finally:
msc.close()
msc_socket.close()
def testVtyTree(self):
self.vty.enable()
@ -1238,7 +1242,7 @@ def nat_msc_test(x, ip, port, verbose = False):
if not conn:
raise Exception("VTY reports MSC is connected, but I haven't"
" connected yet: %r %r" % (ip, port))
return conn
return msc, conn
def ipa_handle_small(x, verbose = False):
s = data2str(x.recv(4))