pub const FEDORA_ONLY_ACTIONS: &[&str] = &[
"AddLayeredPackage",
"RemoveLayeredPackage",
"ReplaceLayeredPackage",
"RemoveBasePackage",
"ResetLayeredPackageOverride",
"GetLayeredPackages",
"GetDeploymentHistory",
"ListDeployments",
"CleanupDeployments",
"RollbackDeployment",
"PinDeployment",
"UnpinDeployment",
"RebaseSystem",
"GetKernelArguments",
"SetKernelArguments",
];
pub const DEBIAN_ONLY_ACTIONS: &[&str] = &[
"AptUpdate",
"AptUpgrade",
"AptInstall",
"AptRemove",
"AptPurge",
"AptAutoremove",
"AptHold",
"AptUnhold",
"AptSearch",
"AptListInstalled",
"AptShow",
"AptListUpgradable",
"AptHistoryList",
"ConfigureUnattendedUpgrades",
"GetAptPins",
"SetAptPin",
"RemoveAptPin",
"AddPpa",
"RemovePpa",
"SnapInstall",
"SnapRemove",
"SnapRefresh",
"SnapHold",
"SnapUnhold",
"SnapList",
"SnapInfo",
"SnapRevert",
"SnapClassicInstall",
"UfwEnable",
"UfwDisable",
"UfwAllow",
"UfwDeny",
"UfwReset",
"UfwStatus",
"DistroboxList",
"DistroboxCreate",
"DistroboxRemove",
"NetplanGetConfig",
"NetplanApply",
"NetplanSet",
"NetplanGenerate",
"GrubGetKargs",
"GrubSetKargs",
"CheckPendingReboot",
"AppArmorStatus",
"AppArmorEnforce",
"AppArmorComplain",
"CloudInitStatus",
"UbuntuInstallFlatpak",
"UbuntuRemoveFlatpak",
"UbuntuUpdateFlatpak",
"UbuntuListFlatpaks",
"Fail2banStatus",
"Fail2banBanIp",
"Fail2banUnbanIp",
"ConfigureFail2banJail",
"UbuntuReleaseUpgrade",
"ProStatus",
"ProAttach",
"ProDetach",
"EnableProService",
"DisableProService",
"LivepatchStatus",
"MultipassList",
"UfwDeleteRule",
"UfwLimit",
];
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn family_lists_are_disjoint() {
for action in FEDORA_ONLY_ACTIONS {
assert!(
!DEBIAN_ONLY_ACTIONS.contains(action),
"{action} is listed as both Fedora-only and Debian-only"
);
}
}
#[test]
fn family_lists_have_no_duplicates() {
for list in [FEDORA_ONLY_ACTIONS, DEBIAN_ONLY_ACTIONS] {
let mut sorted = list.to_vec();
sorted.sort_unstable();
let unique = sorted.len();
sorted.dedup();
assert_eq!(unique, sorted.len(), "duplicate action in family list");
}
}
}