From f0992bedf1f0d01667067cab4c25cefbdb6ad9d6 Mon Sep 17 00:00:00 2001 From: Simon Horman Date: Fri, 30 Nov 2012 10:04:07 +0900 Subject: [PATCH] Add OpenFlow 1.2 parse-flows test This is based on an existing OpenFlow 1.0 variant of this test. Signed-off-by: Simon Horman Signed-off-by: Ben Pfaff --- tests/ovs-ofctl.at | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/tests/ovs-ofctl.at b/tests/ovs-ofctl.at index 2ad165c78..4fa3529ec 100644 --- a/tests/ovs-ofctl.at +++ b/tests/ovs-ofctl.at @@ -31,6 +31,37 @@ OFPT_FLOW_MOD: ADD in_port=0 actions=resubmit:0 ]]) AT_CLEANUP +AT_SETUP([ovs-ofctl parse-flows (OpenFlow 1.2)]) +AT_DATA([flows.txt], [[ +# comment +tcp,tp_src=123,actions=flood +in_port=LOCAL dl_vlan=9 dl_src=00:0A:E4:25:6B:B0 actions=drop +udp dl_vlan_pcp=7 idle_timeout=5 actions=strip_vlan output:0 +tcp,nw_src=192.168.0.3,tp_dst=80 actions=set_queue:37,output:1 +udp,nw_src=192.168.0.3,tp_dst=53 actions=pop_queue,output:1 +cookie=0x123456789abcdef hard_timeout=10 priority=60000 actions=controller +actions=note:41.42.43,note:00.01.02.03.04.05.06.07,note +actions=set_field:fe80:0123:4567:890a:a6ba:dbff:fefe:59fa->ipv6_src +in_port=0 actions=resubmit:0 +]]) + +AT_CHECK([ovs-ofctl --protocols OpenFlow12 parse-flows flows.txt +], [0], [stdout]) +AT_CHECK([[sed 's/ (xid=0x[0-9a-fA-F]*)//' stdout]], [0], +[[usable protocols: any +chosen protocol: OXM-OpenFlow12 +OFPT_FLOW_MOD (OF1.2): ADD table:255 tcp,tp_src=123 actions=FLOOD +OFPT_FLOW_MOD (OF1.2): ADD table:255 in_port=65534,dl_vlan=9,dl_src=00:0a:e4:25:6b:b0 actions=drop +OFPT_FLOW_MOD (OF1.2): ADD table:255 udp,dl_vlan_pcp=7 idle:5 actions=strip_vlan,output:0 +OFPT_FLOW_MOD (OF1.2): ADD table:255 tcp,nw_src=192.168.0.3,tp_dst=80 actions=set_queue:37,output:1 +OFPT_FLOW_MOD (OF1.2): ADD table:255 udp,nw_src=192.168.0.3,tp_dst=53 actions=pop_queue,output:1 +OFPT_FLOW_MOD (OF1.2): ADD table:255 priority=60000 cookie:0x123456789abcdef hard:10 actions=CONTROLLER:65535 +OFPT_FLOW_MOD (OF1.2): ADD table:255 actions=note:41.42.43.00.00.00,note:00.01.02.03.04.05.06.07.00.00.00.00.00.00,note:00.00.00.00.00.00 +OFPT_FLOW_MOD (OF1.2): ADD table:255 actions=set_field:fe80:123:4567:890a:a6ba:dbff:fefe:59fa->ipv6_src +OFPT_FLOW_MOD (OF1.2): ADD table:255 in_port=0 actions=resubmit:0 +]]) +AT_CLEANUP + AT_SETUP([ovs-ofctl parse-flows (With Tunnel-Parameters)]) AT_DATA([flows.txt], [[ tun_id=0x1234000056780000/0xffff0000ffff0000,tun_src=1.1.1.1,tun_dst=2.2.2.2,tun_tos=0x3,tun_ttl=20,tun_flags=key|csum actions=drop -- 2.20.1