]>
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) |
b02475c5 SH |
25 | 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) |
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=7,ttl=100,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=0) | |
28 | 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) | |
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=0) | |
3bffc610 BP |
30 | ]) |
31 | ||
32 | (echo '# Valid forms without tun_id or VLAN header.' | |
d3d32077 | 33 | sed 's/^/skb_priority(0),skb_mark(0),recirc_id(0),dp_hash(0),/' odp-base.txt |
54bb0348 | 34 | |
d3d32077 | 35 | sed ' |
7ce2769e | 36 | s/^/skb_priority(0),skb_mark(0),recirc_id(0),dp_hash(0),/ |
54bb0348 AZ |
37 | ' odp-base.txt |
38 | ||
3bffc610 BP |
39 | |
40 | echo | |
05fb0928 | 41 | echo '# Valid forms with tunnel header.' |
8e4c1621 | 42 | 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 |
43 | |
44 | echo | |
45 | echo '# Valid forms with VLAN header.' | |
7ce2769e | 46 | sed 's/^/skb_priority(0),skb_mark(0),recirc_id(0),dp_hash(0),/ |
54bb0348 | 47 | s/\(eth([[^)]]*)\),*/\1,eth_type(0x8100),vlan(vid=99,pcp=7),encap(/ |
fea393b1 | 48 | s/$/)/' odp-base.txt |
3bffc610 | 49 | |
b02475c5 SH |
50 | echo |
51 | echo '# Valid forms with MPLS header.' | |
7ce2769e | 52 | sed 's/^/skb_priority(0),skb_mark(0),recirc_id(0),dp_hash(0),/ |
54bb0348 | 53 | s/\(eth([[^)]]*),?\)/\1,eth_type(0x8847),mpls(label=100,tc=7,ttl=64,bos=1)/' odp-base.txt |
b02475c5 SH |
54 | |
55 | echo | |
56 | echo '# Valid forms with MPLS multicast header.' | |
7ce2769e | 57 | sed 's/^/skb_priority(0),skb_mark(0),recirc_id(0),dp_hash(0),/ |
54bb0348 | 58 | s/\(eth([[^)]]*),?\)/\1,eth_type(0x8848),mpls(label=100,tc=7,ttl=64,bos=1)/' odp-base.txt |
abff858b | 59 | |
3bffc610 | 60 | echo |
05fb0928 | 61 | echo '# Valid forms with tunnel and VLAN headers.' |
65da723b | 62 | 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 | 63 | s/\(eth([[^)]]*)\),*/\1,eth_type(0x8100),vlan(vid=99,pcp=7),encap(/ |
2508ac16 BP |
64 | s/$/)/' odp-base.txt |
65 | ||
66 | echo | |
05fb0928 | 67 | echo '# Valid forms with QOS priority, tunnel, and VLAN headers.' |
65da723b | 68 | 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 | 69 | s/\(eth([[^)]]*)\),*/\1,eth_type(0x8100),vlan(vid=99,pcp=7),encap(/ |
fea393b1 | 70 | s/$/)/' odp-base.txt |
7257b535 | 71 | |
8e53fe8c JS |
72 | echo |
73 | echo '# Valid forms with conntrack fields.' | |
9daf2348 | 74 | sed 's/^/skb_priority(0),skb_mark(0),ct_mark(0x12345678),ct_label(0x1234567890abcdef1234567890abcdef),recirc_id(0),dp_hash(0),/' odp-base.txt |
8e53fe8c | 75 | |
7257b535 BP |
76 | echo |
77 | echo '# Valid forms with IP first fragment.' | |
7ce2769e | 78 | 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 |
79 | |
80 | echo | |
81 | echo '# Valid forms with IP later fragment.' | |
7ce2769e | 82 | 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' |
8bfd0fda BP |
83 | ) > odp-in.txt |
84 | AT_CAPTURE_FILE([odp-in.txt]) | |
85 | ||
86 | dnl If the BoS bit of the last LSE is 0 then the stack is unterminated | |
87 | dnl Internally a stack of 3 LSEs will be used with the trailing LSEs | |
88 | dnl set to zero. This is reflected when the key is formated | |
89 | sed '/bos=0/{ | |
90 | s/^/ODP_FIT_TOO_LITTLE: / | |
8bfd0fda BP |
91 | }' < odp-in.txt > odp-out.txt |
92 | ||
07659514 JS |
93 | dnl Some fields are always printed for this test, because wildcards aren't |
94 | dnl specified. We can skip these. | |
95 | sed -i 's/\(skb_mark(0)\),\(ct\)/\1,ct_state(0),ct_zone(0),\2/' odp-out.txt | |
9daf2348 | 96 | sed -i 's/\(skb_mark([[^)]]*)\),\(recirc\)/\1,ct_state(0),ct_zone(0),ct_mark(0),ct_label(0),\2/' odp-out.txt |
3d4b2e6e | 97 | sed -i 's/\(in_port(1)\),\(eth\)/\1,packet_type(ns=0,id=0),\2/' odp-out.txt |
07659514 | 98 | |
eadd1644 | 99 | AT_CHECK_UNQUOTED([ovstest test-odp parse-keys < odp-in.txt], [0], [`cat odp-out.txt` |
3bffc610 BP |
100 | ]) |
101 | AT_CLEANUP | |
102 | ||
e6cc0bab AZ |
103 | AT_SETUP([OVS datapath wildcarded key parsing and formatting - valid forms]) |
104 | dnl We could add a test for invalid forms, but that's less important. | |
105 | AT_DATA([odp-base.txt], [dnl | |
106 | 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) | |
107 | in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x1234/0xfff0) | |
2d18eae8 | 108 | 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 |
109 | 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) |
110 | 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 | 111 | 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 |
112 | 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) |
113 | 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 |
114 | 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) |
115 | 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 | 116 | 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 |
117 | 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) |
118 | 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) | |
119 | 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) | |
120 | 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) | |
121 | 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) | |
122 | 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) | |
123 | ]) | |
124 | ||
125 | (echo '# Valid forms without tun_id or VLAN header.' | |
126 | cat odp-base.txt | |
127 | ||
128 | echo | |
129 | echo '# Valid forms with tunnel header.' | |
b666962b | 130 | 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 | 131 | |
125fc637 AW |
132 | echo |
133 | echo '# Valid forms with tunnel header (wildcard flag).' | |
65da723b | 134 | 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 | 135 | |
622a0a8e JG |
136 | echo |
137 | echo '# Valid forms with Geneve header.' | |
8e4c1621 | 138 | 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 | 139 | |
e6cc0bab AZ |
140 | echo |
141 | echo '# Valid forms with VLAN header.' | |
142 | sed 's/\(eth([[^)]]*)\),*/\1,eth_type(0x8100),vlan(vid=99,pcp=7),encap(/ | |
143 | s/$/)/' odp-base.txt | |
144 | ||
145 | echo | |
146 | echo '# Valid forms with MPLS header.' | |
147 | sed 's/\(eth([[^)]]*),?\)/\1,eth_type(0x8847),mpls(label=100\/0xff,tc=7\/7,ttl=64\/0xff,bos=1\/1)/' odp-base.txt | |
148 | ||
149 | echo | |
150 | echo '# Valid forms with QoS priority.' | |
151 | sed 's/^/skb_priority(0x1234\/0xff),/' odp-base.txt | |
152 | ||
153 | echo | |
154 | echo '# Valid forms with tunnel and VLAN headers.' | |
65da723b | 155 | sed 's/^/tunnel(tun_id=0xfedcba9876543210,src=10.0.0.1,dst=10.0.0.2,tos=0x8,ttl=128,flags(key)),/ |
e6cc0bab AZ |
156 | s/\(eth([[^)]]*)\),*/\1,eth_type(0x8100),vlan(vid=99/0xff0,pcp=7/0xe),encap(/ |
157 | s/$/)/' odp-base.txt | |
158 | ||
159 | echo | |
160 | echo '# Valid forms with QOS priority, tunnel, and VLAN headers.' | |
65da723b | 161 | 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 |
162 | s/\(eth([[^)]]*)\),*/\1,eth_type(0x8100),vlan(vid=99,pcp=7),encap(/ |
163 | s/$/)/' odp-base.txt | |
164 | ||
07659514 JS |
165 | echo |
166 | echo '# Valid forms with conntrack fields.' | |
daf4d3c1 | 167 | 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 | 168 | |
e6cc0bab AZ |
169 | echo |
170 | echo '# Valid forms with IP first fragment.' | |
171 | sed -n 's/,frag=no),/,frag=first),/p' odp-base.txt | |
172 | ||
173 | echo | |
174 | echo '# Valid forms with IP later fragment.' | |
175 | sed -n 's/,frag=no),.*/,frag=later)/p' odp-base.txt) > odp.txt | |
176 | AT_CAPTURE_FILE([odp.txt]) | |
eadd1644 | 177 | AT_CHECK_UNQUOTED([ovstest test-odp parse-wc-keys < odp.txt], [0], [`cat odp.txt` |
e6cc0bab AZ |
178 | ]) |
179 | AT_CLEANUP | |
180 | ||
5a0a5702 GS |
181 | AT_SETUP([OVS datapath wildcarded key filtering.]) |
182 | dnl We could add a test for invalid forms, but that's less important. | |
183 | AT_DATA([odp-base.txt], [dnl | |
184 | in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x1234/0xfff0) | |
2d18eae8 | 185 | 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 |
186 | 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) |
187 | 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) | |
188 | 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) | |
189 | 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 | 190 | 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 |
191 | 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) |
192 | 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) | |
193 | ]) | |
194 | AT_DATA([odp-vlan-base.txt], [dnl | |
195 | 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)) | |
196 | 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)) | |
197 | 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)) | |
198 | 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)) | |
199 | ]) | |
200 | AT_DATA([odp-eth-type.txt], [dnl | |
201 | in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x1234/0xfff0) | |
202 | ]) | |
203 | AT_DATA([odp-vlan.txt], [dnl | |
204 | 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)) | |
205 | 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)) | |
206 | ]) | |
207 | AT_DATA([odp-ipv4.txt], [dnl | |
2d18eae8 | 208 | 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 |
209 | ]) |
210 | AT_DATA([odp-icmp.txt], [dnl | |
2d18eae8 | 211 | 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 |
212 | ]) |
213 | AT_DATA([odp-arp.txt], [dnl | |
214 | 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) | |
215 | ]) | |
216 | AT_DATA([odp-tcp.txt], [dnl | |
2d18eae8 | 217 | 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 |
218 | 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) |
219 | ]) | |
220 | AT_DATA([odp-tcp6.txt], [dnl | |
2d18eae8 | 221 | 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 |
222 | 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) |
223 | ]) | |
eadd1644 | 224 | AT_CHECK_UNQUOTED([ovstest test-odp parse-filter filter='dl_type=0x1235' < odp-base.txt], [0], [`cat odp-eth-type.txt` |
5a0a5702 | 225 | ]) |
eadd1644 | 226 | AT_CHECK_UNQUOTED([ovstest test-odp parse-filter filter='dl_vlan=99' < odp-vlan-base.txt], [0], [`cat odp-vlan.txt` |
5a0a5702 | 227 | ]) |
eadd1644 | 228 | AT_CHECK_UNQUOTED([ovstest test-odp parse-filter filter='dl_vlan=99,ip' < odp-vlan-base.txt], [0], [`cat odp-vlan.txt` |
5a0a5702 | 229 | ]) |
eadd1644 | 230 | 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 | 231 | ]) |
eadd1644 | 232 | 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 | 233 | ]) |
eadd1644 | 234 | 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 | 235 | ]) |
eadd1644 | 236 | 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 | 237 | ]) |
eadd1644 | 238 | 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 | 239 | ]) |
eadd1644 | 240 | AT_CHECK_UNQUOTED([ovstest test-odp parse-filter filter='tcp,tp_src=90' < odp-base.txt], [0], [`cat odp-tcp.txt` |
5a0a5702 | 241 | ]) |
eadd1644 | 242 | AT_CHECK_UNQUOTED([ovstest test-odp parse-filter filter='tcp6,tp_src=90' < odp-base.txt], [0], [`cat odp-tcp6.txt` |
5a0a5702 GS |
243 | ]) |
244 | AT_CLEANUP | |
245 | ||
eb1b39b3 BP |
246 | AT_SETUP([OVS datapath actions parsing and formatting - valid forms]) |
247 | AT_DATA([actions.txt], [dnl | |
248 | 1,2,3 | |
7321bda3 NM |
249 | userspace(pid=6633,sFlow(vid=9,pcp=7,output=10),actions) |
250 | userspace(pid=6633,sFlow(vid=9,pcp=7,output=10),actions,tunnel_out_port=10) | |
8e4c1621 JG |
251 | userspace(pid=9765,slow_path(0)) |
252 | userspace(pid=9765,slow_path(0),tunnel_out_port=10) | |
eb1b39b3 | 253 | userspace(pid=9765,slow_path(cfm)) |
8b7ea2d4 | 254 | userspace(pid=9765,slow_path(cfm),tunnel_out_port=10) |
7321bda3 | 255 | userspace(pid=1234567,userdata(0102030405060708090a0b0c0d0e0f),actions) |
8b7ea2d4 | 256 | userspace(pid=1234567,userdata(0102030405060708090a0b0c0d0e0f),tunnel_out_port=10) |
f69f713b | 257 | userspace(pid=6633,flow_sample(probability=123,collector_set_id=1234,obs_domain_id=2345,obs_point_id=3456,output_port=10)) |
4930ea56 | 258 | userspace(pid=6633,flow_sample(probability=123,collector_set_id=1234,obs_domain_id=2345,obs_point_id=3456,output_port=10,ingress)) |
f69f713b | 259 | 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 | 260 | 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 |
261 | userspace(pid=6633,ipfix(output_port=10)) |
262 | userspace(pid=6633,ipfix(output_port=10),tunnel_out_port=10) | |
74c4530d JP |
263 | userspace(pid=6633,controller(reason=1,dont_send=0,continuation=1,recirc_id=4444,rule_cookie=0x5555,controller_id=0,max_len=65535)) |
264 | 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 |
265 | set(in_port(2)) |
266 | set(eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15)) | |
2d18eae8 | 267 | set(eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15/ff:ff:ff:00:00:00)) |
eb1b39b3 BP |
268 | set(eth_type(0x1234)) |
269 | set(ipv4(src=35.8.2.41,dst=172.16.0.20,proto=5,tos=0x80,ttl=128,frag=no)) | |
2d18eae8 JR |
270 | set(ipv4(src=35.8.2.41,dst=172.16.0.20,proto=5,ttl=128,frag=no)) |
271 | set(ipv4(src=35.8.2.41/255.255.255.0,dst=172.16.0.20,proto=5,tos=0x80,ttl=128,frag=no)) | |
272 | set(ipv4(src=35.8.2.41/255.255.255.0,tos=0x80,ttl=128,frag=no)) | |
273 | set(ipv4(tos=0/0x3)) | |
274 | set(ipv4(tos=0x80/0xfc)) | |
275 | set(ipv4(ttl=128,frag=no)) | |
276 | set(ipv4(frag=no)) | |
eb1b39b3 | 277 | set(tcp(src=80,dst=8080)) |
2d18eae8 JR |
278 | set(tcp(src=80/0xff00,dst=8080)) |
279 | set(tcp(src=80)) | |
280 | set(tcp(dst=8080)) | |
eb1b39b3 | 281 | set(udp(src=81,dst=6632)) |
2d18eae8 JR |
282 | set(udp(src=81/0xff00,dst=6632)) |
283 | set(udp(src=81)) | |
284 | set(udp(dst=6633)) | |
61abba80 | 285 | set(sctp(src=82,dst=6633)) |
2d18eae8 JR |
286 | set(sctp(src=82/0xff00,dst=6633)) |
287 | set(sctp(src=82)) | |
288 | set(sctp(dst=6632)) | |
eb1b39b3 BP |
289 | set(icmp(type=1,code=2)) |
290 | set(ipv6(src=::1,dst=::2,label=0,proto=10,tclass=0x70,hlimit=128,frag=no)) | |
2d18eae8 JR |
291 | set(ipv6(src=::1,dst=::2)) |
292 | set(ipv6(label=0,proto=10,tclass=0x70,hlimit=128,frag=no)) | |
293 | set(ipv6(label=0,proto=10,hlimit=128)) | |
294 | set(ipv6(label=0/0xfff,proto=10,tclass=0x70/0x70)) | |
295 | set(ipv6(label=0)) | |
eb1b39b3 | 296 | set(icmpv6(type=1,code=2)) |
4a0a2c24 PB |
297 | set(vlan(vid=5)) |
298 | set(vlan(vid=3,pcp=5)) | |
299 | set(vlan(vid=3,pcp=5,cfi=0)) | |
300 | set(vlan(vid=5/0x3)) | |
301 | set(vlan(vid=5/0x1)),3 | |
eb1b39b3 BP |
302 | push_vlan(vid=12,pcp=0) |
303 | push_vlan(vid=13,pcp=5,cfi=0) | |
304 | push_vlan(tpid=0x9100,vid=13,pcp=5) | |
305 | push_vlan(tpid=0x9100,vid=13,pcp=5,cfi=0) | |
306 | pop_vlan | |
307 | sample(sample=9.7%,actions(1,2,3,push_vlan(vid=1,pcp=2))) | |
8e4c1621 | 308 | set(tunnel(tun_id=0xabcdef1234567890,src=1.1.1.1,dst=2.2.2.2,ttl=64,flags(df|csum|key))) |
65da723b | 309 | set(tunnel(tun_id=0xabcdef1234567890,src=1.1.1.1,dst=2.2.2.2,ttl=64,flags(key))) |
a36de779 | 310 | tnl_pop(4) |
fa47c114 BP |
311 | 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)) |
312 | 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)) | |
313 | 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)) | |
314 | 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)) | |
315 | 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)) | |
316 | 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)) | |
370e373b TLSC |
317 | tnl_push(tnl_port(4),header(size=62,type=3,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)) |
318 | tnl_push(tnl_port(4),header(size=66,type=3,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)) | |
319 | 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)) | |
320 | 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)) | |
321 | 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)) | |
322 | 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 |
323 | ct |
324 | ct(commit) | |
325 | ct(commit,zone=5) | |
8e53fe8c | 326 | ct(commit,mark=0xa0a0a0a0/0xfefefefe) |
9daf2348 | 327 | ct(commit,label=0x1234567890abcdef1234567890abcdef/0xf1f2f3f4f5f6f7f8f9f0fafbfcfdfeff) |
d787ad39 | 328 | ct(commit,helper=ftp) |
40c7b2fc | 329 | ct(commit,helper=tftp) |
9ac0aada JR |
330 | ct(nat) |
331 | ct(commit,nat(src)) | |
332 | ct(commit,nat(dst)) | |
333 | ct(commit,nat(src=10.0.0.240,random)) | |
334 | ct(commit,nat(src=10.0.0.240:32768-65535,random)) | |
335 | ct(commit,nat(dst=10.0.0.128-10.0.0.254,hash)) | |
336 | ct(commit,nat(src=10.0.0.240-10.0.0.254:32768-65535,persistent)) | |
337 | ct(commit,nat(src=fe80::20c:29ff:fe88:a18b,random)) | |
338 | ct(commit,nat(src=fe80::20c:29ff:fe88:1-fe80::20c:29ff:fe88:a18b,random)) | |
339 | ct(commit,nat(src=[[fe80::20c:29ff:fe88:1]]-[[fe80::20c:29ff:fe88:a18b]]:255-4096,random)) | |
340 | ct(commit,helper=ftp,nat(src=10.1.1.240-10.1.1.255)) | |
a76a37ef JR |
341 | ct(force_commit) |
342 | ct(force_commit,zone=5) | |
343 | ct(force_commit,mark=0xa0a0a0a0/0xfefefefe) | |
344 | ct(force_commit,label=0x1234567890abcdef1234567890abcdef/0xf1f2f3f4f5f6f7f8f9f0fafbfcfdfeff) | |
345 | ct(force_commit,helper=ftp) | |
346 | ct(nat) | |
347 | ct(force_commit,nat(src)) | |
348 | ct(force_commit,nat(dst)) | |
349 | ct(force_commit,nat(src=10.0.0.240,random)) | |
350 | ct(force_commit,nat(src=10.0.0.240:32768-65535,random)) | |
351 | ct(force_commit,nat(dst=10.0.0.128-10.0.0.254,hash)) | |
352 | ct(force_commit,nat(src=10.0.0.240-10.0.0.254:32768-65535,persistent)) | |
353 | ct(force_commit,nat(src=fe80::20c:29ff:fe88:a18b,random)) | |
354 | ct(force_commit,nat(src=fe80::20c:29ff:fe88:1-fe80::20c:29ff:fe88:a18b,random)) | |
355 | ct(force_commit,nat(src=[[fe80::20c:29ff:fe88:1]]-[[fe80::20c:29ff:fe88:a18b]]:255-4096,random)) | |
356 | ct(force_commit,helper=ftp,nat(src=10.1.1.240-10.1.1.255)) | |
1fe178d2 | 357 | ct_clear |
aaca4fe0 | 358 | trunc(100) |
c37f7135 AZ |
359 | clone(1) |
360 | clone(clone(push_vlan(vid=12,pcp=0),2),1) | |
eb1b39b3 | 361 | ]) |
eadd1644 | 362 | AT_CHECK_UNQUOTED([ovstest test-odp parse-actions < actions.txt], [0], |
eb1b39b3 BP |
363 | [`cat actions.txt` |
364 | ]) | |
365 | AT_CLEANUP | |
0884990e BP |
366 | |
367 | AT_SETUP([OVS datapath actions parsing and formatting - invalid forms]) | |
368 | dnl This caused a hang in older versions. | |
369 | AT_CHECK([echo 'encap_nsh@:{@' | ovstest test-odp parse-actions | |
370 | ], [0], [dnl | |
371 | odp_actions_from_string: error | |
372 | ]) | |
373 | AT_CLEANUP |