Skip to content

Commit

Permalink
Merge pull request #45045 from idryomov/wip-qemu-task-rbd-package
Browse files Browse the repository at this point in the history
qa/tasks/qemu: make sure block-rbd.so is installed

Reviewed-by: Deepika Upadhyay <dupadhya@redhat.com>
  • Loading branch information
idryomov committed Feb 16, 2022
2 parents e1e9ee6 + 8f0fd0a commit 88eb23e
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 0 deletions.
5 changes: 5 additions & 0 deletions qa/suites/rbd/singleton/all/qemu-iotests-no-cache.yaml
Expand Up @@ -3,6 +3,11 @@ roles:
- [mon.a, mgr.x, osd.0, osd.1, client.0]
tasks:
- install:
extra_system_packages:
rpm:
- qemu-kvm-block-rbd
deb:
- qemu-block-extra
- ceph:
fs: xfs
conf:
Expand Down
5 changes: 5 additions & 0 deletions qa/suites/rbd/singleton/all/qemu-iotests-writearound.yaml
Expand Up @@ -3,6 +3,11 @@ roles:
- [mon.a, mgr.x, osd.0, osd.1, client.0]
tasks:
- install:
extra_system_packages:
rpm:
- qemu-kvm-block-rbd
deb:
- qemu-block-extra
- ceph:
fs: xfs
conf:
Expand Down
5 changes: 5 additions & 0 deletions qa/suites/rbd/singleton/all/qemu-iotests-writeback.yaml
Expand Up @@ -3,6 +3,11 @@ roles:
- [mon.a, mgr.x, osd.0, osd.1, client.0]
tasks:
- install:
extra_system_packages:
rpm:
- qemu-kvm-block-rbd
deb:
- qemu-block-extra
- ceph:
fs: xfs
conf:
Expand Down
5 changes: 5 additions & 0 deletions qa/suites/rbd/singleton/all/qemu-iotests-writethrough.yaml
Expand Up @@ -3,6 +3,11 @@ roles:
- [mon.a, mgr.x, osd.0, osd.1, client.0]
tasks:
- install:
extra_system_packages:
rpm:
- qemu-kvm-block-rbd
deb:
- qemu-block-extra
- ceph:
fs: xfs
conf:
Expand Down
21 changes: 21 additions & 0 deletions qa/tasks/qemu.py
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 88eb23e

Please sign in to comment.