summaryrefslogtreecommitdiffstats
path: root/src/tests/intg/test_secrets.py
diff options
context:
space:
mode:
authorFabiano FidĂȘncio <fidencio@redhat.com>2016-09-23 15:23:23 +0200
committerJakub Hrozek <jhrozek@redhat.com>2016-10-03 15:32:33 +0200
commitefc65e78fa4e01e6cecc8690a9899af61213be62 (patch)
tree2093b436620d0164bfc352aac3a1981a6c438baf /src/tests/intg/test_secrets.py
parentd806427f200dc1ffd44d37724eb40125af5cc8c2 (diff)
downloadsssd-efc65e78fa4e01e6cecc8690a9899af61213be62.tar.gz
sssd-efc65e78fa4e01e6cecc8690a9899af61213be62.tar.xz
sssd-efc65e78fa4e01e6cecc8690a9899af61213be62.zip
SECRETS: Add a configurable depth limit for nested containers
Resolves: https://fedorahosted.org/sssd/ticket/3168 Signed-off-by: Fabiano FidĂȘncio <fidencio@redhat.com> Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
Diffstat (limited to 'src/tests/intg/test_secrets.py')
-rw-r--r--src/tests/intg/test_secrets.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/tests/intg/test_secrets.py b/src/tests/intg/test_secrets.py
index e394d1275..c77c2a470 100644
--- a/src/tests/intg/test_secrets.py
+++ b/src/tests/intg/test_secrets.py
@@ -160,3 +160,15 @@ def test_containers(setup_for_secrets, secrets_cli):
# Try removing the secret first, then the container
cli.del_secret("mycontainer/foo")
cli.del_secret("mycontainer/")
+
+ # Don't allow creating a container after reaching the max nested level
+ DEFAULT_CONTAINERS_NEST_LEVEL = 4
+ container = "mycontainer"
+ for x in xrange(DEFAULT_CONTAINERS_NEST_LEVEL):
+ container += "%s/" % str(x)
+ cli.create_container(container)
+
+ container += "%s/" % str(DEFAULT_CONTAINERS_NEST_LEVEL)
+ with pytest.raises(HTTPError) as err406:
+ cli.create_container(container)
+ assert str(err406.value).startswith("406")