Bug 1136206 - rlIsRHEL should report the syntax error better
Summary: rlIsRHEL should report the syntax error better
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: beakerlib
Version: 20
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
Assignee: Dalibor Pospíšil
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: Fedora-beakerlib-1.10 1136362
TreeView+ depends on / blocked
 
Reported: 2014-09-02 07:32 UTC by Karel Srot
Modified: 2014-12-12 14:51 UTC (History)
3 users (show)

Fixed In Version: beakerlib-1.10-1
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-12-12 14:48:00 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Karel Srot 2014-09-02 07:32:08 UTC
Description of problem:

I had a problem with debugging one test. The test incorrectly uses

rlIsRHEL "<=" 6 

call but since I didn't encounter the problem on the first sight it took me several minutes to find out the root cause.

IMHO the problem is that rlIsRHEL returns exit code 1 on syntax error which is similar to the case when the RHEL version simply doesn't match.

E.g. __INTERNAL_rlIsDistro() contains

  echo $distro | grep -q "$1" || return 1

or

    # sanity check - version needs to consist of numbers/dots/<=>
    [[ "$arg" =~ ^([\<=\>]*)([0-9][0-9\.]*)$ ]] || return 1


I would propose to use different exit code (99 or so) for syntax errors. Some error message on the output would be even better.

version:
beakerlib-1.9-3.el6eso.noarch


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