Added CI test: native node ping
This commit is contained in:
parent
7c1c901028
commit
6cf4d62e90
@ -110,3 +110,4 @@ env:
|
|||||||
- BUILD_TYPE='ieee802154' BUILD_CATEGORY='sim'
|
- BUILD_TYPE='ieee802154' BUILD_CATEGORY='sim'
|
||||||
- BUILD_TYPE='6tisch' BUILD_CATEGORY='sim'
|
- BUILD_TYPE='6tisch' BUILD_CATEGORY='sim'
|
||||||
- BUILD_TYPE='rpl-border-router' BUILD_CATEGORY='sim'
|
- BUILD_TYPE='rpl-border-router' BUILD_CATEGORY='sim'
|
||||||
|
- BUILD_TYPE='native-networking' BUILD_CATEGORY='sim'
|
||||||
|
47
tests/18-native-networking/01-native-ping.sh
Executable file
47
tests/18-native-networking/01-native-ping.sh
Executable file
@ -0,0 +1,47 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Contiki directory
|
||||||
|
CONTIKI=$1
|
||||||
|
# Test basename
|
||||||
|
BASENAME=01-native-ping
|
||||||
|
|
||||||
|
IPADDR=fd00::302:304:506:708
|
||||||
|
|
||||||
|
# Starting Contiki-NG native node
|
||||||
|
echo "Starting native node"
|
||||||
|
make -C $CONTIKI/examples/hello-world
|
||||||
|
sudo $CONTIKI/examples/hello-world/hello-world.native > node.log 2> node.err &
|
||||||
|
CPID=$!
|
||||||
|
sleep 2
|
||||||
|
|
||||||
|
# Do ping
|
||||||
|
echo "Pinging"
|
||||||
|
ping6 $IPADDR -c 5 | tee $BASENAME.log
|
||||||
|
# Fetch ping6 status code (not $? because this is piped)
|
||||||
|
STATUS=${PIPESTATUS[0]}
|
||||||
|
|
||||||
|
echo "Closing native node"
|
||||||
|
sleep 2
|
||||||
|
sudo kill -9 $CPID
|
||||||
|
|
||||||
|
if [ $STATUS -eq 0 ] ; then
|
||||||
|
mv $BASENAME.log $BASENAME.testlog
|
||||||
|
echo " OK"
|
||||||
|
else
|
||||||
|
mv $BASENAME.log $BASENAME.faillog
|
||||||
|
|
||||||
|
echo ""
|
||||||
|
echo "---- node.log"
|
||||||
|
cat node.log
|
||||||
|
|
||||||
|
echo ""
|
||||||
|
echo "---- node.err"
|
||||||
|
cat node.err
|
||||||
|
|
||||||
|
echo " FAIL ಠ_ಠ" | tee -a $BASENAME.faillog;
|
||||||
|
fi
|
||||||
|
|
||||||
|
# We do not want Make to stop -> Return 0
|
||||||
|
# The Makefile will check if a log contains FAIL at the end
|
||||||
|
|
||||||
|
exit 0
|
1
tests/18-native-networking/Makefile
Normal file
1
tests/18-native-networking/Makefile
Normal file
@ -0,0 +1 @@
|
|||||||
|
include ../Makefile.script-test
|
Loading…
Reference in New Issue
Block a user