Nils Fürste | a8263f4 | 2020-11-23 14:45:15 +0100 | [diff] [blame] | 1 | #!/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 |
| 5 | serial=$1 |
| 6 | run_dir=$2 |
| 7 | pcap_path=$3 |
| 8 | remote_ip=$4 |
| 9 | remote_port=$5 |
| 10 | while 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 $! |
| 25 | done |