diff options
author | android-build-team Robot <android-build-team-robot@google.com> | 2017-09-10 08:13:31 +0000 |
---|---|---|
committer | android-build-team Robot <android-build-team-robot@google.com> | 2017-09-10 08:13:31 +0000 |
commit | a4c2920c8a2f59f33f7931a1b4e4db5cef0b324b (patch) | |
tree | 67d6732d97cf248bf18af2fee0329987ca65c942 | |
parent | f303603810c0ff93d09920e0422e1a38ab9b2fc2 (diff) | |
parent | e426de20f9eb216ec1ebcd559fbfc8010476f3f7 (diff) | |
download | lowpan-a4c2920c8a2f59f33f7931a1b4e4db5cef0b324b.tar.gz |
release-request-cacfaf25-4304-4e6b-ab4e-089367c7ed39-for-git_pi-release-4326570 snap-temp-L59400000101056305
Change-Id: I13bf5733f02e41f1a0790cb722d4bf66d0de8702
-rw-r--r-- | product/lowpan-service.mk | 25 | ||||
-rw-r--r-- | product/lowpan.mk | 17 | ||||
-rw-r--r-- | product/wpantund.mk | 17 | ||||
-rwxr-xr-x | tests/commandtest.sh | 34 | ||||
-rwxr-xr-x | tests/jointest.sh | 69 | ||||
-rwxr-xr-x | tests/scantest.sh | 20 |
6 files changed, 139 insertions, 43 deletions
diff --git a/product/lowpan-service.mk b/product/lowpan-service.mk new file mode 100644 index 0000000..7234d2e --- /dev/null +++ b/product/lowpan-service.mk @@ -0,0 +1,25 @@ +# +## Copyright (C) 2017 The Android Open Source Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +PRODUCT_COPY_FILES += \ + $(call add-to-product-copy-files-if-exists,frameworks/native/data/etc/android.hardware.lowpan.xml:system/etc/permissions/android.hardware.lowpan.xml) + +PRODUCT_SYSTEM_SERVER_JARS += \ + lowpan-service + +PRODUCT_PACKAGES += \ + lowpan-service \ + lowpanctl + diff --git a/product/lowpan.mk b/product/lowpan.mk new file mode 100644 index 0000000..b7c1f44 --- /dev/null +++ b/product/lowpan.mk @@ -0,0 +1,17 @@ +# +## Copyright (C) 2017 The Android Open Source Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +$(call inherit-product-if-exists, frameworks/opt/net/lowpan/product/lowpan-service.mk) +$(call inherit-product-if-exists, frameworks/opt/net/lowpan/product/wpantund.mk) diff --git a/product/wpantund.mk b/product/wpantund.mk new file mode 100644 index 0000000..e21ffa2 --- /dev/null +++ b/product/wpantund.mk @@ -0,0 +1,17 @@ +# +## Copyright (C) 2017 The Android Open Source Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +PRODUCT_PACKAGES += \ + wpantund 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." |