blob: e9616f2a2904b327d9261deecc2b3dfe716f704f [file] [log] [blame]
Thomas Vachuska3ce80f72016-07-21 14:52:15 -07001#!/bin/bash
Thomas Vachuskaeb851cd2016-07-21 15:41:05 -07002# Test topology
Thomas Vachuska3ce80f72016-07-21 14:52:15 -07003
4host=${1:-127.0.0.1}
5
Simon Huntf59d36b2016-10-04 19:05:53 -07006### start up null provider
7
Thomas Vachuska3ce80f72016-07-21 14:52:15 -07008onos ${host} null-simulation stop custom
9onos ${host} wipe-out please
10onos ${host} null-simulation start custom
11
Simon Huntf59d36b2016-10-04 19:05:53 -070012
13### Add devices and links
14#
Simon Huntf4fd2a22016-08-10 15:41:09 -070015# null-create-device <type> <name> <#ports> <latitude> <longitude>
16# null-create-link <type> <src> <dst>
17
Thomas Vachuska3ce80f72016-07-21 14:52:15 -070018onos ${host} <<-EOF
19
Simon Huntf4fd2a22016-08-10 15:41:09 -070020null-create-device switch s1-Bristol 10 51.4500 -2.5833
21null-create-device switch s2-London 10 51.5072 -0.1275
22null-create-device switch s3-Dover 10 51.1295 1.3089
23null-create-device switch s4-Brighton 10 50.8429 -0.1313
Thomas Vachuska3ce80f72016-07-21 14:52:15 -070024null-create-device switch s5 10 0 0
25null-create-device switch s6 10 0 0
26null-create-device switch s7 10 0 0
27null-create-device switch s8 10 0 0
28null-create-device switch s9 10 0 0
29# null-create-device switch s10 10 0 0
30
Simon Huntf4fd2a22016-08-10 15:41:09 -070031null-create-link direct s1-Bristol s2-London
32null-create-link direct s2-London s3-Dover
33null-create-link direct s2-London s4-Brighton
34null-create-link direct s3-Dover s4-Brighton
35null-create-link direct s3-Dover s5
Thomas Vachuska3ce80f72016-07-21 14:52:15 -070036null-create-link direct s6 s5
37null-create-link direct s6 s8
38null-create-link direct s7 s9
39null-create-link direct s8 s9
40null-create-link direct s5 s7
41null-create-link direct s8 s7
42
43EOF
44
Simon Huntf59d36b2016-10-04 19:05:53 -070045
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 Vachuska3ce80f72016-07-21 14:52:15 -070051onos ${host} <<-EOF
52
53region-add r1 Region1 METRO ${host}
54region-add r2 Region2 METRO ${host}
55region-add r3 Region3 CAMPUS ${host}
56
57region-add-devices r1 \
Simon Huntb1ce2602016-07-23 14:04:31 -070058 null:0000000000000002 \
59 null:0000000000000003 \
60 null:0000000000000004
Thomas Vachuska3ce80f72016-07-21 14:52:15 -070061
62region-add-devices r2 \
Simon Huntb1ce2602016-07-23 14:04:31 -070063 null:0000000000000005 \
64 null:0000000000000006
Thomas Vachuska3ce80f72016-07-21 14:52:15 -070065
66region-add-devices r3 \
Simon Huntb1ce2602016-07-23 14:04:31 -070067 null:0000000000000007 \
68 null:0000000000000008 \
69 null:0000000000000009
Thomas Vachuska3ce80f72016-07-21 14:52:15 -070070
71regions
Simon Huntf59d36b2016-10-04 19:05:53 -070072EOF
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
79onos ${host} <<-EOF
Thomas Vachuskaeb851cd2016-07-21 15:41:05 -070080
81layout-add l1 r1
82layout-add l2 r2
83layout-add l3 r3 l2
84
85layouts
Steven Burrowse7cc3082016-09-27 11:24:58 -070086EOF
87
88
Simon Huntf59d36b2016-10-04 19:05:53 -070089### Set up debug log messages for classes we care about
90
Steven Burrowse7cc3082016-09-27 11:24:58 -070091onos ${host} <<-EOF
92
93log:set DEBUG org.onosproject.ui.impl.topo.Topo2ViewMessageHandler
94log:set DEBUG org.onosproject.ui.impl.topo.Topo2Jsonifier
95log:set DEBUG org.onosproject.ui.impl.UiWebSocket
96log:list
97EOF