#!/usr/bin/python
"""
This is the most simple example to showcase Containernet.
"""
from mininet.net import Containernet
from mininet.node import Controller
from mininet.cli import CLI
from mininet.link import TCLink
from mininet.log import info, setLogLevel
setLogLevel('info')

net = Containernet(controller=Controller)
info('*** Adding controller\n')
net.addController('c0')
info('*** Adding docker containers\n')
d1 = net.addDocker('d1', ip='10.0.0.3', dimage="server:topo")
d2 = net.addDocker('d2', ip='10.0.0.6', dimage="server:topo")
d3 = net.addDocker('d3', ip='10.0.0.9', dimage="server:topo")
info('*** Adding switches\n')
#s1 = net.addSwitch('s1')
info('*** Creating link\n')
net.addLink(d1, d2)
net.addLink(d2, d3)
#net.addLink(d1, s1)
#net.addLink(s1, d2)
info('*** Starting network\n')
net.start()
info('*** Testing connectivity\n')
net.ping([d1, d2])
info('*** Running CLI\n')
CLI(net)
info('*** Stopping network')
net.stop()

