diff options
author | Xin Li <delphij@google.com> | 2018-08-06 16:50:57 -0700 |
---|---|---|
committer | Xin Li <delphij@google.com> | 2018-08-06 16:50:57 -0700 |
commit | 29497db8b7b1b31d52d3692b4ad0a725db79f553 (patch) | |
tree | 7974b9ccafbb56a3867ece64defed98f33a87541 /tests/scantest.sh | |
parent | dab952b5d0a08d1e82f60dc945a683a40bf50101 (diff) | |
parent | 8c11059c01c490ba2166f560dfa3616d78a575dd (diff) | |
download | lowpan-29497db8b7b1b31d52d3692b4ad0a725db79f553.tar.gz |
Merge Android Pie into masterandroid-o-mr1-iot-release-1.0.4android-o-mr1-iot-release-1.0.3
Bug: 112104996
Change-Id: Ib34e4c6cf033cd092ac0c1b489258083e24f951d
Diffstat (limited to 'tests/scantest.sh')
-rwxr-xr-x | tests/scantest.sh | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/tests/scantest.sh b/tests/scantest.sh new file mode 100755 index 0000000..aee9f1a --- /dev/null +++ b/tests/scantest.sh @@ -0,0 +1,44 @@ +#!/usr/bin/env bash + +cd "`dirname $0`" + +die () { + set +x # Turn off printing commands + echo "" + echo " *** fatal error: $*" + exit 1 +} + +if [ -z $ANDROID_BUILD_TOP ]; then + echo "You need to source and lunch before you can use this script" + exit 1 +fi + +adb wait-for-device || die + +echo "Running scan command test. . ." +sleep 2 + +adb shell killall wpantund 2> /dev/null + +echo "+ adb shell wpantund -I wpan5 -s 'system:ot-ncp\ 1' -o Config:Daemon:ExternalNetifManagement 1 &" +adb shell wpantund -I wpan5 -s 'system:ot-ncp\ 1' -o Config:Daemon:ExternalNetifManagement 1 & +WPANTUND_1_PID=$! +echo "+ adb shell wpantund -I wpan6 -s 'system:ot-ncp\ 2' -o Config:Daemon:ExternalNetifManagement 1 &" +adb shell wpantund -I wpan6 -s 'system:ot-ncp\ 2' -o Config:Daemon:ExternalNetifManagement 1 & +WPANTUND_2_PID=$! +trap "kill -HUP $WPANTUND_1_PID $WPANTUND_2_PID 2> /dev/null" EXIT INT TERM + +sleep 2 +kill -0 $WPANTUND_1_PID || die "wpantund failed to start" +kill -0 $WPANTUND_2_PID || die "wpantund failed to start" +sleep 2 + +echo "+ adb shell lowpanctl -I wpan5 form blahnet" +adb shell lowpanctl -I wpan5 form blahnet || die +echo "+ adb shell lowpanctl -I wpan5 status" +adb shell lowpanctl -I wpan5 status || die +echo "+ adb shell lowpanctl -I wpan6 scan" +adb shell lowpanctl -I wpan6 scan || die + +echo "Finished scan command test." |