osmo-gsm-tester/utils/bin/osmo-gsm-tester_androidue_d...

26 lines
910 B
Bash
Raw Permalink Normal View History

Introduce Android UEs as new modems To expand the test capacities we would like to introduce Android UEs as new modems. Currently the following tests are supported: - Ping - iPerf3 DL/UL - RRC Mobile MT Ping In the following is a small description. Prerequisites: - Android UE - Rooted (Ping, iPerf, RRC Idle MT Ping) - Qualcomm baseband with working diag_mdlog (RRC Idle MT Ping) - iPerf3 - Dropbear - OGT Slave Unit - Android SDK Platform-Tools (https://developer.android.com/studio/releases/platform-tools#downloads) - Pycrate (https://github.com/P1sec/pycrate) - SCAT clone https://github.com/bedrankara/scat/ & install dependencies checkout branch ogt symlink scat (ln -s ~/scat/scat.py /usr/local/bin/scat) Infrastructure explaination: The Android UEs are connected to the OGT Units via USB. We activate tethering and set up a SSH server (with Dropbear). We chose tethering over WiFi to have a more stable route for the ssh connection. We forward incoming connections to the OGT unit hosting the Android UE(s) on specific ports to the UEs via iptables. This enables OGT to issue commands directly to the UEs. In case of local execution we use ADB to issue commands to the AndroidUE. The set up was tested with 5 Android UEs connected in parallel but it should be scalable to the number of available IPs in the respective subnet. Furthermore, we need to cross compile Dropbear and iPerf3 to use them on the UEs. These tools have to be added to the $PATH variable of the UEs. Examplary set up: In this example we have two separate OGT units (master and slave) and two Android UEs that are connected to the slave unit. An illustration may be found here: https://ibb.co/6BXSP2C On UE 1: ip address add 192.168.42.130/24 dev rndis0 ip route add 192.168.42.0/24 dev rndis0 table local_network dropbearmulti dropbear -F -E -p 130 -R -T /data/local/tmp/authorized_keys -U 0 -G 0 -N root -A On UE 2: ip address add 192.168.42.131/24 dev rndis0 ip route add 192.168.42.0/24 dev rndis0 table local_network dropbearmulti dropbear -F -E -p 131 -R -T /data/local/tmp/authorized_keys -U 0 -G 0 -N root -A On OGT slave unit: sudo ip link add name ogt type bridge sudo ip l set eth0 master ogt sudo ip l set enp0s20f0u1 master ogt sudo ip l set enp0s20f0u2 master ogt sudo ip a a 192.168.42.1/24 dev ogt sudo ip link set ogt up Now we have to manually connect to every UE from OGT Master to set up SSH keys and verify that the setup works. Therefore, use: ssh -p [UE-PORT] root@[OGT SLAVE UNIT's IP] Finally, to finish the setup procedure create the remote_run_dir for Android UEs on the slave unit like following: mkdir /osmo-gsm-tester-androidue chown jenkins /osmo-gsm-tester-androidue Example for modem in resource.conf: - label: mi5g type: androidue imsi: '901700000034757' ki: '85E9E9A947B9ACBB966ED7113C7E1B8A' opc: '3E1C73A29B9C293DC5A763E42C061F15' apn: apn: 'srsapn' mcc: '901' mnc: '70' select: 'True' auth_algo: 'milenage' features: ['4g', 'dl_qam256', 'qc_diag'] run_node: run_type: ssh run_addr: 100.113.1.170 ssh_user: jenkins ssh_addr: 100.113.1.170 ue_ssh_port: 130 adb_serial_id: '8d3c79a7' scat_parser: run_type: local run_addr: 127.0.0.1 adb_serial_id: '8d3c79a7' Example for default-suites.conf: - 4g:ms-label@mi5g+srsenb-rftype@uhd+mod-enb-nprb@25+mod-enb-txmode@1 Change-Id: I79a5d803e869a868d4dac5e0d4c2feb38038dc5c
2020-11-23 13:45:15 +00:00
#!/bin/bash
# This script pulls the diag folder created by diag_mdlog and parses the
# .qmdl file. Further, it writes all packets to a pcap file.
# usage: osmo-gsm-tester_androidue_diag_parser.sh $serial $run_dir $pcap_path $remote_ip $remote_port
serial=$1
run_dir=$2
pcap_path=$3
remote_ip=$4
remote_port=$5
while true; do
echo "Pulling new .qmdl file..."
if [ "${remote_ip}" == "0" ]; then
# ScatParser and AndroidUe are attached to/running on the same machine
sudo adb -s "${serial}" pull /data/local/tmp/diag_logs "${run_dir}" >/dev/null
wait $!
else
# ScatParser and AndroidUe are attached to/running on different machines
scp -r -P "${remote_port}" root@"${remote_ip}":/data/local/tmp/diag_logs/ "${run_dir}"
wait $!
fi
qmdl_fn=$(find "${run_dir}" -maxdepth 2 -type f -name "*.qmdl")
wait $!
sudo scat -t qc --event -d "${qmdl_fn}" -F "${pcap_path}"
wait $!
done