Thomas Vachuska | 3ce80f7 | 2016-07-21 14:52:15 -0700 | [diff] [blame] | 1 | #!/bin/bash |
Thomas Vachuska | eb851cd | 2016-07-21 15:41:05 -0700 | [diff] [blame] | 2 | # Test topology |
Thomas Vachuska | 3ce80f7 | 2016-07-21 14:52:15 -0700 | [diff] [blame] | 3 | |
| 4 | host=${1:-127.0.0.1} |
| 5 | |
Simon Hunt | f59d36b | 2016-10-04 19:05:53 -0700 | [diff] [blame] | 6 | ### start up null provider |
| 7 | |
Thomas Vachuska | 3ce80f7 | 2016-07-21 14:52:15 -0700 | [diff] [blame] | 8 | onos ${host} null-simulation stop custom |
| 9 | onos ${host} wipe-out please |
| 10 | onos ${host} null-simulation start custom |
| 11 | |
Simon Hunt | f59d36b | 2016-10-04 19:05:53 -0700 | [diff] [blame] | 12 | |
| 13 | ### Add devices and links |
| 14 | # |
Simon Hunt | f4fd2a2 | 2016-08-10 15:41:09 -0700 | [diff] [blame] | 15 | # null-create-device <type> <name> <#ports> <latitude> <longitude> |
| 16 | # null-create-link <type> <src> <dst> |
| 17 | |
Thomas Vachuska | 3ce80f7 | 2016-07-21 14:52:15 -0700 | [diff] [blame] | 18 | onos ${host} <<-EOF |
| 19 | |
Simon Hunt | 1dc6adf | 2016-10-14 14:47:45 -0700 | [diff] [blame] | 20 | # root region |
| 21 | null-create-device switch DOVER 10 51.1295 1.3089 |
Thomas Vachuska | 3ce80f7 | 2016-07-21 14:52:15 -0700 | [diff] [blame] | 22 | |
Simon Hunt | 1dc6adf | 2016-10-14 14:47:45 -0700 | [diff] [blame] | 23 | # region 1 |
Steven Burrows | 583f4be | 2016-11-04 14:06:50 +0100 | [diff] [blame] | 24 | null-create-device switch BRGHTN-A 10 50.95 -0.1313 |
| 25 | null-create-device switch BRGHTN-B 10 50.8429 -0.3013 |
| 26 | null-create-device switch BRGHTN-C 10 50.8429 0.2 |
Simon Hunt | 1dc6adf | 2016-10-14 14:47:45 -0700 | [diff] [blame] | 27 | |
| 28 | # region 2 |
Steven Burrows | 583f4be | 2016-11-04 14:06:50 +0100 | [diff] [blame] | 29 | null-create-device switch LONDON-A 10 51.5091 -0.3704 |
| 30 | null-create-device switch LONDON-B 10 51.5091 0.132 |
Simon Hunt | 1dc6adf | 2016-10-14 14:47:45 -0700 | [diff] [blame] | 31 | # region 3 (subregion of 2) |
| 32 | null-create-device switch LONDON-C 10 51.4513 -0.1058 |
Steven Burrows | 583f4be | 2016-11-04 14:06:50 +0100 | [diff] [blame] | 33 | null-create-device switch LONDON-D 10 51.5518 -0.1031 |
| 34 | null-create-device switch LONDON-E 10 51.5072 -0.3075 |
Simon Hunt | 1dc6adf | 2016-10-14 14:47:45 -0700 | [diff] [blame] | 35 | |
| 36 | ## NOTE: create more than 9 devices seems to be broken |
| 37 | |
| 38 | null-create-link direct DOVER BRGHTN-A |
| 39 | |
| 40 | null-create-link direct BRGHTN-A BRGHTN-B |
| 41 | null-create-link direct BRGHTN-A BRGHTN-C |
| 42 | null-create-link direct BRGHTN-B BRGHTN-C |
| 43 | |
| 44 | null-create-link direct BRGHTN-B LONDON-A |
| 45 | null-create-link direct LONDON-A LONDON-B |
| 46 | |
| 47 | null-create-link direct LONDON-A LONDON-C |
| 48 | null-create-link direct LONDON-B LONDON-D |
| 49 | |
| 50 | null-create-link direct LONDON-C LONDON-D |
| 51 | null-create-link direct LONDON-C LONDON-E |
| 52 | null-create-link direct LONDON-D LONDON-E |
Thomas Vachuska | 3ce80f7 | 2016-07-21 14:52:15 -0700 | [diff] [blame] | 53 | |
| 54 | EOF |
| 55 | |
Simon Hunt | 1dc6adf | 2016-10-14 14:47:45 -0700 | [diff] [blame] | 56 | ### Add a host per device |
| 57 | # |
| 58 | # null-create-host <device-id> <host-ip> <latitude> <longitude> |
| 59 | |
| 60 | onos ${host} <<-EOF |
| 61 | |
| 62 | null-create-host DOVER 192.168.1.1 51.4780 1.6369 |
| 63 | |
| 64 | null-create-host BRGHTN-A 192.168.2.10 0 0 |
| 65 | null-create-host BRGHTN-B 192.168.2.11 0 0 |
| 66 | null-create-host BRGHTN-C 192.168.2.12 0 0 |
| 67 | |
| 68 | null-create-host LONDON-A 192.168.3.31 0 0 |
| 69 | null-create-host LONDON-B 192.168.3.32 0 0 |
| 70 | null-create-host LONDON-C 192.168.3.33 0 0 |
| 71 | null-create-host LONDON-D 192.168.3.34 0 0 |
| 72 | null-create-host LONDON-E 192.168.3.35 0 0 |
| 73 | |
| 74 | EOF |
Simon Hunt | f59d36b | 2016-10-04 19:05:53 -0700 | [diff] [blame] | 75 | |
| 76 | ### Add regions and associate devices with them |
| 77 | # |
| 78 | # region-add <region-id> <region-name> <region-type> <region-master> |
| 79 | # region-add-devices <region-id> <device-id>... |
| 80 | |
Thomas Vachuska | 3ce80f7 | 2016-07-21 14:52:15 -0700 | [diff] [blame] | 81 | onos ${host} <<-EOF |
| 82 | |
Simon Hunt | 1dc6adf | 2016-10-14 14:47:45 -0700 | [diff] [blame] | 83 | region-add rBrg Brighton METRO ${host} |
| 84 | region-add rLon London METRO ${host} |
| 85 | region-add rTha Thames CAMPUS ${host} |
Thomas Vachuska | 3ce80f7 | 2016-07-21 14:52:15 -0700 | [diff] [blame] | 86 | |
Simon Hunt | 1dc6adf | 2016-10-14 14:47:45 -0700 | [diff] [blame] | 87 | region-add-devices rBrg \ |
Simon Hunt | b1ce260 | 2016-07-23 14:04:31 -0700 | [diff] [blame] | 88 | null:0000000000000002 \ |
| 89 | null:0000000000000003 \ |
| 90 | null:0000000000000004 |
Thomas Vachuska | 3ce80f7 | 2016-07-21 14:52:15 -0700 | [diff] [blame] | 91 | |
Simon Hunt | 1dc6adf | 2016-10-14 14:47:45 -0700 | [diff] [blame] | 92 | region-add-devices rLon \ |
Simon Hunt | b1ce260 | 2016-07-23 14:04:31 -0700 | [diff] [blame] | 93 | null:0000000000000005 \ |
| 94 | null:0000000000000006 |
Thomas Vachuska | 3ce80f7 | 2016-07-21 14:52:15 -0700 | [diff] [blame] | 95 | |
Simon Hunt | 1dc6adf | 2016-10-14 14:47:45 -0700 | [diff] [blame] | 96 | region-add-devices rTha \ |
Simon Hunt | b1ce260 | 2016-07-23 14:04:31 -0700 | [diff] [blame] | 97 | null:0000000000000007 \ |
| 98 | null:0000000000000008 \ |
| 99 | null:0000000000000009 |
Thomas Vachuska | 3ce80f7 | 2016-07-21 14:52:15 -0700 | [diff] [blame] | 100 | |
| 101 | regions |
Simon Hunt | f59d36b | 2016-10-04 19:05:53 -0700 | [diff] [blame] | 102 | EOF |
| 103 | |
| 104 | |
| 105 | ### Add layouts, associating backing regions, and optional parent. |
| 106 | # |
| 107 | # layout-add <layout-id> <region-id(opt)> <parent-layout-id(opt)> |
| 108 | |
| 109 | onos ${host} <<-EOF |
Thomas Vachuska | eb851cd | 2016-07-21 15:41:05 -0700 | [diff] [blame] | 110 | |
Simon Hunt | 1dc6adf | 2016-10-14 14:47:45 -0700 | [diff] [blame] | 111 | layout-add lBrg rBrg |
| 112 | layout-add lLon rLon |
| 113 | layout-add lTha rTha lLon |
Thomas Vachuska | eb851cd | 2016-07-21 15:41:05 -0700 | [diff] [blame] | 114 | |
| 115 | layouts |
Steven Burrows | e7cc308 | 2016-09-27 11:24:58 -0700 | [diff] [blame] | 116 | EOF |
| 117 | |
| 118 | |
Simon Hunt | f59d36b | 2016-10-04 19:05:53 -0700 | [diff] [blame] | 119 | ### Set up debug log messages for classes we care about |
| 120 | |
Steven Burrows | e7cc308 | 2016-09-27 11:24:58 -0700 | [diff] [blame] | 121 | onos ${host} <<-EOF |
| 122 | |
| 123 | log:set DEBUG org.onosproject.ui.impl.topo.Topo2ViewMessageHandler |
| 124 | log:set DEBUG org.onosproject.ui.impl.topo.Topo2Jsonifier |
| 125 | log:set DEBUG org.onosproject.ui.impl.UiWebSocket |
| 126 | log:list |
| 127 | EOF |