def runTest(self): """ Set the first table config as "Send to Controller" and the second table as "Drop", add flow entries: First Table; Match IP Src A; send to 1 // if not match, packet_in Second Table; Match IP Src B; send to 2 // if not match, drop Then send a packet: IP B; expect packet_in """ of_ports = testutils.clear_switch(self, pa_port_map.keys(), pa_logger) # Set table config as "send to controller" and "drop" testutils.set_table_config(self, testutils.WC_ACL_TABLE, ofp.OFPTC_TABLE_MISS_CONTROLLER, True) testutils.set_table_config(self, testutils.WC_SERV_TABLE, ofp.OFPTC_TABLE_MISS_DROP, True) # Set up matches testutils.write_output(self, testutils.WC_ACL_TABLE, of_ports[0], ip_src="192.168.1.10") testutils.write_output(self, testutils.WC_SERV_TABLE, of_ports[1], of_ports[2], ip_src="192.168.1.70") # Generate a packet not matching to any flow entry in the first table testutils.reply_check_ctrl(self, ip_src='192.168.1.70', tcp_sport=1234, ing_port=of_ports[2])
def runTest(self): """ Add five flow entries: First Table; Match IP Src A; send to 1 Second Table; Match IP Src B; send to 1 Third Table; Match IP Src C; send to 1 Fourth Table; Match IP Src D; send to 1 Then send in 2 packets: IP F, TCP C; expect packet_in IP G, TCP B; expect packet_in @param self object instance @param first_table first table @param second_table second table @param third_table third table @param fourth_table fourth table """ of_ports = testutils.clear_switch(self, pa_port_map.keys(), pa_logger) # Set up matches #write_output(self, testutils.EX_ACL_TABLE, 1, ip_src="192.168.1.10") #write_output(self, testutils.EX_ACL_TABLE, of_ports[0], ip_src="128.128.128.10") testutils.set_table_config(self, config = ofp.OFPTC_TABLE_MISS_CONTROLLER) testutils.write_output(self, testutils.WC_ACL_TABLE, of_ports[0], ip_src="192.168.1.10") testutils.write_output(self, testutils.WC_SERV_TABLE, of_ports[0], ing_port=of_ports[1], ip_src="192.168.1.20") testutils.write_output(self, testutils.EX_L2_TABLE, of_ports[0], ip_src="192.168.1.30") testutils.write_output(self, testutils.EX_L3_TABLE, of_ports[0], ip_src="192.168.1.40") # Generate a packet not matching to any flow, then packet_in testutils.reply_check_ctrl(self, ip_src='192.168.1.70', tcp_sport=1234, ing_port = of_ports[2])
def runTest(self): """ Add five flow entries: First Table; Match IP Src A; send to 1 Second Table; Match IP Src B; send to 1 Third Table; Match IP Src C; send to 1 Fourth Table; Match IP Src D; send to 1 Then send in 2 packets: IP F, TCP C; expect packet_in IP G, TCP B; expect packet_in @param self object instance @param first_table first table @param second_table second table @param third_table third table @param fourth_table fourth table """ of_ports = testutils.clear_switch(self, pa_port_map.keys(), pa_logger) # Set up matches #write_output(self, testutils.EX_ACL_TABLE, 1, ip_src="192.168.1.10") #write_output(self, testutils.EX_ACL_TABLE, of_ports[0], ip_src="128.128.128.10") testutils.set_table_config(self, config=ofp.OFPTC_TABLE_MISS_CONTROLLER) testutils.write_output(self, testutils.WC_ACL_TABLE, of_ports[0], ip_src="192.168.1.10") testutils.write_output(self, testutils.WC_SERV_TABLE, of_ports[0], ing_port=of_ports[1], ip_src="192.168.1.20") testutils.write_output(self, testutils.EX_L2_TABLE, of_ports[0], ip_src="192.168.1.30") testutils.write_output(self, testutils.EX_L3_TABLE, of_ports[0], ip_src="192.168.1.40") # Generate a packet not matching to any flow, then packet_in testutils.reply_check_ctrl(self, ip_src='192.168.1.70', tcp_sport=1234, ing_port=of_ports[2])
def runTest(self): """ Set the first table config as "Send to Controller" and the second table as "Drop", add flow entries: First Table; Match IP Src A; send to 1 // if not match, packet_in Second Table; Match IP Src B; send to 2 // if not match, drop Then send a packet: IP B; expect packet_in """ of_ports = testutils.clear_switch(self, pa_port_map.keys(), pa_logger) # Set table config as "send to controller" and "drop" testutils.set_table_config(self, testutils.WC_ACL_TABLE, ofp.OFPTC_TABLE_MISS_CONTROLLER, True) testutils.set_table_config(self, testutils.WC_SERV_TABLE, ofp.OFPTC_TABLE_MISS_DROP, True) # Set up matches testutils.write_output(self, testutils.WC_ACL_TABLE, of_ports[0], ip_src="192.168.1.10") testutils.write_output(self, testutils.WC_SERV_TABLE, of_ports[1], of_ports[2], ip_src="192.168.1.70") # Generate a packet not matching to any flow entry in the first table testutils.reply_check_ctrl(self, ip_src='192.168.1.70', tcp_sport=1234, ing_port = of_ports[2])