- New VMs default to an offline installer of one exact release (`reims-ctl create --macos <ver> --offline --network false`); the wizard lists Apple's releases, marks downloaded ones and warns when space is short. - Offline VMs get an install guide with the install-macos.sh command and a "Finish install" action that ejects the installer and turns the network on (FinishInstall; pending until the next start on a running VM). - Installers page (roadmap M2.2): downloaded installers with resume/delete, Apple's releases with download, progress and pause, space check first. - Commit memory: the host report carries Windows' commit limit and available commit; create/settings refuse memory over the limit, start refuses memory that can't be committed now with a clear message, and the wizard, settings and first launch show a recommended size (16G failed with 14.7 GiB free). - First launch shows a host check (WHPX with enable, Vulkan GPU, memory) before the runtime install. - Create validation rejects a VM name that already exists. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
20 lines
683 B
Go
20 lines
683 B
Go
package host
|
|
|
|
import "testing"
|
|
|
|
func TestRecommendedMemoryFollowsCommitMemory(t *testing.T) {
|
|
// The measured case: 32 GB host, 14.7 GiB commit free -> 16G fails, 8G fits.
|
|
if got := RecommendedMemoryGB(Report{TotalRAMGB: 31.8, CommitAvailGB: 14.7}); got != 8 {
|
|
t.Fatalf("got %v, want 8", got)
|
|
}
|
|
if got := RecommendedMemoryGB(Report{TotalRAMGB: 64, CommitAvailGB: 60}); got != 32 {
|
|
t.Fatalf("got %v, want 32", got)
|
|
}
|
|
if got := RecommendedMemoryGB(Report{TotalRAMGB: 8, CommitAvailGB: 3}); got != 4 {
|
|
t.Fatalf("got %v, want the 4 GB floor", got)
|
|
}
|
|
if got := RecommendedMemoryGB(Report{TotalRAMGB: 32}); got != 16 {
|
|
t.Fatalf("unknown commit: got %v, want 16", got)
|
|
}
|
|
}
|