From 30f147f3b041d52880f33bbb22b6a6e966bb83c8 Mon Sep 17 00:00:00 2001 From: John Mulligan Date: Thu, 21 Apr 2022 15:32:33 -0400 Subject: [PATCH] mgr/nfs: add test for squash validation func Signed-off-by: John Mulligan (cherry picked from commit 2bcd911e3146ed6429a84cccf87f447525c124bc) --- src/pybind/mgr/nfs/tests/test_nfs.py | 10 ++++++++++ 1 file changed, 10 insertions(+) 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") -- 2.47.3