blob: db53261cc5eddd643e3d992f9be0be9639ca6541 [file] [log] [blame]
Nils Fürstea8263f42020-11-23 14:45:15 +01001#!/bin/bash
2# This script pulls the diag folder created by diag_mdlog and parses the
3# .qmdl file. Further, it writes all packets to a pcap file.
4# usage: osmo-gsm-tester_androidue_diag_parser.sh $serial $run_dir $pcap_path $remote_ip $remote_port
5serial=$1
6run_dir=$2
7pcap_path=$3
8remote_ip=$4
9remote_port=$5
10while true; do
11 echo "Pulling new .qmdl file..."
12 if [ "${remote_ip}" == "0" ]; then
13 # ScatParser and AndroidUe are attached to/running on the same machine
14 sudo adb -s "${serial}" pull /data/local/tmp/diag_logs "${run_dir}" >/dev/null
15 wait $!
16 else
17 # ScatParser and AndroidUe are attached to/running on different machines
18 scp -r -P "${remote_port}" root@"${remote_ip}":/data/local/tmp/diag_logs/ "${run_dir}"
19 wait $!
20 fi
21 qmdl_fn=$(find "${run_dir}" -maxdepth 2 -type f -name "*.qmdl")
22 wait $!
23 sudo scat -t qc --event -d "${qmdl_fn}" -F "${pcap_path}"
24 wait $!
25done