tests: Test ofproto-dpif set_tunnel translation.
authorEthan Jackson <ethan@nicira.com>
Tue, 13 Sep 2011 00:19:13 +0000 (17:19 -0700)
committerEthan Jackson <ethan@nicira.com>
Tue, 13 Sep 2011 03:28:40 +0000 (20:28 -0700)
This patch adds a unit test which would have caught the issue fixed
in Commit 2446268e "ofproto-dpif: set_tunnel when required to."

tests/ofproto-dpif.at

index c504dfe6527dd77753fe7b9279261beae4887428..a4fb737bafe69b3680213533ce5a25730c343b38 100644 (file)
@@ -61,3 +61,21 @@ AT_CHECK([tail -1 stdout], [0],
 ])
 OFPROTO_STOP
 AT_CLEANUP
+
+AT_SETUP([ofproto-dpif - set_tunnel])
+OFPROTO_START
+AT_DATA([flows.txt], [dnl
+in_port=90 actions=resubmit:1,resubmit:2,resubmit:3,resubmit:4,resubmit:5
+in_port=1 actions=set_tunnel:1,output:1
+in_port=2 actions=set_tunnel:1,output:2
+in_port=3 actions=set_tunnel:2,set_tunnel:3,output:3
+in_port=4 actions=set_tunnel:4,set_tunnel:3,output:4
+in_port=5 actions=set_tunnel:5
+])
+AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
+AT_CHECK([ovs-appctl -t test-openflowd ofproto/trace br0 'tun_id(0x1),in_port(90),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0),icmp(type=8,code=0)'], [0], [stdout])
+AT_CHECK([tail -1 stdout], [0],
+  [Datapath actions: set_tunnel(0x1),1,2,set_tunnel(0x3),3,4
+])
+OFPROTO_STOP
+AT_CLEANUP