Skip to content

Commit

Permalink
qa/tasks/qemu: make sure block-rbd.so is installed
Browse files Browse the repository at this point in the history
Fixes: https://tracker.ceph.com/issues/54286
Signed-off-by: Ilya Dryomov <[email protected]>
  • Loading branch information
idryomov committed Feb 15, 2022
1 parent 2f20618 commit 525ff61
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions qa/tasks/qemu.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
from teuthology import misc as teuthology
from teuthology.config import config as teuth_config
from teuthology.orchestra import run
from teuthology.packaging import install_package, remove_package

log = logging.getLogger(__name__)

Expand Down Expand Up @@ -158,6 +159,25 @@ def create_dirs(ctx, config):
]
)

@contextlib.contextmanager
def install_block_rbd_driver(ctx, config):
"""
Make sure qemu rbd block driver (block-rbd.so) is installed
"""
for client, client_config in config.items():
(remote,) = ctx.cluster.only(client).remotes.keys()
if remote.os.package_type == 'rpm':
block_rbd_pkg = 'qemu-kvm-block-rbd'
else:
block_rbd_pkg = 'qemu-block-extra'
install_package(block_rbd_pkg, remote)
try:
yield
finally:
for client, client_config in config.items():
(remote,) = ctx.cluster.only(client).remotes.keys()
remove_package(block_rbd_pkg, remote)

@contextlib.contextmanager
def generate_iso(ctx, config):
"""Execute system commands to generate iso"""
Expand Down Expand Up @@ -660,6 +680,7 @@ def task(ctx, config):
create_images(ctx=ctx, config=config, managers=managers)
managers.extend([
lambda: create_dirs(ctx=ctx, config=config),
lambda: install_block_rbd_driver(ctx=ctx, config=config),
lambda: generate_iso(ctx=ctx, config=config),
lambda: download_image(ctx=ctx, config=config),
])
Expand Down

0 comments on commit 525ff61

Please sign in to comment.