def assert_no_action_push(): sFlow = '{"switch": "%s", "name":"flow-mod-1", "cookie":"0", "priority":"32768", "ingress-port":"1","active":"true", "actions":""}' % dpid push_flow(sFlow) # verify in config and active flows if node1type == "linux": flows = controller.restGet('core/switch/%s/flow/json' % dpid) print "printing flows" + str(flows[dpid][0]['actions']) bigtest.Assert(flows[dpid][0]['actions'] == [])
def assert_all_action_push(): log("Test for flow-entry with all actions") sFlow = create_all_action_static_flow_post_data() push_flow(sFlow) # verify flow with all actions is active if node1type == "linux": flows = controller.restGet('core/switch/%s/flow/json' % dpid) bigtest.Assert(len(flows[dpid][0]['actions']) == len(actions))
def assert_action_push(): for i in range(len(actions)): if node1type == "linux": action_inp, action_outp = actions[i][0], actions[i][1] log("Test for flow-entry with action = '%s' -> '%s'", action_inp, action_outp) sFlow = create_single_action_static_flow_post_data(action_inp) push_flow(sFlow) # verify in config and active flows if node1type == "linux": flows = controller.restGet('core/switch/%s/flow/json' % dpid) bigtest.Assert(str(flows[dpid][0]['actions'][0]) == str(action_outp))
def assert_action_push(): for i in range(len(actions)): if node1type == "linux": action_inp, action_outp = actions[i][0], actions[i][1] log("Test for flow-entry with action = '%s' -> '%s'", action_inp, action_outp) sFlow = create_single_action_static_flow_post_data(action_inp) push_flow(sFlow) # verify in config and active flows if node1type == "linux": flows = controller.restGet('core/switch/%s/flow/json' % dpid) bigtest.Assert( str(flows[dpid][0]['actions'][0]) == str(action_outp))