]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/nfs: add test for access type validation func 46006/head
authorJohn Mulligan <jmulligan@redhat.com>
Thu, 21 Apr 2022 19:34:25 +0000 (15:34 -0400)
committerJohn Mulligan <jmulligan@redhat.com>
Tue, 26 Apr 2022 17:38:22 +0000 (13:38 -0400)
Signed-off-by: John Mulligan <jmulligan@redhat.com>
src/pybind/mgr/nfs/tests/test_nfs.py

index 0a606dbdaaa3dab31cbe78bf95048bb83d162337..1fca67249e0d459710f521de349bd04db2be06bd 100644 (file)
@@ -1044,3 +1044,14 @@ def test_ganesha_validate_squash():
     _validate_squash("root")
     with pytest.raises(NFSInvalidOperation):
         _validate_squash("toot")
+
+
+def test_ganesha_validate_access_type():
+    """Check error handling of internal validation function for access type value."""
+    from nfs.ganesha_conf import _validate_access_type
+    from nfs.exception import NFSInvalidOperation
+
+    for ok in ("rw", "ro", "none"):
+        _validate_access_type(ok)
+    with pytest.raises(NFSInvalidOperation):
+        _validate_access_type("any")