2012-11-09 10:00:22 -08:00
|
|
|
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
|
2017-09-14 17:00:38 -07:00
|
|
|
00000000 01 00 00 08 00 00 00 01
|
2012-11-09 10:00:22 -08:00
|
|
|
OFPT_HELLO (xid=0x1):
|
|
|
|
version bitmap: 0x01
|
|
|
|
])
|
|
|
|
AT_CHECK([ovs-ofctl encode-hello 0x6], [0], [dnl
|
2017-09-14 17:00:38 -07:00
|
|
|
00000000 02 00 00 08 00 00 00 01
|
2012-11-09 10:00:22 -08:00
|
|
|
OFPT_HELLO (OF1.1) (xid=0x1):
|
|
|
|
version bitmap: 0x01, 0x02
|
|
|
|
])
|
|
|
|
AT_CHECK([ovs-ofctl encode-hello 0xe], [0], [dnl
|
2017-09-14 17:00:38 -07:00
|
|
|
00000000 03 00 00 08 00 00 00 01
|
2012-11-09 10:00:22 -08:00
|
|
|
OFPT_HELLO (OF1.2) (xid=0x1):
|
|
|
|
version bitmap: 0x01, 0x02, 0x03
|
|
|
|
])
|
|
|
|
AT_CHECK([ovs-ofctl encode-hello 0x1e], [0], [dnl
|
2017-09-14 17:00:38 -07:00
|
|
|
00000000 04 00 00 08 00 00 00 01
|
2012-11-27 17:44:22 +02:00
|
|
|
OFPT_HELLO (OF1.3) (xid=0x1):
|
2012-11-09 10:00:22 -08:00
|
|
|
version bitmap: 0x01, 0x02, 0x03, 0x04
|
|
|
|
])
|
2012-11-27 17:44:22 +02:00
|
|
|
AT_CHECK([ovs-ofctl encode-hello 0x3e], [0], [dnl
|
2017-09-14 17:00:38 -07:00
|
|
|
00000000 05 00 00 08 00 00 00 01
|
2014-05-01 13:22:20 +03:00
|
|
|
OFPT_HELLO (OF1.4) (xid=0x1):
|
2012-11-27 17:44:22 +02:00
|
|
|
version bitmap: 0x01, 0x02, 0x03, 0x04, 0x05
|
|
|
|
])
|
2012-11-09 10:00:22 -08:00
|
|
|
|
|
|
|
dnl Some versions below max version missing.
|
|
|
|
AT_CHECK([ovs-ofctl encode-hello 0xc], [0], [dnl
|
2017-09-14 17:00:38 -07:00
|
|
|
00000000 03 00 00 10 00 00 00 01-00 01 00 08 00 00 00 0c
|
2012-11-09 10:00:22 -08:00
|
|
|
OFPT_HELLO (OF1.2) (xid=0x1):
|
|
|
|
version bitmap: 0x02, 0x03
|
|
|
|
])
|
|
|
|
AT_CHECK([ovs-ofctl encode-hello 0xa], [0], [dnl
|
2017-09-14 17:00:38 -07:00
|
|
|
00000000 03 00 00 10 00 00 00 01-00 01 00 08 00 00 00 0a
|
2012-11-09 10:00:22 -08:00
|
|
|
OFPT_HELLO (OF1.2) (xid=0x1):
|
|
|
|
version bitmap: 0x01, 0x03
|
|
|
|
])
|
|
|
|
AT_CHECK([ovs-ofctl encode-hello 0x8], [0], [dnl
|
2017-09-14 17:00:38 -07:00
|
|
|
00000000 03 00 00 10 00 00 00 01-00 01 00 08 00 00 00 08
|
2012-11-09 10:00:22 -08:00
|
|
|
OFPT_HELLO (OF1.2) (xid=0x1):
|
|
|
|
version bitmap: 0x03
|
|
|
|
])
|
|
|
|
AT_CHECK([ovs-ofctl encode-hello 0x4], [0], [dnl
|
2017-09-14 17:00:38 -07:00
|
|
|
00000000 02 00 00 10 00 00 00 01-00 01 00 08 00 00 00 04
|
2012-11-09 10:00:22 -08:00
|
|
|
OFPT_HELLO (OF1.1) (xid=0x1):
|
|
|
|
version bitmap: 0x02
|
|
|
|
])
|
|
|
|
AT_CLEANUP
|
2016-06-13 14:53:01 -07:00
|
|
|
|
|
|
|
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
|