...
Code Block |
---|
language | powershell |
---|
title | onos setup |
---|
linenumbers | true |
---|
|
# 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 |
---|
|
The directory ${EMULATOR_ROOT} contains: - File "docker-compose.yaml"
- Directory "emulator-oc-cassini"
- 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:
![](/download/attachments/34246415/Screen%20Shot%202019-04-08%20at%2011.47.03%20AM.png?version=1&modificationDate=1554749365429&api=v2)
Anchor |
---|
| net-setup-odtn |
---|
| net-setup-odtn |
---|
|
1.2) odtn-service installation and topology discovery
Code Block |
---|
language | text |
---|
title | stc command |
---|
|
stc net-setup-odtn |
...
Code Block |
---|
|
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 |
---|
|
stc -ENV_DEFAULT=/tmp/odtn/OCvar.sh net-odtn-smoke |
This command could be divided into three subcommands in order:
Code Block |
---|
language | text |
---|
linenumbers | true |
---|
|
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