X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=tests%2Fofp-print.at;h=bcf9d2c70e472787d24c7fffb9cf8275faf4c80a;hb=568e23fc2772235204dcabb61e1425b312070da2;hp=963f13c9acae830a97d9ced6eb0bca360e60c130;hpb=8087f5ff825cae3a699e5a60ca6dd0deb10fc8e5;p=openvswitch diff --git a/tests/ofp-print.at b/tests/ofp-print.at index 963f13c9..bcf9d2c7 100644 --- a/tests/ofp-print.at +++ b/tests/ofp-print.at @@ -45,6 +45,7 @@ AT_SETUP([OFPT_HELLO - ordinary]) AT_KEYWORDS([ofp-print]) AT_CHECK([ovs-ofctl ofp-print 0100000800000000], [0], [dnl OFPT_HELLO (xid=0x0): + version bitmap: 0x01 ]) AT_CLEANUP @@ -53,7 +54,92 @@ AT_KEYWORDS([ofp-print]) AT_CHECK([ovs-ofctl ofp-print 0100001300000000657874726120646174610a], [0], [dnl OFPT_HELLO (xid=0x0): -00000000 65 78 74 72 61 20 64 61-74 61 0a |extra data. | + version bitmap: 0x01 + unknown data in hello: +00000000 01 00 00 13 00 00 00 00-65 78 74 72 61 20 64 61 |........extra da| +00000010 74 61 0a |ta. | +]) +AT_CLEANUP + +AT_SETUP([OFPT_HELLO with version bitmap]) +AT_KEYWORDS([ofp-print]) +AT_CHECK([ovs-ofctl ofp-print "01 00 00 10 00 00 00 00 00 01 00 08 00 00 00 f0"], [0], +[dnl +OFPT_HELLO (xid=0x0): + version bitmap: 0x04, 0x05, 0x06, 0x07 +]) +AT_CLEANUP + +AT_SETUP([OFPT_HELLO with version bitmap and extra data]) +AT_KEYWORDS([ofp-print]) +AT_CHECK([ovs-ofctl ofp-print "\ +01 00 00 1b 00 00 00 00 ff ff 00 06 01 02 00 00 \ +00 01 00 08 00 00 00 f0 61 62 63"], [0], +[dnl +OFPT_HELLO (xid=0x0): + version bitmap: 0x04, 0x05, 0x06, 0x07 + unknown data in hello: +00000000 01 00 00 1b 00 00 00 00-ff ff 00 06 01 02 00 00 |................| +00000010 00 01 00 08 00 00 00 f0-61 62 63 |........abc | +]) +AT_CLEANUP + +AT_SETUP([OFPT_HELLO with higher than supported version]) +AT_KEYWORDS([ofp-print]) +AT_CHECK([ovs-ofctl ofp-print "0f 00 00 08 00 00 00 00"], [0], +[dnl +OFPT_HELLO (OF 0x0f) (xid=0x0): + version bitmap: 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f +]) +AT_CHECK([ovs-ofctl ofp-print "40 00 00 08 00 00 00 00"], [0], +[dnl +OFPT_HELLO (OF 0x40) (xid=0x0): + version bitmap: 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f +]) +AT_CHECK([ovs-ofctl ofp-print "3f 00 00 18 00 00 00 00 00 01 00 0c aa aa aa aa aa aa aa aa 00 00 00 00"], [0], +[dnl +OFPT_HELLO (OF 0x3f) (xid=0x0): + version bitmap: 0x01, 0x03, 0x05, 0x07, 0x09, 0x0b, 0x0d, 0x0f, 0x11, 0x13, 0x15, 0x17, 0x19, 0x1b, 0x1d, 0x1f +]) +AT_CLEANUP + +AT_SETUP([OFPT_HELLO with contradictory version bitmaps]) +AT_KEYWORDS([ofp-print]) +dnl Bitmap claims support for no versions at all. +AT_CHECK([ovs-ofctl '-vPATTERN:console:%c|%p|%m' ofp-print "01 00 00 10 00 00 00 00 00 01 00 08 00 00 00 00"], [0], +[OFPT_HELLO (xid=0x0): + version bitmap: 0x01 + unknown data in hello: +00000000 01 00 00 10 00 00 00 00-00 01 00 08 00 00 00 00 |................| +], [dnl +ofp_util|WARN|peer does not support any OpenFlow version (between 0x01 and 0x1f) +]) +dnl Bitmap claims support for only versions above 0x1f. +AT_CHECK([ovs-ofctl '-vPATTERN:console:%c|%p|%m' ofp-print "3f 00 00 18 00 00 00 00 00 01 00 0c 00 00 00 00 aa aa aa aa 00 00 00 00"], [0], +[OFPT_HELLO (OF 0x3f) (xid=0x0): + version bitmap: 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f + unknown data in hello: +00000000 3f 00 00 18 00 00 00 00-00 01 00 0c 00 00 00 00 |?...............| +00000010 aa aa aa aa 00 00 00 00- |........ | +], [dnl +ofp_util|WARN|peer does not support any OpenFlow version (between 0x01 and 0x1f) +]) +dnl Bitmap claims support for nonexistent version 0x00. +AT_CHECK([ovs-ofctl '-vPATTERN:console:%c|%p|%m' ofp-print "01 00 00 10 00 00 00 00 00 01 00 08 00 00 00 f1"], [0], [dnl +OFPT_HELLO (xid=0x0): + version bitmap: 0x04, 0x05, 0x06, 0x07 +], [dnl +ofp_util|WARN|peer claims to support invalid OpenFlow version 0x00 +]) +dnl Bitmap claims support for only nonexistent version 0x00. +AT_CHECK([ovs-ofctl '-vPATTERN:console:%c|%p|%m' ofp-print "01 00 00 10 00 00 00 00 00 01 00 08 00 00 00 01"], [0], [dnl +OFPT_HELLO (xid=0x0): + version bitmap: 0x01 + unknown data in hello: +00000000 01 00 00 10 00 00 00 00-00 01 00 08 00 00 00 01 |................| +], [dnl +ofp_util|WARN|peer claims to support invalid OpenFlow version 0x00 +ofp_util|WARN|peer does not support any OpenFlow version (between 0x01 and 0x1f) ]) AT_CLEANUP @@ -142,7 +228,7 @@ actions: OUTPUT SET_VLAN_VID SET_VLAN_PCP STRIP_VLAN SET_DL_SRC SET_DL_DST SET_N LOCAL(br0): addr:50:54:00:00:00:01 config: PORT_DOWN state: LINK_DOWN - speed: 100 Mbps now, 100 Mbps max + speed: 0 Mbps now, 0 Mbps max ]) AT_CLEANUP