feat(stagging): add version dropdowns and configurable ISO source in 0.4.0

This commit is contained in:
Madzone
2026-09-09 10:16:38 +02:00
parent 0681874bb2
commit 19a00d8b58
9 changed files with 113 additions and 30 deletions
+13 -1
View File
@@ -25,6 +25,8 @@ $config=Read-KisWorkbook $source
Assert (@($config.Servers).Count -eq 0) 'Unselected workbook stays inactive'
Assert ($config.Settings['GETAC-IP'] -eq '192.168.50.1') 'Native XLSX import'
Assert (@(Get-InstallPlan $config).Count -eq 0) 'No selected rows, no preparation'
Assert ($config.Settings.ContainsKey('ISO-Ablage') -and $config.Settings['ISO-Ablage'] -eq '') 'Unknown ISO location remains blank in delivered workbook'
Assert ($config.Settings.ContainsKey('Proxmox-Medium') -and $config.Settings.ContainsKey('ESXi-Medium')) 'New ISO name labels map to installer media'
$plan=@(Get-InstallPlan (Fixture))
Assert ($plan.Count -eq 2) 'Both installer profiles'
Assert ($plan[0].Version -eq '9.0-1' -and $plan[1].Version -eq '8.0U3') 'Versions from workbook'
@@ -54,6 +56,16 @@ Reject { $c=Fixture; $c.Servers[0].Gateway=''; Get-InstallPlan $c } 'Missing gat
Reject { $c=Fixture; $c.Servers[0].Benutzername='administrator'; Get-InstallPlan $c } 'Unsupported account'
Reject { $c=Fixture; $c.Settings['Proxmox-Medium']='../wrong.iso'; Get-InstallPlan $c } 'Media path traversal'
Reject { $c=Fixture; $c.Settings['GETAC-IP']='192.168.50.150'; Get-InstallPlan $c } 'DHCP includes station'
$c=Fixture; $c.Settings['ISO-Ablage']='C:\ISOs'; $localPlan=@(Get-InstallPlan $c)
Assert ($localPlan[0].Media -eq 'C:\ISOs\proxmox-ve_9.0-1.iso') 'Explicit local ISO source overrides work directory'
$c=Fixture; $c.Settings['ISO-Ablage']='\\fileserver\Installation Media'; $sharePlan=@(Get-InstallPlan $c)
Assert ($sharePlan[1].Media -eq '\\fileserver\Installation Media\VMware-VMvisor-Installer-8.0U3.iso') 'UNC ISO source with spaces, no network access in preview'
Reject { $c=Fixture; $c.Settings['ISO-Ablage']=''; Get-InstallPlan $c } 'Explicit blank source never falls back to work directory'
Reject { $c=Fixture; $c.Settings['ISO-Ablage']='\\fileserver'; Get-InstallPlan $c } 'UNC share name required'
Reject { $c=Fixture; $c.Settings['ISO-Ablage']='C:\ISOs\..\Windows'; Get-InstallPlan $c } 'Source path traversal'
Reject { $c=Fixture; $c.Settings['ISO-Ablage']='https://example.test/isos'; Get-InstallPlan $c } 'Unsupported URL source'
Reject { $c=Fixture; $c.Settings['ISO-Ablage']='relative\ISOs'; Get-InstallPlan $c } 'Relative source rejected'
Reject { $c=Fixture; $c.Settings['Proxmox-Medium']="bad`nname.iso"; Get-InstallPlan $c } 'Control characters in ISO filename'
Reject { ConvertTo-AnswerText $plan[0] $hash "mail@example.test`nroot-password=evil" } 'Email injection'
$pw=ConvertTo-SecureString 'Only-Test-Password-123!' -AsPlainText -Force
try { $secureHash=New-RootHash $pw; Assert ($secureHash.StartsWith('$6$rounds=100000$')) 'Interactive hash profile' } finally { $pw.Dispose() }
@@ -79,7 +91,7 @@ try {
$entry.Delete(); $entry=$Archive.CreateEntry($EntryName); $writer=New-Object IO.StreamWriter($entry.Open())
try { $writer.Write($xml.OuterXml) } finally { $writer.Dispose() }
}
Patch-Cells $zip 'xl/worksheets/sheet1.xml' @{ B8='2025'; B14=$temp; B15='test-pve-9.0-1.iso'; B16='test-esxi-8.0U3.iso' }
Patch-Cells $zip 'xl/worksheets/sheet1.xml' @{ B8='2025'; B14=$temp; B15='test-pve-9.0-1.iso'; B16='test-esxi-8.0U3.iso'; B32=$temp }
Patch-Cells $zip 'xl/worksheets/sheet2.xml' @{ A7='JA'; E7='9.0-1'; F7='ID_SERIAL=TEST_DISK'; I7='192.168.50.254'; J7='192.168.50.53'; A8='JA'; E8='8.0U3'; F8='naa.6000000000000001'; I8='192.168.50.254'; J8='192.168.50.53' }
} finally { $zip.Dispose() }
[IO.File]::WriteAllText((Join-Path $temp 'test-pve-9.0-1.iso'),'TEST ONLY - NOT AN ISO')