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: v17.2.1~48^2~44 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=30f147f3b041d52880f33bbb22b6a6e966bb83c8;p=ceph.git mgr/nfs: add test for squash validation func Signed-off-by: John Mulligan (cherry picked from commit 2bcd911e3146ed6429a84cccf87f447525c124bc) --- diff --git a/src/pybind/mgr/nfs/tests/test_nfs.py b/src/pybind/mgr/nfs/tests/test_nfs.py index 3e6334845bbb..0a606dbdaaa3 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")