You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@qpid.apache.org by "Chuck Rolke (JIRA)" <ji...@apache.org> on 2016/12/19 21:24:58 UTC

[jira] [Created] (QPIDIT-68) Amqp Types test for binary sends only printable strings

Chuck Rolke created QPIDIT-68:
---------------------------------

             Summary: Amqp Types test for binary sends only printable strings
                 Key: QPIDIT-68
                 URL: https://issues.apache.org/jira/browse/QPIDIT-68
             Project: Apache QPID IT
          Issue Type: Bug
          Components: AMQP Types Test
            Reporter: Chuck Rolke


In the Amqp Types test the binary data is defined in Json. One of the defs is huge but the first four are defined as:
{noformat}
        'binary': [bytes(),
                   bytes(12345),
                   b'Hello, world',
                   b'\\x01\\x02\\x03\\x04\\x05abcde\\x80\\x81\\xfe\\xff',
{noformat}

Adding a little code to instrument the cli argument containing the Json and running a wireshark snoop reveals how these four strings are handled by ProtonCpp.

Note that jira makes it hard to render a backslash character. In these tables the <backslash> token represents on ascii character.

h3. Json command line arg

The json generated by python arrives at ProtonCpp arg four as a string

||position||character||hex||
|0|'['|0x5b|
|1|'"'|0x22|
|2|'"'|0x22|
|3|','|0x2c|
|4|' '|0x20|
|5|'"'|0x22|
|6|'1'|0x31|
|7|'2'|0x32|
|8|'3'|0x33|
|9|'4'|0x34|
|10|'5'|0x35|
|11|'"'|0x22|
|12|','|0x2c|
|13|' '|0x20|
|14|'"'|0x22|
|15|'H'|0x48|
|16|'e'|0x65|
|17|'l'|0x6c|
|18|'l'|0x6c|
|19|'o'|0x6f|
|20|','|0x2c|
|21|' '|0x20|
|22|'w'|0x77|
|23|'o'|0x6f|
|24|'r'|0x72|
|25|'l'|0x6c|
|26|'d'|0x64|
|27|'"'|0x22|
|28|','|0x2c|
|29|' '|0x20|
|30|'"'|0x22|
|31|'backslash'|0x5c|
|32|'backslash'|0x5c|
|33|'x'|0x78|
|34|'0'|0x30|
|35|'1'|0x31|
|36|'backslash'|0x5c|
|37|'backslash'|0x5c|
|38|'x'|0x78|
|39|'0'|0x30|
|40|'2'|0x32|
|41|'backslash'|0x5c|
|42|'backslash'|0x5c|
|43|'x'|0x78|
|44|'0'|0x30|
|45|'3'|0x33|
|46|'backslash'|0x5c|
|47|'backslash'|0x5c|
|48|'x'|0x78|
|49|'0'|0x30|
|50|'4'|0x34|
|51|'backslash'|0x5c|
|52|'backslash'|0x5c|
|53|'x'|0x78|
|54|'0'|0x30|
|55|'5'|0x35|
|56|'a'|0x61|
|57|'b'|0x62|
|58|'c'|0x63|
|59|'d'|0x64|
|60|'e'|0x65|
|61|'backslash'|0x5c|
|62|'backslash'|0x5c|
|63|'x'|0x78|
|64|'8'|0x38|
|65|'0'|0x30|
|66|'backslash'|0x5c|
|67|'backslash'|0x5c|
|68|'x'|0x78|
|69|'8'|0x38|
|70|'1'|0x31|
|71|'backslash'|0x5c|
|72|'backslash'|0x5c|
|73|'x'|0x78|
|74|'f'|0x66|
|75|'e'|0x65|
|76|'backslash'|0x5c|
|77|'backslash'|0x5c|
|78|'x'|0x78|
|79|'f'|0x66|
|80|'f'|0x66|
|81|'"'|0x22|
|82|','|0x2c|

h3. Over the wire
The ProtonCpp does its work and sends messages over the wire.

* The messages are encoded with type A0 (binary:vbin8) and an appropriate length.

||Message||Content||
| 0 | "" <empty message> |
| 1 | "12345" <five bytes with ascii encodings of the numbers> |
| 2 | "Hello, world" |
| 3 | "<backslash>x01<backslash>x02<backslash>x03<backslash>x05<backslash>x05 abcd <backslash>x80<backslash>x81<backslash>xfe<backslash>xff|

The intent of the test appears to have binary, non-printable bytes (0x01, 0x02, 0xff) in the messages but that's not what happens.

Maybe this is something simple like having the double backslashes in the test python code. 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For additional commands, e-mail: dev-help@qpid.apache.org