Bug 601126 - $HOME variable not set
$HOME variable not set
Status: CLOSED CURRENTRELEASE
Product: Beaker
Classification: Community
Component: beah (Show other bugs)
0.5
All Linux
low Severity medium (vote)
: 0.6.05
: ---
Assigned To: Marian Csontos
Petr Šplíchal
: Reopened
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2010-06-07 05:53 EDT by Petr Šplíchal
Modified: 2016-05-31 21:39 EDT (History)
8 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2011-02-24 04:53:30 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Petr Šplíchal 2010-06-07 05:53:16 EDT
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 07:37:09 EDT
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 09:16:41 EDT
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 05:32:18 EDT
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 06:58:30 EDT
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 09:41:59 EDT
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 08:07:16 EDT
This will be delivered as beah-0.6.9 this Wednesday.
Comment 7 Petr Šplíchal 2010-07-23 04:01:57 EDT
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 04:24:19 EDT
Lack of concentration.
Comment 9 Marian Csontos 2010-07-27 14:04:25 EDT
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 09:57:56 EST
Marian, any idea?
Comment 13 Marian Csontos 2011-02-14 16:29:12 EST
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 08:11:44 EST
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 08:54:00 EST
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 16:53:44 EST
(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 07:58:15 EST
The package is available on beaker-stage.
Comment 19 Petr Šplíchal 2011-02-21 04:56:56 EST
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 06:55:43 EST
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 07:29:00 EST
(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 08:24:47 EST
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-21 22:31:45 EST
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 01:52:42 EST
(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 02:12:41 EST
(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 02:47:02 EST
(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 02:51:29 EST
Thanks Petre.

Dayong: update the ticket with BZ # please. Let's avoid errata-admin wasting their time...
Comment 28 Dayong Tian 2011-02-22 03:00:07 EST
(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.

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