projects
/
osm
/
vim-emu.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Improved test to be skipped when executed within a container.
[osm/vim-emu.git]
/
src
/
emuvim
/
examples
/
sonata_y1_demo_topology_1.py
diff --git
a/src/emuvim/examples/sonata_y1_demo_topology_1.py
b/src/emuvim/examples/sonata_y1_demo_topology_1.py
index
5145543
..
6ea568a
100644
(file)
--- a/
src/emuvim/examples/sonata_y1_demo_topology_1.py
+++ b/
src/emuvim/examples/sonata_y1_demo_topology_1.py
@@
-8,6
+8,7
@@
import logging
from mininet.log import setLogLevel
from emuvim.dcemulator.net import DCNetwork
from emuvim.api.zerorpc.compute import ZeroRpcApiEndpoint
from mininet.log import setLogLevel
from emuvim.dcemulator.net import DCNetwork
from emuvim.api.zerorpc.compute import ZeroRpcApiEndpoint
+from emuvim.api.sonata import SonataDummyGatekeeperEndpoint
logging.basicConfig(level=logging.INFO)
logging.basicConfig(level=logging.INFO)
@@
-18,18
+19,22
@@
def create_topology1():
dc1 = net.addDatacenter("dc1")
dc2 = net.addDatacenter("dc2")
s1 = net.addSwitch("s1")
dc1 = net.addDatacenter("dc1")
dc2 = net.addDatacenter("dc2")
s1 = net.addSwitch("s1")
- net.addLink(dc1, s1)
- net.addLink(dc2, s1)
+ net.addLink(dc1, s1
, delay="10ms"
)
+ net.addLink(dc2, s1
, delay="20ms"
)
- #
create a new instance of a endpoint implementation
+ #
add the command line interface endpoint to each DC
zapi1 = ZeroRpcApiEndpoint("0.0.0.0", 4242)
zapi1 = ZeroRpcApiEndpoint("0.0.0.0", 4242)
- # connect data centers to this endpoint
zapi1.connectDatacenter(dc1)
zapi1.connectDatacenter(dc2)
# run API endpoint server (in another thread, don't block)
zapi1.start()
zapi1.connectDatacenter(dc1)
zapi1.connectDatacenter(dc2)
# run API endpoint server (in another thread, don't block)
zapi1.start()
- # TODO add "fake gatekeeper" api endpoint and connect it to both dcs
+ # add the SONATA dummy gatekeeper to each DC
+ sdkg1 = SonataDummyGatekeeperEndpoint("0.0.0.0", 5000)
+ sdkg1.connectDatacenter(dc1)
+ sdkg1.connectDatacenter(dc2)
+ # run the dummy gatekeeper (in another thread, don't block)
+ sdkg1.start()
# start the emulation platform
net.start()
# start the emulation platform
net.start()
@@
-43,4
+48,4
@@
def main():
if __name__ == '__main__':
if __name__ == '__main__':
- main()
\ No newline at end of file
+ main()