Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagepowershell
titleonos setup
linenumberstrue
# This scrip is used to test ODTN on single ONOS instance in branch 2.0
# Before this script:
#   1. Make sure the default Python version is 2.x
#   2. Run ONOS locally (bazel run onos-local -- clean)
#   3. Start sshd service, and make sure "ssh $USER@localhost" operation doesn't need passwd
#   4. Emulator configuration could be found under directory $HOME/emulator

# env configuration based on the default ONOS environment
# single ONOS instance runs on local machine directly
export ONOS_ROOT="${ONOS_ROOT:-~/onos}"
source ${ONOS_ROOT}/tools/dev/bash_profile
source ${ONOS_ROOT}/tools/build/envDefaults
unset OC2
unset OC3
export OC1="127.0.0.1"
export OCI="$OC1"
export ONOS_INSTANCES="$OC1"
export ONOS_USER=$USER

export OV=`echo $ONOS_VERSION | sed "s/\.$USER/-SNAPSHOT/g" `
export ONOS_INSTLL_DIR=/tmp/onos-${OV}/apache-karaf-${KARAF_VERSION}/data
export EMULATOR_ROOT="${EMULATOR_ROOT:-$HOME/emulator}"

for t in {1..60}; do
    echo "$t-th times curl request"
    curl --fail -sS http://localhost:8181/onos/v1/applications --user "onos:rocks" 1>/dev/null 2>&1 && break;
    sleep 2
done

# run the emulators
cd ${EMULATOR_ROOT}
# The emulators run as docker containers.
docker-compose up -d
Info
titleAbout the emulator

The directory ${EMULATOR_ROOT} contains:

  1. File "docker-compose.yaml"
  2. Directory "emulator-oc-cassini"
  3. File "net-summary.json" - This file contains one-line json content to describe the network topology briefly ("{"device_num":"2","port_num":"64","link_num":"12"}"), aiming to help information check for topology discovery.


The topology view shows:

Anchor
net-setup-odtn
net-setup-odtn
1.2) odtn-service installation and topology discovery


Code Block
languagetext
titlestc command
stc net-setup-odtn

...

Code Block
languagetext
sdn@odtn:~$ docker ps -a
CONTAINER ID        IMAGE                 COMMAND                  CREATED             STATUS              PORTS                                                      NAMES
ab3bfbf96846        onos:latest           "./bin/onos-service …"   3 minutes ago       Up 3 minutes        22/tcp, 6640/tcp, 6653/tcp, 8101/tcp, 8181/tcp, 9876/tcp   onos-3
10d534c9151d        onos:latest           "./bin/onos-service …"   4 minutes ago       Up 4 minutes        22/tcp, 6640/tcp, 6653/tcp, 8101/tcp, 8181/tcp, 9876/tcp   onos-2
74fe2fbfb163        onos:latest           "./bin/onos-service …"   4 minutes ago       Up 4 minutes        22/tcp, 6640/tcp, 6653/tcp, 8101/tcp, 8181/tcp, 9876/tcp   onos-1
378a13eb63d2        atomix/atomix:3.1.5   "./bin/atomix-agent …"   4 minutes ago       Up 4 minutes        5678-5679/tcp                                              atomix-3
331c68971a6f        atomix/atomix:3.1.5   "./bin/atomix-agent …"   4 minutes ago       Up 4 minutes        5678-5679/tcp                                              atomix-2
fd5d6abee1a4        atomix/atomix:3.1.5   "./bin/atomix-agent …"   4 minutes ago       Up 4 minutes        5678-5679/tcp                                              atomix-1


2.2) test ODTN


Code Block
languagetext
stc -ENV_DEFAULT=/tmp/odtn/OCvar.sh net-odtn-smoke

This command could be divided into three subcommands in order:

Code Block
languagetext
linenumberstrue
stc -ENV_DEFAULT=/tmp/odtn/OCvar.sh net-setup-odtn
stc -ENV_DEFAULT=/tmp/odtn/OCvar.sh net-odtn-restconf
stc -ENV_DEFAULT=/tmp/odtn/OCvar.sh net-teardown-odtn

The parameter "-ENV_DEFAULT*" is used to specify the default environment.

2.2.1) net-setup-odtn

The same as #net-setup-odtn http://#net-setup-odtnin single onos instance scenario, this