2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-21 17:37:37 +00:00
ovs/tests/ofp-util.at
Ben Pfaff 327a39b6ec util: Avoid trailing white space in hex dumps.
ovs_hex_dump() sometimes yields a trailing space in its output.  This is
annoying for the test infrastructure, since we have to specially mark the
trailing white space in Autotest with a "@&t@" marker at the end of the
line.  This commit gets rid of the trailing white space and the annoying
"@&t@" markers.

This also gets rid of an occasional trailing hyphen.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Russell Bryant <russell@ovn.org>
2017-10-06 20:52:24 -07:00

96 lines
2.3 KiB
Plaintext

AT_BANNER([OpenFlow utilities])
AT_SETUP([encoding hellos])
dnl All versions up to a max version supported:
AT_CHECK([ovs-ofctl encode-hello 0x2], [0], [dnl
00000000 01 00 00 08 00 00 00 01
OFPT_HELLO (xid=0x1):
version bitmap: 0x01
])
AT_CHECK([ovs-ofctl encode-hello 0x6], [0], [dnl
00000000 02 00 00 08 00 00 00 01
OFPT_HELLO (OF1.1) (xid=0x1):
version bitmap: 0x01, 0x02
])
AT_CHECK([ovs-ofctl encode-hello 0xe], [0], [dnl
00000000 03 00 00 08 00 00 00 01
OFPT_HELLO (OF1.2) (xid=0x1):
version bitmap: 0x01, 0x02, 0x03
])
AT_CHECK([ovs-ofctl encode-hello 0x1e], [0], [dnl
00000000 04 00 00 08 00 00 00 01
OFPT_HELLO (OF1.3) (xid=0x1):
version bitmap: 0x01, 0x02, 0x03, 0x04
])
AT_CHECK([ovs-ofctl encode-hello 0x3e], [0], [dnl
00000000 05 00 00 08 00 00 00 01
OFPT_HELLO (OF1.4) (xid=0x1):
version bitmap: 0x01, 0x02, 0x03, 0x04, 0x05
])
dnl Some versions below max version missing.
AT_CHECK([ovs-ofctl encode-hello 0xc], [0], [dnl
00000000 03 00 00 10 00 00 00 01-00 01 00 08 00 00 00 0c
OFPT_HELLO (OF1.2) (xid=0x1):
version bitmap: 0x02, 0x03
])
AT_CHECK([ovs-ofctl encode-hello 0xa], [0], [dnl
00000000 03 00 00 10 00 00 00 01-00 01 00 08 00 00 00 0a
OFPT_HELLO (OF1.2) (xid=0x1):
version bitmap: 0x01, 0x03
])
AT_CHECK([ovs-ofctl encode-hello 0x8], [0], [dnl
00000000 03 00 00 10 00 00 00 01-00 01 00 08 00 00 00 08
OFPT_HELLO (OF1.2) (xid=0x1):
version bitmap: 0x03
])
AT_CHECK([ovs-ofctl encode-hello 0x4], [0], [dnl
00000000 02 00 00 10 00 00 00 01-00 01 00 08 00 00 00 04
OFPT_HELLO (OF1.1) (xid=0x1):
version bitmap: 0x02
])
AT_CLEANUP
AT_SETUP([parsing key-value pairs])
dnl Key-only basics.
AT_CHECK([ovs-ofctl parse-key-value a a,b 'a b' 'a b' 'a
b'], 0, [a
a, b
a, b
a, b
a, b
])
dnl Key-value basics.
AT_CHECK([ovs-ofctl parse-key-value a:b a=b a:b,c=d 'a=b c' 'a(b)' 'a(b),c(d)'], 0,
[a=b
a=b
a=b, c=d
a=b, c
a=b
a=b, c=d
])
dnl Values that contain nested delimiters.
AT_CHECK([ovs-ofctl parse-key-value 'a:(b,c)' 'a:b(c,d)e' 'a(b,c(d,e),f)'], 0,
[a=(b,c)
a=b(c,d)e
a=b,c(d,e),f
])
dnl Extraneous delimiters.
AT_CHECK([ovs-ofctl parse-key-value a,,b ',a b' ' a b ,'], 0, [a, b
a, b
a, b
])
dnl Missing right parentheses.
dnl
dnl m4 can't handle unbalanced parentheses so we use @{:@, which
dnl Autotest replaces by a left parenthesis.
AT_CHECK([ovs-ofctl parse-key-value 'a@{:@b' 'a@{:@b(c)' 'a=b@{:@c'], 0, [a=b
a=b(c)
a=b@{:@c
])
AT_CLEANUP