Bug 677292 - Variant doesn't get passed to test cases
Summary: Variant doesn't get passed to test cases
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Beaker
Classification: Retired
Component: lab controller
Version: 0.6
Hardware: Unspecified
OS: Unspecified
high
high vote
Target Milestone: ---
Assignee: Bill Peck
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-02-14 09:31 UTC by Alexander Todorov
Modified: 2019-05-22 13:38 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-03-10 05:21:30 UTC


Attachments (Terms of Use)

Description Alexander Todorov 2011-02-14 09:31:36 UTC
Description of problem:
Information about variant doesn't get passed down to test cases using SNAKE templates. This results in broken test cases which rely on this information. See below:

The everything-package-set template is supposed to generate:
%packages
*
-@conflicts-<variant>

The template looks like this:

$ cat everything-package-set.py 
from pykickstart.version import FC6, RHEL6
from installdefaults import InstallKs

# minimal install, procedural style
def ks(**context):
    '''Package set / Everything'''

    ks=InstallKs()
    if ks.version <= FC6:
        ks.packages.add(['@everything'])
    else:
        ks.packages.add(['*'])

    conflicts = "@conflicts"
    variant = ""

    if (ks.version >= RHEL6):
        if context.has_key('variant'):
            variant = context['variant']
        elif context.has_key('VARIANT'):
            variant = context['VARIANT']

    if len(variant) > 0:
        conflicts = "@conflicts-%s" % variant.lower()

    ks.packages.add(['-%s' % conflicts])

    return ks


When scheduled with:
bkr workflow-snake --arch x86_64 --variant Workstation --distro RHEL6-6.0 --snakeserver=snake.devel.redhat.com --template everything-package-set --task=/distribution/reservesys

The generated ks.cfg contains only -@conflicts which is wrong. This results in file conflicts in the transaction. 


I'm marking this as regression because it was working previously, we've used it during RHEL6.0.

Comment 2 Bill Peck 2011-02-14 14:50:00 UTC
Hello,

I'm trying to understand how this could have worked and is now broken.

            snake_args["ksmeta"]["arch"] = arch
            # Create Base Recipe
            recipeTemplate = BeakerRecipe()
            # get kickstart and add it to recipes
            kickstart = snake_server.kickstart.generate(snakeTemplate, snake_args)
            recipeTemplate.addKickstart(kickstart)



Looking through the code I don't see anywhere where we put variant into snake_args.  

Am I right in assuming if the following code was in place this would work?

snake_args["variant"] = kwargs.get("variant","")

Comment 3 Alexander Todorov 2011-02-14 16:45:25 UTC
Hmm,
I'm not sure about this but it could have been the older snake-workflow command which put the variant into snake_args. If this is not the case then please consider this as RFE.

Comment 4 Bill Peck 2011-03-03 18:47:10 UTC
Fixed in git.

Comment 5 Bill Peck 2011-03-03 19:00:08 UTC
This is now available from the beaker-stage repo.

yum --enablerepo=beaker-stage upgrade beaker-redhat


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