def checkFlows(main, minFlowCount, dumpflows=True): main.step(" Check whether the flow count is bigger than %s" % minFlowCount) count = utilities.retry(main.CLIs[main.active].checkFlowCount, main.FALSE, kwargs={'min': minFlowCount}, attempts=10, sleep=10) utilities.assertEquals( \ expect=True, actual=(count > 0), onpass="******" + str( count ), onfail="Flow count looks wrong: " + str( count ) ) main.step("Check whether all flow status are ADDED") flowCheck = utilities.retry(main.CLIs[main.active].checkFlowsState, main.FALSE, kwargs={'isPENDING': False}, attempts=2, sleep=10) utilities.assertEquals( \ expect=main.TRUE, actual=flowCheck, onpass="******", onfail="Flow status is wrong!" ) if dumpflows: main.ONOSbench.dumpONOSCmd(main.ONOSip[main.active], "flows", main.logdir, "flowsBefore" + main.cfgName) main.ONOSbench.dumpONOSCmd(main.ONOSip[main.active], "groups", main.logdir, "groupsBefore" + main.cfgName)
def checkFlows(main, minFlowCount, tag="", dumpflows=True, sleep=10): main.step("Check whether the flow count is bigger than %s" % minFlowCount) if tag == "": tag = 'CASE%d' % main.CurrentTestCaseNumber count = utilities.retry(main.Cluster.active(0).CLI.checkFlowCount, main.FALSE, kwargs={'min': minFlowCount}, attempts=10, sleep=sleep) utilities.assertEquals(expect=True, actual=(count > 0), onpass="******" + str(count), onfail="Flow count looks wrong: " + str(count)) main.step("Check whether all flow status are ADDED") flowCheck = utilities.retry(main.Cluster.active(0).CLI.checkFlowsState, main.FALSE, kwargs={'isPENDING': False}, attempts=5, sleep=sleep) utilities.assertEquals(expect=main.TRUE, actual=flowCheck, onpass="******", onfail="Flow status is wrong!") if dumpflows: main.ONOSbench.dumpONOSCmd( main.Cluster.active(0).ipAddress, "flows", main.logdir, tag + "_FlowsBefore") main.ONOSbench.dumpONOSCmd( main.Cluster.active(0).ipAddress, "groups", main.logdir, tag + "_GroupsBefore")
def checkFlowEqualityByDpid(main, dpid, flowCount, sleep=10): main.step(" Check whether the flow count of device %s is equal to %s" % (dpid, flowCount)) count = utilities.retry(main.Cluster.active(0).CLI.checkFlowAddedCount, main.FALSE, args=(dpid, flowCount, False, 1), attempts=5, sleep=sleep) utilities.assertEquals( expect=True, actual=(int(count) == flowCount), onpass="******" + str(count), onfail="Flow count looks wrong, should be " + str(flowCount))
def checkFlowsByDpid(main, dpid, minFlowCount, sleep=10): main.step( " Check whether the flow count of device %s is bigger than %s" % (dpid, minFlowCount)) count = utilities.retry(main.Cluster.active(0).CLI.checkFlowAddedCount, main.FALSE, args=(dpid, minFlowCount), attempts=5, sleep=sleep) utilities.assertEquals(expect=True, actual=(count > minFlowCount), onpass="******" + str(count), onfail="Flow count looks wrong. ")
def checkFlows(main, minFlowCount): main.step(" Check whether the flow count is bigger than %s" % minFlowCount) count = utilities.retry( main.CLIs[main.active].checkFlowCount, main.FALSE, kwargs={"min": minFlowCount}, attempts=10, sleep=10 ) utilities.assertEquals( expect=True, actual=(count > 0), onpass="******" + str(count), onfail="Flow count looks wrong: " + str(count), ) main.step("Check whether all flow status are ADDED") flowCheck = utilities.retry( main.CLIs[main.active].checkFlowsState, main.FALSE, kwargs={"isPENDING": False}, attempts=10, sleep=10 ) utilities.assertEquals( expect=main.TRUE, actual=flowCheck, onpass="******", onfail="Flow status is wrong!" ) main.ONOSbench.dumpFlows(main.ONOSip[main.active], main.logdir, "flowsBefore" + main.cfgName) main.ONOSbench.dumpGroups(main.ONOSip[0], main.logdir, "groupsBefore" + main.cfgName)