diff --git a/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py b/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py index 6408ef5aeefbbf294ba0ef758a1ef6f780b9077c..7cc1f20f53f53fccbd227babcc6ce99f9ac17656 100644 --- a/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py +++ b/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py @@ -59,16 +59,21 @@ def send_command (cmd, response, timeout): count=0 sleep_duration = 1 while count <= timeout: - ser.write (cmd + '\r\n') - out = '' - time.sleep(sleep_duration) - count = count + sleep_duration - while ser.inWaiting() > 0: - out += ser.read(1) - print 'out = <' + out + '> response = <' + response + '> \n' - if re.search(response, out): - break - + try: + ser.write (cmd + '\r\n') + out = '' + time.sleep(sleep_duration) + count = count + sleep_duration + while ser.inWaiting() > 0: + out += ser.read(1) + print 'out = <' + out + '> response = <' + response + '> \n' + if re.search(response, out): + break + except Exception, e: + error = ' cmd : ' + cmd + ' response : ' + response + error = error + ' In function: ' + sys._getframe().f_code.co_name + ': *** Caught exception: ' + str(e.__class__) + " : " + str( e) + error = error + traceback.format_exc() + print error def start_ue () : diff --git a/cmake_targets/autotests/tools/search_repl.py b/cmake_targets/autotests/tools/search_repl.py index 43b023fccc0400ed73900745e669a55c7b635449..ee6b77e123e5d82b77bb86c4f2160509e7370640 100644 --- a/cmake_targets/autotests/tools/search_repl.py +++ b/cmake_targets/autotests/tools/search_repl.py @@ -20,7 +20,7 @@ file.close() if keyword == 'mme_ip_address': #string = (re.sub(r"mme_ip_address\s*=\s*\([^\$]+)\)\s*;\s*", r"<% tex \1 %>", t, re.M) - replacement_text = keyword + ' = ' + replacement_text + ' ; ' + replacement_text = keyword + ' = ({' + replacement_text + ')} ; ' string = re.sub(r"mme_ip_address\s*=\s*\(([^\$]+?)\)\s*;", replacement_text, string, re.M) elif keyword == 'N_RB_DL': replacement_text = keyword + ' = ' + replacement_text + ' ; '