summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Quattlebaum <rquattle@google.com>2017-08-11 15:16:08 -0700
committerRobert Quattlebaum <rquattle@google.com>2017-09-07 16:56:52 -0700
commit03e6a13b4724c0a7fffcb50a9f65ec9b6f16eb1a (patch)
treeb67e5cedea37473fbd2a840d6e8bc0f04bd208ee
parent0c9a220563ff3ee7181d52614be33cc475a4de7f (diff)
downloadlowpan-03e6a13b4724c0a7fffcb50a9f65ec9b6f16eb1a.tar.gz
Test script updates
Change-Id: I349f796f975419e152495c63af72ff8c5e2aa2e5
-rwxr-xr-xtests/commandtest.sh34
-rwxr-xr-xtests/jointest.sh69
-rwxr-xr-xtests/scantest.sh20
3 files changed, 80 insertions, 43 deletions
diff --git a/tests/commandtest.sh b/tests/commandtest.sh
index 89ac951..b80feb6 100755
--- a/tests/commandtest.sh
+++ b/tests/commandtest.sh
@@ -23,8 +23,8 @@ sleep 2
adb shell killall wpantund 2> /dev/null
# Start wpantund
-echo "+ adb shell wpantund -s 'system:ot-ncp\ 1' -o Config:Daemon:ExternalNetifManagement 1 &"
-adb shell wpantund -s 'system:ot-ncp\ 1' -o Config:Daemon:ExternalNetifManagement 1 &
+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_PID=$!
trap "kill -HUP $WPANTUND_PID 2> /dev/null" EXIT INT TERM
@@ -33,16 +33,26 @@ sleep 2
kill -0 $WPANTUND_PID || die "wpantund failed to start"
sleep 2
-echo "+ adb shell lowpanctl status"
-adb shell lowpanctl status || die
-echo "+ adb shell lowpanctl form blahnet"
-adb shell lowpanctl form blahnet || die
-echo "+ adb shell lowpanctl status"
-adb shell lowpanctl status || die
-echo "+ adb shell ifconfig wpan0"
-adb shell ifconfig wpan0 || die
-echo "+ adb shell ip rule"
-adb shell ip rule || die
+echo "+ adb shell lowpanctl -I wpan5 status"
+adb shell lowpanctl -I wpan5 status || die
+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 ifconfig wpan5"
+adb shell ifconfig wpan5 || die
+echo "+ adb shell dumpsys netd"
+adb shell dumpsys netd || die
+echo "+ adb shell ip -6 rule"
+adb shell ip -6 rule || die
+echo "+ adb shell ip -6 route list table wpan5"
+adb shell ip -6 route list table wpan5 || die
+
+if [ "shell" = "$1" ]
+then
+ echo "+ adb shell"
+ adb shell
+fi
echo "Finished form command test."
diff --git a/tests/jointest.sh b/tests/jointest.sh
index a99bb67..3a41dcc 100755
--- a/tests/jointest.sh
+++ b/tests/jointest.sh
@@ -2,10 +2,24 @@
cd "`dirname $0`"
+if [ "shell" = "$1" ]
+then
+ WANTS_SHELL=1
+fi
+
+possibly_enter_shell() {
+ if [ "$WANTS_SHELL" = "1" ]
+ then
+ echo " *** Entering adb shell:"
+ adb shell
+ fi
+}
+
die () {
set +x # Turn off printing commands
echo ""
echo " *** fatal error: $*"
+ possibly_enter_shell
exit 1
}
@@ -21,9 +35,9 @@ sleep 2
adb shell killall wpantund 2> /dev/null
-adb shell wpantund -I wpan0 -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=$!
-adb shell wpantund -I wpan1 -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
@@ -34,24 +48,37 @@ kill -0 $WPANTUND_2_PID || die "wpantund failed to start"
sleep 2
-echo "+ adb shell lowpanctl -I wpan0 status"
-adb shell lowpanctl -I wpan0 status || die
-echo "+ adb shell lowpanctl -I wpan0 form blahnet --panid 1234 --xpanid 0011223344556677 --channel 11"
-adb shell lowpanctl -I wpan0 form blahnet --panid 1234 --xpanid 0011223344556677 --channel 11 || die
-echo "+ adb shell lowpanctl -I wpan0 status"
-adb shell lowpanctl -I wpan0 status || die
-echo "+ adb shell lowpanctl -I wpan0 show-credential"
-adb shell lowpanctl -I wpan0 show-credential || die
-
-CREDENTIAL=`adb shell lowpanctl -I wpan0 show-credential -r` || die
-
-echo "+ adb shell lowpanctl -I wpan1 status"
-adb shell lowpanctl -I wpan1 status || die
-echo "+ adb shell lowpanctl -I wpan1 scan"
-adb shell lowpanctl -I wpan1 scan || die
-echo "+ adb shell lowpanctl -I wpan1 join blahnet --panid 1234 --xpanid 0011223344556677 --channel 11 --master-key ${CREDENTIAL}"
-adb shell lowpanctl -I wpan1 join blahnet --panid 1234 --xpanid 0011223344556677 --channel 11 --master-key ${CREDENTIAL} || die
-echo "+ adb shell lowpanctl -I wpan1 status"
-adb shell lowpanctl -I wpan1 status || die
+echo "+ adb shell lowpanctl -I wpan5 status"
+adb shell lowpanctl -I wpan5 status || die
+echo "+ adb shell lowpanctl -I wpan5 form blahnet --panid 1234 --xpanid 0011223344556677 --channel 11"
+adb shell lowpanctl -I wpan5 form blahnet --panid 1234 --xpanid 0011223344556677 --channel 11 || die
+echo "+ adb shell lowpanctl -I wpan5 status"
+adb shell lowpanctl -I wpan5 status || die
+echo "+ adb shell lowpanctl -I wpan5 show-credential"
+adb shell lowpanctl -I wpan5 show-credential || die
+
+CREDENTIAL=`adb shell lowpanctl -I wpan5 show-credential -r` || die
+
+echo "+ adb shell lowpanctl -I wpan6 status"
+adb shell lowpanctl -I wpan6 status || die
+echo "+ adb shell lowpanctl -I wpan6 scan"
+adb shell lowpanctl -I wpan6 scan || die
+echo "+ adb shell lowpanctl -I wpan6 join blahnet --panid 1234 --xpanid 0011223344556677 --channel 11 --master-key ${CREDENTIAL}"
+adb shell lowpanctl -I wpan6 join blahnet --panid 1234 --xpanid 0011223344556677 --channel 11 --master-key ${CREDENTIAL} || die
+
+sleep 2
+
+echo "+ adb shell lowpanctl -I wpan6 status"
+adb shell lowpanctl -I wpan6 status || die
+
+WPAN5_LL_ADDR=`adb shell lowpanctl -I wpan5 status | grep fe80:: | sed -e 's:^[^a-f:0-9]*\([a-f:0-9]*\)/.*:\1:i'`
+WPAN6_LL_ADDR=`adb shell lowpanctl -I wpan6 status | grep fe80:: | sed -e 's:^[^a-f:0-9]*\([a-f:0-9]*\)/.*:\1:i'`
+
+echo "+ ping6 -c 4 -w 6 ${WPAN5_LL_ADDR}%wpan6"
+adb shell ping6 -c 4 -w 6 ${WPAN5_LL_ADDR}%wpan6 || die
+echo "+ ping6 -c 4 -w 6 ${WPAN6_LL_ADDR}%wpan5"
+adb shell ping6 -c 4 -w 6 ${WPAN6_LL_ADDR}%wpan5 || die
+
+possibly_enter_shell
echo "Finished join command test."
diff --git a/tests/scantest.sh b/tests/scantest.sh
index 4945f2b..aee9f1a 100755
--- a/tests/scantest.sh
+++ b/tests/scantest.sh
@@ -21,11 +21,11 @@ sleep 2
adb shell killall wpantund 2> /dev/null
-echo "+ adb shell wpantund -I wpan0 -s 'system:ot-ncp\ 1' -o Config:Daemon:ExternalNetifManagement 1 &"
-adb shell wpantund -I wpan0 -s 'system:ot-ncp\ 1' -o Config:Daemon:ExternalNetifManagement 1 &
+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 wpan1 -s 'system:ot-ncp\ 2' -o Config:Daemon:ExternalNetifManagement 1 &"
-adb shell wpantund -I wpan1 -s 'system:ot-ncp\ 2' -o Config:Daemon:ExternalNetifManagement 1 &
+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
@@ -34,11 +34,11 @@ 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 wpan0 form blahnet"
-adb shell lowpanctl -I wpan0 form blahnet || die
-echo "+ adb shell lowpanctl -I wpan0 status"
-adb shell lowpanctl -I wpan0 status || die
-echo "+ adb shell lowpanctl -I wpan1 scan"
-adb shell lowpanctl -I wpan1 scan || die
+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."