2 Library for the robot based system test tool of the OpenDaylight project.
3 Authors: Baohua Yang@IBM, Denghui Huang@IBM
6 from mininet.net import Mininet
9 class MininetHandler(object):
11 MininetHandler class will provide all operations about Mininet, such as config controller_ip, start or stop net.
13 def __init__(self, controller_ip='127.0.0.1'):
14 self.controller_ip = controller_ip
17 def set_controller_ip(self, controller_ip):
18 self.controller_ip = controller_ip
21 net = Mininet(switch=OVSKernelSwitch, controller=RemoteController) # noqa
23 print '*** Adding controller'
24 net.addController('c0', ip=self.controller_ip)
26 print '*** Adding hosts'
27 h1 = net.addHost('h1', mac='00:00:00:00:00:01')
28 h2 = net.addHost('h2', mac='00:00:00:00:00:02')
29 h3 = net.addHost('h3', mac='00:00:00:00:00:03')
30 h4 = net.addHost('h4', mac='00:00:00:00:00:04')
32 print '*** Adding switch'
33 s1 = net.addSwitch('s1')
34 s2 = net.addSwitch('s2')
35 s3 = net.addSwitch('s3')
37 print '*** Creating links'