Bug 693653 - Zone changed causes traceback and test stop working
Summary: Zone changed causes traceback and test stop working
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: beakerlib
Version: 19
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ---
Assignee: Petr Muller
QA Contact:
URL:
Whiteboard:
: 695047 709687 (view as bug list)
Depends On:
Blocks: 893060
TreeView+ depends on / blocked
 
Reported: 2011-04-05 08:31 UTC by Petr Sklenar
Modified: 2016-09-20 02:07 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 893060 (view as bug list)
Environment:
Last Closed: 2013-06-27 16:36:10 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
the reproducer (1.95 KB, application/x-sh)
2011-06-01 14:03 UTC, Aleš Mareček
no flags Details

Description Petr Sklenar 2011-04-05 08:31:02 UTC
Description of problem:
Zone changed causes traceback and test stop working

Version-Release number of selected component (if applicable):
beakerlib-redhat-1-4.el6.noarch

How reproducible:
always

Steps to Reproduce:
1.
 cat runtest.sh 
. /usr/bin/rhts-environment.sh
. /usr/share/rhts-library/rhtslib.sh

PACKAGE=coreutils
rlJournalStart

        rlPhaseStartSetup "playing with setting"
        rlRun "cp -f /usr/share/zoneinfo/Europe/London /etc/localtime"
        rlRun 'echo ZONE="Europe/London" > /etc/sysconfig/clock'
        rlRun "date" 0 "`date`"
        rlPhaseEnd

rlJournalPrintText


2. make run causes:

:: [ WARNING  ] :: POSIX mode detected and switched off
:: [ WARNING  ] :: Please fix your test to have /bin/bash shebang
Traceback (most recent call last):
  File "/usr/bin/beakerlib-journalling", line 468, in <module>
    createLog(options.testid, options.severity)
  File "/usr/bin/beakerlib-journalling", line 181, in createLog
    printPhaseLog(nod,severity)
  File "/usr/bin/beakerlib-journalling", line 94, in printPhaseLog
    duration = time.mktime(time.strptime(endtime,timeFormat)) - time.mktime(time.strptime(starttime,timeFormat))
  File "/usr/lib64/python2.6/_strptime.py", line 454, in _strptime_time
    return _strptime(data_string, format)[0]
  File "/usr/lib64/python2.6/_strptime.py", line 325, in _strptime
    (data_string, format))
ValueError: time data u'2011-04-05 04:24:54 EDT' does not match format '%Y-%m-%d %H:%M:%S %Z'
make: *** [run] Error 1

  
Actual results:
traceback, and test fail

Expected results:
no traceback

Additional info:
http://beaker-archive.app.eng.bos.redhat.com/beaker-logs/2011/04/692/69293/142237/1554580///TESTOUT.log

Comment 1 Petr Muller 2011-04-11 12:27:49 UTC
*** Bug 695047 has been marked as a duplicate of this bug. ***

Comment 2 Petr Muller 2011-04-12 08:15:48 UTC
Ugh, this area of python 'time' module is apparently a mine field. I *think* this is actually a Python bug, because u'2011-04-05 04:24:54 EDT' *does* match format
'%Y-%m-%d %H:%M:%S %Z'. But the support for %Z is a gray area according to docs. And I found some bugs in Python tracking tool dancing around this.

Not sure how to fix this. What is the expected result in this case anyways? I guess the ideal would be if beakerlib could just figure out the real duration, but that is quite hard with timezones getting mixed under it's hands.

Considering this is quite special case, would it be acceptable to give up computing duration in this case and say it is unknown because time was messed up somehow? I guess the real pain is the WARN you are getting now.

Comment 3 Petr Sklenar 2011-04-12 09:09:43 UTC
(In reply to comment #2)
> I guess the real pain is the WARN you are getting now.
exactly, I don't care time duration but only these warn ...

Comment 4 Petr Muller 2011-06-01 13:26:58 UTC
*** Bug 709687 has been marked as a duplicate of this bug. ***

Comment 5 Aleš Mareček 2011-06-01 14:03:57 UTC
Created attachment 502275 [details]
the reproducer

Comment 6 Petr Šplíchal 2011-09-16 11:20:28 UTC
(In reply to comment #2)
> Considering this is quite special case, would it be acceptable to give up
> computing duration in this case and say it is unknown because time was messed
> up somehow? I guess the real pain is the WARN you are getting now.

+1 for giving up computing the duration and keeping the correct
test phase status.

Comment 7 Karel Volný 2011-10-17 09:54:35 UTC
I've just experienced this bug too:

http://beaker-archive.app.eng.bos.redhat.com/beaker-logs/2011/10/1435/143598/298867/3294206/TESTOUT.log

Traceback (most recent call last):
  File "/usr/bin/beakerlib-journalling", line 468, in <module>
    createLog(options.testid, options.severity)
  File "/usr/bin/beakerlib-journalling", line 181, in createLog
    printPhaseLog(nod,severity)
  File "/usr/bin/beakerlib-journalling", line 94, in printPhaseLog
    duration = time.mktime(time.strptime(endtime,timeFormat)) - time.mktime(time.strptime(starttime,timeFormat))
  File "/usr/lib/python2.6/_strptime.py", line 454, in _strptime_time
    return _strptime(data_string, format)[0]
  File "/usr/lib/python2.6/_strptime.py", line 325, in _strptime
    (data_string, format))
ValueError: time data u'2011-10-15 00:02:06 EDT' does not match format '%Y-%m-%d %H:%M:%S %Z'
'442120f2-73b8-4b04-b0f6-19fdc1ab5347'



note that there are some avc messages which may be relevant:

http://beaker-archive.app.eng.bos.redhat.com/beaker-logs/2011/10/1435/143598/298867/3294206/17558086/test_log-Setup-avc.log

time->Sat Oct 15 04:02:02 2011
type=AVC msg=audit(1318651322.613:177735): avc:  denied  { recv } for  saddr=10.16.64.14 src=67 daddr=255.255.255.255 dest=68 netif=eth0 scontext=system_u:system_r:dhcpc_t:s0 tcontext=system_u:object_r:unlabeled_t:s0 tclass=packet
----
time->Sat Oct 15 04:02:06 2011
type=AVC msg=audit(1318651326.586:177736): avc:  denied  { recv } for  pid=17417 comm="python" saddr=10.16.64.14 src=67 daddr=255.255.255.255 dest=68 netif=eth0 scontext=system_u:system_r:dhcpc_t:s0 tcontext=system_u:object_r:unlabeled_t:s0 tclass=packet

Comment 8 Petr Sklenar 2012-06-15 12:16:09 UTC
my test is still crying and crying on RHEL7
http://beaker-archive.app.eng.bos.redhat.com/beaker-logs/2012/05/2399/239901/510773/6017922/TESTOUT.log

what's the status of this bug?

Comment 9 Petr Muller 2012-06-29 12:18:40 UTC
(In reply to comment #8)
> what's the status of this bug?

No progress, obviously. I'll try to look into it next week.

Comment 12 Petr Muller 2013-01-08 14:22:42 UTC
beakerlib-1.6-1 is already in fedora

Comment 13 Fedora End Of Life 2013-04-03 20:38:36 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


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