[PATCH] openbsc[master]: vty tests: more attempts to resolve 'Broken Pipe' error

Neels Hofmeyr gerrit-no-reply at lists.osmocom.org
Fri Feb 3 15:11:13 UTC 2017


Review at  https://gerrit.osmocom.org/1741

vty tests: more attempts to resolve 'Broken Pipe' error

Change-Id: I4251a24eb7a57a354aa76de711547c3e76ebb846
---
M openbsc/tests/vty_test_runner.py
1 file changed, 17 insertions(+), 7 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/41/1741/1

diff --git a/openbsc/tests/vty_test_runner.py b/openbsc/tests/vty_test_runner.py
index 608aef4..3f6e3df 100644
--- a/openbsc/tests/vty_test_runner.py
+++ b/openbsc/tests/vty_test_runner.py
@@ -781,10 +781,10 @@
         self.vty.command("end")
 
         nat_msc_ip(self, ip, port)
-        msc = nat_msc_test(self, ip, port)
-        b0 = nat_bsc_sock_test(0, "lol")
-        b1 = nat_bsc_sock_test(1, "xyu")
-        b2 = nat_bsc_sock_test(5, "key")
+        msc = nat_msc_test(self, ip, port, verbose=True)
+        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)
 
         self.assertEquals("3 BSCs configured", self.vty.command("show nat num-bscs-configured"))
         self.assertTrue(3 == nat_bsc_num_con(self))
@@ -1256,11 +1256,13 @@
         if (verbose):
             print "\tBSC <- NAT: ", s
 
-def ipa_handle_resp(x, tk, verbose = False):
+def ipa_handle_resp(x, tk, verbose = False, proc=None):
     s = data2str(x.recv(38))
     if "0023fe040108010701020103010401050101010011" in s:
         retries = 3
         while True:
+            if proc:
+              print "\tproc.poll() = %r" % proc.poll()
             print "\tsending IPA identity(%s) at %s" % (tk, time.strftime("%T"))
             try:
                 x.send(IPA().id_resp(IPA().identity(name = tk.encode('utf-8'))))
@@ -1269,6 +1271,8 @@
                 break
             except:
                 print "\tfailed sending IPA identity at", time.strftime("%T")
+                if proc:
+                  print "\tproc.poll() = %r" % proc.poll()
                 if retries < 1:
                     print "\tgiving up"
                     raise
@@ -1281,16 +1285,22 @@
 def nat_bsc_num_con(x):
     return len(x.vty.command("show bsc connections").split('\n'))
 
-def nat_bsc_sock_test(nr, tk, verbose = False):
+def nat_bsc_sock_test(nr, tk, verbose = False, proc=None):
     bsc = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
     bsc.bind(('127.0.0.1', 0))
     bsc.connect(('127.0.0.1', 5000))
     if (verbose):
         print "BSC%d " %nr
         print "\tconnected to %s:%d" % bsc.getpeername()
+    if proc:
+      print "\tproc.poll() = %r" % proc.poll()
     ipa_handle_small(bsc, verbose)
-    ipa_handle_resp(bsc, tk, verbose)
+    ipa_handle_resp(bsc, tk, verbose, proc=proc)
+    if proc:
+      print "\tproc.poll() = %r" % proc.poll()
     bsc.recv(27) # MGCP msg
+    if proc:
+      print "\tproc.poll() = %r" % proc.poll()
     ipa_handle_small(bsc, verbose)
     return bsc
 

-- 
To view, visit https://gerrit.osmocom.org/1741
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I4251a24eb7a57a354aa76de711547c3e76ebb846
Gerrit-PatchSet: 1
Gerrit-Project: openbsc
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr <nhofmeyr at sysmocom.de>


More information about the gerrit-log mailing list