Bug 1404048

Summary: rpm-test-trigger ignores all messages because b'QE' != 'QE'
Product: [Community] rpm-test-trigger Reporter: Dan Callaghan <dcallagh>
Component: generalAssignee: beaker-dev-list
Status: CLOSED NOTABUG QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: unreleasedCC: bmcivor, dcallagh, jorris, rjoost, tabdy
Target Milestone: ---Keywords: EasyFix
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-12-14 04:35:36 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Dan Callaghan 2016-12-12 23:44:01 UTC
Dec 13 05:39:10 burette.usersys.redhat.com rpm-test-trigger[16426]: 2016-12-13 05:39:09,961 rpmtesttrigger.trigger INFO Ignoring state change to: b'QE' for advisory: 24008. Only listening for QE, NEW_FILES.

Seems like Proton is giving us back the message with strings as raw bytes instead of decoded to unicode, so the comparison always fails.

Unsure why this doesn't reproduce in our tests -- it must be some difference between the messages we are sending in our tests vs. what appears on the real message bus.

Note that the above log message came from my instance of rpm-test-trigger which is hooked up to a local broker receiving messages from the "legacy bridge" service. The legacy bridge is forwarding the messages it receives as is, but need to check at which point the bytes -> unicode decoding should or should not be happening...

Comment 1 Dan Callaghan 2016-12-13 03:01:21 UTC
So the AMQP 1.0 protocol has both binary and string data types, the former is returned as bytes() in Proton, the latter is decoded as UTF-8 and returned as unicode() in Proton.

String (in AMQP land) is clearly the right type here for these messages. That is what we are producing in the test suite. So I think this should be fixed on the legacy bridge side, to ensure that it only deals in unicode values in its messages (so that they become AMQP strings not binary, matching what we are testing in the test suite).

Comment 2 Dan Callaghan 2016-12-14 04:35:36 UTC
So this issue was just with the (at the time, unmerged) legacy bridge code:

https://gerrit.beaker-project.org/5529

I fixed it in patch set 4 of that review.