blob: 29f632de012d66f662b18e23239dee29bcf25575 [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 Hunt1dc6adf2016-10-14 14:47:45 -070020# root region
21null-create-device switch DOVER 10 51.1295 1.3089
Thomas Vachuska3ce80f72016-07-21 14:52:15 -070022
Simon Hunt1dc6adf2016-10-14 14:47:45 -070023# region 1
24null-create-device switch BRGHTN-A 10 50.9000 -0.1313
25null-create-device switch BRGHTN-B 10 50.8429 -0.1413
26null-create-device switch BRGHTN-C 10 50.8429 -0.1213
27
28# region 2
29null-create-device switch LONDON-A 10 51.5091 -0.2704
30null-create-device switch LONDON-B 10 51.5091 0.0432
31# region 3 (subregion of 2)
32null-create-device switch LONDON-C 10 51.4513 -0.1058
33null-create-device switch LONDON-D 10 51.5418 -0.1931
34null-create-device switch LONDON-E 10 51.5072 -0.1175
35
36## NOTE: create more than 9 devices seems to be broken
37
38null-create-link direct DOVER BRGHTN-A
39
40null-create-link direct BRGHTN-A BRGHTN-B
41null-create-link direct BRGHTN-A BRGHTN-C
42null-create-link direct BRGHTN-B BRGHTN-C
43
44null-create-link direct BRGHTN-B LONDON-A
45null-create-link direct LONDON-A LONDON-B
46
47null-create-link direct LONDON-A LONDON-C
48null-create-link direct LONDON-B LONDON-D
49
50null-create-link direct LONDON-C LONDON-D
51null-create-link direct LONDON-C LONDON-E
52null-create-link direct LONDON-D LONDON-E
Thomas Vachuska3ce80f72016-07-21 14:52:15 -070053
54EOF
55
Simon Hunt1dc6adf2016-10-14 14:47:45 -070056### Add a host per device
57#
58# null-create-host <device-id> <host-ip> <latitude> <longitude>
59
60onos ${host} <<-EOF
61
62null-create-host DOVER 192.168.1.1 51.4780 1.6369
63
64null-create-host BRGHTN-A 192.168.2.10 0 0
65null-create-host BRGHTN-B 192.168.2.11 0 0
66null-create-host BRGHTN-C 192.168.2.12 0 0
67
68null-create-host LONDON-A 192.168.3.31 0 0
69null-create-host LONDON-B 192.168.3.32 0 0
70null-create-host LONDON-C 192.168.3.33 0 0
71null-create-host LONDON-D 192.168.3.34 0 0
72null-create-host LONDON-E 192.168.3.35 0 0
73
74EOF
Simon Huntf59d36b2016-10-04 19:05:53 -070075
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 Vachuska3ce80f72016-07-21 14:52:15 -070081onos ${host} <<-EOF
82
Simon Hunt1dc6adf2016-10-14 14:47:45 -070083region-add rBrg Brighton METRO ${host}
84region-add rLon London METRO ${host}
85region-add rTha Thames CAMPUS ${host}
Thomas Vachuska3ce80f72016-07-21 14:52:15 -070086
Simon Hunt1dc6adf2016-10-14 14:47:45 -070087region-add-devices rBrg \
Simon Huntb1ce2602016-07-23 14:04:31 -070088 null:0000000000000002 \
89 null:0000000000000003 \
90 null:0000000000000004
Thomas Vachuska3ce80f72016-07-21 14:52:15 -070091
Simon Hunt1dc6adf2016-10-14 14:47:45 -070092region-add-devices rLon \
Simon Huntb1ce2602016-07-23 14:04:31 -070093 null:0000000000000005 \
94 null:0000000000000006
Thomas Vachuska3ce80f72016-07-21 14:52:15 -070095
Simon Hunt1dc6adf2016-10-14 14:47:45 -070096region-add-devices rTha \
Simon Huntb1ce2602016-07-23 14:04:31 -070097 null:0000000000000007 \
98 null:0000000000000008 \
99 null:0000000000000009
Thomas Vachuska3ce80f72016-07-21 14:52:15 -0700100
101regions
Simon Huntf59d36b2016-10-04 19:05:53 -0700102EOF
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
109onos ${host} <<-EOF
Thomas Vachuskaeb851cd2016-07-21 15:41:05 -0700110
Simon Hunt1dc6adf2016-10-14 14:47:45 -0700111layout-add lBrg rBrg
112layout-add lLon rLon
113layout-add lTha rTha lLon
Thomas Vachuskaeb851cd2016-07-21 15:41:05 -0700114
115layouts
Steven Burrowse7cc3082016-09-27 11:24:58 -0700116EOF
117
118
Simon Huntf59d36b2016-10-04 19:05:53 -0700119### Set up debug log messages for classes we care about
120
Steven Burrowse7cc3082016-09-27 11:24:58 -0700121onos ${host} <<-EOF
122
123log:set DEBUG org.onosproject.ui.impl.topo.Topo2ViewMessageHandler
124log:set DEBUG org.onosproject.ui.impl.topo.Topo2Jsonifier
125log:set DEBUG org.onosproject.ui.impl.UiWebSocket
126log:list
127EOF