From d772baa37d7b8d02b7eb654e78a6f43152beba3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Dawans?= Date: Tue, 12 Mar 2013 02:06:58 +0100 Subject: [PATCH] Travis test for slip-radio --- .travis.yml | 1 + .../17-slip-radio/01-sky-slip-radio-dio.csc | 190 ++++++++++++++++++ regression-tests/17-slip-radio/Makefile | 1 + regression-tests/17-slip-radio/code/Makefile | 9 + .../17-slip-radio/code/project-conf.h | 12 ++ .../17-slip-radio/code/wait-dag.c | 74 +++++++ 6 files changed, 287 insertions(+) create mode 100644 regression-tests/17-slip-radio/01-sky-slip-radio-dio.csc create mode 100644 regression-tests/17-slip-radio/Makefile create mode 100644 regression-tests/17-slip-radio/code/Makefile create mode 100644 regression-tests/17-slip-radio/code/project-conf.h create mode 100644 regression-tests/17-slip-radio/code/wait-dag.c diff --git a/.travis.yml b/.travis.yml index 7d1e59067..9e4112ad4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -69,3 +69,4 @@ env: - BUILD_TYPE='compile-8051-ports' BUILD_CATEGORY='compile' BUILD_ARCH='8051' - BUILD_TYPE='compile-arm-ports' BUILD_CATEGORY='compile' BUILD_ARCH='arm' - BUILD_TYPE='compile-6502-ports' BUILD_CATEGORY='compile' BUILD_ARCH='6502' + - BUILD_TYPE='slip-radio' MAKE_TARGETS='cooja' diff --git a/regression-tests/17-slip-radio/01-sky-slip-radio-dio.csc b/regression-tests/17-slip-radio/01-sky-slip-radio-dio.csc new file mode 100644 index 000000000..02a7a3aae --- /dev/null +++ b/regression-tests/17-slip-radio/01-sky-slip-radio-dio.csc @@ -0,0 +1,190 @@ + + + [APPS_DIR]/mrm + [APPS_DIR]/mspsim + [APPS_DIR]/avrora + [APPS_DIR]/serial_socket + [APPS_DIR]/collect-view + [APPS_DIR]/powertracker + + slip radio 1 + 123456 + 1000000 + + se.sics.cooja.radiomediums.UDGM + 15.0 + 15.0 + 1.0 + 1.0 + + + 40000 + + + se.sics.cooja.mspmote.SkyMoteType + sky1 + slip radio + [CONTIKI_DIR]/examples/ipv6/slip-radio/slip-radio.c + make slip-radio.sky TARGET=sky + [CONTIKI_DIR]/examples/ipv6/slip-radio/slip-radio.sky + se.sics.cooja.interfaces.Position + se.sics.cooja.interfaces.RimeAddress + se.sics.cooja.interfaces.IPAddress + se.sics.cooja.interfaces.Mote2MoteRelations + se.sics.cooja.interfaces.MoteAttributes + se.sics.cooja.mspmote.interfaces.MspClock + se.sics.cooja.mspmote.interfaces.MspMoteID + se.sics.cooja.mspmote.interfaces.SkyButton + se.sics.cooja.mspmote.interfaces.SkyFlash + se.sics.cooja.mspmote.interfaces.SkyCoffeeFilesystem + se.sics.cooja.mspmote.interfaces.Msp802154Radio + se.sics.cooja.mspmote.interfaces.MspSerial + se.sics.cooja.mspmote.interfaces.SkyLED + se.sics.cooja.mspmote.interfaces.MspDebugOutput + se.sics.cooja.mspmote.interfaces.SkyTemperature + + + se.sics.cooja.mspmote.SkyMoteType + sky2 + wait-dag + [CONTIKI_DIR]/regression-tests/17-slip-radio/code/wait-dag.c + make wait-dag.sky TARGET=sky + [CONTIKI_DIR]/regression-tests/17-slip-radio/code/wait-dag.sky + se.sics.cooja.interfaces.Position + se.sics.cooja.interfaces.RimeAddress + se.sics.cooja.interfaces.IPAddress + se.sics.cooja.interfaces.Mote2MoteRelations + se.sics.cooja.interfaces.MoteAttributes + se.sics.cooja.mspmote.interfaces.MspClock + se.sics.cooja.mspmote.interfaces.MspMoteID + se.sics.cooja.mspmote.interfaces.SkyButton + se.sics.cooja.mspmote.interfaces.SkyFlash + se.sics.cooja.mspmote.interfaces.SkyCoffeeFilesystem + se.sics.cooja.mspmote.interfaces.Msp802154Radio + se.sics.cooja.mspmote.interfaces.MspSerial + se.sics.cooja.mspmote.interfaces.SkyLED + se.sics.cooja.mspmote.interfaces.MspDebugOutput + se.sics.cooja.mspmote.interfaces.SkyTemperature + + + + + se.sics.cooja.interfaces.Position + 43.565500781711165 + 14.697933087406794 + 0.0 + + + se.sics.cooja.mspmote.interfaces.MspMoteID + 1 + + sky1 + + + + + se.sics.cooja.interfaces.Position + 53.849666651434326 + 14.629826028666905 + 0.0 + + + se.sics.cooja.mspmote.interfaces.MspMoteID + 2 + + sky2 + + + + se.sics.cooja.plugins.SimControl + 315 + 1 + 175 + 433 + 0 + + + se.sics.cooja.plugins.Visualizer + + se.sics.cooja.plugins.skins.IDVisualizerSkin + se.sics.cooja.plugins.skins.GridVisualizerSkin + se.sics.cooja.plugins.skins.TrafficVisualizerSkin + se.sics.cooja.plugins.skins.UDGMVisualizerSkin + 14.682765905648006 0.0 0.0 14.682765905648006 -512.6620495401903 -96.80631081927221 + + 432 + 4 + 291 + 1 + 1 + + + se.sics.cooja.plugins.LogListener + + + + 758 + 3 + 289 + 748 + 159 + + + se.sics.cooja.plugins.Notes + + Slip-radio Tests, 01-sky-slip-radio-dio + +Test that we can send a packet over a slip-radio. +In this basic test, we send a DIO from mote 1, and wait for "DAG Found" in mote 2. + true + + 928 + 5 + 159 + 749 + -1 + + + se.sics.cooja.plugins.ScriptRunner + + + true + + 758 + 2 + 502 + 749 + 449 + + + se.sics.cooja.plugins.RadioLogger + + 150 + + 746 + 0 + 657 + 3 + 294 + + + diff --git a/regression-tests/17-slip-radio/Makefile b/regression-tests/17-slip-radio/Makefile new file mode 100644 index 000000000..272bc7da1 --- /dev/null +++ b/regression-tests/17-slip-radio/Makefile @@ -0,0 +1 @@ +include ../Makefile.simulation-test diff --git a/regression-tests/17-slip-radio/code/Makefile b/regression-tests/17-slip-radio/code/Makefile new file mode 100644 index 000000000..d1db363eb --- /dev/null +++ b/regression-tests/17-slip-radio/code/Makefile @@ -0,0 +1,9 @@ +all: wait-dag +APPS=servreg-hack +CONTIKI=../../.. + +WITH_UIP6=1 +UIP_CONF_IPV6=1 +CFLAGS+= -DUIP_CONF_IPV6_RPL + +include $(CONTIKI)/Makefile.include diff --git a/regression-tests/17-slip-radio/code/project-conf.h b/regression-tests/17-slip-radio/code/project-conf.h new file mode 100644 index 000000000..ce722a040 --- /dev/null +++ b/regression-tests/17-slip-radio/code/project-conf.h @@ -0,0 +1,12 @@ +#ifndef __PROJECT_CONF_H__ +#define __PROJECT_CONF_H__ + +#define NETSTACK_CONF_MAC csma_driver + +#undef NETSTACK_CONF_RDC +#define NETSTACK_CONF_RDC nullrdc_driver +#define NULLRDC_CONF_802154_AUTOACK 1 + +#define RPL_CONF_DAO_ACK 1 + +#endif /* __PROJECT_CONF_H__ */ diff --git a/regression-tests/17-slip-radio/code/wait-dag.c b/regression-tests/17-slip-radio/code/wait-dag.c new file mode 100644 index 000000000..f1664b389 --- /dev/null +++ b/regression-tests/17-slip-radio/code/wait-dag.c @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2013, CETIC, www.cetic.be. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the Institute nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * This file is part of the Contiki operating system. + * + */ + +#include "contiki.h" +#include "contiki-lib.h" +#include "contiki-net.h" +#include "net/rpl/rpl.h" +#include "net/uip.h" +#include + +#define DEBUG DEBUG_FULL +#include "net/uip-debug.h" + +#define INTERVAL 5 * CLOCK_SECOND + +/*---------------------------------------------------------------------------*/ +PROCESS(wait_for_dag, "Wait for DAG process"); +AUTOSTART_PROCESSES(&wait_for_dag); +/*---------------------------------------------------------------------------*/ +static void +timeout_handler(void) +{ + rpl_dag_t *dag = rpl_get_any_dag(); + if (dag != NULL) { + PRINTF("DAG Found\n"); + } +} +/*---------------------------------------------------------------------------*/ +PROCESS_THREAD(wait_for_dag, ev, data) +{ + static struct etimer et; + + PROCESS_BEGIN(); + PRINTF("Wait for DAG process started\n"); + etimer_set(&et, INTERVAL); + while(1) { + PROCESS_YIELD(); + if(etimer_expired(&et)) { + timeout_handler(); + etimer_restart(&et); + } + } + PROCESS_END(); +} +/*---------------------------------------------------------------------------*/