| #!/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 |
| |
| # root region |
| null-create-device switch DOVER 10 51.1295 1.3089 |
| |
| # region 1 |
| null-create-device switch BRGHTN-A 10 50.95 -0.1313 |
| null-create-device switch BRGHTN-B 10 50.8429 -0.3013 |
| null-create-device switch BRGHTN-C 10 50.8429 0.2 |
| |
| # region 2 |
| null-create-device switch LONDON-A 10 51.5091 -0.3704 |
| null-create-device switch LONDON-B 10 51.5091 0.132 |
| # region 3 (subregion of 2) |
| null-create-device switch LONDON-C 10 51.4513 -0.1058 |
| null-create-device switch LONDON-D 10 51.5518 -0.1031 |
| null-create-device switch LONDON-E 10 51.5072 -0.3075 |
| |
| ## NOTE: create more than 9 devices seems to be broken |
| |
| null-create-link direct DOVER BRGHTN-A |
| |
| null-create-link direct BRGHTN-A BRGHTN-B |
| null-create-link direct BRGHTN-A BRGHTN-C |
| null-create-link direct BRGHTN-B BRGHTN-C |
| |
| null-create-link direct BRGHTN-B LONDON-A |
| null-create-link direct LONDON-A LONDON-B |
| |
| null-create-link direct LONDON-A LONDON-C |
| null-create-link direct LONDON-B LONDON-D |
| |
| null-create-link direct LONDON-C LONDON-D |
| null-create-link direct LONDON-C LONDON-E |
| null-create-link direct LONDON-D LONDON-E |
| |
| EOF |
| |
| ### Add a host per device |
| # |
| # null-create-host <device-id> <host-ip> <latitude> <longitude> |
| |
| onos ${host} <<-EOF |
| |
| null-create-host DOVER 192.168.1.1 51.4780 1.6369 |
| |
| null-create-host BRGHTN-A 192.168.2.10 0 0 |
| null-create-host BRGHTN-B 192.168.2.11 0 0 |
| null-create-host BRGHTN-C 192.168.2.12 0 0 |
| |
| null-create-host LONDON-A 192.168.3.31 0 0 |
| null-create-host LONDON-B 192.168.3.32 0 0 |
| null-create-host LONDON-C 192.168.3.33 0 0 |
| null-create-host LONDON-D 192.168.3.34 0 0 |
| null-create-host LONDON-E 192.168.3.35 0 0 |
| |
| 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 rBrg Brighton METRO ${host} |
| region-add rLon London METRO ${host} |
| region-add rTha Thames CAMPUS ${host} |
| |
| region-add-devices rBrg \ |
| null:0000000000000002 \ |
| null:0000000000000003 \ |
| null:0000000000000004 |
| |
| region-add-devices rLon \ |
| null:0000000000000005 \ |
| null:0000000000000006 |
| |
| region-add-devices rTha \ |
| 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 lBrg rBrg |
| layout-add lLon rLon |
| layout-add lTha rTha lLon |
| |
| 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 |