SEBA-676 Test multicast in SiaB

Change-Id: If53c960ba0c1ea1f88dfb22d2b1f5a57eeff4634
diff --git a/mininet/Chart.yaml b/mininet/Chart.yaml
index 2e43e25..f21e28d 100644
--- a/mininet/Chart.yaml
+++ b/mininet/Chart.yaml
@@ -17,4 +17,4 @@
 appVersion: "1.0"
 description: A Helm chart for Mininet
 name: mininet
-version: 0.3.1
+version: 0.4.0
diff --git a/mininet/toposcripts/topo.py b/mininet/toposcripts/topo.py
index 0c9c7cf..a65085d 100644
--- a/mininet/toposcripts/topo.py
+++ b/mininet/toposcripts/topo.py
@@ -22,42 +22,61 @@
 from mininet.log import setLogLevel, info, error
 from mininet.net import Mininet
 from mininet.link import Intf
-from mininet.topo import SingleSwitchTopo
-from mininet.node import OVSSwitch, RemoteController
+from mininet.topo import Topo, SingleSwitchTopo
+from mininet.node import OVSSwitch, Controller, RemoteController
+from mininet.nodelib import LinuxBridge
 from functools import partial
 from mininet.util import quietRun
 
 if __name__ == '__main__':
     setLogLevel( 'info' )
 
-    info( '*** Installing required software' )
+    info( '*** Installing required software\n' )
     print quietRun( 'apt-get update' )
-    print quietRun( 'apt-get -y install dnsmasq ethtool' )
+    print quietRun( 'apt-get -y install dnsmasq ethtool wget pimd bridge-utils' )
+    print quietRun( 'wget https://github.com/troglobit/mcjoin/releases/download/v2.4/mcjoin_2.4_amd64.deb' )
+    print quietRun( 'dpkg -i mcjoin_2.4_amd64.deb' )
 
-    info( '*** Creating network\n' )
     print quietRun( 'ovs-vsctl set Open_vSwitch . other_config:vlan-limit={{ .Values.vlanMatchDepth }}' )
     OVSSwitch13 = partial( OVSSwitch, protocols='OpenFlow13' )
     controllerIp = socket.gethostbyname( '{{ .Values.onosOpenflowSvc }}' )
-    net = Mininet( topo=SingleSwitchTopo(1),
-                   controller=lambda name: RemoteController( name, ip=controllerIp, port=6653 ),
-                   switch=OVSSwitch13
-    )
 
-    switch = net.switches[ 0 ]
-    info( '*** Adding hardware interface eth1 to switch', switch.name, '\n' )
-    _intf = Intf( 'eth1', node=switch )
+    net = Mininet( topo=None )
+
+    info( '*** Adding controllers\n' )
+    onos = net.addController( name='onos', controller=RemoteController, ip=controllerIp, port=6653 )
+
+    info( '*** Adding switches\n' )
+    s1 = net.addSwitch( name='s1', cls=OVSSwitch13 )
+    s2 = net.addSwitch( 's2', cls=LinuxBridge )
+
+    info( '*** Creating hosts\n' )
+    h1 = net.addHost( 'h1', ip='10.0.0.1/24')
+    h2 = net.addHost( 'h2', ip='10.1.0.2/24')
+
+    # Topology: pon1 - eth1 - s1 - h1 - s2 - h2
+    net.addLink( h1, s1 )
+    net.addLink( h1, s2 )
+    net.addLink( h2, s2 )
+
+    info( '*** Adding hardware interface eth1 to switch %s\n' % s1.name)
+    _intf = Intf( 'eth1', node=s1 )
 
     info( '*** Turning off checksum offloading for eth1\n' )
     print quietRun( 'ethtool -K eth1 tx off rx off' )
 
-    bgphost = net.hosts [ 0 ]
-    info( '*** Adding VLAN interface to host\n')
-    bgphost.cmd( 'ip link add link h1-eth0 name h1-eth0.222 type vlan proto 802.1Q id 222' )
-    bgphost.cmd( 'ip link add link h1-eth0.222 name h1-eth0.222.111 type vlan proto 802.1Q id 111' )
-    bgphost.cmd( 'ifconfig h1-eth0.222 up' )
-    bgphost.cmd( 'ifconfig h1-eth0.222.111 up' )
-    bgphost.cmd( 'ifconfig h1-eth0.222.111 172.18.0.10/24' )
-    bgphost.cmd( 'dnsmasq --dhcp-range=172.18.0.50,172.18.0.150,12h' )
+    info( '*** Adding VLAN interface to host %s\n' % h1.name)
+    base = "%s-eth0" % h1.name
+    h1.cmd( 'ifconfig %s-eth1 10.1.0.1/24 up' % h1.name)
+    h1.cmd( 'ip link add link %s name %s.222 type vlan proto 802.1Q id 222' % (base, base))
+    h1.cmd( 'ip link add link %s.222 name %s.222.111 type vlan proto 802.1Q id 111' % (base, base))
+    h1.cmd( 'ifconfig %s.222 up' % base)
+    h1.cmd( 'ifconfig %s.222.111 up' % base)
+    h1.cmd( 'ifconfig %s.222.111 172.18.0.10/24' % base)
+    h1.cmd( 'dnsmasq --dhcp-range=172.18.0.50,172.18.0.150,12h' )
+
+    onos.start()
+    s1.start( [onos] )
 
     net.start()
     CLI( net )