Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 618322

Summary: [RFE] add a convenient way to set system-wide environment variables from job XML
Product: [Retired] Beaker Reporter: Ondrej Hudlicky <ohudlick>
Component: beahAssignee: beaker-dev-list
Status: CLOSED EOL QA Contact:
Severity: medium Docs Contact:
Priority: low    
Version: 0.5CC: azelinka, bpeck, mastyk, mcsontos, mvadkert, ohudlick, tools-bugs
Target Milestone: ---Keywords: FutureFeature
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard: Kickstart
Fixed In Version: Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-02-11 12:17:10 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 Ondrej Hudlicky 2010-07-26 16:45:57 UTC
Description of problem:
This technique can find hard to detect bugs on glibc-based systems. It is therefore suggested to always use this flag (at least temporarily) when testing out code or a new distribution.

   export MALLOC_PERTURB_=$(($RANDOM % 255 + 1))

Additional info:
http://lists.fedoraproject.org/pipermail/devel/2010-May/135667.html
http://udrepper.livejournal.com/11429.html

Comment 1 Miroslav Vadkerti 2011-08-23 06:21:54 UTC
Also usage of MALLOC_CHECK_ should be also considered:

export MALLOC_CHECK_=3

For more information see
http://www.gnu.org/s/hello/manual/libc/Heap-Consistency-Checking.html
http://techbase.kde.org/Development/malloc_check

Comment 2 Marian Csontos 2011-08-23 09:39:05 UTC
I have no desire or intention to do this: I see lot of ***[1] flying my way after making this a default.

[1] BZs reporting regressions. There will be people and teams unwilling to participate. I see it better to be able to turn it on.

The easiest way is to add following snippet to the job:

<ks_append>
<![CDATA[
cat >>/etc/profile.d/task-defaults-rhts.sh <<END
export MALLOC_PERTURB_=$(($RANDOM % 255 + 1))
export MALLOC_CHECK_=3
END
]]>
</ks_append>

Comment 4 Petr Šplíchal 2011-08-30 13:23:45 UTC
I guess global environment variable setting for the whole recipe
could be quite a useful feature. What about providing a more user
friendly xml for such variable setting? This could be similar to
that of task parameters:

    <recipe ks_meta="method=nfs" whiteboard="Server">
        <distroRequires>
            ...
        </distroRequires>

        <environment>
            <variable name="X" value="Y"/>
        </environment>

        <task name="/some/task" role="STANDALONE">
            <params>
                <param name="X" value="Y"/>
            </params>
        </task>
        ...
    </recipe>

Then workflows will be able to add the required setting very
easily. This could even be implemented in the common workflow
code. What do you think?

Comment 5 Marian Csontos 2011-08-30 13:44:58 UTC
You may not believe it, but I have a branch which does exactly that!

Get scheduler support it and we are ready to go.

Comment 6 Petr Šplíchal 2011-08-30 14:24:11 UTC
Great! :-) Thanks!

Comment 7 Nick Coghlan 2012-10-17 04:39:05 UTC
Bulk reassignment of issues as Bill has moved to another team.

Comment 9 Martin Styk 2020-02-11 12:17:10 UTC
Beah is no longer supported by Beaker development team.
Instead of that, we are working on Restraint test harness. You can find all the features of Restraint here.

https://restraint.readthedocs.io/en/latest/

If you think your RFE should be still implemented as part of Restraint feel free to create a new BZ ticket.

https://bugzilla.redhat.com/enter_bug.cgi?product=Restraint

In case you have any question feel free to reach out to me
Thank you,
Martin Styk <martin.styk>