blob: 4f223ac2f80ec2901f615e24b903964b8ee5708b [file] [log] [blame]
Boyuan Yaned2ea3572019-04-02 15:38:42 -07001#!/bin/bash
2
3# This scrip is used to test ODTN on single ONOS instance in branch 2.0
4# Before this script:
5# 1. Make sure the default Python version is 2.x
6# 2. Run ONOS locally (bazel run onos-local -- clean)
7# 3. Start sshd service, and make sure "ssh $USER@localhost" operation doesn't need passwd
8# 4. Emulator configuration could be found under directory $HOME/emulator
9
10# env configuration
11ONOS_ROOT="${ONOS_ROOT:-~/onos}"
12source ${ONOS_ROOT}/tools/dev/bash_profile
13source ${ONOS_ROOT}/tools/build/envDefaults
14unset OC2
15unset OC3
16export OC1="127.0.0.1"
17export OCI="$OC1"
18export ONOS_INSTANCES="$OC1"
19export ONOS_USER=$USER
20
21OV=`echo $ONOS_VERSION | sed "s/\.$USER/-SNAPSHOT/g" `
22export ONOS_INSTLL_DIR=/tmp/onos-${OV}/apache-karaf-${KARAF_VERSION}/data
23export EMULATOR_ROOT="${EMULATOR_ROOT:-$HOME/emulator}"
24
25for t in {1..60}; do
26 echo "$t-th times curl request"
27 curl --fail -sS http://localhost:8181/onos/v1/applications --user "onos:rocks" 1>/dev/null 2>&1 && break;
28 sleep 2
29done
30
31# activate odtn-service
32# run emulator, and push topo into local onos instance
33cd ${EMULATOR_ROOT}
34docker-compose up -d
35stc net-setup-odtn
36if [[ $? == 0 ]]; then
37 stc net-odtn-restconf
38fi