From eb31a70666f446c8f38519bfd9495fb92f09105a Mon Sep 17 00:00:00 2001 From: Madhusudhan Date: Fri, 17 Jan 2014 11:29:36 -0800 Subject: [PATCH] Upload OF plugin test to Integration repo Change-Id: I8a0c04b5cbb01e9a56ab197cffd29eb66e6bcfed Signed-off-by: Madhusudhan --- test/tools/OF_Test/action-keywords.csv | 3 + test/tools/OF_Test/keywords.csv | 15 + test/tools/OF_Test/keywords.csv.backup | 50 +++ test/tools/OF_Test/match-keywords.csv | 32 ++ test/tools/OF_Test/odl_tests.py | 539 +++++++++++++++++++++++++ test/tools/OF_Test/odl_tests.py.backup | 518 ++++++++++++++++++++++++ test/tools/OF_Test/ofctl/t1 | 1 + test/tools/OF_Test/ofctl/t11 | 1 + test/tools/OF_Test/ofctl/t19 | 1 + test/tools/OF_Test/ofctl/t2 | 1 + test/tools/OF_Test/ofctl/t20 | 1 + test/tools/OF_Test/ofctl/t21 | 1 + test/tools/OF_Test/ofctl/t22 | 1 + test/tools/OF_Test/ofctl/t25 | 1 + test/tools/OF_Test/ofctl/t27 | 1 + test/tools/OF_Test/ofctl/t29 | 1 + test/tools/OF_Test/ofctl/t30 | 1 + test/tools/OF_Test/ofctl/t31 | 1 + test/tools/OF_Test/ofctl/t33 | 1 + test/tools/OF_Test/ofctl/t36 | 1 + test/tools/OF_Test/ofctl/t38 | 1 + test/tools/OF_Test/ofctl/t4 | 1 + test/tools/OF_Test/ofctl/t41 | 1 + test/tools/OF_Test/ofctl/t43 | 1 + test/tools/OF_Test/ofctl/t45 | 1 + test/tools/OF_Test/ofctl/t48 | 1 + test/tools/OF_Test/ofctl/t5 | 1 + test/tools/OF_Test/ofctl/t6 | 1 + test/tools/OF_Test/test.py | 14 + test/tools/OF_Test/test1.py | 14 + test/tools/OF_Test/xmls/f1.xml | 34 ++ test/tools/OF_Test/xmls/f10.xml | 48 +++ test/tools/OF_Test/xmls/f11.xml | 51 +++ test/tools/OF_Test/xmls/f12.xml | 43 ++ test/tools/OF_Test/xmls/f13.xml | 46 +++ test/tools/OF_Test/xmls/f14.xml | 52 +++ test/tools/OF_Test/xmls/f15.xml | 45 +++ test/tools/OF_Test/xmls/f16.xml | 35 ++ test/tools/OF_Test/xmls/f17.xml | 36 ++ test/tools/OF_Test/xmls/f18.xml | 36 ++ test/tools/OF_Test/xmls/f19.xml | 36 ++ test/tools/OF_Test/xmls/f2.xml | 34 ++ test/tools/OF_Test/xmls/f20.xml | 36 ++ test/tools/OF_Test/xmls/f21.xml | 36 ++ test/tools/OF_Test/xmls/f22.xml | 36 ++ test/tools/OF_Test/xmls/f23.xml | 39 ++ test/tools/OF_Test/xmls/f24.xml | 36 ++ test/tools/OF_Test/xmls/f25.xml | 36 ++ test/tools/OF_Test/xmls/f26.xml | 38 ++ test/tools/OF_Test/xmls/f27.xml | 34 ++ test/tools/OF_Test/xmls/f28.xml | 36 ++ test/tools/OF_Test/xmls/f29.xml | 36 ++ test/tools/OF_Test/xmls/f3.xml | 33 ++ test/tools/OF_Test/xmls/f30.xml | 36 ++ test/tools/OF_Test/xmls/f31.xml | 33 ++ test/tools/OF_Test/xmls/f32.xml | 38 ++ test/tools/OF_Test/xmls/f33.xml | 38 ++ test/tools/OF_Test/xmls/f34.xml | 38 ++ test/tools/OF_Test/xmls/f35.xml | 38 ++ test/tools/OF_Test/xmls/f36.xml | 36 ++ test/tools/OF_Test/xmls/f37.xml | 38 ++ test/tools/OF_Test/xmls/f38.xml | 38 ++ test/tools/OF_Test/xmls/f39.xml | 38 ++ test/tools/OF_Test/xmls/f4.xml | 39 ++ test/tools/OF_Test/xmls/f40.xml | 38 ++ test/tools/OF_Test/xmls/f41.xml | 38 ++ test/tools/OF_Test/xmls/f42.xml | 36 ++ test/tools/OF_Test/xmls/f43.xml | 42 ++ test/tools/OF_Test/xmls/f44.xml | 32 ++ test/tools/OF_Test/xmls/f45.xml | 34 ++ test/tools/OF_Test/xmls/f46.xml | 44 ++ test/tools/OF_Test/xmls/f47.xml | 42 ++ test/tools/OF_Test/xmls/f48.xml | 31 ++ test/tools/OF_Test/xmls/f49.xml | 34 ++ test/tools/OF_Test/xmls/f5.xml | 41 ++ test/tools/OF_Test/xmls/f6.xml | 44 ++ test/tools/OF_Test/xmls/f7.xml | 46 +++ test/tools/OF_Test/xmls/f8.xml | 50 +++ test/tools/OF_Test/xmls/f9.xml | 49 +++ 79 files changed, 3110 insertions(+) create mode 100644 test/tools/OF_Test/action-keywords.csv create mode 100755 test/tools/OF_Test/keywords.csv create mode 100755 test/tools/OF_Test/keywords.csv.backup create mode 100755 test/tools/OF_Test/match-keywords.csv create mode 100755 test/tools/OF_Test/odl_tests.py create mode 100755 test/tools/OF_Test/odl_tests.py.backup create mode 100644 test/tools/OF_Test/ofctl/t1 create mode 100644 test/tools/OF_Test/ofctl/t11 create mode 100644 test/tools/OF_Test/ofctl/t19 create mode 100644 test/tools/OF_Test/ofctl/t2 create mode 100644 test/tools/OF_Test/ofctl/t20 create mode 100644 test/tools/OF_Test/ofctl/t21 create mode 100644 test/tools/OF_Test/ofctl/t22 create mode 100644 test/tools/OF_Test/ofctl/t25 create mode 100644 test/tools/OF_Test/ofctl/t27 create mode 100644 test/tools/OF_Test/ofctl/t29 create mode 100644 test/tools/OF_Test/ofctl/t30 create mode 100644 test/tools/OF_Test/ofctl/t31 create mode 100644 test/tools/OF_Test/ofctl/t33 create mode 100644 test/tools/OF_Test/ofctl/t36 create mode 100644 test/tools/OF_Test/ofctl/t38 create mode 100644 test/tools/OF_Test/ofctl/t4 create mode 100644 test/tools/OF_Test/ofctl/t41 create mode 100644 test/tools/OF_Test/ofctl/t43 create mode 100644 test/tools/OF_Test/ofctl/t45 create mode 100644 test/tools/OF_Test/ofctl/t48 create mode 100644 test/tools/OF_Test/ofctl/t5 create mode 100644 test/tools/OF_Test/ofctl/t6 create mode 100644 test/tools/OF_Test/test.py create mode 100644 test/tools/OF_Test/test1.py create mode 100644 test/tools/OF_Test/xmls/f1.xml create mode 100644 test/tools/OF_Test/xmls/f10.xml create mode 100644 test/tools/OF_Test/xmls/f11.xml create mode 100644 test/tools/OF_Test/xmls/f12.xml create mode 100644 test/tools/OF_Test/xmls/f13.xml create mode 100644 test/tools/OF_Test/xmls/f14.xml create mode 100644 test/tools/OF_Test/xmls/f15.xml create mode 100644 test/tools/OF_Test/xmls/f16.xml create mode 100644 test/tools/OF_Test/xmls/f17.xml create mode 100644 test/tools/OF_Test/xmls/f18.xml create mode 100644 test/tools/OF_Test/xmls/f19.xml create mode 100644 test/tools/OF_Test/xmls/f2.xml create mode 100644 test/tools/OF_Test/xmls/f20.xml create mode 100644 test/tools/OF_Test/xmls/f21.xml create mode 100644 test/tools/OF_Test/xmls/f22.xml create mode 100644 test/tools/OF_Test/xmls/f23.xml create mode 100644 test/tools/OF_Test/xmls/f24.xml create mode 100644 test/tools/OF_Test/xmls/f25.xml create mode 100644 test/tools/OF_Test/xmls/f26.xml create mode 100644 test/tools/OF_Test/xmls/f27.xml create mode 100644 test/tools/OF_Test/xmls/f28.xml create mode 100644 test/tools/OF_Test/xmls/f29.xml create mode 100644 test/tools/OF_Test/xmls/f3.xml create mode 100644 test/tools/OF_Test/xmls/f30.xml create mode 100644 test/tools/OF_Test/xmls/f31.xml create mode 100644 test/tools/OF_Test/xmls/f32.xml create mode 100644 test/tools/OF_Test/xmls/f33.xml create mode 100644 test/tools/OF_Test/xmls/f34.xml create mode 100644 test/tools/OF_Test/xmls/f35.xml create mode 100644 test/tools/OF_Test/xmls/f36.xml create mode 100644 test/tools/OF_Test/xmls/f37.xml create mode 100644 test/tools/OF_Test/xmls/f38.xml create mode 100644 test/tools/OF_Test/xmls/f39.xml create mode 100644 test/tools/OF_Test/xmls/f4.xml create mode 100644 test/tools/OF_Test/xmls/f40.xml create mode 100644 test/tools/OF_Test/xmls/f41.xml create mode 100644 test/tools/OF_Test/xmls/f42.xml create mode 100644 test/tools/OF_Test/xmls/f43.xml create mode 100644 test/tools/OF_Test/xmls/f44.xml create mode 100644 test/tools/OF_Test/xmls/f45.xml create mode 100644 test/tools/OF_Test/xmls/f46.xml create mode 100644 test/tools/OF_Test/xmls/f47.xml create mode 100644 test/tools/OF_Test/xmls/f48.xml create mode 100644 test/tools/OF_Test/xmls/f49.xml create mode 100644 test/tools/OF_Test/xmls/f5.xml create mode 100644 test/tools/OF_Test/xmls/f6.xml create mode 100644 test/tools/OF_Test/xmls/f7.xml create mode 100644 test/tools/OF_Test/xmls/f8.xml create mode 100644 test/tools/OF_Test/xmls/f9.xml diff --git a/test/tools/OF_Test/action-keywords.csv b/test/tools/OF_Test/action-keywords.csv new file mode 100644 index 0000000000..e61030339f --- /dev/null +++ b/test/tools/OF_Test/action-keywords.csv @@ -0,0 +1,3 @@ +dec-nw-ttl;dec_ttl +dec-mpls-ttl;dec_mpls_ttl +drop-action;drop diff --git a/test/tools/OF_Test/keywords.csv b/test/tools/OF_Test/keywords.csv new file mode 100755 index 0000000000..5ff10e3cb3 --- /dev/null +++ b/test/tools/OF_Test/keywords.csv @@ -0,0 +1,15 @@ +cookie;cookie +duration;duration +exit;exit +idle-timeout;idle_timeout +in_port;in_port +instructions;instructions +hard-timeout;hard_timeout +out_port;out_port +match;matches +n_packets;n_packets +n_bytes;n_bytes +priority;priority +reg;reg +table;table +table_id;table diff --git a/test/tools/OF_Test/keywords.csv.backup b/test/tools/OF_Test/keywords.csv.backup new file mode 100755 index 0000000000..7cd9ee08ad --- /dev/null +++ b/test/tools/OF_Test/keywords.csv.backup @@ -0,0 +1,50 @@ +in_port;in_port +dl_vlan;dl_vlan +dl_vlan_pcp;dl_vlan_pcp +dl_src;dl_src +dl_dst;dl_dst +dl_type;dl_type +ipv4-source;nw_src +ipv4-destination;nw_dst +nw_proto;nw_proto +nw_tos;nw_tos +nw_ecn;nw_ecn +nw_ttl;nw_ttl +tp_src;tp_src +tp_dst;tp_dst +icmp_type;icmp_type +icmp_code;icmp_code +table;table +ip;ip +icmp;icmp +tcp;tcp +udp;udp +arp;arp +vlan_tci;vlan_tci +ip_frag;ip_frag +arp_sha;arp_sha +arp_tha;arp_tha +ipv6_src;ipv6_src +ipv6_dst;ipv6_dst +ipv6_label;ipv6_label +nd_target;nd_target +nd_sll;nd_sll +nd_tll;nd_tll +tun_id;tun_id +reg;reg +ipv6;ipv6 +tcp6;tcp6 +udp6;udp6 +icmp6;icmp6 +apply_actions;actions +exit;exit +cookie;cookie +priority;priority +idle-timeout;idle_timeout +hard-timeout;hard_timeout +out_port;out_port +duration;duration +table_id;table +priority;priority +n_packets;n_packets +n_bytes;n_bytes diff --git a/test/tools/OF_Test/match-keywords.csv b/test/tools/OF_Test/match-keywords.csv new file mode 100755 index 0000000000..7dad3ebf3b --- /dev/null +++ b/test/tools/OF_Test/match-keywords.csv @@ -0,0 +1,32 @@ +arp-op;arp_op +arp-source-transport-address;arp_spa +arp-target-transport-address;arp_tpa +arp-source-hardware-address;arp_sha +arp-target-hardware-address;arp_tha +ethernet-source;dl_src +ethernet-destination;dl_dst +ethernet-type;dl_type +icmpv4-type;icmp_type +icmpv4-code;icmp_code +in-port;in_port +in-phy-port;in_phy_port +ip-dscp;nw_tos +ip-ecn;nw_ecn +ip-protocol;nw_proto +ipv4-source;nw_src +ipv4-destination;nw_dst +ipv6_source;ipv6_src +ipv6_destination;ipv6_dst +ipv6_label;ipv6_label +sctp-destination-port;tp_dst +sctp-source-port;tp_src +tcp-destination-port;tp_dst +tcp-source-port;tp_src +udp-destination-port;tp_dst +udp-source-port;tp_src +vlan-id;dl_vlan +vlan_tci;vlan_tci +nd_target;nd_target +nd_sll;nd_sll +nd_tll;nd_tll +tun_id;tun_id diff --git a/test/tools/OF_Test/odl_tests.py b/test/tools/OF_Test/odl_tests.py new file mode 100755 index 0000000000..d743bd245a --- /dev/null +++ b/test/tools/OF_Test/odl_tests.py @@ -0,0 +1,539 @@ +import os +import sys +import time +import logging +import argparse +import unittest +import requests +import xml.dom.minidom as md +from xml.etree import ElementTree as ET +from netaddr import IPNetwork +from string import lower + +import mininet.node +import mininet.topo +import mininet.net +import mininet.util + +from mininet.node import RemoteController +from mininet.node import OVSKernelSwitch + +def create_network(controller_ip, controller_port): + """Create topology and mininet network.""" + topo = mininet.topo.Topo() + + topo.addSwitch('s1') + topo.addHost('h1') + topo.addHost('h2') + + topo.addLink('h1', 's1') + topo.addLink('h2', 's1') + + switch=mininet.util.customConstructor( + {'ovsk':OVSKernelSwitch}, 'ovsk,protocols=OpenFlow13') + + controller=mininet.util.customConstructor( + {'remote': RemoteController}, 'remote,ip=%s:%s' % (controller_ip, + controller_port)) + + + net = mininet.net.Mininet(topo=topo, switch=switch, controller=controller) + + return net + + +def get_flows(net): + """Get list of flows from network's first switch. + + Return list of all flows on switch, sorted by duration (newest first) + One flow is a dictionary with all flow's attribute:value pairs. Matches + are stored under 'matches' key as another dictionary. + Example: + + { + 'actions': 'drop', + 'cookie': '0xa,', + 'duration': '3.434s,', + 'hard_timeout': '12,', + 'idle_timeout': '34,', + 'matches': { + 'ip': None, + 'nw_dst': '10.0.0.0/24' + }, + 'n_bytes': '0,', + 'n_packets': '0,', + 'priority': '2', + 'table': '1,' + } + + """ + log = logging.getLogger(__name__) + def parse_matches(flow, matches): + flow['matches'] = {} + + for match in matches: + split_match = match.split('=', 1) + if len(split_match) == 1: + flow['matches'][split_match[0]] = None + else: + flow['matches'][split_match[0]] = split_match[1].rstrip(',') + + switch = net.switches[0] + output = switch.cmdPrint( + 'ovs-ofctl -O OpenFlow13 dump-flows %s' % switch.name) +# output = switch.cmdPrint( +# 'ovs-ofctl -F openflow10 dump-flows %s' % switch.name) + + log.debug('switch flow table: {}'.format(output)) + + flows = [] + + for line in output.splitlines()[1:]: + flow = {} + for word in line.split(): + word.rstrip(',') + try: + key, value = word.split('=', 1) + except ValueError: + #TODO: need to figure out what to do here? + continue + + if key == 'priority': + values = value.split(',') + flow[key] = values[0] + parse_matches(flow, values[1:]) + else: + flow[key] = value.rstrip(',') + + flows.append(flow) + + # sort by duration + return sorted(flows, key=lambda x: x['duration'].rstrip('s')) + + +def translate_to_flow(flow, name, dictionary): + switch_flow_name = dictionary[name] + + key_err = '{} needs to be present in flow definition. Flow definition ' \ + 'was: {}.'.format(switch_flow_name, flow) + assert switch_flow_name in flow, key_err + return switch_flow_name + + +def get_text_value(element): + return element.childNodes[0].nodeValue + + +def compare_elements(expected_match, actual_match, kw, comparators, default): + for child in expected_match.childNodes: + if child.nodeType is expected_match.TEXT_NODE: + continue + + comparator = comparators.get(child.nodeName, default) + comparator(child, actual_match, kw) + + +def fallback_comparator(xml_element, switch_flow, kw): + # print 'fallback_comparator-xml_element', xml_element.toxml() + # print 'fallback_comparator: switch_flow', switch_flow + # print 'fallback_comparator: kw', kws + + name = translate_to_flow(switch_flow, xml_element.nodeName, kw) + + actual = switch_flow[name] + expected = xml_element.childNodes[0].nodeValue + + data = xml_element.toxml(), name, actual + # print 'fallback_comparator: data', data + + assert expected == actual, 'xml part: %s && switch %s=%s' % data + + +def default_comparator(xml_element, switch_flow): + fallback_comparator(xml_element, switch_flow, keywords) + + +def integer_comparator(expected, actual, kw, base): + expected_value = int(expected.childNodes[0].data) + + name = kw.get(expected.nodeName) + actual_value = int(actual[name], base) + + data = expected.toxml(), name, actual + assert expected_value == actual_value, \ + 'xml value: %s && actual value %s=%s' % data + + +def cookie_comparator(cookie, switch_flow): + integer_comparator(cookie, switch_flow, keywords, 16) + + +def ethernet_address_comparator(child, actual_match, kw): + expected_address = child.getElementsByTagName("address")[0].childNodes[0].data + actual_address = actual_match[kw.get(child.nodeName)] + + data = child.toxml(), kw.get(child.nodeName), actual_address + + assert lower(expected_address) == lower(actual_address), \ + 'xml address: %s && actual address %s=%s' % data + + +def vlan_match_comparator(expected_match, actual_match, kw): + + def compare_vlan_pcp(expected_match, actual_match, kw): + integer_comparator(expected_match, actual_match, kw, 10) + + def compare_vlan_id(expected_match, actual_match, kw): + integer_comparator(expected_match.getElementsByTagName('vlan-id')[0], \ + actual_match, kw, 10) + + VLAN_COMPARATORS = { + 'vlan-pcp': compare_vlan_pcp, + 'vlan-id': compare_vlan_id, + } + + # print 'ethernet_match_comparator-expected_match:', expected_match.toxml() + # print 'ethernet_match_comparator-actual_match:', actual_match + + compare_elements(expected_match, actual_match, kw, \ + VLAN_COMPARATORS, fallback_comparator) + + +def ethernet_match_comparator(expected_match, actual_match, kw): + def compare_etype(child, actual_match, kw): + expected_etype = int(child.getElementsByTagName("type")[0].childNodes[0].data) + name = kw.get(child.nodeName) + data = child.toxml(), name, actual_match + + if expected_etype == 2048: # IP + assert ((actual_match.get('ip', 'IP Not-present') is None) or \ + (actual_match.get('tcp', 'TCP Not-present') is None) or \ + (actual_match.get('sctp', 'SCTP Not-present') is None) or \ + (actual_match.get('udp', 'UDP Not-present') is None)), \ + 'Expected etype %s && actual etype %s=%s' % data + + elif expected_etype == 2054: #ARP + assert actual_match.get('arp', 'ARP Not-present') is None, \ + 'Expected etype %s && actual etype %s=%s' % data + + else: + actual_etype = int(actual_match[name], 16) + + assert expected_etype == actual_etype, \ + 'xml etype: %s && actual etype %s=%s' % data + + + ETH_COMPARATORS = { + 'ethernet-type': compare_etype, + 'ethernet-source': ethernet_address_comparator, + 'ethernet-destination': ethernet_address_comparator, + } + + # print 'ethernet_match_comparator-expected_match:', expected_match.toxml() + # print 'ethernet_match_comparator-actual_match:', actual_match + + compare_elements(expected_match, actual_match, kw, \ + ETH_COMPARATORS, fallback_comparator) + + +def ipv4_comparator(expected_match, actual_match, kw): + # print 'ip_v4_comparator:', expected_match.toxml(), actual_match + # print 'ip_v4_comparator-actual_match:', actual_match + + expected_value = expected_match.childNodes[0].data + actual_value = actual_match[kw.get(expected_match.nodeName)] + + data = expected_match.toxml(), kw.get(expected_match.nodeName), actual_value + + assert IPNetwork(expected_value) == IPNetwork(actual_value),\ + 'xml part: %s && address %s=%s' % data + + +def ip_match_comparator(expected_match, actual_match, kw): + def compare_proto(child, actual_match, kw): + print 'compare_proto:', child.toxml(), actual_match + expected_proto = int(child.childNodes[0].data) + + name = child.nodeName + data = expected_match.toxml(), name, actual_match + + if expected_proto == 6: # TCP + assert actual_match.get('tcp', 'TCP Not-present') is None, \ + 'ip protocol type: expected %s, actual %s=%s' % data + + elif expected_proto == 17: #UDP + assert actual_match.get('udp', 'UDP Not-present') is None, \ + 'ip protocol type: expected %s, actual %s=%s' % data + + elif expected_proto == 132: #SCTP + assert actual_match.get('sctp', 'SCTP Not-present') is None, \ + 'ip protocol type: expected %s, actual %s=%s' % data + + else: + fallback_comparator(child, actual_match, kw) + + + def compare_dscp(child, actual_match, kw): + # print 'compare_dscp:', child.toxml(), actual_match + + expected_dscp = int(child.childNodes[0].data) + name = kw.get(child.nodeName) + actual_dscp = int(actual_match[name]) + + data = child.toxml(), name, actual_match + + assert (expected_dscp * 4) == actual_dscp, 'dscp: expected %s, actual %s=%s' % data + + + IP_MATCH_COMPARATORS = { + 'ip-protocol': compare_proto, + 'ip-dscp': compare_dscp, + } + + # print 'ip_match_comparator:', expected_match.toxml(), actual_match + compare_elements(expected_match, actual_match, kw, \ + IP_MATCH_COMPARATORS, fallback_comparator) + + +def match_comparator(expected_match, switch_flow): + MATCH_COMPARATORS = { + 'arp-source-hardware-address': ethernet_address_comparator, + 'arp-target-hardware-address': ethernet_address_comparator, + 'vlan-match': vlan_match_comparator, + 'ethernet-match': ethernet_match_comparator, + 'ip-match': ip_match_comparator, + 'ipv4-destination': ipv4_comparator, + 'ipv4-source': ipv4_comparator, + } + + actual_match = switch_flow['matches'] + + # print 'match_comparator-expected_match:', expected_match.toxml() + # print 'match_comparator-actual_match:', actual_match + # print 'match_comparator: keywords', keywords + + compare_elements(expected_match, actual_match, match_keywords, \ + MATCH_COMPARATORS, fallback_comparator) + + +def actions_comparator(actions, switch_flow): + # print 'actions_comparator:', actions, switch_flow + + actual_actions = switch_flow['actions'].split(",") + # print 'actions_comparator:', actual_actions + + for action in actions.childNodes: + if action.nodeType is actions.TEXT_NODE: + continue + + action_name = action.childNodes[3].nodeName + expected_action = action_keywords.get(action_name) + + data = action.toxml(), expected_action + # print 'actions_comparator:', data + + assert expected_action in actual_actions, 'xml part:\n%s\n expected action: %s' % data + + +def null_comparator(element, switch_flow): + pass + + +def instructions_comparator(instructions_element, switch_flow): + INSTRUCTION_COMPARATORS = { + 'apply-actions': actions_comparator, + 'default': null_comparator, + } + # print 'instructions_comparator:', instructions_element, switch_flow + + instructions = instructions_element.childNodes + + for instruction in instructions_element.childNodes: + if instruction.nodeType is instructions_element.TEXT_NODE: + continue + + for itype in instruction.childNodes: + if itype.nodeType is itype.TEXT_NODE: + continue + + comparator = INSTRUCTION_COMPARATORS.get(itype.nodeName, + INSTRUCTION_COMPARATORS['default']) + comparator(itype, switch_flow) + + +COMPARATORS = { + 'cookie': cookie_comparator, + 'instructions': instructions_comparator, + 'match': match_comparator, + 'default': default_comparator, +} + +def all_nodes(xml_root): + """ + Generates every non-text nodes. + """ + current_nodes = [xml_root] + next_nodes = [] + + while len(current_nodes) > 0: + for node in current_nodes: + if node.nodeType != xml_root.TEXT_NODE: + yield node + next_nodes.extend(node.childNodes) + + current_nodes, next_nodes = next_nodes, [] + + +def check_elements(xmlstr, keywords): + # namespace = 'urn:opendaylight:flow:inventory' + tree = md.parseString(xmlstr) + + for element in all_nodes(tree.documentElement): + # switch flow object contains only some data from xml + if element.nodeName not in keywords: + # print 'check_elements: element.nodeName', element.nodeName, 'NOT in keywords' + continue + + yield element + + raise StopIteration() + + +class TestOpenFlowXMLs(unittest.TestCase): + @classmethod + def setUpClass(cls): + cls.net = create_network(cls.host, cls.mn_port) + cls.net.start() + time.sleep(15) + + @classmethod + def tearDownClass(cls): + cls.net.stop() + + +def get_values(node, *tags): + result = {tag: None for tag in tags} + for node in all_nodes(node): + if node.nodeName in result and len(node.childNodes) > 0: + result[node.nodeName] = node.childNodes[0].nodeValue + return result + + +def generate_tests_from_xmls(path, xmls=None): + # generate test function from path to request xml + def generate_test(path_to_xml): + xml_string = '' + with open(path_to_xml) as f: + xml_string = f.read() + + tree = md.parseString(xml_string) + ids = get_values(tree.documentElement, 'table_id', 'id') + + def new_test(self): + log = logging.getLogger(__name__) + # send request throught RESTCONF + data = (self.host, self.port, ids['table_id'], ids['id']) + url = 'http://%s:%d/restconf/config/opendaylight-inventory:nodes' \ + '/node/openflow:1/table/%s/flow/%s' % data + headers = { + 'Content-Type': 'application/xml', + 'Accept': 'application/xml', + } + log.info('sending request to url: {}'.format(url)) + rsp = requests.put(url, auth=('admin', 'admin'), data=xml_string, + headers=headers) + log.info('received status code: {}'.format(rsp.status_code)) + log.debug('received content: {}'.format(rsp.text)) + assert rsp.status_code == 204 or rsp.status_code == 200, 'Status' \ + ' code returned %d' % rsp.status_code + + # check request content against restconf's datastore + response = requests.get(url, auth=('admin', 'admin'), + headers={'Accept': 'application/xml'}) + assert response.status_code == 200 + req = ET.tostring(ET.fromstring(xml_string)) + res = ET.tostring(ET.fromstring(response.text)) + assert req == res, 'uploaded and stored xml, are not the same\n' \ + 'uploaded: %s\nstored:%s' % (req, res) + + # collect flow table state on switch + switch_flows = get_flows(self.net) + assert len(switch_flows) > 0 + + # compare requested object and flow table state + for important_element in check_elements(xml_string, keywords): + # log.info('important element: {}'.format(important_element.nodeName)) + comparator = COMPARATORS.get(important_element.nodeName, + COMPARATORS['default']) + + comparator(important_element, switch_flows[0]) + + return new_test + + # generate list of available xml requests + xmlfiles = None + if xmls is not None: + xmlfiles = ('f%d.xml' % fid for fid in xmls) + else: + xmlfiles = (xml for xml in os.listdir(path) if xml.endswith('.xml')) + + # define key getter for sorting + def get_test_number(test_name): + return int(test_name[1:-4]) + + for xmlfile in xmlfiles: + test_name = 'test_xml_%04d' % get_test_number(xmlfile) + setattr(TestOpenFlowXMLs, + test_name, + generate_test(os.path.join(path, xmlfile))) + + +if __name__ == '__main__': + # set up logging + logging.basicConfig(level=logging.DEBUG) + + # parse cmdline arguments + parser = argparse.ArgumentParser(description='Run switch <-> ODL tests ' + 'defined by xmls.') + parser.add_argument('--odlhost', default='127.0.0.1', help='host where ' + 'odl controller is running') + parser.add_argument('--odlport', type=int, default=8080, help='port on ' + 'which odl\'s RESTCONF is listening') + parser.add_argument('--mnport', type=int, default=6653, help='port on ' + 'which odl\'s controller is listening') + parser.add_argument('--xmls', default=None, help='generete tests only ' + 'from some xmls (i.e. 1,3,34) ') + args = parser.parse_args() + + # set host and port of ODL controller for test cases + TestOpenFlowXMLs.port = args.odlport + TestOpenFlowXMLs.host = args.odlhost + TestOpenFlowXMLs.mn_port = args.mnport + + keywords = None + with open('keywords.csv') as f: + keywords = dict(line.strip().split(';') for line in f + if not line.startswith('#')) + + match_keywords = None + with open('match-keywords.csv') as f: + match_keywords = dict(line.strip().split(';') for line in f + if not line.startswith('#')) + + action_keywords = None + with open('action-keywords.csv') as f: + action_keywords = dict(line.strip().split(';') for line in f + if not line.startswith('#')) + + # fix arguments for unittest + del sys.argv[1:] + + # generate tests for TestOpenFlowXMLs + if args.xmls is not None: + xmls = map(int, args.xmls.split(',')) + generate_tests_from_xmls('xmls', xmls) + else: + generate_tests_from_xmls('xmls') + + # run all tests + unittest.main() diff --git a/test/tools/OF_Test/odl_tests.py.backup b/test/tools/OF_Test/odl_tests.py.backup new file mode 100755 index 0000000000..73ad84a8bf --- /dev/null +++ b/test/tools/OF_Test/odl_tests.py.backup @@ -0,0 +1,518 @@ +import os +import sys +import time +import logging +import argparse +import unittest +import requests +import xml.dom.minidom as md +from xml.etree import ElementTree as ET +from netaddr import IPNetwork +from string import lower + +import mininet.node +import mininet.topo +import mininet.net +import mininet.util + +from mininet.node import RemoteController +from mininet.node import OVSKernelSwitch + +def create_network(controller_ip, controller_port): + """Create topology and mininet network.""" + topo = mininet.topo.Topo() + + topo.addSwitch('s1') + topo.addHost('h1') + topo.addHost('h2') + + topo.addLink('h1', 's1') + topo.addLink('h2', 's1') + + switch=mininet.util.customConstructor( + {'ovsk':OVSKernelSwitch}, 'ovsk,protocols=OpenFlow13') + + controller=mininet.util.customConstructor( + {'remote': RemoteController}, 'remote,ip=%s:%s' % (controller_ip, + controller_port)) + + + net = mininet.net.Mininet(topo=topo, switch=switch, controller=controller) + + return net + + +def get_flows(net): + """Get list of flows from network's first switch. + + Return list of all flows on switch, sorted by duration (newest first) + One flow is a dictionary with all flow's attribute:value pairs. Matches + are stored under 'matches' key as another dictionary. + Example: + + { + 'actions': 'drop', + 'cookie': '0xa,', + 'duration': '3.434s,', + 'hard_timeout': '12,', + 'idle_timeout': '34,', + 'matches': { + 'ip': None, + 'nw_dst': '10.0.0.0/24' + }, + 'n_bytes': '0,', + 'n_packets': '0,', + 'priority': '2', + 'table': '1,' + } + + """ + log = logging.getLogger(__name__) + def parse_matches(flow, matches): + flow['matches'] = {} + + for match in matches: + split_match = match.split('=', 1) + if len(split_match) == 1: + flow['matches'][split_match[0]] = None + else: + flow['matches'][split_match[0]] = split_match[1].rstrip(',') + + switch = net.switches[0] + output = switch.cmdPrint( + 'ovs-ofctl -O OpenFlow13 dump-flows %s' % switch.name) +# output = switch.cmdPrint( +# 'ovs-ofctl -F openflow10 dump-flows %s' % switch.name) + + log.debug('switch flow table: {}'.format(output)) + + flows = [] + + for line in output.splitlines()[1:]: + flow = {} + for word in line.split(): + word.rstrip(',') + try: + key, value = word.split('=', 1) + except ValueError: + #TODO: need to figure out what to do here? + continue + + if key == 'priority': + values = value.split(',') + flow[key] = values[0] + parse_matches(flow, values[1:]) + else: + flow[key] = value.rstrip(',') + + flows.append(flow) + + # sort by duration + return sorted(flows, key=lambda x: x['duration'].rstrip('s')) + + +def translate_to_flow(flow, name, dictionary): + switch_flow_name = dictionary[name] + + key_err = '{} needs to be present in flow definition. Flow definition ' \ + 'was: {}.'.format(switch_flow_name, flow) + assert switch_flow_name in flow, key_err + return switch_flow_name + + +def get_text_value(element): + return element.childNodes[0].nodeValue + + +def fallback_comparator(xml_element, switch_flow, kw): + # print 'fallback_comparator-xml_element', xml_element.toxml() + # print 'fallback_comparator: switch_flow', switch_flow + # print 'fallback_comparator: kw', kws + + name = translate_to_flow(switch_flow, xml_element.nodeName, kw) + + actual = switch_flow[name] + expected = xml_element.childNodes[0].nodeValue + + data = xml_element.toxml(), name, actual + # print 'fallback_comparator: data', data + + assert expected == actual, 'xml part: %s && switch %s=%s' % data + + +def default_comparator(xml_element, switch_flow): + fallback_comparator(xml_element, switch_flow, keywords) + + +def cookie_comparator(cookie, switch_flow): + name = translate_to_flow(switch_flow, cookie.nodeName, keywords) + + actual = int(switch_flow[name], 0) + expected = int(cookie.childNodes[0].nodeValue) + data = cookie.toxml(), name, actual + + assert expected == actual, 'xml part: %s && switch %s=%s' % data + + +def ethernet_address_comparator(child, actual_match, kw): + expected_address = child.getElementsByTagName("address")[0].childNodes[0].data + actual_address = actual_match[kw.get(child.nodeName)] + + data = child.toxml(), kw.get(child.nodeName), actual_address + + assert lower(expected_address) == lower(actual_address), \ + 'xml address: %s && actual address %s=%s' % data + + +def ethernet_match_comparator(expected_match, actual_match, kw): + def compare_etype(child, actual_match, kw): + expected_etype = int(child.getElementsByTagName("type")[0].childNodes[0].data) + name = kw.get(child.nodeName) + data = child.toxml(), name, actual_match + + if expected_etype == 2048: # IP + assert ((actual_match.get('ip', 'IP Not-present') is None) or \ + (actual_match.get('tcp', 'TCP Not-present') is None) or \ + (actual_match.get('sctp', 'SCTP Not-present') is None) or \ + (actual_match.get('udp', 'UDP Not-present') is None)), \ + 'Expected etype %s && actual etype %s=%s' % data + + elif expected_etype == 2054: #ARP + assert actual_match.get('arp', 'ARP Not-present') is None, \ + 'Expected etype %s && actual etype %s=%s' % data + + else: + actual_etype = int(actual_match[name], 16) + + assert expected_etype == actual_etype, 'xml etype: %s && actual etype %s=%s' % data + + + ETH_COMPARATORS = { + 'ethernet-type': compare_etype, + 'ethernet-source': ethernet_address_comparator, + 'ethernet-destination': ethernet_address_comparator, + } + + # print 'ethernet_match_comparator-expected_match:', expected_match.toxml() + # print 'ethernet_match_comparator-actual_match:', actual_match + # print 'ethernet_match_comparator-keywords:', keywords + + for child in expected_match.childNodes: + if child.nodeType is expected_match.TEXT_NODE: + continue + + comparator = ETH_COMPARATORS.get(child.nodeName) + comparator(child, actual_match, kw) + + +def ip_v4_comparator(expected_match, actual_match, kw): + # print 'ip_v4_comparator:', expected_match.toxml(), actual_match + # print 'ip_v4_comparator-actual_match:', actual_match + + expected_value = expected_match.childNodes[0].data + actual_value = actual_match[kw.get(expected_match.nodeName)] + + data = expected_match.toxml(), kw.get(expected_match.nodeName), actual_value + + assert IPNetwork(expected_value) == IPNetwork(actual_value), 'xml part: %s && address %s=%s' % data + + +def ip_match_comparator(expected_match, actual_match, kw): + def compare_proto(child, actual_match, kw): + print 'compare_proto:', child.toxml(), actual_match + expected_proto = int(child.childNodes[0].data) + + name = child.nodeName + data = expected_match.toxml(), name, actual_match + + if expected_proto == 6: # TCP + assert actual_match.get('tcp', 'TCP Not-present') is None, \ + 'ip protocol type: expected %s, actual %s=%s' % data + + elif expected_proto == 17: #UDP + assert actual_match.get('udp', 'UDP Not-present') is None, \ + 'ip protocol type: expected %s, actual %s=%s' % data + + elif expected_proto == 132: #SCTP + assert actual_match.get('sctp', 'SCTP Not-present') is None, \ + 'ip protocol type: expected %s, actual %s=%s' % data + + else: + fallback_comparator(child, actual_match, kw) + + + def compare_dscp(child, actual_match, kw): + # print 'compare_dscp:', child.toxml(), actual_match + + expected_dscp = int(child.childNodes[0].data) + name = kw.get(child.nodeName) + actual_dscp = int(actual_match[name]) + + data = child.toxml(), name, actual_match + + assert (expected_dscp * 4) == actual_dscp, 'dscp: expected %s, actual %s=%s' % data + + + IP_MATCH_COMPARATORS = { + 'ip-protocol': compare_proto, + 'ip-dscp': compare_dscp, + 'ip-ecn': fallback_comparator, + } + + # print 'ip_match_comparator:', expected_match.toxml(), actual_match + + for child in expected_match.childNodes: + if child.nodeType is expected_match.TEXT_NODE: + continue + + comparator = IP_MATCH_COMPARATORS.get(child.nodeName) + comparator(child, actual_match, kw) + + +def match_comparator(expected_match, switch_flow): + MATCH_COMPARATORS = { + 'arp-source-hardware-address': ethernet_address_comparator, + 'arp-target-hardware-address': ethernet_address_comparator, + 'ethernet-match': ethernet_match_comparator, + 'ip-match': ip_match_comparator, + 'ipv4-destination': ip_v4_comparator, + 'ipv4-source': ip_v4_comparator, + 'default': fallback_comparator, + } + + actual_match = switch_flow['matches'] + + # print 'match_comparator-expected_match:', expected_match.toxml() + # print 'match_comparator-actual_match:', actual_match + # print 'match_comparator: keywords', keywords + + for child in expected_match.childNodes: + if child.nodeType is expected_match.TEXT_NODE: + continue + + comparator = MATCH_COMPARATORS.get(child.nodeName, + MATCH_COMPARATORS['default']) + comparator(child, actual_match, match_keywords) + + +def actions_comparator(actions, switch_flow): + # print 'actions_comparator:', actions, switch_flow + + actual_actions = switch_flow['actions'].split(",") + # print 'actions_comparator:', actual_actions + + for action in actions.childNodes: + if action.nodeType is actions.TEXT_NODE: + continue + + action_name = action.childNodes[3].nodeName + expected_action = action_keywords.get(action_name) + + data = action.toxml(), expected_action + # print 'actions_comparator:', data + + assert expected_action in actual_actions, 'xml part:\n%s\n expected action: %s' % data + + +def null_comparator(element, switch_flow): + pass + + +def instructions_comparator(instructions_element, switch_flow): + INSTRUCTION_COMPARATORS = { + 'apply-actions': actions_comparator, + 'default': null_comparator, + } + # print 'instructions_comparator:', instructions_element, switch_flow + + instructions = instructions_element.childNodes + + for instruction in instructions_element.childNodes: + if instruction.nodeType is instructions_element.TEXT_NODE: + continue + + for itype in instruction.childNodes: + if itype.nodeType is itype.TEXT_NODE: + continue + + comparator = INSTRUCTION_COMPARATORS.get(itype.nodeName, + INSTRUCTION_COMPARATORS['default']) + comparator(itype, switch_flow) + + +COMPARATORS = { + 'cookie': cookie_comparator, + 'instructions': instructions_comparator, + 'match': match_comparator, + 'default': default_comparator, +} + +def all_nodes(xml_root): + """ + Generates every non-text nodes. + """ + current_nodes = [xml_root] + next_nodes = [] + + while len(current_nodes) > 0: + for node in current_nodes: + if node.nodeType != xml_root.TEXT_NODE: + yield node + next_nodes.extend(node.childNodes) + + current_nodes, next_nodes = next_nodes, [] + + +def check_elements(xmlstr, keywords): + # namespace = 'urn:opendaylight:flow:inventory' + tree = md.parseString(xmlstr) + + for element in all_nodes(tree.documentElement): + # switch flow object contains only some data from xml + if element.nodeName not in keywords: + # print 'check_elements: element.nodeName', element.nodeName, 'NOT in keywords' + continue + + yield element + + raise StopIteration() + + +class TestOpenFlowXMLs(unittest.TestCase): + @classmethod + def setUpClass(cls): + cls.net = create_network(cls.host, cls.mn_port) + cls.net.start() + time.sleep(15) + + @classmethod + def tearDownClass(cls): + cls.net.stop() + + +def get_values(node, *tags): + result = {tag: None for tag in tags} + for node in all_nodes(node): + if node.nodeName in result and len(node.childNodes) > 0: + result[node.nodeName] = node.childNodes[0].nodeValue + return result + + +def generate_tests_from_xmls(path, xmls=None): + # generate test function from path to request xml + def generate_test(path_to_xml): + xml_string = '' + with open(path_to_xml) as f: + xml_string = f.read() + + tree = md.parseString(xml_string) + ids = get_values(tree.documentElement, 'table_id', 'id') + + def new_test(self): + log = logging.getLogger(__name__) + # send request throught RESTCONF + data = (self.host, self.port, ids['table_id'], ids['id']) + url = 'http://%s:%d/restconf/config/opendaylight-inventory:nodes' \ + '/node/openflow:1/table/%s/flow/%s' % data + headers = { + 'Content-Type': 'application/xml', + 'Accept': 'application/xml', + } + log.info('sending request to url: {}'.format(url)) + rsp = requests.put(url, auth=('admin', 'admin'), data=xml_string, + headers=headers) + log.info('received status code: {}'.format(rsp.status_code)) + log.debug('received content: {}'.format(rsp.text)) + assert rsp.status_code == 204 or rsp.status_code == 200, 'Status' \ + ' code returned %d' % rsp.status_code + + # check request content against restconf's datastore + response = requests.get(url, auth=('admin', 'admin'), + headers={'Accept': 'application/xml'}) + assert response.status_code == 200 + req = ET.tostring(ET.fromstring(xml_string)) + res = ET.tostring(ET.fromstring(response.text)) + assert req == res, 'uploaded and stored xml, are not the same\n' \ + 'uploaded: %s\nstored:%s' % (req, res) + + # collect flow table state on switch + switch_flows = get_flows(self.net) + assert len(switch_flows) > 0 + + # compare requested object and flow table state + for important_element in check_elements(xml_string, keywords): + # log.info('important element: {}'.format(important_element.nodeName)) + comparator = COMPARATORS.get(important_element.nodeName, + COMPARATORS['default']) + + comparator(important_element, switch_flows[0]) + + return new_test + + # generate list of available xml requests + xmlfiles = None + if xmls is not None: + xmlfiles = ('f%d.xml' % fid for fid in xmls) + else: + xmlfiles = (xml for xml in os.listdir(path) if xml.endswith('.xml')) + + # define key getter for sorting + def get_test_number(test_name): + return int(test_name[1:-4]) + + for xmlfile in xmlfiles: + test_name = 'test_xml_%04d' % get_test_number(xmlfile) + setattr(TestOpenFlowXMLs, + test_name, + generate_test(os.path.join(path, xmlfile))) + + +if __name__ == '__main__': + # set up logging + logging.basicConfig(level=logging.DEBUG) + + # parse cmdline arguments + parser = argparse.ArgumentParser(description='Run switch <-> ODL tests ' + 'defined by xmls.') + parser.add_argument('--odlhost', default='127.0.0.1', help='host where ' + 'odl controller is running') + parser.add_argument('--odlport', type=int, default=8080, help='port on ' + 'which odl\'s RESTCONF is listening') + parser.add_argument('--mnport', type=int, default=6653, help='port on ' + 'which odl\'s controller is listening') + parser.add_argument('--xmls', default=None, help='generete tests only ' + 'from some xmls (i.e. 1,3,34) ') + args = parser.parse_args() + + # set host and port of ODL controller for test cases + TestOpenFlowXMLs.port = args.odlport + TestOpenFlowXMLs.host = args.odlhost + TestOpenFlowXMLs.mn_port = args.mnport + + keywords = None + with open('keywords.csv') as f: + keywords = dict(line.strip().split(';') for line in f + if not line.startswith('#')) + + match_keywords = None + with open('match-keywords.csv') as f: + match_keywords = dict(line.strip().split(';') for line in f + if not line.startswith('#')) + + action_keywords = None + with open('action-keywords.csv') as f: + action_keywords = dict(line.strip().split(';') for line in f + if not line.startswith('#')) + + # fix arguments for unittest + del sys.argv[1:] + + # generate tests for TestOpenFlowXMLs + if args.xmls is not None: + xmls = map(int, args.xmls.split(',')) + generate_tests_from_xmls('xmls', xmls) + else: + generate_tests_from_xmls('xmls') + + # run all tests + unittest.main() diff --git a/test/tools/OF_Test/ofctl/t1 b/test/tools/OF_Test/ofctl/t1 new file mode 100644 index 0000000000..23f204b49c --- /dev/null +++ b/test/tools/OF_Test/ofctl/t1 @@ -0,0 +1 @@ +cookie=0xa, duration=1.451s, table=2, n_packets=0, n_bytes=0, priority=2,ip,nw_dst=10.0.0.0/24 actions=dec_ttl diff --git a/test/tools/OF_Test/ofctl/t11 b/test/tools/OF_Test/ofctl/t11 new file mode 100644 index 0000000000..1ceaf006e6 --- /dev/null +++ b/test/tools/OF_Test/ofctl/t11 @@ -0,0 +1 @@ +cookie=0xa, duration=1.754s, table=2, n_packets=0, n_bytes=0, priority=2,ip,nw_dst=10.0.0.0/24 actions=push_vlan diff --git a/test/tools/OF_Test/ofctl/t19 b/test/tools/OF_Test/ofctl/t19 new file mode 100644 index 0000000000..43044613ce --- /dev/null +++ b/test/tools/OF_Test/ofctl/t19 @@ -0,0 +1 @@ +cookie=0xa, duration=1.753s, table=2, n_packets=0, n_bytes=0, priority=2,ip,nw_dst=10.0.0.0/24 actions=dec_ttl diff --git a/test/tools/OF_Test/ofctl/t2 b/test/tools/OF_Test/ofctl/t2 new file mode 100644 index 0000000000..6f39f37d53 --- /dev/null +++ b/test/tools/OF_Test/ofctl/t2 @@ -0,0 +1 @@ +cookie=0xa, duration=1.557s, table=2, n_packets=0, n_bytes=0, priority=2,ip,nw_src=10.0.0.1 actions=drop diff --git a/test/tools/OF_Test/ofctl/t20 b/test/tools/OF_Test/ofctl/t20 new file mode 100644 index 0000000000..33d4c2e286 --- /dev/null +++ b/test/tools/OF_Test/ofctl/t20 @@ -0,0 +1 @@ + cookie=0xa, duration=17.581s, table=2, n_packets=0, n_bytes=0, priority=2,ip,nw_dst=10.0.0.0/24 actions=drop diff --git a/test/tools/OF_Test/ofctl/t21 b/test/tools/OF_Test/ofctl/t21 new file mode 100644 index 0000000000..0c97c64306 --- /dev/null +++ b/test/tools/OF_Test/ofctl/t21 @@ -0,0 +1 @@ + cookie=0xa, duration=14.319s, table=2, n_packets=0, n_bytes=0, priority=2,ip,nw_dst=10.0.0.0/24 actions=drop diff --git a/test/tools/OF_Test/ofctl/t22 b/test/tools/OF_Test/ofctl/t22 new file mode 100644 index 0000000000..3a4b0d16b3 --- /dev/null +++ b/test/tools/OF_Test/ofctl/t22 @@ -0,0 +1 @@ + cookie=0xa, duration=12.954s, table=2, n_packets=0, n_bytes=0, priority=2,ip,nw_dst=10.0.0.0/24 actions=drop diff --git a/test/tools/OF_Test/ofctl/t25 b/test/tools/OF_Test/ofctl/t25 new file mode 100644 index 0000000000..a7a3eadb3b --- /dev/null +++ b/test/tools/OF_Test/ofctl/t25 @@ -0,0 +1 @@ + cookie=0xa, duration=16.708s, table=2, n_packets=0, n_bytes=0, priority=2,ip,nw_dst=10.0.0.0/24 actions=drop diff --git a/test/tools/OF_Test/ofctl/t27 b/test/tools/OF_Test/ofctl/t27 new file mode 100644 index 0000000000..1008ca52dd --- /dev/null +++ b/test/tools/OF_Test/ofctl/t27 @@ -0,0 +1 @@ + cookie=0xa, duration=38.123s, table=2, n_packets=0, n_bytes=0, priority=2,ip,nw_dst=10.0.0.0/24 actions=write_metadata:0xa/0xc diff --git a/test/tools/OF_Test/ofctl/t29 b/test/tools/OF_Test/ofctl/t29 new file mode 100644 index 0000000000..2ab911c7a9 --- /dev/null +++ b/test/tools/OF_Test/ofctl/t29 @@ -0,0 +1 @@ + cookie=0xa, duration=20.251s, table=2, n_packets=0, n_bytes=0, priority=2,ip,nw_dst=10.0.0.0/24 actions=strip_vlan diff --git a/test/tools/OF_Test/ofctl/t30 b/test/tools/OF_Test/ofctl/t30 new file mode 100644 index 0000000000..44fe1ec18b --- /dev/null +++ b/test/tools/OF_Test/ofctl/t30 @@ -0,0 +1 @@ + cookie=0xa, duration=17.729s, table=2, n_packets=0, n_bytes=0, priority=2,ip,nw_dst=10.0.0.0/24 actions=drop diff --git a/test/tools/OF_Test/ofctl/t31 b/test/tools/OF_Test/ofctl/t31 new file mode 100644 index 0000000000..3e9dbca2f8 --- /dev/null +++ b/test/tools/OF_Test/ofctl/t31 @@ -0,0 +1 @@ + cookie=0xa, duration=14.874s, table=2, n_packets=0, n_bytes=0, priority=2,ip,nw_dst=10.0.0.0/24 actions=drop diff --git a/test/tools/OF_Test/ofctl/t33 b/test/tools/OF_Test/ofctl/t33 new file mode 100644 index 0000000000..1b74b0c9c8 --- /dev/null +++ b/test/tools/OF_Test/ofctl/t33 @@ -0,0 +1 @@ + cookie=0xa, duration=23.141s, table=2, n_packets=0, n_bytes=0, priority=2,ip,nw_dst=10.0.0.0/24 actions=drop diff --git a/test/tools/OF_Test/ofctl/t36 b/test/tools/OF_Test/ofctl/t36 new file mode 100644 index 0000000000..03b530c925 --- /dev/null +++ b/test/tools/OF_Test/ofctl/t36 @@ -0,0 +1 @@ + cookie=0xa, duration=35.125s, table=2, n_packets=0, n_bytes=0, priority=2,ip,nw_dst=10.0.0.0/24 actions=drop diff --git a/test/tools/OF_Test/ofctl/t38 b/test/tools/OF_Test/ofctl/t38 new file mode 100644 index 0000000000..0109e4244b --- /dev/null +++ b/test/tools/OF_Test/ofctl/t38 @@ -0,0 +1 @@ + cookie=0xa, duration=69.848s, table=2, n_packets=0, n_bytes=0, priority=2,ip,nw_dst=10.0.0.0/24 actions=set_queue:1 diff --git a/test/tools/OF_Test/ofctl/t4 b/test/tools/OF_Test/ofctl/t4 new file mode 100644 index 0000000000..c11ad89725 --- /dev/null +++ b/test/tools/OF_Test/ofctl/t4 @@ -0,0 +1 @@ +cookie=0xa, duration=3.098s, table=2, n_packets=0, n_bytes=0, priority=2,ip,dl_src=00 diff --git a/test/tools/OF_Test/ofctl/t41 b/test/tools/OF_Test/ofctl/t41 new file mode 100644 index 0000000000..ede432ea4f --- /dev/null +++ b/test/tools/OF_Test/ofctl/t41 @@ -0,0 +1 @@ + cookie=0xa, duration=19.763s, table=2, n_packets=0, n_bytes=0, priority=2,ip,nw_dst=10.0.0.0/24 actions=drop diff --git a/test/tools/OF_Test/ofctl/t43 b/test/tools/OF_Test/ofctl/t43 new file mode 100644 index 0000000000..313dc26986 --- /dev/null +++ b/test/tools/OF_Test/ofctl/t43 @@ -0,0 +1 @@ + cookie=0xa, duration=93.115s, table=2, n_packets=0, n_bytes=0, priority=2,ip,nw_dst=10.0.0.0/24 actions=drop diff --git a/test/tools/OF_Test/ofctl/t45 b/test/tools/OF_Test/ofctl/t45 new file mode 100644 index 0000000000..6e7ba483bb --- /dev/null +++ b/test/tools/OF_Test/ofctl/t45 @@ -0,0 +1 @@ + cookie=0xa, duration=19.913s, table=2, n_packets=0, n_bytes=0, priority=2,metadata=0x100/0xffffff0000000101 actions=drop diff --git a/test/tools/OF_Test/ofctl/t48 b/test/tools/OF_Test/ofctl/t48 new file mode 100644 index 0000000000..5fc3381029 --- /dev/null +++ b/test/tools/OF_Test/ofctl/t48 @@ -0,0 +1 @@ + cookie=0xa, duration=45.249s, table=2, n_packets=0, n_bytes=0, priority=2,tun_id=0x100/0xffffff0000000101 actions=goto_table:2 diff --git a/test/tools/OF_Test/ofctl/t5 b/test/tools/OF_Test/ofctl/t5 new file mode 100644 index 0000000000..f0a6dd6e7b --- /dev/null +++ b/test/tools/OF_Test/ofctl/t5 @@ -0,0 +1 @@ +cookie=0xa, duration=2.095s, table=2, n_packets=0, n_bytes=0, priority=2,ip,nw_dst=10.0.0.0/24 actions=drop diff --git a/test/tools/OF_Test/ofctl/t6 b/test/tools/OF_Test/ofctl/t6 new file mode 100644 index 0000000000..9b9cb261cf --- /dev/null +++ b/test/tools/OF_Test/ofctl/t6 @@ -0,0 +1 @@ +cookie=0xa, duration=4.08s, table=2, n_packets=0, n_bytes=0, priority=2,ip,nw_dst=10.0.0.0/24 actions=goto_table diff --git a/test/tools/OF_Test/test.py b/test/tools/OF_Test/test.py new file mode 100644 index 0000000000..9b36f7a311 --- /dev/null +++ b/test/tools/OF_Test/test.py @@ -0,0 +1,14 @@ +from xml.dom import minidom + +xmldoc=minidom.parse('./xmls/f1.xml') +flow=xmldoc.childNodes[0] +match=flow.childNodes[15] + +ipv4dst = match.getElementsByTagName("ipv4-destination") +print ipv4dst[0].childNodes[0].data + +cvok = match.getElementsByTagName("cvok") +print cvok + +print "ethernet type", match.getElementsByTagName("type")[0].childNodes[0].data +# print "ethernet cvok", match.getElementsByTagName("cvok")[0].childNodes[0].data diff --git a/test/tools/OF_Test/test1.py b/test/tools/OF_Test/test1.py new file mode 100644 index 0000000000..69e6ac3bda --- /dev/null +++ b/test/tools/OF_Test/test1.py @@ -0,0 +1,14 @@ +from xml.dom import minidom + +xmldoc=minidom.parse('./xmls/f7.xml') +flow=xmldoc.childNodes[0] +match=flow.childNodes[11] + +print match.toxml() + +ip_match = match.getElementsByTagName("ip-match") +print 'ip-match:', ip_match + + +# print "ethernet type", match.getElementsByTagName("type")[0].childNodes[0].data +# print "ethernet cvok", match.getElementsByTagName("cvok")[0].childNodes[0].data diff --git a/test/tools/OF_Test/xmls/f1.xml b/test/tools/OF_Test/xmls/f1.xml new file mode 100644 index 0000000000..7afe8fe792 --- /dev/null +++ b/test/tools/OF_Test/xmls/f1.xml @@ -0,0 +1,34 @@ + + + false + + + 0 + + + 0 + + + + + + 2 + 124 + 255 + false + + + + 2048 + + + 10.0.1.1/24 + + 12 + FlowModFlags [_cHECKOVERLAP=false, _rESETCOUNTS=false, _nOPKTCOUNTS=false, _nOBYTCOUNTS=false, _sENDFLOWREM=false] + 1 + 34 + FooXf1 + 2 + false + diff --git a/test/tools/OF_Test/xmls/f10.xml b/test/tools/OF_Test/xmls/f10.xml new file mode 100644 index 0000000000..2587391008 --- /dev/null +++ b/test/tools/OF_Test/xmls/f10.xml @@ -0,0 +1,48 @@ + + + false + + + 0 + + + 0 + + + + + + 2 + 133 + 255 + + + + 2048 + + +
ff:ff:29:01:19:61
+
+ +
00:00:00:11:23:ae
+
+
+ 17.1.2.3/8 + 172.168.5.6/16 + + 132 + 0 + 0 + + 768 + 384 + 0 +
+ 1200 + FlowModFlags [_cHECKOVERLAP=false, _rESETCOUNTS=false, _nOPKTCOUNTS=false, _nOBYTCOUNTS=false, _sENDFLOWREM=false] + 10 + 3400 + FooXf10 + 2 + false +
diff --git a/test/tools/OF_Test/xmls/f11.xml b/test/tools/OF_Test/xmls/f11.xml new file mode 100644 index 0000000000..8384da29eb --- /dev/null +++ b/test/tools/OF_Test/xmls/f11.xml @@ -0,0 +1,51 @@ + + + false + + + 0 + + + 0 + + + + + + 2 + 134 + 255 + + + + 2048 + + +
ff:ff:29:01:19:61
+
+ +
00:00:00:11:23:ae
+
+
+ 17.1.2.3/8 + 172.168.5.6/16 + + 1 + 3f + 3 + + + 6 + 3 + + 0 +
+ 1200 + FlowModFlags [_cHECKOVERLAP=false, _rESETCOUNTS=false, _nOPKTCOUNTS=false, _nOBYTCOUNTS=false, _sENDFLOWREM=false] + 11 + 3400 + FooXf11 + 2 + false +
+ diff --git a/test/tools/OF_Test/xmls/f12.xml b/test/tools/OF_Test/xmls/f12.xml new file mode 100644 index 0000000000..1eb7559d0f --- /dev/null +++ b/test/tools/OF_Test/xmls/f12.xml @@ -0,0 +1,43 @@ + + + false + + + 0 + + + 0 + + + + 1 + + + + + + 2 + 135 + 255 + + + + 2054 + + +
ff:ff:ff:ff:ff:ff
+
+ +
00:00:00:01:23:ae
+
+
+ 1 +
+ 12 + FlowModFlags [_cHECKOVERLAP=false, _rESETCOUNTS=false, _nOPKTCOUNTS=false, _nOBYTCOUNTS=false, _sENDFLOWREM=false] + 12 + 34 + FooXf12 + 2 + false +
diff --git a/test/tools/OF_Test/xmls/f13.xml b/test/tools/OF_Test/xmls/f13.xml new file mode 100644 index 0000000000..e93b571366 --- /dev/null +++ b/test/tools/OF_Test/xmls/f13.xml @@ -0,0 +1,46 @@ + + + false + + + 0 + + + 0 + + + + 1 + + + + + + 2 + 136 + 255 + + + + 2054 + + +
ff:ff:ff:ff:ff:ff
+
+ +
00:00:00:01:23:ae
+
+
+ 1 + 192.168.4.1 + 10.21.22.23 +
+ 12 + FlowModFlags [_cHECKOVERLAP=false, _rESETCOUNTS=false, _nOPKTCOUNTS=false, _nOBYTCOUNTS=false, _sENDFLOWREM=false] + 13 + 34 + FooXf13 + 2 + false +
+ diff --git a/test/tools/OF_Test/xmls/f14.xml b/test/tools/OF_Test/xmls/f14.xml new file mode 100644 index 0000000000..6c075ae7d9 --- /dev/null +++ b/test/tools/OF_Test/xmls/f14.xml @@ -0,0 +1,52 @@ + + + false + + + 0 + + + 0 + + + + 1 + + + + + + 2 + 137 + 255 + + + + 2054 + + +
ff:ff:ff:ff:FF:ff
+
+ +
00:00:FC:01:23:ae
+
+
+ 1 + 192.168.4.1 + 10.21.22.23 + +
12:34:56:78:98:AB
+
+ +
FE:DC:BA:98:76:54
+
+
+ 12 + FlowModFlags [_cHECKOVERLAP=false, _rESETCOUNTS=false, _nOPKTCOUNTS=false, _nOBYTCOUNTS=false, _sENDFLOWREM=false] + 14 + 34 + FooXf14 + 2 + false +
+ diff --git a/test/tools/OF_Test/xmls/f15.xml b/test/tools/OF_Test/xmls/f15.xml new file mode 100644 index 0000000000..99d3eeddda --- /dev/null +++ b/test/tools/OF_Test/xmls/f15.xml @@ -0,0 +1,45 @@ + + + false + + + 0 + + + 0 + + + + + + 2 + 138 + 255 + + + + 2048 + + +
ff:ff:29:01:19:61
+
+ +
00:00:00:11:23:ae
+
+
+ + + 78 + true + + +
+ 1200 + FlowModFlags [_cHECKOVERLAP=false, _rESETCOUNTS=false, _nOPKTCOUNTS=false, _nOBYTCOUNTS=false, _sENDFLOWREM=false] + 15 + 3400 + FooXf15 + 2 + false +
+ diff --git a/test/tools/OF_Test/xmls/f16.xml b/test/tools/OF_Test/xmls/f16.xml new file mode 100644 index 0000000000..2c70f7428c --- /dev/null +++ b/test/tools/OF_Test/xmls/f16.xml @@ -0,0 +1,35 @@ + + + false + + + 0 + + + 0 + + + + + + 2 + 139 + 266 + false + 2 + + + + 2048 + + + 10.0.0.1/24 + + 12 + FlowModFlags [_cHECKOVERLAP=false, _rESETCOUNTS=false, _nOPKTCOUNTS=false, _nOBYTCOUNTS=false, _sENDFLOWREM=false] + 16 + 34 + FooXf16 + 2 + false + diff --git a/test/tools/OF_Test/xmls/f17.xml b/test/tools/OF_Test/xmls/f17.xml new file mode 100644 index 0000000000..7f69eaeb72 --- /dev/null +++ b/test/tools/OF_Test/xmls/f17.xml @@ -0,0 +1,36 @@ + + + false + + + 0 + + + 0 + + + + + + 2 + 140 + 10 + 10 + false + 2 + + + + 2048 + + + 10.0.0.1/24 + + 12 + FlowModFlags [_cHECKOVERLAP=false, _rESETCOUNTS=false, _nOPKTCOUNTS=false, _nOBYTCOUNTS=false, _sENDFLOWREM=false] + 10 + 34 + FooXf17 + 2 + false + diff --git a/test/tools/OF_Test/xmls/f18.xml b/test/tools/OF_Test/xmls/f18.xml new file mode 100644 index 0000000000..252075a1bc --- /dev/null +++ b/test/tools/OF_Test/xmls/f18.xml @@ -0,0 +1,36 @@ + + + false + + + 0 + + + 0 + + + + + + 2 + 141 + 10 + 10 + false + 2 + + + + 2048 + + + 10.0.0.1/24 + + 12 + FlowModFlags [_cHECKOVERLAP=false, _rESETCOUNTS=false, _nOPKTCOUNTS=false, _nOBYTCOUNTS=false, _sENDFLOWREM=false] + 10 + 34 + FooXf18 + 2 + false + diff --git a/test/tools/OF_Test/xmls/f19.xml b/test/tools/OF_Test/xmls/f19.xml new file mode 100644 index 0000000000..8c21a76163 --- /dev/null +++ b/test/tools/OF_Test/xmls/f19.xml @@ -0,0 +1,36 @@ + + + false + + + 0 + + + 0 + + + + + + 2 + 142 + 10 + 10 + false + 2 + + + + 2048 + + + 10.0.0.1/24 + + 12 + FlowModFlags [_cHECKOVERLAP=false, _rESETCOUNTS=false, _nOPKTCOUNTS=false, _nOBYTCOUNTS=false, _sENDFLOWREM=false] + 10 + 34 + FooXf19 + 2 + false + diff --git a/test/tools/OF_Test/xmls/f2.xml b/test/tools/OF_Test/xmls/f2.xml new file mode 100644 index 0000000000..46c1885bec --- /dev/null +++ b/test/tools/OF_Test/xmls/f2.xml @@ -0,0 +1,34 @@ + + + false + + + 0 + + + 0 + + + + + + 2 + 125 + 255 + false + + + + 2048 + + + 10.0.0.1 + + 12 + FlowModFlags [_cHECKOVERLAP=false, _rESETCOUNTS=false, _nOPKTCOUNTS=false, _nOBYTCOUNTS=false, _sENDFLOWREM=false] + 2 + 34 + FooXf2 + 2 + false + diff --git a/test/tools/OF_Test/xmls/f20.xml b/test/tools/OF_Test/xmls/f20.xml new file mode 100644 index 0000000000..b26b4085f2 --- /dev/null +++ b/test/tools/OF_Test/xmls/f20.xml @@ -0,0 +1,36 @@ + + + false + + + 0 + + + 0 + + + + + + 2 + 143 + 10 + 10 + false + 2 + + + + 2048 + + + 10.0.0.1/24 + + 12 + FlowModFlags [_cHECKOVERLAP=false, _rESETCOUNTS=false, _nOPKTCOUNTS=false, _nOBYTCOUNTS=false, _sENDFLOWREM=false] + 10 + 34 + FooXf20 + 2 + false + diff --git a/test/tools/OF_Test/xmls/f21.xml b/test/tools/OF_Test/xmls/f21.xml new file mode 100644 index 0000000000..cc5aca0722 --- /dev/null +++ b/test/tools/OF_Test/xmls/f21.xml @@ -0,0 +1,36 @@ + + + false + + + 0 + + + 0 + + + + + + 2 + 144 + 10 + 10 + false + 2 + + + + 2048 + + + 10.0.0.1/24 + + 12 + FlowModFlags [_cHECKOVERLAP=false, _rESETCOUNTS=false, _nOPKTCOUNTS=false, _nOBYTCOUNTS=false, _sENDFLOWREM=false] + 10 + 34 + FooXf21 + 2 + false + diff --git a/test/tools/OF_Test/xmls/f22.xml b/test/tools/OF_Test/xmls/f22.xml new file mode 100644 index 0000000000..9175388409 --- /dev/null +++ b/test/tools/OF_Test/xmls/f22.xml @@ -0,0 +1,36 @@ + + + false + + + 0 + + + 0 + + + + + + 2 + 145 + 10 + 10 + false + 2 + + + + 2048 + + + 10.0.0.1/24 + + 12 + FlowModFlags [_cHECKOVERLAP=false, _rESETCOUNTS=false, _nOPKTCOUNTS=false, _nOBYTCOUNTS=false, _sENDFLOWREM=false] + 10 + 34 + FooXf22 + 2 + false + diff --git a/test/tools/OF_Test/xmls/f23.xml b/test/tools/OF_Test/xmls/f23.xml new file mode 100644 index 0000000000..8d1dbcc16f --- /dev/null +++ b/test/tools/OF_Test/xmls/f23.xml @@ -0,0 +1,39 @@ + + + false + + + 0 + + + 0 + + 0 + 1 + + + + + + 2 + 146 + 10 + 10 + false + 2 + + + + 2048 + + + 10.0.0.1/24 + + 12 + FlowModFlags [_cHECKOVERLAP=false, _rESETCOUNTS=false, _nOPKTCOUNTS=false, _nOBYTCOUNTS=false, _sENDFLOWREM=false] + 10 + 34 + FooXf23 + 2 + false + diff --git a/test/tools/OF_Test/xmls/f24.xml b/test/tools/OF_Test/xmls/f24.xml new file mode 100644 index 0000000000..f80ccaa7be --- /dev/null +++ b/test/tools/OF_Test/xmls/f24.xml @@ -0,0 +1,36 @@ + + + false + + + 0 + + + 0 + + + + + + 2 + 147 + 10 + 10 + false + 2 + + + + 2048 + + + 10.0.0.1/24 + + 12 + FlowModFlags [_cHECKOVERLAP=false, _rESETCOUNTS=false, _nOPKTCOUNTS=false, _nOBYTCOUNTS=false, _sENDFLOWREM=false] + 10 + 34 + FooXf24 + 2 + false + diff --git a/test/tools/OF_Test/xmls/f25.xml b/test/tools/OF_Test/xmls/f25.xml new file mode 100644 index 0000000000..3a30568302 --- /dev/null +++ b/test/tools/OF_Test/xmls/f25.xml @@ -0,0 +1,36 @@ + + + false + + + 0 + + + 0 + + + + + + 2 + 148 + 10 + 10 + false + 2 + + + + 2048 + + + 10.0.0.1/24 + + 12 + FlowModFlags [_cHECKOVERLAP=false, _rESETCOUNTS=false, _nOPKTCOUNTS=false, _nOBYTCOUNTS=false, _sENDFLOWREM=false] + 10 + 34 + FooXf25 + 2 + false + diff --git a/test/tools/OF_Test/xmls/f26.xml b/test/tools/OF_Test/xmls/f26.xml new file mode 100644 index 0000000000..b2786c3eed --- /dev/null +++ b/test/tools/OF_Test/xmls/f26.xml @@ -0,0 +1,38 @@ + + + false + + + 0 + + + 0 + + 11 + + + + + + 2 + 149 + 10 + 10 + false + 2 + + + + 2048 + + + 10.0.0.1/24 + + 12 + FlowModFlags [_cHECKOVERLAP=false, _rESETCOUNTS=false, _nOPKTCOUNTS=false, _nOBYTCOUNTS=false, _sENDFLOWREM=false] + 10 + 34 + FooXf26 + 2 + false + diff --git a/test/tools/OF_Test/xmls/f27.xml b/test/tools/OF_Test/xmls/f27.xml new file mode 100644 index 0000000000..069278261f --- /dev/null +++ b/test/tools/OF_Test/xmls/f27.xml @@ -0,0 +1,34 @@ + + + false + + + 0 + + 12 + 10 + + + + 2 + 150 + 10 + 10 + false + 2 + + + + 2048 + + + 10.0.0.1/24 + + 12 + FlowModFlags [_cHECKOVERLAP=false, _rESETCOUNTS=false, _nOPKTCOUNTS=false, _nOBYTCOUNTS=false, _sENDFLOWREM=false] + 10 + 34 + FooXf27 + 2 + false + diff --git a/test/tools/OF_Test/xmls/f28.xml b/test/tools/OF_Test/xmls/f28.xml new file mode 100644 index 0000000000..08e61e9e13 --- /dev/null +++ b/test/tools/OF_Test/xmls/f28.xml @@ -0,0 +1,36 @@ + + + false + + + 0 + + + 0 + + + + + + 2 + 151 + 10 + 10 + false + 2 + + + + 2048 + + + 10.0.0.1/24 + + 12 + FlowModFlags [_cHECKOVERLAP=false, _rESETCOUNTS=false, _nOPKTCOUNTS=false, _nOBYTCOUNTS=false, _sENDFLOWREM=false] + 10 + 34 + FooXf28 + 2 + false + diff --git a/test/tools/OF_Test/xmls/f29.xml b/test/tools/OF_Test/xmls/f29.xml new file mode 100644 index 0000000000..bbdba6d50d --- /dev/null +++ b/test/tools/OF_Test/xmls/f29.xml @@ -0,0 +1,36 @@ + + + false + + + 0 + + + 0 + + + + + + 2 + 152 + 10 + 10 + false + 2 + + + + 2048 + + + 10.0.0.1/24 + + 12 + FlowModFlags [_cHECKOVERLAP=false, _rESETCOUNTS=false, _nOPKTCOUNTS=false, _nOBYTCOUNTS=false, _sENDFLOWREM=false] + 10 + 34 + FooXf29 + 2 + false + diff --git a/test/tools/OF_Test/xmls/f3.xml b/test/tools/OF_Test/xmls/f3.xml new file mode 100644 index 0000000000..07e4ebe591 --- /dev/null +++ b/test/tools/OF_Test/xmls/f3.xml @@ -0,0 +1,33 @@ + + + false + + + 0 + + + 0 + + + + + + 2 + 126 + 255 + false + + + +
00:00:00:00:00:01
+
+
+
+ 12 + FlowModFlags [_cHECKOVERLAP=false, _rESETCOUNTS=false, _nOPKTCOUNTS=false, _nOBYTCOUNTS=false, _sENDFLOWREM=false] + 3 + 34 + FooXf3 + 2 + false +
diff --git a/test/tools/OF_Test/xmls/f30.xml b/test/tools/OF_Test/xmls/f30.xml new file mode 100644 index 0000000000..96125c9b84 --- /dev/null +++ b/test/tools/OF_Test/xmls/f30.xml @@ -0,0 +1,36 @@ + + + false + + + 0 + + + 0 + + 8 + + + + + + 2 + 153 + 255 + false + + + + 2048 + + + 10.0.0.1/24 + + 12 + FlowModFlags [_cHECKOVERLAP=false, _rESETCOUNTS=false, _nOPKTCOUNTS=false, _nOBYTCOUNTS=false, _sENDFLOWREM=false] + 30 + 34 + FooXf30 + 2 + false + diff --git a/test/tools/OF_Test/xmls/f31.xml b/test/tools/OF_Test/xmls/f31.xml new file mode 100644 index 0000000000..81cb38c087 --- /dev/null +++ b/test/tools/OF_Test/xmls/f31.xml @@ -0,0 +1,33 @@ + + + false + + + 0 + + + + + + 2 + 154 + 10 + 10 + false + 2 + + + + 2048 + + + 10.0.0.1/24 + + 12 + FlowModFlags [_cHECKOVERLAP=false, _rESETCOUNTS=false, _nOPKTCOUNTS=false, _nOBYTCOUNTS=false, _sENDFLOWREM=false] + 10 + 34 + FooXf31 + 2 + false + diff --git a/test/tools/OF_Test/xmls/f32.xml b/test/tools/OF_Test/xmls/f32.xml new file mode 100644 index 0000000000..3c837225db --- /dev/null +++ b/test/tools/OF_Test/xmls/f32.xml @@ -0,0 +1,38 @@ + + + false + + + 0 + + + 0 + + 1 + + + + + + 2 + 155 + 10 + 10 + false + 2 + + + + 2048 + + + 10.0.0.1/24 + + 12 + FlowModFlags [_cHECKOVERLAP=false, _rESETCOUNTS=false, _nOPKTCOUNTS=false, _nOBYTCOUNTS=false, _sENDFLOWREM=false] + 10 + 34 + FooXf32 + 2 + false + diff --git a/test/tools/OF_Test/xmls/f33.xml b/test/tools/OF_Test/xmls/f33.xml new file mode 100644 index 0000000000..0294b10209 --- /dev/null +++ b/test/tools/OF_Test/xmls/f33.xml @@ -0,0 +1,38 @@ + + + false + + + 0 + + + 0 + + 10.0.0.1/24 + + + + + + 2 + 156 + 10 + 10 + false + 2 + + + + 2048 + + + 10.0.0.1/24 + + 12 + FlowModFlags [_cHECKOVERLAP=false, _rESETCOUNTS=false, _nOPKTCOUNTS=false, _nOBYTCOUNTS=false, _sENDFLOWREM=false] + 10 + 34 + FooXf33 + 2 + false + diff --git a/test/tools/OF_Test/xmls/f34.xml b/test/tools/OF_Test/xmls/f34.xml new file mode 100644 index 0000000000..27a0e7dffc --- /dev/null +++ b/test/tools/OF_Test/xmls/f34.xml @@ -0,0 +1,38 @@ + + + false + + + 0 + + + 0 + + 10.0.0.21/24 + + + + + + 2 + 157 + 10 + 10 + false + 2 + + + + 2048 + + + 10.0.0.1/24 + + 12 + FlowModFlags [_cHECKOVERLAP=false, _rESETCOUNTS=false, _nOPKTCOUNTS=false, _nOBYTCOUNTS=false, _sENDFLOWREM=false] + 10 + 34 + FooXf34 + 2 + false + diff --git a/test/tools/OF_Test/xmls/f35.xml b/test/tools/OF_Test/xmls/f35.xml new file mode 100644 index 0000000000..60d3eaa413 --- /dev/null +++ b/test/tools/OF_Test/xmls/f35.xml @@ -0,0 +1,38 @@ + + + false + + + 0 + + + 0 + + 10.0.23.21/24 + + + + + + 2 + 158 + 10 + 10 + false + 2 + + + + 2048 + + + 10.0.0.1/24 + + 12 + FlowModFlags [_cHECKOVERLAP=false, _rESETCOUNTS=false, _nOPKTCOUNTS=false, _nOBYTCOUNTS=false, _sENDFLOWREM=false] + 10 + 34 + FooXf35 + 2 + false + diff --git a/test/tools/OF_Test/xmls/f36.xml b/test/tools/OF_Test/xmls/f36.xml new file mode 100644 index 0000000000..8942668bfa --- /dev/null +++ b/test/tools/OF_Test/xmls/f36.xml @@ -0,0 +1,36 @@ + + + false + + + 0 + + + 0 + + 1 + + + + + + 2 + 159 + 255 + false + + + + 2048 + + + 10.0.0.1/24 + + 12 + FlowModFlags [_cHECKOVERLAP=false, _rESETCOUNTS=false, _nOPKTCOUNTS=false, _nOBYTCOUNTS=false, _sENDFLOWREM=false] + 36 + 34 + FooXf36 + 2 + false + diff --git a/test/tools/OF_Test/xmls/f37.xml b/test/tools/OF_Test/xmls/f37.xml new file mode 100644 index 0000000000..6b82df960a --- /dev/null +++ b/test/tools/OF_Test/xmls/f37.xml @@ -0,0 +1,38 @@ + + + false + + + 0 + + + 0 + + 1 + + + + + + 2 + 160 + 10 + 10 + false + 2 + + + + 2048 + + + 10.0.0.1/24 + + 12 + FlowModFlags [_cHECKOVERLAP=false, _rESETCOUNTS=false, _nOPKTCOUNTS=false, _nOBYTCOUNTS=false, _sENDFLOWREM=false] + 10 + 34 + FooXf37 + 2 + false + diff --git a/test/tools/OF_Test/xmls/f38.xml b/test/tools/OF_Test/xmls/f38.xml new file mode 100644 index 0000000000..faa2fe8e4a --- /dev/null +++ b/test/tools/OF_Test/xmls/f38.xml @@ -0,0 +1,38 @@ + + + false + + + 0 + + + 0 + + 1 + + + + + + 2 + 161 + 10 + 10 + false + 2 + + + + 2048 + + + 10.0.0.1/24 + + 12 + FlowModFlags [_cHECKOVERLAP=false, _rESETCOUNTS=false, _nOPKTCOUNTS=false, _nOBYTCOUNTS=false, _sENDFLOWREM=false] + 10 + 34 + FooXf38 + 2 + false + diff --git a/test/tools/OF_Test/xmls/f39.xml b/test/tools/OF_Test/xmls/f39.xml new file mode 100644 index 0000000000..5f2130ec67 --- /dev/null +++ b/test/tools/OF_Test/xmls/f39.xml @@ -0,0 +1,38 @@ + + + false + + + 0 + + + 0 + + 109 + + + + + + 2 + 162 + 10 + 10 + false + 2 + + + + 2048 + + + 10.0.0.1/24 + + 12 + FlowModFlags [_cHECKOVERLAP=false, _rESETCOUNTS=false, _nOPKTCOUNTS=false, _nOBYTCOUNTS=false, _sENDFLOWREM=false] + 10 + 34 + FooXf39 + 2 + false + diff --git a/test/tools/OF_Test/xmls/f4.xml b/test/tools/OF_Test/xmls/f4.xml new file mode 100644 index 0000000000..0f08362ee3 --- /dev/null +++ b/test/tools/OF_Test/xmls/f4.xml @@ -0,0 +1,39 @@ + + + false + + + 0 + + + 0 + + + + + + 2 + 127 + 255 + false + + + + 45 + + +
ff:ff:ff:ff:ff:ff
+
+ +
00:00:00:00:23:ae
+
+
+
+ 12 + FlowModFlags [_cHECKOVERLAP=false, _rESETCOUNTS=false, _nOPKTCOUNTS=false, _nOBYTCOUNTS=false, _sENDFLOWREM=false] + 4 + 34 + FooXf4 + 2 + false +
diff --git a/test/tools/OF_Test/xmls/f40.xml b/test/tools/OF_Test/xmls/f40.xml new file mode 100644 index 0000000000..3eacd6ee1d --- /dev/null +++ b/test/tools/OF_Test/xmls/f40.xml @@ -0,0 +1,38 @@ + + + false + + + 0 + + + 0 + + 109 + + + + + + 2 + 163 + 10 + 10 + false + 2 + + + + 2048 + + + 10.0.0.1/24 + + 12 + FlowModFlags [_cHECKOVERLAP=false, _rESETCOUNTS=false, _nOPKTCOUNTS=false, _nOBYTCOUNTS=false, _sENDFLOWREM=false] + 10 + 34 + FooXf40 + 2 + false + diff --git a/test/tools/OF_Test/xmls/f41.xml b/test/tools/OF_Test/xmls/f41.xml new file mode 100644 index 0000000000..a1c4539202 --- /dev/null +++ b/test/tools/OF_Test/xmls/f41.xml @@ -0,0 +1,38 @@ + + + false + + + 0 + + + 0 + + 2 + + + + + + 2 + 164 + 10 + 10 + false + 2 + + + + 2048 + + + 10.0.0.1/24 + + 12 + FlowModFlags [_cHECKOVERLAP=false, _rESETCOUNTS=false, _nOPKTCOUNTS=false, _nOBYTCOUNTS=false, _sENDFLOWREM=false] + 10 + 34 + FooXf41 + 2 + false + diff --git a/test/tools/OF_Test/xmls/f42.xml b/test/tools/OF_Test/xmls/f42.xml new file mode 100644 index 0000000000..538ff0012f --- /dev/null +++ b/test/tools/OF_Test/xmls/f42.xml @@ -0,0 +1,36 @@ + + + false + + + 0 + + + 0 + + + + + + 2 + 165 + 10 + 10 + false + 2 + + + + 2048 + + + 10.0.0.1/24 + + 12 + FlowModFlags [_cHECKOVERLAP=false, _rESETCOUNTS=false, _nOPKTCOUNTS=false, _nOBYTCOUNTS=false, _sENDFLOWREM=false] + 10 + 34 + FooXf42 + 2 + false + diff --git a/test/tools/OF_Test/xmls/f43.xml b/test/tools/OF_Test/xmls/f43.xml new file mode 100644 index 0000000000..b720bdcc79 --- /dev/null +++ b/test/tools/OF_Test/xmls/f43.xml @@ -0,0 +1,42 @@ + + + false + + + 0 + + + 0 + + + + + + 2 + 166 + 10 + 10 + false + 2 + + + + 34525 + + + + 135 + 1 + + + 58 + + + 12 + FlowModFlags [_cHECKOVERLAP=false, _rESETCOUNTS=false, _nOPKTCOUNTS=false, _nOBYTCOUNTS=false, _sENDFLOWREM=false] + 10 + 34 + FooXf43 + 2 + false + diff --git a/test/tools/OF_Test/xmls/f44.xml b/test/tools/OF_Test/xmls/f44.xml new file mode 100644 index 0000000000..ed37acc8b5 --- /dev/null +++ b/test/tools/OF_Test/xmls/f44.xml @@ -0,0 +1,32 @@ + + + false + + + 0 + + + 0 + + + + + + 2 + 167 + 10 + 10 + false + 2 + + 202 + 10122 + + 12 + FlowModFlags [_cHECKOVERLAP=false, _rESETCOUNTS=false, _nOPKTCOUNTS=false, _nOBYTCOUNTS=false, _sENDFLOWREM=false] + 10 + 34 + FooXf44 + 2 + false + diff --git a/test/tools/OF_Test/xmls/f45.xml b/test/tools/OF_Test/xmls/f45.xml new file mode 100644 index 0000000000..00d934e756 --- /dev/null +++ b/test/tools/OF_Test/xmls/f45.xml @@ -0,0 +1,34 @@ + + + false + + + 0 + + + 0 + + + + + + 2 + 168 + 10 + 10 + false + 2 + + + [B@46645a66 + 500 + + + 12 + FlowModFlags [_cHECKOVERLAP=false, _rESETCOUNTS=false, _nOPKTCOUNTS=false, _nOBYTCOUNTS=false, _sENDFLOWREM=false] + 10 + 34 + FooXf45 + 2 + false + diff --git a/test/tools/OF_Test/xmls/f46.xml b/test/tools/OF_Test/xmls/f46.xml new file mode 100644 index 0000000000..59d482c0f1 --- /dev/null +++ b/test/tools/OF_Test/xmls/f46.xml @@ -0,0 +1,44 @@ + + + false + + + 0 + + + 0 + + + + + + 2 + 169 + 10 + 10 + false + 2 + + + + 34525 + + + + 10028 + + 00:0c:29:0e:4c:67 + c2:00:54:f5:00:00 + + 135 + 0 + + + 12 + FlowModFlags [_cHECKOVERLAP=false, _rESETCOUNTS=false, _nOPKTCOUNTS=false, _nOBYTCOUNTS=false, _sENDFLOWREM=false] + 10 + 34 + FooXf46 + 2 + false + diff --git a/test/tools/OF_Test/xmls/f47.xml b/test/tools/OF_Test/xmls/f47.xml new file mode 100644 index 0000000000..ba6fa1384c --- /dev/null +++ b/test/tools/OF_Test/xmls/f47.xml @@ -0,0 +1,42 @@ + + + false + + + 0 + + + 0 + + 5 + + + + + + 2 + 170 + 10 + 10 + false + 2 + + + + 2048 + + + 22 + 1435 + + 132 + + + 12 + FlowModFlags [_cHECKOVERLAP=false, _rESETCOUNTS=false, _nOPKTCOUNTS=false, _nOBYTCOUNTS=false, _sENDFLOWREM=false] + 10 + 34 + FooXf47 + 2 + false + diff --git a/test/tools/OF_Test/xmls/f48.xml b/test/tools/OF_Test/xmls/f48.xml new file mode 100644 index 0000000000..f20d5d791d --- /dev/null +++ b/test/tools/OF_Test/xmls/f48.xml @@ -0,0 +1,31 @@ + + + false + + + 0 + + 2 + + + + 2 + 171 + 10 + 10 + false + 2 + + + [B@f7d120c + 10668 + + + 12 + FlowModFlags [_cHECKOVERLAP=false, _rESETCOUNTS=false, _nOPKTCOUNTS=false, _nOBYTCOUNTS=false, _sENDFLOWREM=false] + 10 + 34 + FooXf48 + 2 + false + diff --git a/test/tools/OF_Test/xmls/f49.xml b/test/tools/OF_Test/xmls/f49.xml new file mode 100644 index 0000000000..1f8c5d7c80 --- /dev/null +++ b/test/tools/OF_Test/xmls/f49.xml @@ -0,0 +1,34 @@ + + + false + + + + 1 + + + + 2 + 172 + 10 + 10 + false + 2 + + + + 10 + true + + 3 + + + 0 + FlowModFlags [_cHECKOVERLAP=false, _rESETCOUNTS=false, _nOPKTCOUNTS=false, _nOBYTCOUNTS=false, _sENDFLOWREM=false] + 10 + 0 + FooXf49 + 2 + false + diff --git a/test/tools/OF_Test/xmls/f5.xml b/test/tools/OF_Test/xmls/f5.xml new file mode 100644 index 0000000000..9b1a870379 --- /dev/null +++ b/test/tools/OF_Test/xmls/f5.xml @@ -0,0 +1,41 @@ + + + false + + + 0 + + + 0 + + + + + + 2 + 128 + 255 + + + + 2048 + + +
ff:ff:ff:ff:ff:ff
+
+ +
00:00:00:00:23:ae
+
+
+ 10.1.2.3/24 + 20.4.5.6/16 + 0 +
+ 12 + FlowModFlags [_cHECKOVERLAP=false, _rESETCOUNTS=false, _nOPKTCOUNTS=false, _nOBYTCOUNTS=false, _sENDFLOWREM=false] + 5 + 34 + FooXf5 + 2 + false +
diff --git a/test/tools/OF_Test/xmls/f6.xml b/test/tools/OF_Test/xmls/f6.xml new file mode 100644 index 0000000000..a220752942 --- /dev/null +++ b/test/tools/OF_Test/xmls/f6.xml @@ -0,0 +1,44 @@ + + + false + + + 0 + + + 0 + + + + 1 + + + + + + 2 + 129 + 255 + + + + 2048 + + +
ff:ff:ff:ff:ff:ff
+
+ +
00:00:00:01:23:ae
+
+
+ 10.1.2.3/24 + 40.4.5.6/16 +
+ 12 + FlowModFlags [_cHECKOVERLAP=false, _rESETCOUNTS=false, _nOPKTCOUNTS=false, _nOBYTCOUNTS=false, _sENDFLOWREM=false] + 5 + 34 + FooXf5 + 2 + false +
diff --git a/test/tools/OF_Test/xmls/f7.xml b/test/tools/OF_Test/xmls/f7.xml new file mode 100644 index 0000000000..64047dd9ca --- /dev/null +++ b/test/tools/OF_Test/xmls/f7.xml @@ -0,0 +1,46 @@ + + + false + + + 0 + + + 0 + + + + + + 2 + 130 + 255 + + + + 2048 + + +
ff:ff:ff:ff:ff:aa
+
+ +
00:00:00:11:23:ae
+
+
+ 10.1.2.3/24 + 20.4.5.6/16 + + 56 + 15 + 1 + + 0 +
+ 12000 + FlowModFlags [_cHECKOVERLAP=false, _rESETCOUNTS=false, _nOPKTCOUNTS=false, _nOBYTCOUNTS=false, _sENDFLOWREM=false] + 7 + 12000 + FooXf7 + 2 + false +
diff --git a/test/tools/OF_Test/xmls/f8.xml b/test/tools/OF_Test/xmls/f8.xml new file mode 100644 index 0000000000..8c19936b5c --- /dev/null +++ b/test/tools/OF_Test/xmls/f8.xml @@ -0,0 +1,50 @@ + + + false + + + 0 + + + 0 + + + + + + 2 + 131 + 255 + + + + 2048 + + +
ff:ff:29:01:19:61
+
+ +
00:00:00:11:23:ae
+
+
+ 17.1.2.3/8 + 172.168.5.6/16 + + 6 + 2 + 2 + + 25364 + 8080 + 0 +
+ 1200 + FlowModFlags [_cHECKOVERLAP=false, _rESETCOUNTS=false, _nOPKTCOUNTS=false, _nOBYTCOUNTS=false, _sENDFLOWREM=false] + 8 + 3400 + FooXf8 + 2 + false +
+ + diff --git a/test/tools/OF_Test/xmls/f9.xml b/test/tools/OF_Test/xmls/f9.xml new file mode 100644 index 0000000000..b32c398302 --- /dev/null +++ b/test/tools/OF_Test/xmls/f9.xml @@ -0,0 +1,49 @@ + + + false + + + 0 + + + 0 + + + + + + 2 + 132 + 255 + + + + 2048 + + +
20:14:29:01:19:61
+
+ +
00:00:00:11:23:ae
+
+
+ 19.1.2.3/10 + 172.168.5.6/18 + + 17 + 8 + 3 + + 25364 + 8080 + 0 +
+ 1200 + FlowModFlags [_cHECKOVERLAP=false, _rESETCOUNTS=false, _nOPKTCOUNTS=false, _nOBYTCOUNTS=false, _sENDFLOWREM=false] + 9 + 3400 + FooXf9 + 2 + false +
+ -- 2.36.6