CI: more details on the UE status

Signed-off-by: Raphael Defosseux <raphael.defosseux@eurecom.fr>
This commit is contained in:
Raphael Defosseux
2019-03-21 16:18:16 +01:00
parent 5d82287fa5
commit 8bd3075a3b
2 changed files with 44 additions and 9 deletions
+35 -6
View File
@@ -1079,15 +1079,44 @@ class SSHConnection():
def CheckUEStatus_common(self, lock, device_id, statusQueue):
try:
self.open(self.ADBIPAddress, self.ADBUserName, self.ADBPassword)
self.command('stdbuf -o0 adb -s ' + device_id + ' shell dumpsys telephony.registry', '\$', 15)
result = re.search('mServiceState=(?P<serviceState>[0-9]+)', str(self.ssh.before))
serviceState = 'Service State: UNKNOWN'
if result is not None:
lServiceState = int(result.group('serviceState'))
if lServiceState == 3:
serviceState = 'Service State: RADIO_POWERED_OFF'
if lServiceState == 1:
serviceState = 'Service State: OUT_OF_SERVICE'
if lServiceState == 0:
serviceState = 'Service State: IN_SERVICE'
if lServiceState == 2:
serviceState = 'Service State: EMERGENCY_ONLY'
result = re.search('mDataConnectionState=(?P<dataConnectionState>[0-9]+)', str(self.ssh.before))
dataConnectionState = 'Data State: UNKNOWN'
if result is not None:
lDataConnectionState = int(result.group('dataConnectionState'))
if lDataConnectionState == 0:
dataConnectionState = 'Data State: DISCONNECTED'
if lDataConnectionState == 1:
dataConnectionState = 'Data State: CONNECTING'
if lDataConnectionState == 2:
dataConnectionState = 'Data State: CONNECTED'
if lDataConnectionState == 3:
dataConnectionState = 'Data State: SUSPENDED'
result = re.search('mDataConnectionReason=(?P<dataConnectionReason>[0-9a-zA-Z_]+)', str(self.ssh.before))
dataConnectionReason = 'Data Reason: UNKNOWN'
if result is not None:
dataConnectionReason = 'Data Reason: ' + result.group('dataConnectionReason')
lock.acquire()
logging.debug('\u001B[1;37;44m Status Check (' + str(device_id) + ') \u001B[0m')
#logging.debug('\u001B[1;34m ' + pal_msg + '\u001B[0m')
#logging.debug('\u001B[1;34m ' + min_msg + '\u001B[0m')
#logging.debug('\u001B[1;34m ' + avg_msg + '\u001B[0m')
#logging.debug('\u001B[1;34m ' + max_msg + '\u001B[0m')
logging.debug('\u001B[1;34m ' + serviceState + '\u001B[0m')
logging.debug('\u001B[1;34m ' + dataConnectionState + '\u001B[0m')
logging.debug('\u001B[1;34m ' + dataConnectionReason + '\u001B[0m')
statusQueue.put(0)
statusQueue.put(device_id)
statusQueue.put('Nothing for the moment')
qMsg = serviceState + '\n' + dataConnectionState + '\n' + dataConnectionReason
statusQueue.put(qMsg)
lock.release()
self.close()
except:
@@ -1123,7 +1152,7 @@ class SSHConnection():
if result is not None:
nb_ues = int(result.group('nb_ues'))
htmlOptions = 'Nb Connected UE(s) to eNB = ' + str(nb_ues)
logging.debug(htmlOptions)
logging.debug('\u001B[1;37;44m ' + htmlOptions + ' \u001B[0m')
if self.expectedNbOfConnectedUEs > -1:
if nb_ues != self.expectedNbOfConnectedUEs:
passStatus = False
@@ -28,7 +28,7 @@
040101
030101 040301 040501 040603 040604 040605 040606 040607 040641 040642 040643 040644 040401 040201 030201
050102
030102 040301 040502 000010 040302 000001 000011 040303 000002 000012 040503 040401 040201 030201
030102 000010 040301 040502 000011 040302 000001 000012 040303 000002 000013 040503 040401 040201 030201
050202
</TestCaseRequestedList>
<TestCaseExclusionList></TestCaseExclusionList>
@@ -46,18 +46,24 @@
</testCase>
<testCase id="000010">
<class>CheckStatusUE</class>
<desc>Check UE(s) status before attachment</desc>
<expectedNbOfConnectedUEs>0</expectedNbOfConnectedUEs>
</testCase>
<testCase id="000011">
<class>CheckStatusUE</class>
<desc>Check UE(s) status before data disabling</desc>
<expectedNbOfConnectedUEs>2</expectedNbOfConnectedUEs>
</testCase>
<testCase id="000011">
<testCase id="000012">
<class>CheckStatusUE</class>
<desc>Check UE(s) status after data disabling</desc>
<expectedNbOfConnectedUEs>0</expectedNbOfConnectedUEs>
</testCase>
<testCase id="000012">
<testCase id="000013">
<class>CheckStatusUE</class>
<desc>Check UE(s) status after data re-enabling</desc>
<expectedNbOfConnectedUEs>2</expectedNbOfConnectedUEs>