X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=csit%2Flibraries%2FMininetTopo%2Fvlan_vtn_test.py;h=9dee18b2f171d6500d532f840c58faacc2b13bab;hb=97e57d489bfc88db0a70fcb04f145c4737d76b75;hp=016b44709b9dccf9f8100959f1f4bfdfdd88d9eb;hpb=744560c6eee65d876aca4716b4182786b82020fa;p=integration%2Ftest.git diff --git a/csit/libraries/MininetTopo/vlan_vtn_test.py b/csit/libraries/MininetTopo/vlan_vtn_test.py index 016b44709b..9dee18b2f1 100644 --- a/csit/libraries/MininetTopo/vlan_vtn_test.py +++ b/csit/libraries/MininetTopo/vlan_vtn_test.py @@ -9,19 +9,19 @@ class VLANHost(Host): def config(self, vlan=100, **params): """Configure VLANHost according to (optional) parameters - vlan: VLAN ID for default interface""" + vlan: VLAN ID for default interface""" hostid = super(Host, self).config(**params) intf = self.defaultIntf() # remove IP from default, "physical" interface - self.cmd('ifconfig %s inet 0' % intf) + self.cmd("ifconfig %s inet 0" % intf) # create VLAN interface - self.cmd('vconfig add %s %d' % (intf, vlan)) + self.cmd("vconfig add %s %d" % (intf, vlan)) # assign the host's IP to the VLAN interface - self.cmd('ifconfig %s.%d inet %s' % (intf, vlan, params['ip'])) + self.cmd("ifconfig %s.%d inet %s" % (intf, vlan, params["ip"])) # update the intf name and host's intf map - new_name = '%s.%d' % (intf, vlan) + new_name = "%s.%d" % (intf, vlan) # update the (Mininet) interface to refer to VLAN interface name intf.name = new_name # add VLAN interface to host's name to intf map @@ -40,24 +40,25 @@ class VlanTopo(Topo): Topo.__init__(self) # Add hosts and switches - host1 = self.addHost('h1', cls=VLANHost, vlan=200) - host2 = self.addHost('h2', cls=VLANHost, vlan=300) - host3 = self.addHost('h3', cls=VLANHost, vlan=200) - host4 = self.addHost('h4', cls=VLANHost, vlan=300) - host5 = self.addHost('h5', cls=VLANHost, vlan=200) - host6 = self.addHost('h6', cls=VLANHost, vlan=300) - - s1 = self.addSwitch('s1') - s2 = self.addSwitch('s2') - s3 = self.addSwitch('s3') - - self.addLink(s1, host1) + host1 = self.addHost("h1", cls=VLANHost, vlan=200) + host2 = self.addHost("h2", cls=VLANHost, vlan=300) + host3 = self.addHost("h3", cls=VLANHost, vlan=200) + host4 = self.addHost("h4", cls=VLANHost, vlan=300) + host5 = self.addHost("h5", cls=VLANHost, vlan=200) + host6 = self.addHost("h6", cls=VLANHost, vlan=300) + + s1 = self.addSwitch("s1") + s2 = self.addSwitch("s2") + s3 = self.addSwitch("s3") + self.addLink(s1, s2) + self.addLink(s2, host1) self.addLink(s2, host2) self.addLink(s2, host3) - self.addLink(s2, host4) self.addLink(s1, s3) + self.addLink(s3, host4) self.addLink(s3, host5) self.addLink(s3, host6) -topos = {'vlantopo': (lambda: VlanTopo())} + +topos = {"vlantopo": (lambda: VlanTopo())}