From bb2b45d7036cd6fe03c45f349c86302d7fbfbbf1 Mon Sep 17 00:00:00 2001 From: John Mulligan Date: Thu, 21 Apr 2022 15:34:25 -0400 Subject: [PATCH] mgr/nfs: add test for access type validation func Signed-off-by: John Mulligan --- src/pybind/mgr/nfs/tests/test_nfs.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/pybind/mgr/nfs/tests/test_nfs.py b/src/pybind/mgr/nfs/tests/test_nfs.py index 0a606dbdaaa..1fca67249e0 100644 --- a/src/pybind/mgr/nfs/tests/test_nfs.py +++ b/src/pybind/mgr/nfs/tests/test_nfs.py @@ -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") -- 2.47.3