mirror of
https://github.com/GoodOlClint/PSProxmoxVE.git
synced 2026-08-24 11:36:30 +00:00
fix: address PR #67 review feedback
- HasDiskOptions(): include -ScsiHardware so the "disk options ignored" warning fires when -ScsiHardware is passed without -DiskStorage/-DiskSize. - PveVmConfig.AdditionalProperties: lazy-init a backing field so the native dictionary is built once rather than reallocated on every property access (matters when iterating many configs in a pipeline). Safe because the model is effectively immutable after deserialization. - New-PveVm.Tests.ps1: add a case asserting -DiskIoThread on scsi with a wrong -ScsiHardware (virtio-scsi-pci) is rejected, covering the validator's "!= virtio-scsi-single" branch (not just the null case). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -222,6 +222,11 @@ Describe 'New-PveVm' {
|
||||
Should -Throw '*virtio-scsi-single*'
|
||||
}
|
||||
|
||||
It 'Should reject -DiskIoThread on scsi with a wrong -ScsiHardware (virtio-scsi-pci)' {
|
||||
{ New-PveVm -Node 'pve-node1' -DiskStorage 'local-lvm' -DiskSize '32' -DiskBus scsi -ScsiHardware 'virtio-scsi-pci' -DiskIoThread -WhatIf -ErrorAction Stop } |
|
||||
Should -Throw '*virtio-scsi-single*'
|
||||
}
|
||||
|
||||
It 'Should accept -DiskIoThread on scsi with -ScsiHardware virtio-scsi-single' {
|
||||
{ New-PveVm -Node 'pve-node1' -DiskStorage 'local-lvm' -DiskSize '32' -DiskBus scsi -ScsiHardware 'virtio-scsi-single' -DiskIoThread -WhatIf -ErrorAction Stop } |
|
||||
Should -Not -Throw
|
||||
|
||||
Reference in New Issue
Block a user