Bug 1032354

Summary: [RFE][rlImport] rlImport should not rely/depend rlJournalStart
Product: [Fedora] Fedora Reporter: JianHong Yin <jiyin>
Component: beakerlibAssignee: Petr Muller <pmuller>
Status: CLOSED WONTFIX QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: unspecified    
Version: 19CC: ohudlick, pmuller, psplicha
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-12-03 14:17:17 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:
Embargoed:

Description JianHong Yin 2013-11-20 02:50:36 UTC
Description of problem:
when we use the rlImport some lib in the head of runtest.sh
always got "BEAKERLIB_JOURNAL not defined in the environment";

so we hope rlImport not depend the rlJournalStart; then
we can write runtest.sh as follow clear format:

# Load beakerlib you needed
rlImport xxx/base  <<<- Hide . beakerlib.sh in Makefile
                   and use rlImport as a "keyword", like import in python
#--------------------------------------------------------------------------
envinfo $PACKAGE

rlJournalStart
    rlPhaseStartSetup ${TEST}-$role-Setup
        rlFileBackup /etc/sysconfig/nfs /etc/exports
    rlPhaseEnd

    rlPhaseStartTest ${TEST}-$role-Test
        rlRun "ls"
    rlPhaseEnd

    rlPhaseStartCleanup ${TEST}-$role-Cleanup
        rlFileRestore
    rlPhaseEnd
#rlJournalPrintText
rlJournalEnd


Test log:
---------------------------------------------------
test -x runtest.sh || chmod a+x runtest.sh
( set +o posix; . /usr/bin/rhts_environment.sh; \
. /usr/share/beakerlib/beakerlib.sh; \
. runtest.sh )
:: [ 07:44:13 ] :: [ INFO    ] :: rlImport: Found 'kernel/base' in /mnt/tests
BEAKERLIB_JOURNAL not defined in the environment
:: [ 07:44:13 ] :: [ INFO    ] :: rlImport: Will try to import kernel/base from /mnt/tests/kernel/Library/base/lib.sh
BEAKERLIB_JOURNAL not defined in the environment  <<<---Nasty output
----------------------------------------------------

Version-Release number of selected component (if applicable):
all version

How reproducible:
always

Steps to Reproduce:
1. use rlImport without pre runing rlJournalStart;
2.
3.

Actual results:
output "BEAKERLIB_JOURNAL not defined in the environment"

Expected results:
not depend rlJournalStart; not output the log "BEAKERLIB_JOURNAL not defined..."

Additional info:

Comment 1 Petr Muller 2013-12-02 15:55:34 UTC
No. This is not Python, and there's no reason to mimic it. We need some infrastructure in place when running rlImport, and rlJournalStart sets up that infrastructure.