5
0
mirror of git://git.proxmox.com/git/proxmox-backup.git synced 2025-01-24 02:04:14 +03:00

config: acl get child paths: make tests more specific

to avoid that extra paths "sneak" in in some regression

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Thomas Lamprecht 2022-06-08 14:04:33 +02:00
parent 2d7ec3578b
commit b4bda79ac5

View File

@ -918,7 +918,11 @@ acl:1:/storage/store1:user1@pbs:DatastoreBackup
// user1 has admin on "/store/store2/store3" -> return paths
let paths = tree.get_child_paths(&user1, &["store"])?;
assert!(paths.contains(&"store/store2/store3".to_string()));
assert!(
paths.len() == 2
&& paths.contains(&"store/store2".to_string())
&& paths.contains(&"store/store2/store3".to_string())
);
// user2 has no privileges under "/store/store2/store3" --> return empty
assert!(tree
@ -927,7 +931,9 @@ acl:1:/storage/store1:user1@pbs:DatastoreBackup
// user2 has DatastoreReader privileges under "/store/store2/store31" --> return paths
let paths = tree.get_child_paths(&user2, &["store/store2/store31"])?;
assert!(paths.contains(&"store/store2/store31/store4/store6".to_string()));
assert!(
paths.len() == 1 && paths.contains(&"store/store2/store31/store4/store6".to_string())
);
// user2 has no privileges under "/store/store2/foo/bar/baz"
assert!(tree