Skip to content

Commit

Permalink
qa/rgw: patch keystone requirements.txt
Browse files Browse the repository at this point in the history
an ugly workaround for a python dependency conflict that's broken the
rgw/tempest suite. allows us to preserve the pinned versions of
keystone/tempest without having to maintain a fork of the keystone
repository

Fixes: http://tracker.ceph.com/issues/23659

Signed-off-by: Casey Bodley <cbodley@redhat.com>
(cherry picked from commit 338b97a)
  • Loading branch information
cbodley authored and Prashant D committed Aug 28, 2018
1 parent 3f81140 commit 4ebc2a7
Showing 1 changed file with 34 additions and 30 deletions.
64 changes: 34 additions & 30 deletions qa/tasks/keystone.py
Expand Up @@ -45,6 +45,28 @@ def install_packages(ctx, config):
for dep in deps[remote.os.package_type]:
remove_package(dep, remote)

def get_keystone_dir(ctx):
return '{tdir}/keystone'.format(tdir=teuthology.get_testdir(ctx))

def run_in_keystone_dir(ctx, client, args):
ctx.cluster.only(client).run(
args=[ 'cd', get_keystone_dir(ctx), run.Raw('&&'), ] + args,
)

def run_in_keystone_venv(ctx, client, args):
run_in_keystone_dir(ctx, client,
[ 'source',
'.tox/venv/bin/activate',
run.Raw('&&')
] + args)

def get_keystone_venved_cmd(ctx, cmd, args):
kbindir = get_keystone_dir(ctx) + '/.tox/venv/bin/'
return [ kbindir + 'python', kbindir + cmd ] + args

def get_toxvenv_dir(ctx):
return ctx.tox.venv_path

@contextlib.contextmanager
def download(ctx, config):
"""
Expand All @@ -56,59 +78,41 @@ def download(ctx, config):
"""
assert isinstance(config, dict)
log.info('Downloading keystone...')
testdir = teuthology.get_testdir(ctx)
keystonedir = get_keystone_dir(ctx)

for (client, cconf) in config.items():
ctx.cluster.only(client).run(
args=[
'git', 'clone',
'-b', cconf.get('force-branch', 'master'),
'https://github.com/openstack/keystone.git',
'{tdir}/keystone'.format(tdir=testdir),
keystonedir,
],
)

sha1 = cconf.get('sha1')
if sha1 is not None:
ctx.cluster.only(client).run(
args=[
'cd', '{tdir}/keystone'.format(tdir=testdir),
run.Raw('&&'),
run_in_keystone_dir(ctx, client, [
'git', 'reset', '--hard', sha1,
],
)

# hax for http://tracker.ceph.com/issues/23659
run_in_keystone_dir(ctx, client, [
'sed', '-i',
's/pysaml2<4.0.3,>=2.4.0/pysaml2>=4.5.0/',
'requirements.txt'
],
)
try:
yield
finally:
log.info('Removing keystone...')
testdir = teuthology.get_testdir(ctx)
for client in config:
ctx.cluster.only(client).run(
args=[ 'rm', '-rf', '{tdir}/keystone'.format(tdir=testdir) ],
args=[ 'rm', '-rf', keystonedir ],
)

def get_keystone_dir(ctx):
return '{tdir}/keystone'.format(tdir=teuthology.get_testdir(ctx))

def run_in_keystone_dir(ctx, client, args):
ctx.cluster.only(client).run(
args=[ 'cd', get_keystone_dir(ctx), run.Raw('&&'), ] + args,
)

def run_in_keystone_venv(ctx, client, args):
run_in_keystone_dir(ctx, client,
[ 'source',
'.tox/venv/bin/activate',
run.Raw('&&')
] + args)

def get_keystone_venved_cmd(ctx, cmd, args):
kbindir = get_keystone_dir(ctx) + '/.tox/venv/bin/'
return [ kbindir + 'python', kbindir + cmd ] + args

def get_toxvenv_dir(ctx):
return ctx.tox.venv_path

@contextlib.contextmanager
def setup_venv(ctx, config):
"""
Expand Down

0 comments on commit 4ebc2a7

Please sign in to comment.