From: John Mulligan Date: Thu, 21 Apr 2022 19:32:33 +0000 (-0400) Subject: mgr/nfs: add test for squash validation func X-Git-Tag: v18.0.0~948^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=2bcd911e3146ed6429a84cccf87f447525c124bc;p=ceph.git mgr/nfs: add test for squash validation func Signed-off-by: John Mulligan --- diff --git a/src/pybind/mgr/nfs/tests/test_nfs.py b/src/pybind/mgr/nfs/tests/test_nfs.py index 3e6334845bb..0a606dbdaaa 100644 --- a/src/pybind/mgr/nfs/tests/test_nfs.py +++ b/src/pybind/mgr/nfs/tests/test_nfs.py @@ -1034,3 +1034,13 @@ NFS_CORE_PARAM { ) def test_normalize_path(path, expected): assert normalize_path(path) == expected + + +def test_ganesha_validate_squash(): + """Check error handling of internal validation function for squash value.""" + from nfs.ganesha_conf import _validate_squash + from nfs.exception import NFSInvalidOperation + + _validate_squash("root") + with pytest.raises(NFSInvalidOperation): + _validate_squash("toot")