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 | f4fd2a2 | 2016-08-10 15:41:09 -0700 | [diff] [blame] | 20 | null-create-device switch s1-Bristol 10 51.4500 -2.5833 |
| 21 | null-create-device switch s2-London 10 51.5072 -0.1275 |
| 22 | null-create-device switch s3-Dover 10 51.1295 1.3089 |
| 23 | null-create-device switch s4-Brighton 10 50.8429 -0.1313 |
Thomas Vachuska | 3ce80f7 | 2016-07-21 14:52:15 -0700 | [diff] [blame] | 24 | null-create-device switch s5 10 0 0 |
| 25 | null-create-device switch s6 10 0 0 |
| 26 | null-create-device switch s7 10 0 0 |
| 27 | null-create-device switch s8 10 0 0 |
| 28 | null-create-device switch s9 10 0 0 |
| 29 | # null-create-device switch s10 10 0 0 |
| 30 | |
Simon Hunt | f4fd2a2 | 2016-08-10 15:41:09 -0700 | [diff] [blame] | 31 | null-create-link direct s1-Bristol s2-London |
| 32 | null-create-link direct s2-London s3-Dover |
| 33 | null-create-link direct s2-London s4-Brighton |
| 34 | null-create-link direct s3-Dover s4-Brighton |
| 35 | null-create-link direct s3-Dover s5 |
Thomas Vachuska | 3ce80f7 | 2016-07-21 14:52:15 -0700 | [diff] [blame] | 36 | null-create-link direct s6 s5 |
| 37 | null-create-link direct s6 s8 |
| 38 | null-create-link direct s7 s9 |
| 39 | null-create-link direct s8 s9 |
| 40 | null-create-link direct s5 s7 |
| 41 | null-create-link direct s8 s7 |
| 42 | |
| 43 | EOF |
| 44 | |
Simon Hunt | f59d36b | 2016-10-04 19:05:53 -0700 | [diff] [blame] | 45 | |
| 46 | ### Add regions and associate devices with them |
| 47 | # |
| 48 | # region-add <region-id> <region-name> <region-type> <region-master> |
| 49 | # region-add-devices <region-id> <device-id>... |
| 50 | |
Thomas Vachuska | 3ce80f7 | 2016-07-21 14:52:15 -0700 | [diff] [blame] | 51 | onos ${host} <<-EOF |
| 52 | |
| 53 | region-add r1 Region1 METRO ${host} |
| 54 | region-add r2 Region2 METRO ${host} |
| 55 | region-add r3 Region3 CAMPUS ${host} |
| 56 | |
| 57 | region-add-devices r1 \ |
Simon Hunt | b1ce260 | 2016-07-23 14:04:31 -0700 | [diff] [blame] | 58 | null:0000000000000002 \ |
| 59 | null:0000000000000003 \ |
| 60 | null:0000000000000004 |
Thomas Vachuska | 3ce80f7 | 2016-07-21 14:52:15 -0700 | [diff] [blame] | 61 | |
| 62 | region-add-devices r2 \ |
Simon Hunt | b1ce260 | 2016-07-23 14:04:31 -0700 | [diff] [blame] | 63 | null:0000000000000005 \ |
| 64 | null:0000000000000006 |
Thomas Vachuska | 3ce80f7 | 2016-07-21 14:52:15 -0700 | [diff] [blame] | 65 | |
| 66 | region-add-devices r3 \ |
Simon Hunt | b1ce260 | 2016-07-23 14:04:31 -0700 | [diff] [blame] | 67 | null:0000000000000007 \ |
| 68 | null:0000000000000008 \ |
| 69 | null:0000000000000009 |
Thomas Vachuska | 3ce80f7 | 2016-07-21 14:52:15 -0700 | [diff] [blame] | 70 | |
| 71 | regions |
Simon Hunt | f59d36b | 2016-10-04 19:05:53 -0700 | [diff] [blame] | 72 | EOF |
| 73 | |
| 74 | |
| 75 | ### Add layouts, associating backing regions, and optional parent. |
| 76 | # |
| 77 | # layout-add <layout-id> <region-id(opt)> <parent-layout-id(opt)> |
| 78 | |
| 79 | onos ${host} <<-EOF |
Thomas Vachuska | eb851cd | 2016-07-21 15:41:05 -0700 | [diff] [blame] | 80 | |
| 81 | layout-add l1 r1 |
| 82 | layout-add l2 r2 |
| 83 | layout-add l3 r3 l2 |
| 84 | |
| 85 | layouts |
Steven Burrows | e7cc308 | 2016-09-27 11:24:58 -0700 | [diff] [blame] | 86 | EOF |
| 87 | |
| 88 | |
Simon Hunt | f59d36b | 2016-10-04 19:05:53 -0700 | [diff] [blame] | 89 | ### Set up debug log messages for classes we care about |
| 90 | |
Steven Burrows | e7cc308 | 2016-09-27 11:24:58 -0700 | [diff] [blame] | 91 | onos ${host} <<-EOF |
| 92 | |
| 93 | log:set DEBUG org.onosproject.ui.impl.topo.Topo2ViewMessageHandler |
| 94 | log:set DEBUG org.onosproject.ui.impl.topo.Topo2Jsonifier |
| 95 | log:set DEBUG org.onosproject.ui.impl.UiWebSocket |
| 96 | log:list |
| 97 | EOF |