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
# make sure the installation directory, which would be used in command "onos-check-logs".
export OV=`echo $ONOS_VERSION | sed "s/\.$USER/-SNAPSHOT/g" `
export ONOS_INSTALL_DIR=/tmp/onos-${OV}/apache-karaf-${KARAF_VERSION}/data
# start ONOS
cd ${ONOS_ROOT}
bazel run onos-local -- clean

# Check whether onos starts successfully in another CLI.
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

...

Code Block
languagepowershell
# You should specify this emulator variable manually set this emulator variable. Please don't change the path of $EMULATOR_ROOT. If you want to specify it, please change "${ONOS_ROOT}/tools/test/scenarios/odtn/createNetCfg.sh" by yourself.
export EMULATOR_ROOT="${EMULATOR_ROOT:-$HOME/emulator}"
# run the emulators
cd ${EMULATOR_ROOT}
# Thethe 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:

Image Removed

  1. This file will be copied to directory /tmp/odtn in the next step.

1.2) odtn-service installation and topology discovery

...

stc net-setup-odtn
Code Block
languagetext
titlestc command
stc command
stc net-setup-odtn

In the command shown above, two topology json files are pushed into ONOS via restconf interface, and then ONOS starts the connection to the emulators. The content of these two json files must be matched with the configuration under directory ${EMULATOR_ROOT}. The default paths of these two json files are "${ONOS_ROOT}/apps/odtn/api/src/test/resources/openconfig-devices.json" and "${ONOS_ROOT}/apps/odtn/api/src/test/resources/openconfig-device-link.json" respectively. These json files would be copied to directory /tmp/odtn on standby.

The output of this command is listed:

Code Block
languagetext
linenumberstrue
2019-04-08 12:55:55  ODTN-Net-Setup started
2019-04-08 12:55:55  ODTN-Net-Setup.Wipe-Out-Data-Before started -- onos-wipe-out
2019-04-08 12:55:55  ODTN-Net-Setup.Wipe-Out-Data-Before completed
2019-04-08 12:55:55  ODTN-Net-Setup.Initial-Summary-Check started -- onos-check-summary 127.0.0.1 [0-9]* 0 0 0
2019-04-08 12:55:56  ODTN-Net-Setup.Initial-Summary-Check completed
2019-04-08 12:55:56  ODTN-Net-Setup.Activate-Apps started -- onos 127.0.0.1 app activate odtn-service
2019-04-08 12:56:28  ODTN-Net-Setup.Activate-Apps completed
2019-04-08 12:56:28  ODTN-Net-Setup.Verify-Apps started
2019-04-08 12:56:28  Check-Apps-1 started -- onos-check-apps 127.0.0.1 optical-model,yang,config,configsync,faultmanagement,netconf,configsync-netconf,drivers,drivers.netconf,drivers.optical,restconf,protocols.restconfserver,odtn-api,drivers.odtn-driver,odtn-service,models.tapi,models.ietf,models.openconfig,models.openconfig-infinera,models.openconfig-odtn includes
2019-04-08 12:56:58  Check-Apps-1 completed
2019-04-08 12:56:58  ODTN-Net-Setup.Verify-Apps completed
2019-04-08 12:56:58  ODTN-Net-Setup.Tapi-context started
2019-04-08 12:56:58  ODTN-Net-Setup.Tapi-context-1 started -- /Users/onf/onos/tools/test/scenarios/odtn/checkUntilSucc.sh /Users/onf/onos/tools/test/scenarios/bin/execute-tapi-context-get-call.py+127.0.0.1+empty
2019-04-08 12:56:58  ODTN-Net-Setup.Tapi-context-1 completed
2019-04-08 12:56:58  ODTN-Net-Setup.Tapi-context completed
2019-04-08 12:56:58  ODTN-Net-Setup.Tapi-connectivity started -- /Users/onf/onos/tools/test/scenarios/odtn/checkUntilSucc.sh /Users/onf/onos/tools/test/scenarios/bin/execute-tapi-post-call.py+127.0.0.1+tapi-connectivity:get-connectivity-service-list+empty
2019-04-08 12:56:59  ODTN-Net-Setup.Tapi-connectivity completed
2019-04-08 12:56:59  ODTN-Net-Setup.Verify-Logs-1 started
2019-04-08 12:56:59  Check-Logs-Odtn-Setup-1-1 started -- onos-check-logs 127.0.0.1
2019-04-08 12:56:59  Check-Logs-Odtn-Setup-1-1 completed
2019-04-08 12:56:59  ODTN-Net-Setup.Verify-Logs-1 completed
2019-04-08 12:56:59  ODTN-Net-Setup.Init-network started
2019-04-08 12:56:59  ODTN-Net-Setup.Start-emulators started -- docker-compose -f /Users/onf/emulator/docker-compose.yaml up -d
2019-04-08 12:56:59  ODTN-Net-Setup.Start-emulators completed
2019-04-08 12:56:59  ODTN-Net-Setup.Generate-cfg-files started -- /Users/onf/onos/tools/test/scenarios/odtn/createNetCfg.sh
2019-04-08 12:57:29  ODTN-Net-Setup.Generate-cfg-files completed
2019-04-08 12:57:29  ODTN-Net-Setup.Put-nodes started -- onos-netcfg 127.0.0.1 /tmp/odtn/openconfig-devices.json
2019-04-08 12:57:29  ODTN-Net-Setup.Put-nodes completed
2019-04-08 12:57:29  ODTN-Net-Setup.Wait-nodes started
2019-04-08 12:57:29  ODTN-Net-Setup.Wait-node-1 started -- /Users/onf/onos/tools/test/scenarios/odtn/checkNetInit.sh device 127.0.0.1
2019-04-08 12:57:40  ODTN-Net-Setup.Wait-node-1 completed
2019-04-08 12:57:40  ODTN-Net-Setup.Wait-port-1 started -- /Users/onf/onos/tools/test/scenarios/odtn/checkNetInit.sh port 127.0.0.1
2019-04-08 12:57:40  ODTN-Net-Setup.Wait-port-1 completed
2019-04-08 12:57:40  ODTN-Net-Setup.Wait-nodes completed
2019-04-08 12:57:40  ODTN-Net-Setup.Verify-Logs-2 started
2019-04-08 12:57:40  Check-Logs-Odtn-Setup-2-1 started -- onos-check-logs 127.0.0.1
2019-04-08 12:57:40  Check-Logs-Odtn-Setup-2-1 completed
2019-04-08 12:57:40  ODTN-Net-Setup.Verify-Logs-2 completed
2019-04-08 12:57:40  ODTN-Net-Setup.Put-links started -- onos-netcfg 127.0.0.1 /tmp/odtn/openconfig-device-link.json
2019-04-08 12:57:41  ODTN-Net-Setup.Put-links completed
2019-04-08 12:57:41  ODTN-Net-Setup.Wait-links started
2019-04-08 12:57:41  ODTN-Net-Setup.Wait-link-1 started -- /Users/onf/onos/tools/test/scenarios/odtn/checkNetInit.sh link 127.0.0.1
2019-04-08 12:58:11  ODTN-Net-Setup.Wait-link-1 completed
2019-04-08 12:58:11  ODTN-Net-Setup.Wait-links completed
2019-04-08 12:58:11  ODTN-Net-Setup.Verify-Logs-3 started
2019-04-08 12:58:11  Check-Logs-Odtn-Setup-3-1 started -- onos-check-logs 127.0.0.1
2019-04-08 12:58:11  ODTN-Net-Setup.Init-network completed
2019-04-08 12:58:11  Check-Logs-Odtn-Setup-3-1 completed
2019-04-08 12:58:11  ODTN-Net-Setup.Verify-Logs-3 completed
2019-04-08 12:58:11  ODTN-Net-Setup completed
2:16 Passed! 25 steps succeeded

After this command is executed successfully, we can find a temporary directory "/tmp/odtn" that contains  3 files, which are copied from :

  1. "openconfig-devices.json"
  2. "openconfig-device-link.json"
  3. "net-summary.json"


After this command is executed successfully, the topology view shows below:

Image Added

1.3) creation and deletion for line-side/client-side connectivities

...