Boyuan Yan | ed2ea357 | 2019-04-02 15:38:42 -0700 | [diff] [blame^] | 1 | #!/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 |
| 11 | ONOS_ROOT="${ONOS_ROOT:-~/onos}" |
| 12 | source ${ONOS_ROOT}/tools/dev/bash_profile |
| 13 | source ${ONOS_ROOT}/tools/build/envDefaults |
| 14 | unset OC2 |
| 15 | unset OC3 |
| 16 | export OC1="127.0.0.1" |
| 17 | export OCI="$OC1" |
| 18 | export ONOS_INSTANCES="$OC1" |
| 19 | export ONOS_USER=$USER |
| 20 | |
| 21 | OV=`echo $ONOS_VERSION | sed "s/\.$USER/-SNAPSHOT/g" ` |
| 22 | export ONOS_INSTLL_DIR=/tmp/onos-${OV}/apache-karaf-${KARAF_VERSION}/data |
| 23 | export EMULATOR_ROOT="${EMULATOR_ROOT:-$HOME/emulator}" |
| 24 | |
| 25 | for 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 |
| 29 | done |
| 30 | |
| 31 | # activate odtn-service |
| 32 | # run emulator, and push topo into local onos instance |
| 33 | cd ${EMULATOR_ROOT} |
| 34 | docker-compose up -d |
| 35 | stc net-setup-odtn |
| 36 | if [[ $? == 0 ]]; then |
| 37 | stc net-odtn-restconf |
| 38 | fi |