refactor: rename aim to upm and extract appimage module

This commit is contained in:
stoorps 2026-03-21 22:39:11 +00:00
parent af13e98eb3
commit 863c57e473
Signed by: stoorps
SSH key fingerprint: SHA256:AZlPfu9hTu042EGtZElmDQoy+KvMOeShLDan/fYLoNI
117 changed files with 2622 additions and 887 deletions

View file

@ -0,0 +1,49 @@
use std::path::Path;
use upm_core::integration::policy::{IntegrationMode, resolve_install_policy};
use upm_core::platform::{DistroFamily, HostCapabilities, InstallScope};
#[test]
fn immutable_system_request_downgrades_to_user_when_allowed() {
let capabilities = HostCapabilities::immutable_user_only();
let policy =
resolve_install_policy(DistroFamily::Immutable, InstallScope::System, &capabilities)
.unwrap();
assert_eq!(policy.scope, InstallScope::User);
assert_eq!(policy.integration_mode, IntegrationMode::Degraded);
assert!(!policy.warnings.is_empty());
}
#[test]
fn nix_system_request_is_denied() {
let error = resolve_install_policy(
DistroFamily::Nix,
InstallScope::System,
&HostCapabilities::default(),
)
.unwrap_err();
assert!(error.contains("not supported on Nix hosts"));
}
#[test]
fn system_policy_uses_managed_payload_and_native_integration_roots() {
let policy = resolve_install_policy(
DistroFamily::Fedora,
InstallScope::System,
&HostCapabilities::default(),
)
.unwrap();
assert_eq!(policy.scope, InstallScope::System);
assert_eq!(policy.payload_root, Path::new("/opt/upm/appimages"));
assert_eq!(
policy.desktop_entry_root,
Path::new("/usr/share/applications")
);
assert_eq!(
policy.icon_root,
Path::new("/usr/share/icons/hicolor/256x256/apps")
);
assert_eq!(policy.integration_mode, IntegrationMode::Full);
}