Commit 4b4e2213 authored by Rohit Gupta's avatar Rohit Gupta

fixed bugs related to COTS UE

parent cd71443d
...@@ -59,6 +59,7 @@ def send_command (cmd, response, timeout): ...@@ -59,6 +59,7 @@ def send_command (cmd, response, timeout):
count=0 count=0
sleep_duration = 1 sleep_duration = 1
while count <= timeout: while count <= timeout:
try:
ser.write (cmd + '\r\n') ser.write (cmd + '\r\n')
out = '' out = ''
time.sleep(sleep_duration) time.sleep(sleep_duration)
...@@ -68,7 +69,11 @@ def send_command (cmd, response, timeout): ...@@ -68,7 +69,11 @@ def send_command (cmd, response, timeout):
print 'out = <' + out + '> response = <' + response + '> \n' print 'out = <' + out + '> response = <' + response + '> \n'
if re.search(response, out): if re.search(response, out):
break 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 () : def start_ue () :
......
...@@ -20,7 +20,7 @@ file.close() ...@@ -20,7 +20,7 @@ file.close()
if keyword == 'mme_ip_address': if keyword == 'mme_ip_address':
#string = (re.sub(r"mme_ip_address\s*=\s*\([^\$]+)\)\s*;\s*", r"<% tex \1 %>", t, re.M) #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) string = re.sub(r"mme_ip_address\s*=\s*\(([^\$]+?)\)\s*;", replacement_text, string, re.M)
elif keyword == 'N_RB_DL': elif keyword == 'N_RB_DL':
replacement_text = keyword + ' = ' + replacement_text + ' ; ' replacement_text = keyword + ' = ' + replacement_text + ' ; '
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment