def test_mds_is_up(self, node, host):
hostname = node["vars"]["inventory_hostname"]
if node['docker']:
- docker_exec_cmd = 'docker exec ceph-mds-{hostname}'.format(hostname=hostname)
+ container_binary = 'docker'
+ if host.exists('podman') and host.ansible("setup")["ansible_facts"]["ansible_distribution"] == 'Fedora': # noqa E501
+ container_binary = 'podman'
+ docker_exec_cmd = '{container_binary} exec ceph-mds-{hostname}'.format(
+ hostname=hostname, container_binary=container_binary)
else:
docker_exec_cmd = ''
assert host.service(service_name).is_enabled
def test_mgr_is_up(self, node, host):
- hostname=node["vars"]["inventory_hostname"]
- cluster=node["cluster_name"]
+ hostname = node["vars"]["inventory_hostname"]
+ cluster = node["cluster_name"]
if node['docker']:
- docker_exec_cmd = 'docker exec ceph-mgr-{hostname}'.format(hostname=hostname)
+ container_binary = 'docker'
+ if host.exists('podman') and host.ansible("setup")["ansible_facts"]["ansible_distribution"] == 'Fedora': # noqa E501
+ container_binary = 'podman'
+ docker_exec_cmd = '{container_binary} exec ceph-mgr-{hostname}'.format(
+ hostname=hostname, container_binary=container_binary)
else:
docker_exec_cmd = ''
cmd = "sudo {docker_exec_cmd} ceph --name mgr.{hostname} --keyring /var/lib/ceph/mgr/{cluster}-{hostname}/keyring --cluster={cluster} --connect-timeout 5 -f json -s".format(
hostname = node["vars"]["inventory_hostname"]
cluster = node['cluster_name']
if node['docker']:
- docker_exec_cmd = 'docker exec ceph-nfs-{hostname}'.format(hostname=hostname)
+ container_binary = 'docker'
+ if host.exists('podman') and host.ansible("setup")["ansible_facts"]["ansible_distribution"] == 'Fedora': # noqa E501
+ container_binary = 'podman'
+ docker_exec_cmd = '{container_binary} exec ceph-nfs-{hostname}'.format(
+ hostname=hostname, container_binary=container_binary)
else:
docker_exec_cmd = ''
cmd = "sudo {docker_exec_cmd} ceph --name client.rgw.{hostname} --keyring /var/lib/ceph/radosgw/{cluster}-rgw.{hostname}/keyring --cluster={cluster} --connect-timeout 5 -f json -s".format(
@pytest.mark.docker
def test_all_docker_osds_are_up_and_in(self, node, host):
- osd_id = host.check_output(
- "docker ps -q --filter='name=ceph-osd' | head -1")
- cmd = "sudo docker exec {osd_id} ceph --cluster={cluster} --connect-timeout 5 --keyring /var/lib/ceph/bootstrap-osd/{cluster}.keyring -n client.bootstrap-osd osd tree -f json".format(
+ container_binary = 'docker'
+ if host.exists('podman') and host.ansible("setup")["ansible_facts"]["ansible_distribution"] == 'Fedora': # noqa E501
+ container_binary = 'podman'
+ osd_id = host.check_output(os.path.join(
+ container_binary + " ps -q --filter='name=ceph-osd' | head -1"))
+ cmd = "sudo {container_binary} exec {osd_id} ceph --cluster={cluster} --connect-timeout 5 --keyring /var/lib/ceph/bootstrap-osd/{cluster}.keyring -n client.bootstrap-osd osd tree -f json".format(
osd_id=osd_id,
- cluster=node["cluster_name"]
+ cluster=node["cluster_name"],
+ container_binary=container_binary
)
output = json.loads(host.check_output(cmd))
assert node["num_osds"] == self._get_nb_up_osds_from_ids(node, output)
assert host.service(service_name).is_enabled
def test_rbd_mirror_is_up(self, node, host):
- hostname=node["vars"]["inventory_hostname"]
- cluster=node["cluster_name"]
+ hostname = node["vars"]["inventory_hostname"]
+ cluster = node["cluster_name"]
daemons = []
if node['docker']:
- docker_exec_cmd = 'docker exec ceph-rbd-mirror-{hostname}'.format(hostname=hostname)
+ container_binary = 'docker'
+ if host.exists('podman') and host.ansible("setup")["ansible_facts"]["ansible_distribution"] == 'Fedora': # noqa E501
+ container_binary = 'podman'
+ docker_exec_cmd = '{container_binary} exec ceph-rbd-mirror-{hostname}'.format(
+ hostname=hostname, container_binary=container_binary)
else:
docker_exec_cmd = ''
hostname = node["vars"]["inventory_hostname"]
assert host.service(service_name).is_enabled
def test_rgw_is_up(self, node, host):
- hostname=node["vars"]["inventory_hostname"]
- cluster=node["cluster_name"]
+ hostname = node["vars"]["inventory_hostname"]
+ cluster = node["cluster_name"]
if node['docker']:
- docker_exec_cmd = 'docker exec ceph-rgw-{hostname}'.format(hostname=hostname)
+ container_binary = 'docker'
+ if host.exists('podman') and host.ansible("setup")["ansible_facts"]["ansible_distribution"] == 'Fedora': # noqa E501
+ container_binary = 'podman'
+ docker_exec_cmd = '{container_binary} exec ceph-rgw-{hostname}'.format(
+ hostname=hostname, container_binary=container_binary)
else:
docker_exec_cmd = ''
cmd = "sudo {docker_exec_cmd} ceph --name client.bootstrap-rgw --keyring /var/lib/ceph/bootstrap-rgw/{cluster}.keyring --cluster={cluster} --connect-timeout 5 -f json -s".format(
def test_docker_rgw_tuning_pools_are_set(self, node, host):
hostname = node["vars"]["inventory_hostname"]
cluster = node['cluster_name']
- cmd = "sudo docker exec ceph-rgw-{hostname} ceph --cluster={cluster} -n client.rgw.{hostname} --connect-timeout 5 --keyring /var/lib/ceph/radosgw/{cluster}-rgw.{hostname}/keyring osd dump".format(
+ container_binary = 'docker'
+ if host.exists('podman') and host.ansible("setup")["ansible_facts"]["ansible_distribution"] == 'Fedora': # noqa E501
+ container_binary = 'podman'
+ cmd = "sudo {container_binary} exec ceph-rgw-{hostname} ceph --cluster={cluster} -n client.rgw.{hostname} --connect-timeout 5 --keyring /var/lib/ceph/radosgw/{cluster}-rgw.{hostname}/keyring osd dump".format(
hostname=hostname,
- cluster=cluster
+ cluster=cluster,
+ container_binary=container_binary
)
output = host.check_output(cmd)
pools = node["vars"].get("rgw_create_pools")