blob: e9616f2a2904b327d9261deecc2b3dfe716f704f [file] [log] [blame]
#!/bin/bash
# Test topology
host=${1:-127.0.0.1}
### start up null provider
onos ${host} null-simulation stop custom
onos ${host} wipe-out please
onos ${host} null-simulation start custom
### Add devices and links
#
# null-create-device <type> <name> <#ports> <latitude> <longitude>
# null-create-link <type> <src> <dst>
onos ${host} <<-EOF
null-create-device switch s1-Bristol 10 51.4500 -2.5833
null-create-device switch s2-London 10 51.5072 -0.1275
null-create-device switch s3-Dover 10 51.1295 1.3089
null-create-device switch s4-Brighton 10 50.8429 -0.1313
null-create-device switch s5 10 0 0
null-create-device switch s6 10 0 0
null-create-device switch s7 10 0 0
null-create-device switch s8 10 0 0
null-create-device switch s9 10 0 0
# null-create-device switch s10 10 0 0
null-create-link direct s1-Bristol s2-London
null-create-link direct s2-London s3-Dover
null-create-link direct s2-London s4-Brighton
null-create-link direct s3-Dover s4-Brighton
null-create-link direct s3-Dover s5
null-create-link direct s6 s5
null-create-link direct s6 s8
null-create-link direct s7 s9
null-create-link direct s8 s9
null-create-link direct s5 s7
null-create-link direct s8 s7
EOF
### Add regions and associate devices with them
#
# region-add <region-id> <region-name> <region-type> <region-master>
# region-add-devices <region-id> <device-id>...
onos ${host} <<-EOF
region-add r1 Region1 METRO ${host}
region-add r2 Region2 METRO ${host}
region-add r3 Region3 CAMPUS ${host}
region-add-devices r1 \
null:0000000000000002 \
null:0000000000000003 \
null:0000000000000004
region-add-devices r2 \
null:0000000000000005 \
null:0000000000000006
region-add-devices r3 \
null:0000000000000007 \
null:0000000000000008 \
null:0000000000000009
regions
EOF
### Add layouts, associating backing regions, and optional parent.
#
# layout-add <layout-id> <region-id(opt)> <parent-layout-id(opt)>
onos ${host} <<-EOF
layout-add l1 r1
layout-add l2 r2
layout-add l3 r3 l2
layouts
EOF
### Set up debug log messages for classes we care about
onos ${host} <<-EOF
log:set DEBUG org.onosproject.ui.impl.topo.Topo2ViewMessageHandler
log:set DEBUG org.onosproject.ui.impl.topo.Topo2Jsonifier
log:set DEBUG org.onosproject.ui.impl.UiWebSocket
log:list
EOF