def test_3_port_based_flows_test(self):
        """
        This method is to test the OVS functionality in presence of traffic
        :return:
        """
        self.ovs_obj.manage_flows(manage_type="delete", br_name=config.OVS_BRIDGE, inputs=None)
        flow_input = {OvsConf.flow_inputs['Pri']: OvsConf.priority[0], OvsConf.flow_inputs['iPort']: OvsConf.ports[0]}
        action = {OvsConf.flow_actions[0]: [OvsConf.ports[1]]}
        self.ovs_obj.manage_flows(manage_type="add", br_name=config.OVS_BRIDGE, inputs=flow_input, action=action)
        flow_input = {OvsConf.flow_inputs['Pri']: OvsConf.priority[0], OvsConf.flow_inputs['iPort']: OvsConf.ports[1]}
        action = {OvsConf.flow_actions[0]: [OvsConf.ports[0]]}
        self.ovs_obj.manage_flows(manage_type="add", br_name=config.OVS_BRIDGE, inputs=flow_input, action=action)
        if config.MININET and self.MN:
            temp = self.mn.execute_command("h1 ping h2 -c 5",exp_out = "0% packet loss")
            if temp:
                print self.mn.resp
            else:
                print self.mn.resp
        self.ovs_obj.manage_flows(manage_type="delete", br_name=config.OVS_BRIDGE, inputs=flow_input)
        if config.MININET and self.MN:
            temp = self.mn.execute_command("h1 ping h2 -c 5",exp_out = "0% packet loss")
            if temp:
                print self.mn.resp
                return False
            else:
                print self.mn.resp
                return True

        else:
            status = remote_ping(config.HOST1_IP,config.HOST1_USER,config.HOST1_PASSWORD,config.h2_port1,echo_count=10)
            if status:
                print "Ping between hosts H1 & H2 through OVS is Successfull\n"
        self.ovs_obj.manage_flows(manage_type="delete", br_name=config.OVS_BRIDGE, inputs=flow_input)
        status = remote_ping(config.HOST1_IP, config.HOST1_USER, config.HOST1_PASSWORD, config.h2_port1, echo_count=10)
        if not status:
            print "Ping between hosts H1 & H2 through OVS failed as flows are deleted\n"
        self.ovs_obj.manage_flows(manage_type="add", br_name=config.OVS_BRIDGE, inputs=flow_input, action=action)
        action = {OvsConf.flow_actions[2]: None}
        self.ovs_obj.manage_flows(manage_type="alter", br_name=config.OVS_BRIDGE, inputs=flow_input, action=action)


        #flow_input = {OvsConf.flow_inputs['Pri']:OvsConf.priority[0],OvsConf.flow_inputs['iPort']:OvsConf.ports[0],OvsConf.flow_inputs['Protocol']:"arp"}
        #action = {OvsConf.flow_actions[0]:[OvsConf.ports[1]]}
        #self.ovs_obj.manage_flows(manage_type="add",br_name=config.OVS_BRIDGE, inputs = flow_input, action = action)
        #action = {OvsConf.flow_actions[2]: None}
        #self.ovs_obj.manage_flows(manage_type="alter", br_name=config.OVS_BRIDGE, inputs=flow_input,action=action)
        #action = {OvsConf.flow_actions[0]:[OvsConf.ports[1],4]}
        #self.ovs_obj.manage_flows(manage_type="alter", br_name=config.OVS_BRIDGE, inputs=flow_input, action=action)
        #self.ovs_obj.manage_flows(manage_type="delete", br_name=config.OVS_BRIDGE, inputs=flow_input)
        """
    def e_PingDevices(self, source_ip, source_user, source_password,
                      destination_ip):
        """
        1. Ping between Source and Destination.
        :return: Return True if ping succeeds else False
        """
        status = True

        status &= sys_utils.remote_ping(source_ip=source_ip,
                                        source_user=source_user,
                                        source_password=source_password,
                                        destination_ip=destination_ip)
        return status
    def test_3_port_based_flows_test(self):
        """
        This method is to test the OVS functionality in presence of traffic
        :return:

        """
        status = remote_ping(config.HOST1_IP,
                             config.HOST1_USER,
                             config.HOST1_PASSWORD,
                             config.h2_port1,
                             echo_count=10)
        if status:
            print "Ping between hosts H1 & H2 through OVS is Successfull\n"
        self.ovs_obj.addflows(interface=ovs,
                              protocol=icmp,
                              priority=500,
                              input_port=1,
                              action="output:2")
        self.ovs_obj.addflows(interface=ovs,
                              protocol=icmp,
                              priority=500,
                              input_port=2,
                              action="output:1")

        self.ovs_obj.manage_flows(manage_type="delete",
                                  br_name=config.OVS_BRIDGE,
                                  inputs=None)
        flow_input = {
            OvsConf.flow_inputs['Pri']: OvsConf.priority[0],
            OvsConf.flow_inputs['iPort']: OvsConf.ports[0]
        }
        action = {OvsConf.flow_actions[0]: [OvsConf.ports[1]]}
        self.ovs_obj.manage_flows(manage_type="add",
                                  br_name=config.OVS_BRIDGE,
                                  inputs=flow_input,
                                  action=action)
        flow_input = {
            OvsConf.flow_inputs['Pri']: OvsConf.priority[0],
            OvsConf.flow_inputs['iPort']: OvsConf.ports[1]
        }
        action = {OvsConf.flow_actions[0]: [OvsConf.ports[0]]}
        self.ovs_obj.manage_flows(manage_type="add",
                                  br_name=config.OVS_BRIDGE,
                                  inputs=flow_input,
                                  action=action)

        status = remote_ping(config.HOST1_IP,
                             config.HOST1_USER,
                             config.HOST1_PASSWORD,
                             config.h2_port1,
                             echo_count=10)
        if status:
            print "Ping between hosts H1 & H2 through OVS is Successfull\n"
        self.ovs_obj.manage_flows(manage_type="delete",
                                  br_name=config.OVS_BRIDGE,
                                  inputs=flow_input)
        status = remote_ping(config.HOST1_IP,
                             config.HOST1_USER,
                             config.HOST1_PASSWORD,
                             config.h2_port1,
                             echo_count=10)
        if not status:
            print "Ping between hosts H1 & H2 through OVS failed as flows are deleted\n"
        self.ovs_obj.manage_flows(manage_type="add",
                                  br_name=config.OVS_BRIDGE,
                                  inputs=flow_input,
                                  action=action)
        action = {OvsConf.flow_actions[2]: None}
        self.ovs_obj.manage_flows(manage_type="alter",
                                  br_name=config.OVS_BRIDGE,
                                  inputs=flow_input,
                                  action=action)