Bug 696163

Summary: can't output arbitrary strings
Product: [Fedora] Fedora Reporter: Karel Volný <kvolny>
Component: beakerlibAssignee: Petr Muller <pmuller>
Status: CLOSED ERRATA QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 19CC: ohudlick, pmuller, psplicha, qa-errata-list
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: beakerlib-1.7-1.fc19 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 921695 (view as bug list) Environment:
Last Closed: 2013-05-22 03:18:19 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On:    
Bug Blocks: 921695    

Description Karel Volný 2011-04-13 13:13:55 UTC
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:

Comment 1 Petr Muller 2013-03-14 17:09:36 UTC
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 2 Karel Volný 2013-03-22 12:59:47 UTC
seems that an easy way would be to open RFE for Python to add a new value to the errors argument, somthing like "quote" which would print the numeric value instead of the replacement character :-)

Comment 3 Petr Muller 2013-03-25 00:39:40 UTC
New enough python has this feature, but remember that this needs to run on RHEL4 python too.

Comment 4 Karel Volný 2013-03-28 16:28:09 UTC
(In reply to comment #3)
> New enough python has this feature,

comparing

http://docs.python.org/2/howto/unicode.html

and

http://docs.python.org/3/howto/unicode.html

I don't get the impression that anything has changed in this regard ...?

> but remember that this needs to run on RHEL4 python too.

ahem, RHEL3 is still not dead ...

Comment 5 Fedora End Of Life 2013-04-03 20:30:08 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 19 development cycle.
Changing version to '19'.

(As we did not run this process for some time, it could affect also pre-Fedora 19 development
cycle bugs. We are very sorry. It will help us with cleanup during Fedora 19 End Of Life. Thank you.)

More information and reason for this action is here:
https://fedoraproject.org/wiki/BugZappers/HouseKeeping/Fedora19

Comment 6 Fedora Update System 2013-04-30 15:10:03 UTC
beakerlib-1.7-1.fc19 has been submitted as an update for Fedora 19.
https://admin.fedoraproject.org/updates/beakerlib-1.7-1.fc19

Comment 7 Fedora Update System 2013-04-30 20:03:37 UTC
Package beakerlib-1.7-1.fc19:
* should fix your issue,
* was pushed to the Fedora 19 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing beakerlib-1.7-1.fc19'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2013-7067/beakerlib-1.7-1.fc19
then log in and leave karma (feedback).

Comment 8 Fedora Update System 2013-05-22 03:18:19 UTC
beakerlib-1.7-1.fc19 has been pushed to the Fedora 19 stable repository.  If problems still persist, please make note of it in this bug report.