Bug 921695 - can't output arbitrary strings
Summary: can't output arbitrary strings
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat QA Process
Classification: Red Hat
Component: beakerlib
Version: 1.8.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Petr Muller
QA Contact:
URL:
Whiteboard:
Depends On: 696163
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-03-14 17:11 UTC by Petr Muller
Modified: 2016-09-20 02:09 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of: 696163
Environment:
Last Closed: 2013-06-27 16:03:12 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Petr Muller 2013-03-14 17:11:06 UTC
+++ This bug was initially created as a clone of Bug #696163 +++

Description of problem:
Within the test
/CoreOS/ypserv/Regression/bz681699-yppasswdd-x-has-garbage-prefixed-to-username
I need to check for output containing garbage.
And I'd like to know what the garbage looked like.
I can echo the string on stdout and see it in the results log, but I can't see that in test protocol, as any attempt to pass the string via rlFail or other functions ends in traceback.

Version-Release number of selected component (if applicable):
beakerlib-1.3-3.el5.noarch

How reproducible:
always

Steps to Reproduce:
1. rlFail $'\xFF'
  
Actual results:
Traceback (most recent call last):
  File "/usr/bin/beakerlib-journalling", line 474, in ?
    addTest(options.testid, options.message, result)
  File "/usr/bin/beakerlib-journalling", line 388, in addTest
    msg.setAttribute("message", unicode(message,'utf-8').translate(xmlTrans))
UnicodeDecodeError: 'utf8' codec can't decode byte 0xff in position 0: unexpected code byte

Expected results:
:: [   FAIL   ] :: <FF>

Additional info:

--- Additional comment from Petr Muller on 2013-03-14 13:09:36 EDT ---

I have not found an easy way to stringify the byte value itself, but I have fixed the traceback by replacing the garbage by the UTF replacement character, so the output not looks like this:

$ rlFail $'\xFF'
:: [   FAIL   ] :: �

http://git.fedorahosted.org/cgit/beakerlib.git/commit
/?id=e8bae52f99b92e37bdd4764ff26aac59f6f331c5

Comment 1 Petr Muller 2013-05-27 13:34:54 UTC
Packages with this fix are present in the testing repository and should hit Beaker instance repositories soon. Until then, you can test the packages by enabling the testing repository:

http://nest.test.redhat.com/mnt/qa/scratch/pmuller/beakerlib-testing-rhel/$releasever

This is integrated in workflow-tomorrow so you can use the following option to use the testing version in your jobs:

$ bkr workflow-tomorrow --setup=beakerlib

Comment 2 Petr Muller 2013-06-27 16:03:12 UTC
The packages containing fix for this issue are present in Beaker instance repositories.


Note You need to log in before you can comment on or make changes to this bug.