Bug 601126

Summary: $HOME variable not set
Product: [Retired] Beaker Reporter: Petr Šplíchal <psplicha>
Component: beahAssignee: Marian Csontos <mcsontos>
Status: CLOSED CURRENTRELEASE QA Contact: Petr Šplíchal <psplicha>
Severity: medium Docs Contact:
Priority: low    
Version: 0.5CC: azelinka, bpeck, dtian, kbaker, mcermak, mcsontos, ohudlick, rmancy
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: 2011-02-24 09:53:30 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Petr Šplíchal 2010-06-07 09:53:16 UTC
Description of problem:

While running some tests in Beaker I noticed the $HOME variable is
not set, which is causing some tests to fail. For example the top
test checks user config file "~/.toprc". Apparently $HOME is empty
resulting in checking for "/.toprc" file which then fails:

    TopRc=$HOME/.toprc
    ...
    :: [05:00:32] :: Inspecting /.toprc
    cat: /.toprc: No such file or directory

https://beaker.engineering.redhat.com/jobs/2046
https://beaker.engineering.redhat.com/logs/2010/46/2046/3831/32354///TESTOUT.log

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

Comment 1 Marian Csontos 2010-06-07 11:37:09 UTC
The variable is not set in RHTS [1]. As far as that we are "compatible."

Absolutely no problem to add it, but do we really want/need it? Any chance adding it would cause incompatibilities?

[1] http://rhts.redhat.com/cgi-bin/rhts/test_log.cgi?id=13391149

Comment 2 Petr Šplíchal 2010-06-07 13:16:41 UTC
Regarding "Do we really want it?": I guess so. Any action which
expects $HOME to be set results usually in placing some unwanted
files into root directory. See my example above, or another clear
case is rpm -i *.src.rpm which in last versions places the files
into user's home dir. Don't know of any incompatibility or problem.

Comment 3 Ales Zelinka 2010-06-08 09:32:18 UTC
I can confirm that RHTS and Beaker are consistent in not having HOME set:

http://rhts.redhat.com/cgi-bin/rhts/jobs.cgi?id=161802&type=Single
https://beaker.engineering.redhat.com/jobs/2198
Both failures are caused by rpm installing source package into $HOME/rpmbuild and expecting that to be /root/rpmbuild

Could it be rhel5 vs rhel6 issue?

Comment 4 Martin Cermak 2010-06-08 10:58:30 UTC
I also noticed this in [1]. After consultation with pmuller I added
[ -z $HOME ] && HOME="/root"
to /CoreOS/libtdb/Sanity/built-in-sanity-test

[1] http://rhts.redhat.com/cgi-bin/rhts/test_log.cgi?id=14378305

Comment 5 Petr Šplíchal 2010-06-16 13:41:59 UTC
Another example of failed ipython test:

    https://beaker.engineering.redhat.com/logs/2010/11/3311/6276/61533///TESTOUT.log

    FATAL ERROR: undefined $HOME, IPython can not proceed.
    Exiting.

Can we get the $HOME variable set?

Comment 6 Marian Csontos 2010-07-20 12:07:16 UTC
This will be delivered as beah-0.6.9 this Wednesday.

Comment 7 Petr Šplíchal 2010-07-23 08:01:57 UTC
This does not seems to be fixed. I ran the "top" test without the
workaround and it failed again:

    https://beaker.engineering.redhat.com/jobs/8618

while with the workaround

    [ -z "$HOME" ] && export HOME="/root"

works fine:

    https://beaker.engineering.redhat.com/jobs/8574

Comment 8 Marian Csontos 2010-07-23 08:24:19 UTC
Lack of concentration.

Comment 9 Marian Csontos 2010-07-27 18:04:25 UTC
This is now really fixed in beah-0.6.10-1 and will be delivered tomorrow.

https://beaker-stage.app.eng.bos.redhat.com/jobs/1250

Comment 12 Bill Peck 2011-02-14 14:57:56 UTC
Marian, any idea?

Comment 13 Marian Csontos 2011-02-14 21:29:12 UTC
Yeah I have an idea: it's the rhts-compat thing is not entirely "compatible" with non-compat. Easy fix.

Comment 14 Marian Csontos 2011-02-16 13:11:44 UTC
One-liner. Pushed directly to master:

  http://git.fedorahosted.org/git?p=beah.git;a=commit;h=a8f1babacb3dc5639554b6b06bb8de7bb9a6f324

Comment 15 Martin Cermak 2011-02-16 13:54:00 UTC
What about writing some beaker regression test (for beaker)? Does anything like that exist? Testing of $HOME could be one of subtests.

Comment 16 Marian Csontos 2011-02-16 21:53:44 UTC
(In reply to comment #15)
> What about writing some beaker regression test (for beaker)? Does anything like
> that exist? Testing of $HOME could be one of subtests.

I added this check to one of the tests.

Comment 17 Marian Csontos 2011-02-18 12:58:15 UTC
The package is available on beaker-stage.

Comment 19 Petr Šplíchal 2011-02-21 09:56:56 UTC
I'm not able to verify the fix, beah fails to install the task,
re-submitting with "make tag && make bkradd" did not help:

https://beaker-stage.app.eng.bos.redhat.com/jobs/2215
https://beaker-stage.app.eng.bos.redhat.com/jobs/2216

Comment 20 Marian Csontos 2011-02-21 11:55:43 UTC
You have to:
- upload the task to beaker-stage [1] or
- use harness from stage on production server - need to set a repo

https://engineering.redhat.com/trac/rhat/wiki/BeakerUserGuide#Usingbeaker-stage

Comment 21 Petr Šplíchal 2011-02-21 12:29:00 UTC
(In reply to comment #20)
> You have to:
> - upload the task to beaker-stage [1] or
> - use harness from stage on production server - need to set a repo

I did use the first method mentioned above, see the update date:

    https://beaker-stage.app.eng.bos.redhat.com/tasks/1918

However the package still could not be found. Even after re-submit
as I've mentioned in comment 19.

Comment 22 Marian Csontos 2011-02-21 13:24:47 UTC
Petr: Try method 2 please. We have had a related bug reported, but can not find details.

Bill: beaker-stage is not picking tasks. I looked into repo files and the task is not there at all. Any ideas?

Comment 23 Dayong Tian 2011-02-22 03:31:45 UTC
I met the same issue when I ran SRPM tests, and I submited a ticket https://engineering.redhat.com/rt3/Ticket/Display.html?id=102529.

Comment 24 Marian Csontos 2011-02-22 06:52:42 UTC
(In reply to comment #23)
> I met the same issue when I ran SRPM tests, and I submited a ticket
> https://engineering.redhat.com/rt3/Ticket/Display.html?id=102529.

I can not access the ticket.

In case it is re: HOME env.variable: close the ticket, please. eng-ops has nothing to do with it.

Comment 25 Dayong Tian 2011-02-22 07:12:41 UTC
(In reply to comment #24)
> (In reply to comment #23)
> > I met the same issue when I ran SRPM tests, and I submited a ticket
> > https://engineering.redhat.com/rt3/Ticket/Display.html?id=102529.
> 
> I can not access the ticket.
> 
> In case it is re: HOME env.variable: close the ticket, please. eng-ops has
> nothing to do with it.

eng-ops forwarded the ticket to errata-admin@, following is the content of ticket:

I ran SRPM tests on i386/x86_64/ppc64/s390x with
kernel-2.6.32-71.18.1.el6, all the /kernel/errata/srpm-rebuild tests
failed, the job link is:

https://beaker.engineering.redhat.com/jobs/54169

From the TESTOUT.log, I found when it started to run, the rpmbuild path
is wrong, it should be "/root/rpmbuild/BUILD":
------------------
Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.w9fW8y
+ umask 022
+ cd /rpmbuild/BUILD
------------------

The value of $HOME is wrong may be the reason, could you please take a look?

Comment 26 Petr Šplíchal 2011-02-22 07:47:02 UTC
(In reply to comment #22)
> Petr: Try method 2 please. We have had a related bug reported,
> but can not find details.

I've tested the updated harness on production Beaker and
everything now seems to be ok. Thanks for the fix.

https://beaker.engineering.redhat.com/jobs/54847

Comment 27 Marian Csontos 2011-02-22 07:51:29 UTC
Thanks Petre.

Dayong: update the ticket with BZ # please. Let's avoid errata-admin wasting their time...

Comment 28 Dayong Tian 2011-02-22 08:00:07 UTC
(In reply to comment #27)
> Thanks Petre.
> 
> Dayong: update the ticket with BZ # please. Let's avoid errata-admin wasting
> their time...

Sure, already done that.