diff options
author | Neels Hofmeyr <nhofmeyr@sysmocom.de> | 2017-01-26 23:04:28 +0100 |
---|---|---|
committer | Neels Hofmeyr <nhofmeyr@sysmocom.de> | 2017-02-02 23:38:46 +0000 |
commit | 7d17c3ef61c31540a45fb31cd42fbca6a932964b (patch) | |
tree | e0b8129af3890e8d17f229deb7c5306721f1f50b /openbsc/tests/vty_test_runner.py | |
parent | 35706ddd80c248a9ef26e702c81e9865a7b8cf6d (diff) |
vty tests: attempt to get at sporadic 'Broken Pipe' error
Add verbose logging as well as three retries around the place that often
fails on our build server with a 'Broken Pipe' error.
Change-Id: I8851b76b2d7b87dd500ae40f47e6bea716ef3fc4
Diffstat (limited to 'openbsc/tests/vty_test_runner.py')
-rw-r--r-- | openbsc/tests/vty_test_runner.py | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/openbsc/tests/vty_test_runner.py b/openbsc/tests/vty_test_runner.py index 89b7a1990..7b25d1097 100644 --- a/openbsc/tests/vty_test_runner.py +++ b/openbsc/tests/vty_test_runner.py @@ -1257,7 +1257,21 @@ def ipa_handle_small(x, verbose = False): def ipa_handle_resp(x, tk, verbose = False): s = data2str(x.recv(38)) if "0023fe040108010701020103010401050101010011" in s: - x.send(IPA().id_resp(IPA().identity(name = tk.encode('utf-8')))) + retries = 3 + while True: + print "\tsending IPA identity(%s) at %s" % (tk, time.strftime("%T")) + try: + x.send(IPA().id_resp(IPA().identity(name = tk.encode('utf-8')))) + print "\tdone sending IPA identity(%s) at %s" % (tk, + time.strftime("%T")) + break + except: + print "\tfailed sending IPA identity at", time.strftime("%T") + if retries < 1: + print "\tgiving up" + raise + print "\tretrying (%d attempts left)" % retries + retries -= 1 else: if (verbose): print "\tBSC <- NAT: ", s |