From b4bec524429cd0cf1d0b95e8255557aa41cbd28b Mon Sep 17 00:00:00 2001 From: =?utf8?q?S=C3=A9bastien=20Han?= Date: Tue, 26 Sep 2017 14:21:37 +0200 Subject: [PATCH] tests: add tests for rgw-nfs MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 --- .../functional/tests/nfs/test_nfs_ganesha.py | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) 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): -- 2.39.5