]>
Commit | Line | Data |
---|---|---|
0e399d88 JP |
1 | AT_BANNER([datapath parsing and formatting]) |
2 | ||
eb1b39b3 BP |
3 | AT_SETUP([OVS datapath key parsing and formatting - valid forms]) |
4 | dnl We could add a test for invalid forms, but that's less important. | |
3bffc610 BP |
5 | AT_DATA([odp-base.txt], [dnl |
6 | in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15) | |
7 | in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x1234) | |
a61680c6 JP |
8 | in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x0800),ipv4(src=35.8.2.41,dst=172.16.0.20,proto=5,tos=0x80,ttl=128,frag=no) |
9 | in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x0800),ipv4(src=35.8.2.41,dst=172.16.0.20,proto=5,tos=0x81,ttl=128,frag=no) | |
10 | in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x0800),ipv4(src=35.8.2.41,dst=172.16.0.20,proto=5,tos=0x80,ttl=128,frag=first) | |
11 | in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x0800),ipv4(src=35.8.2.41,dst=172.16.0.20,proto=5,tos=0x80,ttl=128,frag=later) | |
12 | in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x0800),ipv4(src=35.8.2.41,dst=172.16.0.20,proto=6,tos=0,ttl=128,frag=no),tcp(src=80,dst=8080) | |
13 | in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x0800),ipv4(src=35.8.2.41,dst=172.16.0.20,proto=17,tos=0,ttl=128,frag=no),udp(src=81,dst=6632) | |
14 | in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x0800),ipv4(src=35.8.2.41,dst=172.16.0.20,proto=1,tos=0,ttl=128,frag=no),icmp(type=1,code=2) | |
60258dcb JP |
15 | in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x86dd),ipv6(src=::1,dst=::2,label=0,proto=10,tclass=0x70,hlimit=128,frag=no) |
16 | in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x86dd),ipv6(src=::1,dst=::2,label=0,proto=10,tclass=0x71,hlimit=128,frag=no) | |
17 | in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x86dd),ipv6(src=::1,dst=::2,label=0,proto=10,tclass=0x70,hlimit=128,frag=first) | |
18 | in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x86dd),ipv6(src=::1,dst=::2,label=0,proto=10,tclass=0x70,hlimit=128,frag=later) | |
19 | in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x86dd),ipv6(src=::1,dst=::2,label=0,proto=6,tclass=0,hlimit=128,frag=no),tcp(src=80,dst=8080) | |
20 | in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x86dd),ipv6(src=::1,dst=::2,label=0,proto=17,tclass=0,hlimit=128,frag=no),udp(src=6630,dst=22) | |
21 | in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x86dd),ipv6(src=::1,dst=::2,label=0,proto=58,tclass=0,hlimit=128,frag=no),icmpv6(type=1,code=2) | |
60258dcb | 22 | in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x86dd),ipv6(src=::1,dst=::2,label=0,proto=58,tclass=0,hlimit=128,frag=no),icmpv6(type=136,code=0),nd(target=::3,sll=00:05:06:07:08:09,tll=00:0a:0b:0c:0d:0e) |
3bffc610 | 23 | in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x0806),arp(sip=1.2.3.4,tip=5.6.7.8,op=1,sha=00:0f:10:11:12:13,tha=00:14:15:16:17:18) |
54bb0348 | 24 | in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x86dd),ipv6(src=::1,dst=::2,label=0,proto=58,tclass=0,hlimit=128,frag=no),icmpv6(type=136,code=0),nd(target=::3,sll=00:05:06:07:08:09,tll=00:0a:0b:0c:0d:0e) |
9b2b8497 | 25 | in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x86dd),ipv6(src=::1,dst=::2,label=0,proto=58,tclass=0,hlimit=128,frag=no),icmpv6(type=136,code=0),nd(target=::3,sll=00:05:06:07:08:09,tll=00:0a:0b:0c:0d:0e),nd_ext(nd_reserved=0x0,nd_options_type=2) |
b02475c5 SH |
26 | in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x8847),mpls(label=100,tc=3,ttl=64,bos=1) |
27 | in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x8847),mpls(label=100,tc=7,ttl=100,bos=1) | |
28 | in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x8847),mpls(label=100,tc=7,ttl=100,bos=0) | |
29 | in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x8848),mpls(label=1000,tc=4,ttl=200,bos=1) | |
30 | in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x8848),mpls(label=1000,tc=4,ttl=200,bos=0) | |
3bffc610 BP |
31 | ]) |
32 | ||
33 | (echo '# Valid forms without tun_id or VLAN header.' | |
d3d32077 | 34 | sed 's/^/skb_priority(0),skb_mark(0),recirc_id(0),dp_hash(0),/' odp-base.txt |
54bb0348 | 35 | |
d3d32077 | 36 | sed ' |
7ce2769e | 37 | s/^/skb_priority(0),skb_mark(0),recirc_id(0),dp_hash(0),/ |
54bb0348 AZ |
38 | ' odp-base.txt |
39 | ||
3bffc610 BP |
40 | |
41 | echo | |
05fb0928 | 42 | echo '# Valid forms with tunnel header.' |
8e4c1621 | 43 | sed 's/^/skb_priority(0),tunnel(tun_id=0x7f10354,src=10.10.10.10,dst=20.20.20.20,ttl=64,flags(csum|key)),skb_mark(0x1234),recirc_id(0),dp_hash(0),/' odp-base.txt |
3bffc610 BP |
44 | |
45 | echo | |
46 | echo '# Valid forms with VLAN header.' | |
7ce2769e | 47 | sed 's/^/skb_priority(0),skb_mark(0),recirc_id(0),dp_hash(0),/ |
54bb0348 | 48 | s/\(eth([[^)]]*)\),*/\1,eth_type(0x8100),vlan(vid=99,pcp=7),encap(/ |
fea393b1 | 49 | s/$/)/' odp-base.txt |
3bffc610 | 50 | |
b02475c5 SH |
51 | echo |
52 | echo '# Valid forms with MPLS header.' | |
7ce2769e | 53 | sed 's/^/skb_priority(0),skb_mark(0),recirc_id(0),dp_hash(0),/ |
54bb0348 | 54 | s/\(eth([[^)]]*),?\)/\1,eth_type(0x8847),mpls(label=100,tc=7,ttl=64,bos=1)/' odp-base.txt |
b02475c5 SH |
55 | |
56 | echo | |
57 | echo '# Valid forms with MPLS multicast header.' | |
7ce2769e | 58 | sed 's/^/skb_priority(0),skb_mark(0),recirc_id(0),dp_hash(0),/ |
54bb0348 | 59 | s/\(eth([[^)]]*),?\)/\1,eth_type(0x8848),mpls(label=100,tc=7,ttl=64,bos=1)/' odp-base.txt |
abff858b | 60 | |
3bffc610 | 61 | echo |
05fb0928 | 62 | echo '# Valid forms with tunnel and VLAN headers.' |
65da723b | 63 | sed 's/^/skb_priority(0),tunnel(tun_id=0xfedcba9876543210,src=10.0.0.1,dst=10.0.0.2,tos=0x8,ttl=128,flags(key)),skb_mark(0),recirc_id(0),dp_hash(0),/ |
fea393b1 | 64 | s/\(eth([[^)]]*)\),*/\1,eth_type(0x8100),vlan(vid=99,pcp=7),encap(/ |
2508ac16 BP |
65 | s/$/)/' odp-base.txt |
66 | ||
67 | echo | |
05fb0928 | 68 | echo '# Valid forms with QOS priority, tunnel, and VLAN headers.' |
65da723b | 69 | sed 's/^/skb_priority(0x1234),tunnel(tun_id=0xfedcba9876543210,src=10.10.10.10,dst=20.20.20.20,tos=0x8,ttl=64,flags(key)),skb_mark(0),recirc_id(0),dp_hash(0),/ |
2508ac16 | 70 | s/\(eth([[^)]]*)\),*/\1,eth_type(0x8100),vlan(vid=99,pcp=7),encap(/ |
fea393b1 | 71 | s/$/)/' odp-base.txt |
7257b535 | 72 | |
8e53fe8c JS |
73 | echo |
74 | echo '# Valid forms with conntrack fields.' | |
9daf2348 | 75 | sed 's/^/skb_priority(0),skb_mark(0),ct_mark(0x12345678),ct_label(0x1234567890abcdef1234567890abcdef),recirc_id(0),dp_hash(0),/' odp-base.txt |
8e53fe8c | 76 | |
7257b535 BP |
77 | echo |
78 | echo '# Valid forms with IP first fragment.' | |
7ce2769e | 79 | sed 's/^/skb_priority(0),skb_mark(0),recirc_id(0),dp_hash(0),/' odp-base.txt | sed -n 's/,frag=no),/,frag=first),/p' |
7257b535 BP |
80 | |
81 | echo | |
82 | echo '# Valid forms with IP later fragment.' | |
7ce2769e | 83 | sed 's/^/skb_priority(0),skb_mark(0),recirc_id(0),dp_hash(0),/' odp-base.txt | sed -n 's/,frag=no),.*/,frag=later)/p' |
98514eea WT |
84 | |
85 | echo | |
86 | echo '# Valid forms with tunnel and ERSPAN v1 headers.' | |
23cfec1c | 87 | sed 's/^/skb_priority(0),tunnel(tun_id=0xfedcba9876543210,src=10.0.0.1,dst=10.0.0.2,ttl=128,erspan(ver=1,idx=0x7),flags(df|key)),skb_mark(0),recirc_id(0),dp_hash(0),/' odp-base.txt |
98514eea WT |
88 | |
89 | echo | |
90 | echo '# Valid forms with tunnel and ERSPAN v2 headers.' | |
23cfec1c | 91 | sed 's/^/skb_priority(0),tunnel(tun_id=0xfedcba9876543210,src=10.0.0.1,dst=10.0.0.2,ttl=128,erspan(ver=2,dir=1,hwid=0x7),flags(df|key)),skb_mark(0),recirc_id(0),dp_hash(0),/' odp-base.txt |
8bfd0fda BP |
92 | ) > odp-in.txt |
93 | AT_CAPTURE_FILE([odp-in.txt]) | |
94 | ||
95 | dnl If the BoS bit of the last LSE is 0 then the stack is unterminated | |
96 | dnl Internally a stack of 3 LSEs will be used with the trailing LSEs | |
97 | dnl set to zero. This is reflected when the key is formated | |
98 | sed '/bos=0/{ | |
99 | s/^/ODP_FIT_TOO_LITTLE: / | |
8bfd0fda BP |
100 | }' < odp-in.txt > odp-out.txt |
101 | ||
07659514 JS |
102 | dnl Some fields are always printed for this test, because wildcards aren't |
103 | dnl specified. We can skip these. | |
5bb6f38b IM |
104 | sed -i'back' 's/\(skb_mark(0)\),\(ct\)/\1,ct_state(0),ct_zone(0),\2/' odp-out.txt |
105 | sed -i'back' 's/\(skb_mark([[^)]]*)\),\(recirc\)/\1,ct_state(0),ct_zone(0),ct_mark(0),ct_label(0),\2/' odp-out.txt | |
106 | sed -i'back' 's/\(in_port(1)\),\(eth\)/\1,packet_type(ns=0,id=0),\2/' odp-out.txt | |
07659514 | 107 | |
eadd1644 | 108 | AT_CHECK_UNQUOTED([ovstest test-odp parse-keys < odp-in.txt], [0], [`cat odp-out.txt` |
3bffc610 BP |
109 | ]) |
110 | AT_CLEANUP | |
111 | ||
e6cc0bab AZ |
112 | AT_SETUP([OVS datapath wildcarded key parsing and formatting - valid forms]) |
113 | dnl We could add a test for invalid forms, but that's less important. | |
114 | AT_DATA([odp-base.txt], [dnl | |
115 | in_port(1/0xff),eth(src=00:01:02:03:04:05/ff:ff:ff:ff:ff:f0,dst=10:11:12:13:14:15/ff:ff:ff:ff:ff:f0) | |
116 | in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x1234/0xfff0) | |
2d18eae8 | 117 | in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x0800),ipv4(src=35.8.2.41/255.255.255.0,dst=172.16.0.20/255.255.255.0,proto=5/0xf0,tos=0x80/0xf0,ttl=128/0xf0,frag=no) |
e6cc0bab AZ |
118 | in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x0800),ipv4(src=35.8.2.41,dst=172.16.0.20,proto=6,tos=0,ttl=128,frag=no),tcp(src=80/0xff00,dst=8080/0xff) |
119 | in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x0800),ipv4(src=35.8.2.41,dst=172.16.0.20,proto=17,tos=0,ttl=128,frag=no),udp(src=81/0xff00,dst=6632/0xff) | |
041e7168 | 120 | in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x0800),ipv4(src=35.8.2.41,dst=172.16.0.20,proto=17,tos=0,ttl=128,frag=no),udp(src=81/0xff,dst=6632/0xff00) |
2d18eae8 JR |
121 | in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x0800),ipv4(src=35.8.2.41,dst=172.16.0.20,proto=1,tos=0,ttl=128,frag=no),icmp(type=1/0xf0,code=2) |
122 | in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x86dd),ipv6(src=::1/::255,dst=::2/::255,label=0/0xf0,proto=10/0xf0,tclass=0x70/0xf0,hlimit=128/0xf0,frag=no) | |
e6cc0bab AZ |
123 | in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x86dd),ipv6(src=::1,dst=::2,label=0,proto=6,tclass=0,hlimit=128,frag=no),tcp(src=80/0xff00,dst=8080/0xff) |
124 | in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x86dd),ipv6(src=::1,dst=::2,label=0,proto=17,tclass=0,hlimit=128,frag=no),udp(src=6630/0xff00,dst=22/0xff) | |
2d18eae8 | 125 | in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x86dd),ipv6(src=::1,dst=::2,label=0,proto=58,tclass=0,hlimit=128,frag=no),icmpv6(type=1/0xf0,code=2) |
e6cc0bab AZ |
126 | in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x86dd),ipv6(src=::1,dst=::2,label=0,proto=58,tclass=0,hlimit=128,frag=no),icmpv6(type=135,code=0),nd(target=::3/::250) |
127 | in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x86dd),ipv6(src=::1,dst=::2,label=0,proto=58,tclass=0,hlimit=128,frag=no),icmpv6(type=135,code=0),nd(target=::3/::250,sll=00:05:06:07:08:09/ff:ff:ff:ff:ff:00) | |
128 | in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x86dd),ipv6(src=::1,dst=::2,label=0,proto=58,tclass=0,hlimit=128,frag=no),icmpv6(type=136,code=0),nd(target=::3/::250,tll=00:0a:0b:0c:0d:0e/ff:ff:ff:ff:ff:00) | |
129 | in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x86dd),ipv6(src=::1,dst=::2,label=0,proto=58,tclass=0,hlimit=128,frag=no),icmpv6(type=136,code=0),nd(target=::3/::250,sll=00:05:06:07:08:09/ff:ff:ff:ff:ff:00,tll=00:0a:0b:0c:0d:0e/ff:ff:ff:ff:ff:00) | |
130 | in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x0806),arp(sip=1.2.3.4/255.255.255.250,tip=5.6.7.8/255.255.255.250,op=1/0xf0,sha=00:0f:10:11:12:13/ff:ff:ff:ff:ff:00,tha=00:14:15:16:17:18/ff:ff:ff:ff:ff:00) | |
131 | skb_mark(0x1234/0xfff0),in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x86dd),ipv6(src=::1,dst=::2,label=0,proto=58,tclass=0,hlimit=128,frag=no),icmpv6(type=136,code=0),nd(target=::3,sll=00:05:06:07:08:09,tll=00:0a:0b:0c:0d:0e) | |
132 | ]) | |
133 | ||
134 | (echo '# Valid forms without tun_id or VLAN header.' | |
135 | cat odp-base.txt | |
136 | ||
137 | echo | |
138 | echo '# Valid forms with tunnel header.' | |
b666962b | 139 | sed 's/^/tunnel(tun_id=0x7f10354\/0xff,src=10.10.10.10\/255.255.255.0,dst=20.20.20.20\/255.255.255.0,ttl=64,vxlan(gbp(id=10\/0xff,flags=0xb)),flags(oam|csum|key)),/' odp-base.txt |
e6cc0bab | 140 | |
125fc637 AW |
141 | echo |
142 | echo '# Valid forms with tunnel header (wildcard flag).' | |
65da723b | 143 | sed 's/^/tunnel(tun_id=0x7f10354\/0xff,src=10.10.10.10\/255.255.255.0,dst=20.20.20.20\/255.255.255.0,ttl=64,flags(-df+csum+key)),/' odp-base.txt |
125fc637 | 144 | |
622a0a8e JG |
145 | echo |
146 | echo '# Valid forms with Geneve header.' | |
8e4c1621 | 147 | sed 's/^/tunnel(tun_id=0x7f10354\/0xff,src=10.10.10.10\/255.255.255.0,dst=20.20.20.20\/255.255.255.0,ttl=64,geneve({class=0,type=0,len=4,0xa\/0xff}{class=0xffff,type=0x1,len=4,0xffffffff}),flags(csum|key)),/' odp-base.txt |
622a0a8e | 148 | |
e6cc0bab AZ |
149 | echo |
150 | echo '# Valid forms with VLAN header.' | |
151 | sed 's/\(eth([[^)]]*)\),*/\1,eth_type(0x8100),vlan(vid=99,pcp=7),encap(/ | |
152 | s/$/)/' odp-base.txt | |
153 | ||
154 | echo | |
155 | echo '# Valid forms with MPLS header.' | |
156 | sed 's/\(eth([[^)]]*),?\)/\1,eth_type(0x8847),mpls(label=100\/0xff,tc=7\/7,ttl=64\/0xff,bos=1\/1)/' odp-base.txt | |
157 | ||
158 | echo | |
159 | echo '# Valid forms with QoS priority.' | |
160 | sed 's/^/skb_priority(0x1234\/0xff),/' odp-base.txt | |
161 | ||
162 | echo | |
163 | echo '# Valid forms with tunnel and VLAN headers.' | |
65da723b | 164 | sed 's/^/tunnel(tun_id=0xfedcba9876543210,src=10.0.0.1,dst=10.0.0.2,tos=0x8,ttl=128,flags(key)),/ |
e6cc0bab AZ |
165 | s/\(eth([[^)]]*)\),*/\1,eth_type(0x8100),vlan(vid=99/0xff0,pcp=7/0xe),encap(/ |
166 | s/$/)/' odp-base.txt | |
167 | ||
168 | echo | |
169 | echo '# Valid forms with QOS priority, tunnel, and VLAN headers.' | |
65da723b | 170 | sed 's/^/skb_priority(0x1234),tunnel(tun_id=0xfedcba9876543210,src=10.10.10.10,dst=20.20.20.20,tos=0x8,ttl=64,flags(key)),/ |
e6cc0bab AZ |
171 | s/\(eth([[^)]]*)\),*/\1,eth_type(0x8100),vlan(vid=99,pcp=7),encap(/ |
172 | s/$/)/' odp-base.txt | |
173 | ||
07659514 JS |
174 | echo |
175 | echo '# Valid forms with conntrack fields.' | |
daf4d3c1 | 176 | sed 's/\(eth([[^)]]*)\),/\1,ct_state(+trk),ct_zone(0x5\/0xff),ct_mark(0x10305070\/0xf0f0f0f0),ct_label(0x1234567890abcdef1234567890abcdef\/0x102030405060708090a0b0c0d0e0f0),ct_tuple4(src=10.10.10.10,dst=20.20.20.20,proto=17,tp_src=1,tp_dst=2),/' odp-base.txt |
07659514 | 177 | |
e6cc0bab AZ |
178 | echo |
179 | echo '# Valid forms with IP first fragment.' | |
180 | sed -n 's/,frag=no),/,frag=first),/p' odp-base.txt | |
181 | ||
182 | echo | |
183 | echo '# Valid forms with IP later fragment.' | |
98514eea WT |
184 | sed -n 's/,frag=no),.*/,frag=later)/p' odp-base.txt |
185 | ||
186 | echo | |
187 | echo '# Valid forms with tunnel and ERSPAN v1 headers.' | |
23cfec1c | 188 | sed 's/^/skb_priority(0),tunnel(tun_id=0xfedcba9876543210,src=10.0.0.1,dst=10.0.0.2,ttl=128,erspan(ver=1/0,idx=0x7/0xf),flags(df|key)),skb_mark(0),recirc_id(0),dp_hash(0),/' odp-base.txt |
98514eea WT |
189 | |
190 | echo | |
191 | echo '# Valid forms with tunnel and ERSPAN v2 headers.' | |
f9162628 | 192 | sed 's/^/skb_priority(0),tunnel(tun_id=0xfedcba9876543210,src=10.0.0.1,dst=10.0.0.2,ttl=128,erspan(ver=2,dir=1,hwid=0x7/0xf),flags(df|key)),skb_mark(0),recirc_id(0),dp_hash(0),/' odp-base.txt |
98514eea | 193 | ) > odp.txt |
e6cc0bab | 194 | AT_CAPTURE_FILE([odp.txt]) |
eadd1644 | 195 | AT_CHECK_UNQUOTED([ovstest test-odp parse-wc-keys < odp.txt], [0], [`cat odp.txt` |
e6cc0bab AZ |
196 | ]) |
197 | AT_CLEANUP | |
198 | ||
5a0a5702 GS |
199 | AT_SETUP([OVS datapath wildcarded key filtering.]) |
200 | dnl We could add a test for invalid forms, but that's less important. | |
201 | AT_DATA([odp-base.txt], [dnl | |
202 | in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x1234/0xfff0) | |
2d18eae8 | 203 | in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x0800),ipv4(src=35.8.2.41/255.255.255.0,dst=172.16.0.20/255.255.255.0,proto=5/0xf0,tos=0x80/0xf0,ttl=128/0xf0,frag=no) |
5a0a5702 GS |
204 | in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x0800),ipv4(src=35.8.2.41,dst=172.16.0.20,proto=6,tos=0,ttl=128,frag=no),tcp(src=80/0xff00,dst=8080/0xff) |
205 | in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x0800),ipv4(src=35.8.2.41,dst=172.16.0.20,proto=17,tos=0,ttl=128,frag=no),udp(src=81/0xff00,dst=6632/0xff) | |
206 | in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x0800),ipv4(src=35.8.2.41,dst=172.16.0.20,proto=17,tos=0,ttl=128,frag=no),udp(src=81/0xff,dst=6632/0xff00) | |
207 | in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x0800),ipv4(src=35.8.2.41,dst=172.16.0.20,proto=1,tos=0,ttl=128,frag=no),icmp(type=1/0xf0,code=2/0xff) | |
2d18eae8 | 208 | in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x86dd),ipv6(src=::1/::255,dst=::2/::255,label=0/0xf0,proto=10/0xf0,tclass=0x70/0xf0,hlimit=128/0xf0,frag=no) |
5a0a5702 GS |
209 | in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x86dd),ipv6(src=::1,dst=::2,label=0,proto=6,tclass=0,hlimit=128,frag=no),tcp(src=80/0xff00,dst=8080/0xff) |
210 | in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x0806),arp(sip=1.2.3.4/255.255.255.250,tip=5.6.7.8/255.255.255.250,op=1/0xf0,sha=00:0f:10:11:12:13/ff:ff:ff:ff:ff:00,tha=00:14:15:16:17:18/ff:ff:ff:ff:ff:00) | |
211 | ]) | |
212 | AT_DATA([odp-vlan-base.txt], [dnl | |
213 | in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x8100),vlan(vid=99,pcp=7),encap(eth_type(0x0800),ipv4(src=35.8.2.41,dst=172.16.0.20,proto=6,tos=0,ttl=128,frag=no),tcp(src=80/0xff00,dst=8080/0xff)) | |
214 | in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x8100),vlan(vid=100,pcp=7),encap(eth_type(0x0800),ipv4(src=35.8.2.41,dst=172.16.0.20,proto=6,tos=0,ttl=128,frag=no),tcp(src=80/0xff00,dst=8080/0xff)) | |
215 | in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x8100),vlan(vid=99,pcp=7),encap(eth_type(0x0800),ipv4(src=35.8.2.41,dst=172.16.0.20,proto=17,tos=0,ttl=128,frag=no),udp(src=81/0xff00,dst=6632/0xff)) | |
216 | in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x8100),vlan(vid=100,pcp=7),encap(eth_type(0x0800),ipv4(src=35.8.2.41,dst=172.16.0.20,proto=17,tos=0,ttl=128,frag=no),udp(src=81/0xff00,dst=6632/0xff)) | |
217 | ]) | |
218 | AT_DATA([odp-eth-type.txt], [dnl | |
219 | in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x1234/0xfff0) | |
220 | ]) | |
221 | AT_DATA([odp-vlan.txt], [dnl | |
222 | in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x8100),vlan(vid=99,pcp=7),encap(eth_type(0x0800),ipv4(src=35.8.2.41,dst=172.16.0.20,proto=6,tos=0,ttl=128,frag=no),tcp(src=80/0xff00,dst=8080/0xff)) | |
223 | in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x8100),vlan(vid=99,pcp=7),encap(eth_type(0x0800),ipv4(src=35.8.2.41,dst=172.16.0.20,proto=17,tos=0,ttl=128,frag=no),udp(src=81/0xff00,dst=6632/0xff)) | |
224 | ]) | |
225 | AT_DATA([odp-ipv4.txt], [dnl | |
2d18eae8 | 226 | in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x0800),ipv4(src=35.8.2.41/255.255.255.0,dst=172.16.0.20/255.255.255.0,proto=5/0xf0,tos=0x80/0xf0,ttl=128/0xf0,frag=no) |
5a0a5702 GS |
227 | ]) |
228 | AT_DATA([odp-icmp.txt], [dnl | |
2d18eae8 | 229 | in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x0800),ipv4(src=35.8.2.41/255.255.255.0,dst=172.16.0.20/255.255.255.0,proto=5/0xf0,tos=0x80/0xf0,ttl=128/0xf0,frag=no) |
5a0a5702 GS |
230 | ]) |
231 | AT_DATA([odp-arp.txt], [dnl | |
232 | in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x0806),arp(sip=1.2.3.4/255.255.255.250,tip=5.6.7.8/255.255.255.250,op=1/0xf0,sha=00:0f:10:11:12:13/ff:ff:ff:ff:ff:00,tha=00:14:15:16:17:18/ff:ff:ff:ff:ff:00) | |
233 | ]) | |
234 | AT_DATA([odp-tcp.txt], [dnl | |
2d18eae8 | 235 | in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x0800),ipv4(src=35.8.2.41/255.255.255.0,dst=172.16.0.20/255.255.255.0,proto=5/0xf0,tos=0x80/0xf0,ttl=128/0xf0,frag=no) |
5a0a5702 GS |
236 | in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x0800),ipv4(src=35.8.2.41,dst=172.16.0.20,proto=6,tos=0,ttl=128,frag=no),tcp(src=80/0xff00,dst=8080/0xff) |
237 | ]) | |
238 | AT_DATA([odp-tcp6.txt], [dnl | |
2d18eae8 | 239 | in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x86dd),ipv6(src=::1/::255,dst=::2/::255,label=0/0xf0,proto=10/0xf0,tclass=0x70/0xf0,hlimit=128/0xf0,frag=no) |
5a0a5702 GS |
240 | in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x86dd),ipv6(src=::1,dst=::2,label=0,proto=6,tclass=0,hlimit=128,frag=no),tcp(src=80/0xff00,dst=8080/0xff) |
241 | ]) | |
eadd1644 | 242 | AT_CHECK_UNQUOTED([ovstest test-odp parse-filter filter='dl_type=0x1235' < odp-base.txt], [0], [`cat odp-eth-type.txt` |
5a0a5702 | 243 | ]) |
eadd1644 | 244 | AT_CHECK_UNQUOTED([ovstest test-odp parse-filter filter='dl_vlan=99' < odp-vlan-base.txt], [0], [`cat odp-vlan.txt` |
5a0a5702 | 245 | ]) |
eadd1644 | 246 | AT_CHECK_UNQUOTED([ovstest test-odp parse-filter filter='dl_vlan=99,ip' < odp-vlan-base.txt], [0], [`cat odp-vlan.txt` |
5a0a5702 | 247 | ]) |
eadd1644 | 248 | AT_CHECK_UNQUOTED([ovstest test-odp parse-filter filter='ip,nw_src=35.8.2.199' < odp-base.txt], [0], [`cat odp-ipv4.txt` |
5a0a5702 | 249 | ]) |
eadd1644 | 250 | AT_CHECK_UNQUOTED([ovstest test-odp parse-filter filter='ip,nw_dst=172.16.0.199' < odp-base.txt], [0], [`cat odp-ipv4.txt` |
5a0a5702 | 251 | ]) |
eadd1644 | 252 | AT_CHECK_UNQUOTED([ovstest test-odp parse-filter filter='dl_type=0x0800,nw_src=35.8.2.199,nw_dst=172.16.0.199' < odp-base.txt], [0], [`cat odp-ipv4.txt` |
5a0a5702 | 253 | ]) |
eadd1644 | 254 | AT_CHECK_UNQUOTED([ovstest test-odp parse-filter filter='icmp,nw_src=35.8.2.199' < odp-base.txt], [0], [`cat odp-icmp.txt` |
5a0a5702 | 255 | ]) |
eadd1644 | 256 | AT_CHECK_UNQUOTED([ovstest test-odp parse-filter filter='arp,arp_spa=1.2.3.5' < odp-base.txt], [0], [`cat odp-arp.txt` |
5a0a5702 | 257 | ]) |
eadd1644 | 258 | AT_CHECK_UNQUOTED([ovstest test-odp parse-filter filter='tcp,tp_src=90' < odp-base.txt], [0], [`cat odp-tcp.txt` |
5a0a5702 | 259 | ]) |
eadd1644 | 260 | AT_CHECK_UNQUOTED([ovstest test-odp parse-filter filter='tcp6,tp_src=90' < odp-base.txt], [0], [`cat odp-tcp6.txt` |
5a0a5702 GS |
261 | ]) |
262 | AT_CLEANUP | |
263 | ||
eb1b39b3 BP |
264 | AT_SETUP([OVS datapath actions parsing and formatting - valid forms]) |
265 | AT_DATA([actions.txt], [dnl | |
266 | 1,2,3 | |
7321bda3 NM |
267 | userspace(pid=6633,sFlow(vid=9,pcp=7,output=10),actions) |
268 | userspace(pid=6633,sFlow(vid=9,pcp=7,output=10),actions,tunnel_out_port=10) | |
8e4c1621 JG |
269 | userspace(pid=9765,slow_path(0)) |
270 | userspace(pid=9765,slow_path(0),tunnel_out_port=10) | |
eb1b39b3 | 271 | userspace(pid=9765,slow_path(cfm)) |
8b7ea2d4 | 272 | userspace(pid=9765,slow_path(cfm),tunnel_out_port=10) |
7321bda3 | 273 | userspace(pid=1234567,userdata(0102030405060708090a0b0c0d0e0f),actions) |
8b7ea2d4 | 274 | userspace(pid=1234567,userdata(0102030405060708090a0b0c0d0e0f),tunnel_out_port=10) |
f69f713b | 275 | userspace(pid=6633,flow_sample(probability=123,collector_set_id=1234,obs_domain_id=2345,obs_point_id=3456,output_port=10)) |
4930ea56 | 276 | userspace(pid=6633,flow_sample(probability=123,collector_set_id=1234,obs_domain_id=2345,obs_point_id=3456,output_port=10,ingress)) |
f69f713b | 277 | userspace(pid=6633,flow_sample(probability=123,collector_set_id=1234,obs_domain_id=2345,obs_point_id=3456,output_port=10),tunnel_out_port=10) |
4930ea56 | 278 | userspace(pid=6633,flow_sample(probability=123,collector_set_id=1234,obs_domain_id=2345,obs_point_id=3456,output_port=10,egress),tunnel_out_port=10) |
8b7ea2d4 WZ |
279 | userspace(pid=6633,ipfix(output_port=10)) |
280 | userspace(pid=6633,ipfix(output_port=10),tunnel_out_port=10) | |
74c4530d JP |
281 | userspace(pid=6633,controller(reason=1,dont_send=0,continuation=1,recirc_id=4444,rule_cookie=0x5555,controller_id=0,max_len=65535)) |
282 | userspace(pid=6633,controller(reason=1,dont_send=1,continuation=0,recirc_id=4444,rule_cookie=0x5555,controller_id=0,max_len=65535)) | |
eb1b39b3 BP |
283 | set(in_port(2)) |
284 | set(eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15)) | |
2d18eae8 | 285 | set(eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15/ff:ff:ff:00:00:00)) |
eb1b39b3 BP |
286 | set(eth_type(0x1234)) |
287 | set(ipv4(src=35.8.2.41,dst=172.16.0.20,proto=5,tos=0x80,ttl=128,frag=no)) | |
2d18eae8 JR |
288 | set(ipv4(src=35.8.2.41,dst=172.16.0.20,proto=5,ttl=128,frag=no)) |
289 | set(ipv4(src=35.8.2.41/255.255.255.0,dst=172.16.0.20,proto=5,tos=0x80,ttl=128,frag=no)) | |
290 | set(ipv4(src=35.8.2.41/255.255.255.0,tos=0x80,ttl=128,frag=no)) | |
291 | set(ipv4(tos=0/0x3)) | |
292 | set(ipv4(tos=0x80/0xfc)) | |
293 | set(ipv4(ttl=128,frag=no)) | |
294 | set(ipv4(frag=no)) | |
eb1b39b3 | 295 | set(tcp(src=80,dst=8080)) |
2d18eae8 JR |
296 | set(tcp(src=80/0xff00,dst=8080)) |
297 | set(tcp(src=80)) | |
298 | set(tcp(dst=8080)) | |
eb1b39b3 | 299 | set(udp(src=81,dst=6632)) |
2d18eae8 JR |
300 | set(udp(src=81/0xff00,dst=6632)) |
301 | set(udp(src=81)) | |
302 | set(udp(dst=6633)) | |
61abba80 | 303 | set(sctp(src=82,dst=6633)) |
2d18eae8 JR |
304 | set(sctp(src=82/0xff00,dst=6633)) |
305 | set(sctp(src=82)) | |
306 | set(sctp(dst=6632)) | |
eb1b39b3 BP |
307 | set(icmp(type=1,code=2)) |
308 | set(ipv6(src=::1,dst=::2,label=0,proto=10,tclass=0x70,hlimit=128,frag=no)) | |
2d18eae8 JR |
309 | set(ipv6(src=::1,dst=::2)) |
310 | set(ipv6(label=0,proto=10,tclass=0x70,hlimit=128,frag=no)) | |
311 | set(ipv6(label=0,proto=10,hlimit=128)) | |
312 | set(ipv6(label=0/0xfff,proto=10,tclass=0x70/0x70)) | |
313 | set(ipv6(label=0)) | |
eb1b39b3 | 314 | set(icmpv6(type=1,code=2)) |
4a0a2c24 PB |
315 | set(vlan(vid=5)) |
316 | set(vlan(vid=3,pcp=5)) | |
317 | set(vlan(vid=3,pcp=5,cfi=0)) | |
318 | set(vlan(vid=5/0x3)) | |
319 | set(vlan(vid=5/0x1)),3 | |
eb1b39b3 BP |
320 | push_vlan(vid=12,pcp=0) |
321 | push_vlan(vid=13,pcp=5,cfi=0) | |
322 | push_vlan(tpid=0x9100,vid=13,pcp=5) | |
323 | push_vlan(tpid=0x9100,vid=13,pcp=5,cfi=0) | |
324 | pop_vlan | |
325 | sample(sample=9.7%,actions(1,2,3,push_vlan(vid=1,pcp=2))) | |
8e4c1621 | 326 | set(tunnel(tun_id=0xabcdef1234567890,src=1.1.1.1,dst=2.2.2.2,ttl=64,flags(df|csum|key))) |
65da723b | 327 | set(tunnel(tun_id=0xabcdef1234567890,src=1.1.1.1,dst=2.2.2.2,ttl=64,flags(key))) |
a36de779 | 328 | tnl_pop(4) |
fa47c114 BP |
329 | tnl_push(tnl_port(4),header(size=42,type=3,eth(dst=f8:bc:12:44:34:b6,src=f8:bc:12:46:58:e0,dl_type=0x0800),ipv4(src=1.1.2.88,dst=1.1.2.92,proto=47,tos=0,ttl=64,frag=0x4000),gre((flags=0x2000,proto=0x6558),key=0x1e241)),out_port(1)) |
330 | tnl_push(tnl_port(4),header(size=46,type=3,eth(dst=f8:bc:12:44:34:b6,src=f8:bc:12:46:58:e0,dl_type=0x0800),ipv4(src=1.1.2.88,dst=1.1.2.92,proto=47,tos=0,ttl=64,frag=0x4000),gre((flags=0xa000,proto=0x6558),csum=0x0,key=0x1e241)),out_port(1)) | |
331 | tnl_push(tnl_port(6),header(size=50,type=4,eth(dst=f8:bc:12:44:34:b6,src=f8:bc:12:46:58:e0,dl_type=0x0800),ipv4(src=1.1.2.88,dst=1.1.2.92,proto=17,tos=0,ttl=64,frag=0x4000),udp(src=0,dst=4789,csum=0x0),vxlan(flags=0x8000000,vni=0x1c7)),out_port(1)) | |
332 | tnl_push(tnl_port(6),header(size=50,type=5,eth(dst=f8:bc:12:44:34:b6,src=f8:bc:12:46:58:e0,dl_type=0x0800),ipv4(src=1.1.2.88,dst=1.1.2.92,proto=17,tos=0,ttl=64,frag=0x4000),udp(src=0,dst=6081,csum=0x0),geneve(oam,vni=0x1c7)),out_port(1)) | |
333 | tnl_push(tnl_port(6),header(size=58,type=5,eth(dst=f8:bc:12:44:34:b6,src=f8:bc:12:46:58:e0,dl_type=0x0800),ipv4(src=1.1.2.88,dst=1.1.2.92,proto=17,tos=0,ttl=64,frag=0x4000),udp(src=0,dst=6081,csum=0x0),geneve(crit,vni=0x1c7,options({class=0xffff,type=0x80,len=4,0xa}))),out_port(1)) | |
334 | tnl_push(tnl_port(6),header(size=50,type=5,eth(dst=f8:bc:12:44:34:b6,src=f8:bc:12:46:58:e0,dl_type=0x0800),ipv4(src=1.1.2.88,dst=1.1.2.92,proto=17,tos=0,ttl=64,frag=0x4000),udp(src=0,dst=6081,csum=0xffff),geneve(vni=0x1c7)),out_port(1)) | |
7dc18ae9 WT |
335 | tnl_push(tnl_port(4),header(size=62,type=109,eth(dst=f8:bc:12:44:34:b6,src=f8:bc:12:46:58:e0,dl_type=0x86dd),ipv6(src=2001:cafe::88,dst=2001:cafe::92,label=0,proto=47,tclass=0x0,hlimit=64),gre((flags=0x2000,proto=0x6558),key=0x1e241)),out_port(1)) |
336 | tnl_push(tnl_port(4),header(size=66,type=109,eth(dst=f8:bc:12:44:34:b6,src=f8:bc:12:46:58:e0,dl_type=0x86dd),ipv6(src=2001:cafe::88,dst=2001:cafe::92,label=0,proto=47,tclass=0x0,hlimit=64),gre((flags=0xa000,proto=0x6558),csum=0x0,key=0x1e241)),out_port(1)) | |
370e373b TLSC |
337 | tnl_push(tnl_port(6),header(size=70,type=4,eth(dst=f8:bc:12:44:34:b6,src=f8:bc:12:46:58:e0,dl_type=0x86dd),ipv6(src=2001:cafe::88,dst=2001:cafe::92,label=0,proto=17,tclass=0x0,hlimit=64),udp(src=0,dst=4789,csum=0x0),vxlan(flags=0x8000000,vni=0x1c7)),out_port(1)) |
338 | tnl_push(tnl_port(6),header(size=70,type=5,eth(dst=f8:bc:12:44:34:b6,src=f8:bc:12:46:58:e0,dl_type=0x86dd),ipv6(src=2001:cafe::88,dst=2001:cafe::92,label=0,proto=17,tclass=0x0,hlimit=64),udp(src=0,dst=6081,csum=0x0),geneve(oam,vni=0x1c7)),out_port(1)) | |
339 | tnl_push(tnl_port(6),header(size=78,type=5,eth(dst=f8:bc:12:44:34:b6,src=f8:bc:12:46:58:e0,dl_type=0x86dd),ipv6(src=2001:cafe::88,dst=2001:cafe::92,label=0,proto=17,tclass=0x0,hlimit=64),udp(src=0,dst=6081,csum=0x0),geneve(crit,vni=0x1c7,options({class=0xffff,type=0x80,len=4,0xa}))),out_port(1)) | |
340 | tnl_push(tnl_port(6),header(size=70,type=5,eth(dst=f8:bc:12:44:34:b6,src=f8:bc:12:46:58:e0,dl_type=0x86dd),ipv6(src=2001:cafe::88,dst=2001:cafe::92,label=0,proto=17,tclass=0x0,hlimit=64),udp(src=0,dst=6081,csum=0xffff),geneve(vni=0x1c7)),out_port(1)) | |
07659514 JS |
341 | ct |
342 | ct(commit) | |
343 | ct(commit,zone=5) | |
8e53fe8c | 344 | ct(commit,mark=0xa0a0a0a0/0xfefefefe) |
9daf2348 | 345 | ct(commit,label=0x1234567890abcdef1234567890abcdef/0xf1f2f3f4f5f6f7f8f9f0fafbfcfdfeff) |
d787ad39 | 346 | ct(commit,helper=ftp) |
40c7b2fc | 347 | ct(commit,helper=tftp) |
ebe62ec1 | 348 | ct(commit,timeout=ovs_tp_1_tcp4) |
9ac0aada JR |
349 | ct(nat) |
350 | ct(commit,nat(src)) | |
351 | ct(commit,nat(dst)) | |
352 | ct(commit,nat(src=10.0.0.240,random)) | |
353 | ct(commit,nat(src=10.0.0.240:32768-65535,random)) | |
354 | ct(commit,nat(dst=10.0.0.128-10.0.0.254,hash)) | |
355 | ct(commit,nat(src=10.0.0.240-10.0.0.254:32768-65535,persistent)) | |
356 | ct(commit,nat(src=fe80::20c:29ff:fe88:a18b,random)) | |
357 | ct(commit,nat(src=fe80::20c:29ff:fe88:1-fe80::20c:29ff:fe88:a18b,random)) | |
358 | ct(commit,nat(src=[[fe80::20c:29ff:fe88:1]]-[[fe80::20c:29ff:fe88:a18b]]:255-4096,random)) | |
359 | ct(commit,helper=ftp,nat(src=10.1.1.240-10.1.1.255)) | |
a76a37ef JR |
360 | ct(force_commit) |
361 | ct(force_commit,zone=5) | |
362 | ct(force_commit,mark=0xa0a0a0a0/0xfefefefe) | |
363 | ct(force_commit,label=0x1234567890abcdef1234567890abcdef/0xf1f2f3f4f5f6f7f8f9f0fafbfcfdfeff) | |
364 | ct(force_commit,helper=ftp) | |
365 | ct(nat) | |
366 | ct(force_commit,nat(src)) | |
367 | ct(force_commit,nat(dst)) | |
368 | ct(force_commit,nat(src=10.0.0.240,random)) | |
369 | ct(force_commit,nat(src=10.0.0.240:32768-65535,random)) | |
370 | ct(force_commit,nat(dst=10.0.0.128-10.0.0.254,hash)) | |
371 | ct(force_commit,nat(src=10.0.0.240-10.0.0.254:32768-65535,persistent)) | |
372 | ct(force_commit,nat(src=fe80::20c:29ff:fe88:a18b,random)) | |
373 | ct(force_commit,nat(src=fe80::20c:29ff:fe88:1-fe80::20c:29ff:fe88:a18b,random)) | |
374 | ct(force_commit,nat(src=[[fe80::20c:29ff:fe88:1]]-[[fe80::20c:29ff:fe88:a18b]]:255-4096,random)) | |
375 | ct(force_commit,helper=ftp,nat(src=10.1.1.240-10.1.1.255)) | |
1fe178d2 | 376 | ct_clear |
aaca4fe0 | 377 | trunc(100) |
c37f7135 AZ |
378 | clone(1) |
379 | clone(clone(push_vlan(vid=12,pcp=0),2),1) | |
98514eea WT |
380 | set(tunnel(tun_id=0x1,dst=1.1.1.1,ttl=64,erspan(ver=1,idx=0x7),flags(df|key))) |
381 | set(tunnel(tun_id=0x1,dst=1.1.1.1,ttl=64,erspan(ver=2,dir=1,hwid=0x1),flags(df|key))) | |
5b34f8fc NS |
382 | check_pkt_len(size=200,gt(4),le(5)) |
383 | check_pkt_len(size=200,gt(drop),le(5)) | |
384 | check_pkt_len(size=200,gt(ct(nat)),le(drop)) | |
385 | check_pkt_len(size=200,gt(set(eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15))),le(set(eth(src=00:01:02:03:04:06,dst=10:11:12:13:14:16)))) | |
9df65060 | 386 | lb_output(1) |
eb1b39b3 | 387 | ]) |
eadd1644 | 388 | AT_CHECK_UNQUOTED([ovstest test-odp parse-actions < actions.txt], [0], |
eb1b39b3 BP |
389 | [`cat actions.txt` |
390 | ]) | |
391 | AT_CLEANUP | |
0884990e BP |
392 | |
393 | AT_SETUP([OVS datapath actions parsing and formatting - invalid forms]) | |
394 | dnl This caused a hang in older versions. | |
395 | AT_CHECK([echo 'encap_nsh@:{@' | ovstest test-odp parse-actions | |
396 | ], [0], [dnl | |
397 | odp_actions_from_string: error | |
398 | ]) | |
399 | AT_CLEANUP | |
ac20d3fe | 400 | |
55f2b065 IM |
401 | AT_SETUP([OVS datapath actions parsing and formatting - userdata overflow]) |
402 | dnl Userdata should fit in a single netlink message, i.e. should be less than | |
403 | dnl UINT16_MAX - NLA_HDRLEN = 65535 - 4 = 65531 bytes. OVS should not accept | |
404 | dnl larger userdata. OTOH, userdata is part of a nested netlink message, that | |
405 | dnl should not be oversized too. 'pid' takes NLA_HDRLEN + 4 = 8 bytes. | |
406 | dnl Plus NLA_HDRLEN for the nested header. 'actions' flag takes NLA_HDRLEN = 4 | |
407 | dnl and 'tunnel_out_port' takes NLA_HDRLEN + 4 = 8 bytes. | |
408 | dnl So, for the variant with 'actions' maximum length of userdata should be: | |
409 | dnl UINT16_MAX - NLA_HDRLEN - (NLA_HDRLEN + 4) - NLA_HDRLEN - NLA_HDRLEN | |
410 | dnl total max nested header pid actions userdata | |
411 | dnl Result: 65515 bytes for the actual userdata. | |
412 | dnl For the case with 'tunnel_out_port': 65511 | |
413 | dnl Size of userdata will be rounded up to be multiple of 4, so highest | |
414 | dnl acceptable sizes are 65512 and 65508. | |
415 | ||
416 | dnl String with length 65512 * 2 = 131024 is valid, while 131026 is not. | |
417 | data_valid=$( printf '%*s' 131024 | tr ' ' "a") | |
418 | data_invalid=$(printf '%*s' 131026 | tr ' ' "a") | |
419 | ||
420 | echo "userspace(pid=1234567,userdata(${data_valid}),actions)" > actions.txt | |
421 | echo "userspace(pid=1234567,userdata(${data_invalid}),actions)" >> actions.txt | |
422 | ||
423 | dnl String with length 65508 * 2 = 131016 is valid, while 131018 is not. | |
424 | data_valid=$( printf '%*s' 131016 | tr ' ' "a") | |
425 | data_invalid=$(printf '%*s' 131018 | tr ' ' "a") | |
426 | ||
427 | echo "userspace(pid=1234567,userdata(${data_valid}),tunnel_out_port=10)" >> actions.txt | |
428 | echo "userspace(pid=1234567,userdata(${data_invalid}),tunnel_out_port=10)" >> actions.txt | |
429 | ||
430 | AT_CHECK_UNQUOTED([ovstest test-odp parse-actions < actions.txt], [0], [dnl | |
431 | `cat actions.txt | head -1` | |
432 | odp_actions_from_string: error | |
433 | `cat actions.txt | head -3 | tail -1` | |
434 | odp_actions_from_string: error | |
435 | ]) | |
436 | AT_CLEANUP | |
437 | ||
ac20d3fe YS |
438 | AT_SETUP([OVS datapath keys parsing and formatting - 33 nested encap ]) |
439 | AT_DATA([odp-in.txt], [dnl | |
440 | encap(encap(encap(encap(encap(encap(encap(encap(encap(encap(encap(encap(encap(encap(encap(encap(encap(encap(encap(encap(encap(encap(encap(encap(encap(encap(encap(encap(encap(encap(encap(encap(encap())))))))))))))))))))))))))))))))) | |
441 | ]) | |
442 | AT_CHECK_UNQUOTED([ovstest test-odp parse-keys < odp-in.txt], [0], [dnl | |
d40533fc | 443 | odp_flow_from_string: error (syntax error at encap(encap(encap(encap(encap(encap(encap(encap(encap(encap(encap(encap(encap(encap(encap(encap(encap(encap(encap(encap(encap(encap(encap(encap(encap(encap(encap(encap(encap(encap(encap(encap(encap()))))))))))))))))))))))))))))))))) |
ac20d3fe YS |
444 | ]) |
445 | AT_CLEANUP |