use proxmox 0.1.25, use new EnumEntry feature

This commit is contained in:
Dietmar Maurer
2020-04-29 13:01:24 +02:00
parent acb428cdec
commit bc0d03885c
8 changed files with 79 additions and 114 deletions

View File

@ -142,27 +142,3 @@ fn verify_root_api() -> Result<(), Error> {
Ok(())
}
#[test]
fn verify_acl_role_schema() -> Result<(), Error> {
let list = match api2::types::ACL_ROLE_SCHEMA {
Schema::String(StringSchema { format: Some(ApiStringFormat::Enum(list)), .. }) => list,
_ => unreachable!(),
};
let map = &proxmox_backup::config::acl::ROLE_NAMES;
for item in *list {
if !map.contains_key(item) {
bail!("found role '{}' without description/mapping", item);
}
}
for role in map.keys() {
if !list.contains(role) {
bail!("role '{}' missing in ACL_ROLE_SCHEMA enum", role);
}
}
Ok(())
}