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
8 class MininetHandler(object):
10 MininetHandler class will provide all operations about Mininet, such as config controller_ip, start or stop net.
12 def __init__(self,controller_ip='127.0.0.1'):
13 self.controller_ip = controller_ip
16 def set_controller_ip(self,controller_ip):
17 self.controller_ip = controller_ip
20 net = Mininet(switch=OVSKernelSwitch,controller=RemoteController)
22 print '*** Adding controller'
23 net.addController('c0',ip=self.controller_ip)
25 print '*** Adding hosts'
26 h1 = net.addHost( 'h1', mac='00:00:00:00:00:01')
27 h2 = net.addHost( 'h2', mac='00:00:00:00:00:02')
28 h3 = net.addHost( 'h3', mac='00:00:00:00:00:03')
29 h4 = net.addHost( 'h4', mac='00:00:00:00:00:04')
31 print '*** Adding switch'
32 s1 = net.addSwitch( 's1' )
33 s2 = net.addSwitch( 's2' )
34 s3 = net.addSwitch( 's3' )
36 print '*** Creating links'