]> git.proxmox.com Git - mirror_ovs.git/blame - tests/odp.at
AUTHORS: Add Edward Tomasz NapieraƂa.
[mirror_ovs.git] / tests / odp.at
CommitLineData
df2c07f4 1AT_SETUP([OVS datapath parsing and formatting - valid forms])
3bffc610
BP
2AT_DATA([odp-base.txt], [dnl
3in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15)
4in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x1234)
7257b535
BP
5in_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=128,frag=no)
6in_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=128,frag=first)
7in_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=128,frag=later)
8in_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,frag=no),tcp(src=80,dst=8080)
9in_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,frag=no),udp(src=81,dst=6632)
10in_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,frag=no),icmp(type=1,code=2)
11in_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,proto=10,tos=112,frag=no)
12in_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,proto=10,tos=112,frag=first)
13in_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,proto=10,tos=112,frag=later)
14in_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,proto=6,tos=0,frag=no),tcp(src=80,dst=8080)
15in_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,proto=17,tos=0,frag=no),udp(src=6630,dst=22)
16in_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,proto=58,tos=0,frag=no),icmpv6(type=1,code=2)
17in_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,proto=58,tos=0,frag=no),icmpv6(type=135,code=0),nd(target=::3)
18in_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,proto=58,tos=0,frag=no),icmpv6(type=135,code=0),nd(target=::3,sll=00:05:06:07:08:09)
19in_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,proto=58,tos=0,frag=no),icmpv6(type=136,code=0),nd(target=::3,tll=00:0a:0b:0c:0d:0e)
20in_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,proto=58,tos=0,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
BP
21in_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)
22])
23
24(echo '# Valid forms without tun_id or VLAN header.'
25 cat odp-base.txt
26
27 echo
28 echo '# Valid forms with tun_id header.'
29 sed 's/^/tun_id(0x7f10354),/' odp-base.txt
30
31 echo
32 echo '# Valid forms with VLAN header.'
33 sed 's/eth([[^)]]*)/&,vlan(vid=99,pcp=7)/' odp-base.txt
34
35 echo
36 echo '# Valid forms with tun_id and VLAN headers.'
37 sed 's/^/tun_id(0xfedcba9876543210),/
7257b535
BP
38s/eth([[^)]]*)/&,vlan(vid=99,pcp=7)/' odp-base.txt
39
40 echo
41 echo '# Valid forms with IP first fragment.'
42sed -n 's/,frag=no),/,frag=first),/p' odp-base.txt
43
44 echo
45 echo '# Valid forms with IP later fragment.'
46sed -n 's/,frag=no),.*/,frag=later)/p' odp-base.txt) > odp.txt
3bffc610
BP
47AT_CAPTURE_FILE([odp.txt])
48AT_CHECK_UNQUOTED([test-odp < odp.txt], [0], [`cat odp.txt`
49])
50AT_CLEANUP
51
52dnl We could add a test for invalid forms, but that's less important.