Esempio n. 1
0
def assert_no_flows(remove):
    if node1type == "linux":
        # remove flows via static flow pusher api (done when finishing test)
        if remove:
            urllib.urlopen(
                "http://%s:8080/wm/staticflowentrypusher/clear/all/json" %
                controller.ipAddress())
        restout = rest('core/switch/%s/flow/json' % dpid)
    bigtest.Assert(restout[dpid] == [])
def assert_no_flows(remove):
    if node1type == "linux":
        # remove flows via static flow pusher api (done when finishing test)
        if remove:
            urllib.urlopen("http://%s:8080/wm/staticflowentrypusher/clear/all/json" % controller.ipAddress())
        restout = rest('core/switch/%s/flow/json' % dpid)
    bigtest.Assert(restout[dpid] == [])
Esempio n. 3
0
env = bigtest.controller.TwoNodeTest()
log = bigtest.log.info

controller = env.node1()
cli = controller.cli()
rest = controller.restGet
cli2 = env.node2().cli()

log("Restarting Floodlight with Quantum config")
floodlightLoadQuantumConfig(cli)

cli.gotoBashMode()
cli.runCmd("sudo mn -c")

cli2.gotoBashMode()
cli2.gotoMininetMode("--controller=remote --ip=%s --mac --topo=linear,5" % controller.ipAddress())

hostmacs = ["00:00:00:00:00:%02x" % x  for x in xrange(6,11)]
switches = ["00:00:00:00:00:00:00:%02x" % x for x in xrange(1,6)]
controller.waitForSwitches(switches)
createVirtualNetwork(controller, "ten1", "net1", "guid1", "10.0.0.10")
addHostToVirtualNetwork(controller, "ten1", "guid1", "port1", "attach1", hostmacs[0])
addHostToVirtualNetwork(controller, "ten1", "guid1", "port2", "attach2", hostmacs[1])
createVirtualNetwork(controller, "ten2", "net2", "guid2", "10.0.0.10")
addHostToVirtualNetwork(controller, "ten2", "guid2", "port3", "attach3", hostmacs[2])
addHostToVirtualNetwork(controller, "ten2", "guid2", "port4", "attach4", hostmacs[3])
verifyPing(cli2, 'h6', 'h7')
verifyPing(cli2, 'h8', 'h9')
verifyNoPing(cli2, 'h6', 'h8')
verifyNoPing(cli2, 'h7', 'h9')
# verify default gateway works