From: Sébastien Han Date: Tue, 26 Sep 2017 12:21:37 +0000 (+0200) Subject: tests: add tests for rgw-nfs X-Git-Tag: v3.0.0rc14~4^2~6 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=b4bec524429cd0cf1d0b95e8255557aa41cbd28b;p=ceph-ansible.git tests: add tests for rgw-nfs rgw-nfs is part of servicemap so we should use it to make sure the process is up and running. Signed-off-by: Sébastien Han --- diff --git a/tests/functional/tests/nfs/test_nfs_ganesha.py b/tests/functional/tests/nfs/test_nfs_ganesha.py index e0ad01080..8136ff459 100644 --- a/tests/functional/tests/nfs/test_nfs_ganesha.py +++ b/tests/functional/tests/nfs/test_nfs_ganesha.py @@ -1,3 +1,4 @@ +import json import pytest class TestNFSs(object): @@ -22,6 +23,30 @@ class TestNFSs(object): def test_nfs_config_override(self, node, host): assert host.file("/etc/ganesha/ganesha.conf").contains("Entries_HWMark") + @pytest.mark.no_docker + def test_nfs_is_up(self, node, host): + hostname = node["vars"]["inventory_hostname"] + cluster = node['cluster_name'] + cmd = "sudo ceph --name client.rgw.{hostname} --keyring /var/lib/ceph/radosgw/{cluster}-rgw.{hostname}/keyring --cluster={cluster} --connect-timeout 5 -f json -s".format( + hostname=hostname, + cluster=cluster + ) + output = host.check_output(cmd) + daemons = [i for i in json.loads(output)["servicemap"]["services"]["rgw-nfs"]["daemons"]] + assert hostname in daemons + + @pytest.mark.docker + def test_docker_nfs_is_up(self, node, host): + hostname = node["vars"]["inventory_hostname"] + cluster = node['cluster_name'] + cmd = "sudo docker exec ceph-nfs-{hostname} ceph --name client.rgw.{hostname} --keyring /var/lib/ceph/radosgw/{cluster}-rgw.{hostname}/keyring --cluster={cluster} --connect-timeout 5 -f json -s".format( + hostname=hostname, + cluster=cluster + ) + output = host.check_output(cmd) + daemons = [i for i in json.loads(output)["servicemap"]["services"]["rgw-nfs"]["daemons"]] + assert hostname in daemons + #NOTE (guits): This check must be fixed. (Permission denied error) # @pytest.mark.no_docker # def test_nfs_rgw_fsal_export(self, node, host):