Commit 03526f90 authored by Raphael Defosseux's avatar Raphael Defosseux

CI: adding tshark capturing on EPC side

Signed-off-by: default avatarRaphael Defosseux <raphael.defosseux@eurecom.fr>
parent 7090357e
......@@ -145,6 +145,7 @@ class SSHConnection():
self.UEDevicesRemoteUser = []
self.UEDevicesOffCmd = []
self.UEDevicesOnCmd = []
self.UEDevicesRebootCmd = []
self.CatMDevices = []
self.UEIPAddresses = []
self.htmlFile = ''
......@@ -613,6 +614,14 @@ class SSHConnection():
if re.match('OAI-Rel14-CUPS', self.EPCType, re.IGNORECASE):
logging.debug('Using the OAI EPC Release 14 Cassandra-based HSS')
self.command('cd ' + self.EPCSourceCodePath + '/scripts', '\$', 5)
self.command('ip addr show | awk -f /tmp/active_net_interfaces.awk | egrep --colour=never "s11"', '\$', 5)
result = re.search('interfaceToUse=(?P<eth_interface>[a-zA-Z0-9\-\_\:]+)done', str(self.ssh.before))
if result is not None:
eth_interface = result.group('eth_interface')
logging.debug('\u001B[1m Launching tshark on interface ' + eth_interface + ' and lo \u001B[0m')
EPC_PcapFileName = 'epc_' + self.testCase_id + '.pcap'
self.command('echo ' + self.EPCPassword + ' | sudo -S rm -f ' + EPC_PcapFileName, '\$', 5)
self.command('echo $USER; nohup sudo tshark -i ' + eth_interface + ' -i lo -w ' + self.EPCSourceCodePath + '/scripts/' + EPC_PcapFileName + ' > /tmp/tshark.log 2>&1 &', self.EPCUserName, 5)
self.command('echo ' + self.EPCPassword + ' | sudo -S mkdir -p logs', '\$', 5)
self.command('echo ' + self.EPCPassword + ' | sudo -S rm -f hss_' + self.testCase_id + '.log logs/hss*.*', '\$', 5)
self.command('echo "oai_hss -j /usr/local/etc/oai/hss_rel14.json" > ./my-hss.sh', '\$', 5)
......@@ -873,8 +882,21 @@ class SSHConnection():
try:
self.open(self.ADBIPAddress, self.ADBUserName, self.ADBPassword)
if not self.ADBCentralized:
# Reboot UE
self.command('ssh ' + self.UEDevicesRemoteUser[idx] + '@' + self.UEDevicesRemoteServer[idx] + ' ' + self.UEDevicesRebootCmd[idx], '\$', 60)
# Wait
time.sleep(60)
# Put in LTE-Mode only
self.command('ssh ' + self.UEDevicesRemoteUser[idx] + '@' + self.UEDevicesRemoteServer[idx] + ' \'adb -s ' + device_id + ' shell "settings put global preferred_network_mode 11"\'', '\$', 60)
self.command('ssh ' + self.UEDevicesRemoteUser[idx] + '@' + self.UEDevicesRemoteServer[idx] + ' \'adb -s ' + device_id + ' shell "settings put global preferred_network_mode1 11"\'', '\$', 60)
self.command('ssh ' + self.UEDevicesRemoteUser[idx] + '@' + self.UEDevicesRemoteServer[idx] + ' \'adb -s ' + device_id + ' shell "settings put global preferred_network_mode2 11"\'', '\$', 60)
self.command('ssh ' + self.UEDevicesRemoteUser[idx] + '@' + self.UEDevicesRemoteServer[idx] + ' \'adb -s ' + device_id + ' shell "settings put global preferred_network_mode3 11"\'', '\$', 60)
# enable data service
self.command('ssh ' + self.UEDevicesRemoteUser[idx] + '@' + self.UEDevicesRemoteServer[idx] + ' \'adb -s ' + device_id + ' shell "svc data enable"\'', '\$', 60)
# we need to do radio on/off cycle to make sure of above changes
# airplane mode off // radio on
self.command('ssh ' + self.UEDevicesRemoteUser[idx] + '@' + self.UEDevicesRemoteServer[idx] + ' ' + self.UEDevicesOnCmd[idx], '\$', 60)
time.sleep(10)
# airplane mode on // radio off
self.command('ssh ' + self.UEDevicesRemoteUser[idx] + '@' + self.UEDevicesRemoteServer[idx] + ' ' + self.UEDevicesOffCmd[idx], '\$', 60)
self.close()
......@@ -1615,6 +1637,7 @@ class SSHConnection():
self.UEDevicesRemoteUser.append(comma_split[2])
self.UEDevicesOffCmd.append(comma_split[3])
self.UEDevicesOnCmd.append(comma_split[4])
self.UEDevicesRebootCmd.append(comma_split[5])
phone_list_file.close()
if terminate_ue_flag == False:
......@@ -3461,6 +3484,11 @@ class SSHConnection():
if result is not None:
self.command('echo ' + self.EPCPassword + ' | sudo -S killall --signal SIGKILL spgwc spgwu || true', '\$', 5)
self.command('rm -f ' + self.EPCSourceCodePath + '/scripts/my-spgw*.sh', '\$', 5)
self.command('stdbuf -o0 ps -aux | grep tshark | grep -v grep', '\$', 5)
result = re.search('-w ', str(self.ssh.before))
if result is not None:
self.command('echo ' + self.EPCPassword + ' | sudo -S killall --signal SIGINT tshark || true', '\$', 5)
self.command('echo ' + self.EPCPassword + ' | sudo -S chmod 666 ' + self.EPCSourceCodePath + '/scripts/*.pcap', '\$', 5)
elif re.match('OAI', self.EPCType, re.IGNORECASE):
self.command('echo ' + self.EPCPassword + ' | sudo -S killall --signal SIGINT run_spgw spgw || true', '\$', 5)
time.sleep(2)
......@@ -3776,8 +3804,8 @@ class SSHConnection():
self.command('zip hss.log.zip hss*.log', '\$', 60)
self.command('echo ' + self.EPCPassword + ' | sudo -S rm hss*.log', '\$', 5)
if re.match('OAI-Rel14-CUPS', self.EPCType, re.IGNORECASE):
self.command('zip hss.log.zip logs/hss*.*', '\$', 60)
self.command('echo ' + self.EPCPassword + ' | sudo -S rm logs/hss*.*', '\$', 5)
self.command('zip hss.log.zip logs/hss*.* *.pcap', '\$', 60)
self.command('echo ' + self.EPCPassword + ' | sudo -S rm -f logs/hss*.* *.pcap', '\$', 5)
elif re.match('ltebox', self.EPCType, re.IGNORECASE):
self.command('cp /opt/hss_sim0609/hss.log .', '\$', 60)
self.command('zip hss.log.zip hss.log', '\$', 60)
......
......@@ -25,7 +25,7 @@
<htmlTabName>Build eNB0</htmlTabName>
<htmlTabIcon>wrench</htmlTabIcon>
<TestCaseRequestedList>
010101 040101
010101
</TestCaseRequestedList>
<TestCaseExclusionList></TestCaseExclusionList>
......@@ -35,24 +35,4 @@
<Build_eNB_args>-w USRP -c --eNB</Build_eNB_args>
</testCase>
<testCase id="050101">
<class>Initialize_HSS</class>
<desc>Initialize HSS</desc>
</testCase>
<testCase id="060101">
<class>Initialize_MME</class>
<desc>Initialize MME</desc>
</testCase>
<testCase id="070101">
<class>Initialize_SPGW</class>
<desc>Initialize SPGW</desc>
</testCase>
<testCase id="040101">
<class>Initialize_UE</class>
<desc>Initialize UE</desc>
</testCase>
</testCaseList>
......@@ -26,6 +26,7 @@
<htmlTabIcon>log-out</htmlTabIcon>
<TestCaseRequestedList>
050201 060201 070201
040101
</TestCaseRequestedList>
<TestCaseExclusionList></TestCaseExclusionList>
......@@ -44,4 +45,9 @@
<desc>Terminate SPGW</desc>
</testCase>
<testCase id="040101">
<class>Initialize_UE</class>
<desc>Initialize UE</desc>
</testCase>
</testCaseList>
......@@ -19,18 +19,24 @@
For more information about the OpenAirInterface (OAI) Software Alliance:
contact@openairinterface.org
030102 000002 040301 000002 040504 040605 040606 040645 040646 000001 040401 000002 030201
-->
<testCaseList>
<htmlTabRef>test-05-tm1</htmlTabRef>
<htmlTabName>Test-05MHz-TM1</htmlTabName>
<htmlTabIcon>tasks</htmlTabIcon>
<repeatCount>4</repeatCount>
<repeatCount>2</repeatCount>
<TestCaseRequestedList>
030201
030201 040101
030102 000002 040301 000002 040504 000001 040401 000002 030201
</TestCaseRequestedList>
<TestCaseExclusionList></TestCaseExclusionList>
<testCase id="040101">
<class>Initialize_UE</class>
<desc>Initialize UE</desc>
</testCase>
<testCase id="000001">
<class>IdleSleep</class>
<desc>Sleep for 10 sec</desc>
......@@ -71,28 +77,28 @@
<ping_packetloss_threshold>5</ping_packetloss_threshold>
</testCase>
<testCase id="040603">
<testCase id="040605">
<class>Iperf</class>
<desc>iperf (5MHz - DL/1Mbps/UDP)(30 sec)</desc>
<iperf_args>-u -b 1M -t 30 -i 1 -fm</iperf_args>
<iperf_packetloss_threshold>50</iperf_packetloss_threshold>
</testCase>
<testCase id="040604">
<testCase id="040606">
<class>Iperf</class>
<desc>iperf (5MHz - DL/12Mbps/UDP)(30 sec)</desc>
<iperf_args>-u -b 12M -t 30 -i 1 -fm</iperf_args>
<iperf_packetloss_threshold>50</iperf_packetloss_threshold>
</testCase>
<testCase id="040643">
<testCase id="040645">
<class>Iperf</class>
<desc>iperf (5MHz - UL/1Mbps/UDP)(30 sec)</desc>
<iperf_args>-u -b 1M -t 30 -i 1 -fm -R</iperf_args>
<iperf_packetloss_threshold>50</iperf_packetloss_threshold>
</testCase>
<testCase id="040644">
<testCase id="040646">
<class>Iperf</class>
<desc>iperf (5MHz - UL/2Mbps/UDP)(30 sec)</desc>
<iperf_args>-u -b 2M -t 30 -i 1 -fm -R</iperf_args>
......
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