summaryrefslogtreecommitdiffstats
path: root/src/pybind/mgr/nfs/tests/test_nfs.py
diff options
context:
space:
mode:
authorSage Weil <sage@newdream.net>2021-07-09 15:54:59 +0200
committerSage Weil <sage@newdream.net>2021-07-14 22:20:11 +0200
commit7760cb2aedf52e247d9908b65d30250e2a049df3 (patch)
treef817a89bf16fc09ba26b93ed31338df8c0f0f5a9 /src/pybind/mgr/nfs/tests/test_nfs.py
parentqa/tasks/cephfs/test_nfs: retry mount a few times (diff)
downloadceph-7760cb2aedf52e247d9908b65d30250e2a049df3.tar.xz
ceph-7760cb2aedf52e247d9908b65d30250e2a049df3.zip
mgr/nfs: add test for ganesha conf apply/import
Signed-off-by: Sage Weil <sage@newdream.net>
Diffstat (limited to 'src/pybind/mgr/nfs/tests/test_nfs.py')
-rw-r--r--src/pybind/mgr/nfs/tests/test_nfs.py31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/pybind/mgr/nfs/tests/test_nfs.py b/src/pybind/mgr/nfs/tests/test_nfs.py
index c21139e4fba..0d8377d6921 100644
--- a/src/pybind/mgr/nfs/tests/test_nfs.py
+++ b/src/pybind/mgr/nfs/tests/test_nfs.py
@@ -74,6 +74,25 @@ EXPORT
}
}
"""
+ export_3 = """
+EXPORT {
+ FSAL {
+ name = "CEPH";
+ user_id = "nfs.foo.1";
+ filesystem = "a";
+ secret_access_key = "AQCjU+hgjyReLBAAddJa0Dza/ZHqjX5+JiePMA==";
+ }
+ export_id = 1;
+ path = "/";
+ pseudo = "/a";
+ access_type = "RW";
+ squash = "none";
+ attr_expiration_time = 0;
+ security_label = true;
+ protocols = 4;
+ transports = "TCP";
+}
+"""
conf_nodea = '''
%url "rados://ganesha/ns/export-2"
@@ -737,6 +756,18 @@ NFS_CORE_PARAM {
assert export.clients[0].access_type is None
assert export.cluster_id == cluster_id
+ def test_update_export_with_ganesha_conf(self):
+ with self._mock_orchestrator(True):
+ for cluster_id, info in self.clusters.items():
+ self._do_test_update_export_with_ganesha_conf(cluster_id, info['exports'])
+ self._reset_temp_store()
+
+ def _do_test_update_export_with_ganesha_conf(self, cluster_id, expected_exports):
+ nfs_mod = Module('nfs', '', '')
+ conf = ExportMgr(nfs_mod)
+ r = conf.apply_export(cluster_id, self.export_3)
+ assert r[0] == 0
+
def test_remove_export(self) -> None:
with self._mock_orchestrator(True), mock.patch('nfs.module.ExportMgr._exec'):
for cluster_id, info in self.clusters.items():