X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=tests%2Fodp.at;h=9617af266e04b879daa998425badbccf272c7ae9;hb=617da9cda70c6f11a3e674bc4a81f54e8b77b690;hp=90a11920a68a401e2c57552baa698866a153056f;hpb=fea393b1d6b2729a784b898dbdd48d30d42e3ff7;p=openvswitch diff --git a/tests/odp.at b/tests/odp.at index 90a11920..9617af26 100644 --- a/tests/odp.at +++ b/tests/odp.at @@ -1,6 +1,7 @@ AT_BANNER([datapath parsing and formatting]) -AT_SETUP([OVS datapath parsing and formatting - valid forms]) +AT_SETUP([OVS datapath key parsing and formatting - valid forms]) +dnl We could add a test for invalid forms, but that's less important. AT_DATA([odp-base.txt], [dnl in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15) in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x1234) @@ -45,6 +46,12 @@ s/$/)/' odp-base.txt echo '# Valid forms with tun_id and VLAN headers.' sed 's/^/tun_id(0xfedcba9876543210),/ s/\(eth([[^)]]*)\),*/\1,eth_type(0x8100),vlan(vid=99,pcp=7),encap(/ +s/$/)/' odp-base.txt + + echo + echo '# Valid forms with QOS priority, tun_id, and VLAN headers.' + sed 's/^/priority(1234),tun_id(0xfedcba9876543210),/ +s/\(eth([[^)]]*)\),*/\1,eth_type(0x8100),vlan(vid=99,pcp=7),encap(/ s/$/)/' odp-base.txt echo @@ -55,8 +62,37 @@ sed -n 's/,frag=no),/,frag=first),/p' odp-base.txt echo '# Valid forms with IP later fragment.' sed -n 's/,frag=no),.*/,frag=later)/p' odp-base.txt) > odp.txt AT_CAPTURE_FILE([odp.txt]) -AT_CHECK_UNQUOTED([test-odp < odp.txt], [0], [`cat odp.txt` +AT_CHECK_UNQUOTED([test-odp parse-keys < odp.txt], [0], [`cat odp.txt` ]) AT_CLEANUP -dnl We could add a test for invalid forms, but that's less important. +AT_SETUP([OVS datapath actions parsing and formatting - valid forms]) +AT_DATA([actions.txt], [dnl +1,2,3 +userspace(pid=555666777) +userspace(pid=6633,sFlow(vid=9,pcp=7,output=10)) +userspace(pid=9765,slow_path()) +userspace(pid=9765,slow_path(cfm)) +userspace(pid=9765,slow_path(cfm,match)) +userspace(pid=9123,userdata=0x815309) +set(tun_id(0x7f10354)) +set(in_port(2)) +set(eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15)) +set(eth_type(0x1234)) +set(ipv4(src=35.8.2.41,dst=172.16.0.20,proto=5,tos=0x80,ttl=128,frag=no)) +set(tcp(src=80,dst=8080)) +set(udp(src=81,dst=6632)) +set(icmp(type=1,code=2)) +set(ipv6(src=::1,dst=::2,label=0,proto=10,tclass=0x70,hlimit=128,frag=no)) +set(icmpv6(type=1,code=2)) +push_vlan(vid=12,pcp=0) +push_vlan(vid=13,pcp=5,cfi=0) +push_vlan(tpid=0x9100,vid=13,pcp=5) +push_vlan(tpid=0x9100,vid=13,pcp=5,cfi=0) +pop_vlan +sample(sample=9.7%,actions(1,2,3,push_vlan(vid=1,pcp=2))) +]) +AT_CHECK_UNQUOTED([test-odp parse-actions < actions.txt], [0], + [`cat actions.txt` +]) +AT_CLEANUP