feat(post-install): catalogue de profils — paquets, Docker officiel, partages, VM tools (tâche 2 SJ-9)
- mécanisme presetVars (variables fixes injectées au rendu, surchargées par le formulaire) - 6 profils : base_tools / network_tools / dev_git (listes de paquets, low), docker_official (dépôt officiel Debian, confirmation), sharing (Samba/NFS/mDNS, confirmation), vm_guest_tools (qemu/vmware) - 4 templates custom (install-package-groups, docker-official-debian, sharing, vm-guest-tools) émettant PKG_INSTALLED/SERVICE_ENABLED/ERR → réutilise buildPostInstallResult - l'UI post-install générique les expose automatiquement (manifeste → formulaire → run) tsc 0 · 104 tests · build OK · boot OK (8 profils servis). Clôt le volet moteur tâche 2. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -4,6 +4,7 @@ import {
|
||||
validateProfileValues,
|
||||
maskSecretValues,
|
||||
buildPostInstallResult,
|
||||
previewProfile,
|
||||
type ProfileManifest,
|
||||
} from "./postInstall.js";
|
||||
|
||||
@@ -67,6 +68,26 @@ describe("maskSecretValues", () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe("profils SJ-9 (presetVars + sections)", () => {
|
||||
it("base_tools injecte la liste de paquets fixe", () => {
|
||||
expect(PROFILES.base_tools).toBeTruthy();
|
||||
const script = previewProfile("base_tools", {});
|
||||
expect(script).toContain("nano");
|
||||
expect(script).toContain("htop");
|
||||
});
|
||||
|
||||
it("sharing ne rend que les paquets cochés", () => {
|
||||
const script = previewProfile("sharing", { installSamba: true, installNfs: false, installMdns: true });
|
||||
expect(script).toContain("samba");
|
||||
expect(script).toContain("avahi-daemon");
|
||||
expect(script).not.toContain("nfs-kernel-server");
|
||||
});
|
||||
|
||||
it("docker_official exige une confirmation", () => {
|
||||
expect(PROFILES.docker_official!.requiresConfirmation).toBe(true);
|
||||
});
|
||||
});
|
||||
|
||||
describe("buildPostInstallResult", () => {
|
||||
const raw = [
|
||||
"===SU:CUSTOM_IDENTITY===",
|
||||
|
||||
Reference in New Issue
Block a user