mirror of
https://github.com/GoodOlClint/PSProxmoxVE.git
synced 2026-08-27 15:36:57 +00:00
fix(tests): resolve all 400 unit test failures to reach green
Cmdlet fixes:
- GetPveSnapshotCmdlet: add -Name filter; fix s.SnapName → s.Name
- GetPveStorageCmdlet: add -Storage name filter
- GetPveNetworkCmdlet: add -Iface optional filter
- NewPveNetworkCmdlet: rename Interface → Iface (consistency with Set/Remove)
- SetPveNetworkCmdlet, RemovePveNetworkCmdlet: rename Interface → Iface
- RemovePveNetworkCmdlet, RemovePveSdnZoneCmdlet, RemovePveSdnVnetCmdlet,
RemovePveUserCmdlet: add ConfirmImpact = ConfirmImpact.High
- SetPveCloudInitConfigCmdlet: rename User → CiUser; move GetSession() first;
remove duplicate session variable
- SendPveIsoCmdlet: add sha512 to ChecksumAlgorithm ValidateSet
- GetPveUserCmdlet: add -Enabled switch; refactor into MatchesFilters(); fix
int? comparison (Enabled != 1)
- GetPvePermissionCmdlet: rename UgId → UserId
- SetPvePermissionCmdlet: rename RoleId → Role
- NewPveTemplateCmdlet: add ConfirmImpact.High; move GetSession() before
ShouldProcess so -WhatIf-less calls throw session error first
- NewPveVmFromTemplateCmdlet: rename Node → TemplateNode with [Alias("Node")]
- RemovePveSnapshotCmdlet, RestorePveSnapshotCmdlet: move GetSession() before
ShouldProcess so session check precedes confirm prompt
Test fixes:
- All 18 Pester test files: update DLL candidates to net9.0
- Fix foreach+It closure capture using -TestCases pattern
- Remove-PveVm, Remove-PveContainer no-session tests: add -Confirm:$false to
bypass ConfirmImpact.High prompt before GetSession() check
- Get-PveStorageContent test: add mandatory -Node/-Storage params
- Send-PveIso test: create temp file to satisfy FileExistsValidation
- New-PveVmFromTemplate test: add NewVmId to parameter splat
Tooling:
- Invoke-Tests.ps1: add -FromTerraform, explicit lab params, fix TFM
auto-detection via Select-Xml, fix Pester import, fix variable scoping
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -16,8 +16,8 @@
|
||||
BeforeAll {
|
||||
$moduleRoot = Resolve-Path (Join-Path $PSScriptRoot '../../../src/PSProxmoxVE')
|
||||
$dllCandidates = @(
|
||||
Join-Path $moduleRoot 'bin/Debug/net8.0/PSProxmoxVE.dll'
|
||||
Join-Path $moduleRoot 'bin/Release/net8.0/PSProxmoxVE.dll'
|
||||
Join-Path $moduleRoot 'bin/Debug/net9.0/PSProxmoxVE.dll'
|
||||
Join-Path $moduleRoot 'bin/Release/net9.0/PSProxmoxVE.dll'
|
||||
Join-Path $moduleRoot 'bin/Debug/net48/PSProxmoxVE.dll'
|
||||
Join-Path $moduleRoot 'bin/Release/net48/PSProxmoxVE.dll'
|
||||
)
|
||||
@@ -52,12 +52,13 @@ Describe 'Cloud-Init cmdlets — manifest declarations' {
|
||||
$script:Manifest = if (Test-Path $manifestPath) { Import-PowerShellDataFile $manifestPath } else { $null }
|
||||
}
|
||||
|
||||
foreach ($cmdName in @('Get-PveCloudInitConfig', 'Set-PveCloudInitConfig',
|
||||
'Invoke-PveCloudInitRegenerate')) {
|
||||
It "$cmdName should be declared in CmdletsToExport" {
|
||||
if ($null -eq $script:Manifest) { Set-ItResult -Skipped -Because 'Manifest not found'; return }
|
||||
$script:Manifest.CmdletsToExport | Should -Contain $cmdName
|
||||
}
|
||||
It "<cmdName> should be declared in CmdletsToExport" -TestCases @(
|
||||
@{ cmdName = 'Get-PveCloudInitConfig' }
|
||||
@{ cmdName = 'Set-PveCloudInitConfig' }
|
||||
@{ cmdName = 'Invoke-PveCloudInitRegenerate' }
|
||||
) {
|
||||
if ($null -eq $script:Manifest) { Set-ItResult -Skipped -Because 'Manifest not found'; return }
|
||||
$script:Manifest.CmdletsToExport | Should -Contain $cmdName
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -12,8 +12,8 @@ BeforeAll {
|
||||
# Adjust the path if your build output directory differs.
|
||||
$moduleRoot = Resolve-Path (Join-Path $PSScriptRoot '../../../src/PSProxmoxVE')
|
||||
$dllCandidates = @(
|
||||
Join-Path $moduleRoot 'bin/Debug/net8.0/PSProxmoxVE.dll'
|
||||
Join-Path $moduleRoot 'bin/Release/net8.0/PSProxmoxVE.dll'
|
||||
Join-Path $moduleRoot 'bin/Debug/net9.0/PSProxmoxVE.dll'
|
||||
Join-Path $moduleRoot 'bin/Release/net9.0/PSProxmoxVE.dll'
|
||||
Join-Path $moduleRoot 'bin/Debug/net48/PSProxmoxVE.dll'
|
||||
Join-Path $moduleRoot 'bin/Release/net48/PSProxmoxVE.dll'
|
||||
)
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
BeforeAll {
|
||||
$moduleRoot = Resolve-Path (Join-Path $PSScriptRoot '../../../src/PSProxmoxVE')
|
||||
$dllCandidates = @(
|
||||
Join-Path $moduleRoot 'bin/Debug/net8.0/PSProxmoxVE.dll'
|
||||
Join-Path $moduleRoot 'bin/Release/net8.0/PSProxmoxVE.dll'
|
||||
Join-Path $moduleRoot 'bin/Debug/net9.0/PSProxmoxVE.dll'
|
||||
Join-Path $moduleRoot 'bin/Release/net9.0/PSProxmoxVE.dll'
|
||||
Join-Path $moduleRoot 'bin/Debug/net48/PSProxmoxVE.dll'
|
||||
Join-Path $moduleRoot 'bin/Release/net48/PSProxmoxVE.dll'
|
||||
)
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
BeforeAll {
|
||||
$moduleRoot = Resolve-Path (Join-Path $PSScriptRoot '../../../src/PSProxmoxVE')
|
||||
$dllCandidates = @(
|
||||
Join-Path $moduleRoot 'bin/Debug/net8.0/PSProxmoxVE.dll'
|
||||
Join-Path $moduleRoot 'bin/Release/net8.0/PSProxmoxVE.dll'
|
||||
Join-Path $moduleRoot 'bin/Debug/net9.0/PSProxmoxVE.dll'
|
||||
Join-Path $moduleRoot 'bin/Release/net9.0/PSProxmoxVE.dll'
|
||||
Join-Path $moduleRoot 'bin/Debug/net48/PSProxmoxVE.dll'
|
||||
Join-Path $moduleRoot 'bin/Release/net48/PSProxmoxVE.dll'
|
||||
)
|
||||
|
||||
@@ -12,8 +12,8 @@
|
||||
BeforeAll {
|
||||
$moduleRoot = Resolve-Path (Join-Path $PSScriptRoot '../../../src/PSProxmoxVE')
|
||||
$dllCandidates = @(
|
||||
Join-Path $moduleRoot 'bin/Debug/net8.0/PSProxmoxVE.dll'
|
||||
Join-Path $moduleRoot 'bin/Release/net8.0/PSProxmoxVE.dll'
|
||||
Join-Path $moduleRoot 'bin/Debug/net9.0/PSProxmoxVE.dll'
|
||||
Join-Path $moduleRoot 'bin/Release/net9.0/PSProxmoxVE.dll'
|
||||
Join-Path $moduleRoot 'bin/Debug/net48/PSProxmoxVE.dll'
|
||||
Join-Path $moduleRoot 'bin/Release/net48/PSProxmoxVE.dll'
|
||||
)
|
||||
@@ -159,8 +159,7 @@ Describe 'Remove-PveContainer' {
|
||||
Context 'Without active session' {
|
||||
It 'Should throw when no session is active (without -WhatIf)' {
|
||||
Skip-IfMissing 'Remove-PveContainer'
|
||||
{ Remove-PveContainer -Node 'pve-node1' -VmId 200 -ErrorAction Stop } |
|
||||
Should -Throw '*No active Proxmox VE session*'
|
||||
{ Remove-PveContainer -Node 'pve-node1' -VmId 200 -Confirm:$false -ErrorAction Stop } | Should -Throw '*No active Proxmox VE session*'
|
||||
}
|
||||
|
||||
It 'Should not throw with -WhatIf' {
|
||||
|
||||
@@ -12,8 +12,8 @@
|
||||
BeforeAll {
|
||||
$moduleRoot = Resolve-Path (Join-Path $PSScriptRoot '../../../src/PSProxmoxVE')
|
||||
$dllCandidates = @(
|
||||
Join-Path $moduleRoot 'bin/Debug/net8.0/PSProxmoxVE.dll'
|
||||
Join-Path $moduleRoot 'bin/Release/net8.0/PSProxmoxVE.dll'
|
||||
Join-Path $moduleRoot 'bin/Debug/net9.0/PSProxmoxVE.dll'
|
||||
Join-Path $moduleRoot 'bin/Release/net9.0/PSProxmoxVE.dll'
|
||||
Join-Path $moduleRoot 'bin/Debug/net48/PSProxmoxVE.dll'
|
||||
Join-Path $moduleRoot 'bin/Release/net48/PSProxmoxVE.dll'
|
||||
)
|
||||
|
||||
@@ -29,8 +29,8 @@ BeforeAll {
|
||||
# -----------------------------------------------------------------------
|
||||
$moduleRoot = Resolve-Path (Join-Path $PSScriptRoot '../../../src/PSProxmoxVE')
|
||||
$dllCandidates = @(
|
||||
Join-Path $moduleRoot 'bin/Debug/net8.0/PSProxmoxVE.dll'
|
||||
Join-Path $moduleRoot 'bin/Release/net8.0/PSProxmoxVE.dll'
|
||||
Join-Path $moduleRoot 'bin/Debug/net9.0/PSProxmoxVE.dll'
|
||||
Join-Path $moduleRoot 'bin/Release/net9.0/PSProxmoxVE.dll'
|
||||
Join-Path $moduleRoot 'bin/Debug/net48/PSProxmoxVE.dll'
|
||||
Join-Path $moduleRoot 'bin/Release/net48/PSProxmoxVE.dll'
|
||||
)
|
||||
|
||||
@@ -12,8 +12,8 @@
|
||||
BeforeAll {
|
||||
$moduleRoot = Resolve-Path (Join-Path $PSScriptRoot '../../../src/PSProxmoxVE')
|
||||
$dllCandidates = @(
|
||||
Join-Path $moduleRoot 'bin/Debug/net8.0/PSProxmoxVE.dll'
|
||||
Join-Path $moduleRoot 'bin/Release/net8.0/PSProxmoxVE.dll'
|
||||
Join-Path $moduleRoot 'bin/Debug/net9.0/PSProxmoxVE.dll'
|
||||
Join-Path $moduleRoot 'bin/Release/net9.0/PSProxmoxVE.dll'
|
||||
Join-Path $moduleRoot 'bin/Debug/net48/PSProxmoxVE.dll'
|
||||
Join-Path $moduleRoot 'bin/Release/net48/PSProxmoxVE.dll'
|
||||
)
|
||||
@@ -48,12 +48,15 @@ Describe 'Network cmdlets — manifest declarations' {
|
||||
$script:Manifest = if (Test-Path $manifestPath) { Import-PowerShellDataFile $manifestPath } else { $null }
|
||||
}
|
||||
|
||||
foreach ($cmdName in @('Get-PveNetwork', 'New-PveNetwork', 'Set-PveNetwork',
|
||||
'Remove-PveNetwork', 'Invoke-PveNetworkApply')) {
|
||||
It "$cmdName should be declared in CmdletsToExport" {
|
||||
if ($null -eq $script:Manifest) { Set-ItResult -Skipped -Because 'Manifest not found'; return }
|
||||
$script:Manifest.CmdletsToExport | Should -Contain $cmdName
|
||||
}
|
||||
It "<cmdName> should be declared in CmdletsToExport" -TestCases @(
|
||||
@{ cmdName = 'Get-PveNetwork' }
|
||||
@{ cmdName = 'New-PveNetwork' }
|
||||
@{ cmdName = 'Set-PveNetwork' }
|
||||
@{ cmdName = 'Remove-PveNetwork' }
|
||||
@{ cmdName = 'Invoke-PveNetworkApply' }
|
||||
) {
|
||||
if ($null -eq $script:Manifest) { Set-ItResult -Skipped -Because 'Manifest not found'; return }
|
||||
$script:Manifest.CmdletsToExport | Should -Contain $cmdName
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -16,8 +16,8 @@
|
||||
BeforeAll {
|
||||
$moduleRoot = Resolve-Path (Join-Path $PSScriptRoot '../../../src/PSProxmoxVE')
|
||||
$dllCandidates = @(
|
||||
Join-Path $moduleRoot 'bin/Debug/net8.0/PSProxmoxVE.dll'
|
||||
Join-Path $moduleRoot 'bin/Release/net8.0/PSProxmoxVE.dll'
|
||||
Join-Path $moduleRoot 'bin/Debug/net9.0/PSProxmoxVE.dll'
|
||||
Join-Path $moduleRoot 'bin/Release/net9.0/PSProxmoxVE.dll'
|
||||
Join-Path $moduleRoot 'bin/Debug/net48/PSProxmoxVE.dll'
|
||||
Join-Path $moduleRoot 'bin/Release/net48/PSProxmoxVE.dll'
|
||||
)
|
||||
@@ -56,12 +56,16 @@ Describe 'SDN cmdlets — manifest declarations' {
|
||||
$script:Manifest = if (Test-Path $manifestPath) { Import-PowerShellDataFile $manifestPath } else { $null }
|
||||
}
|
||||
|
||||
foreach ($cmdName in @('Get-PveSdnZone', 'New-PveSdnZone', 'Remove-PveSdnZone',
|
||||
'Get-PveSdnVnet', 'New-PveSdnVnet', 'Remove-PveSdnVnet')) {
|
||||
It "$cmdName should be declared in CmdletsToExport" {
|
||||
if ($null -eq $script:Manifest) { Set-ItResult -Skipped -Because 'Manifest not found'; return }
|
||||
$script:Manifest.CmdletsToExport | Should -Contain $cmdName
|
||||
}
|
||||
It "<cmdName> should be declared in CmdletsToExport" -TestCases @(
|
||||
@{ cmdName = 'Get-PveSdnZone' }
|
||||
@{ cmdName = 'New-PveSdnZone' }
|
||||
@{ cmdName = 'Remove-PveSdnZone' }
|
||||
@{ cmdName = 'Get-PveSdnVnet' }
|
||||
@{ cmdName = 'New-PveSdnVnet' }
|
||||
@{ cmdName = 'Remove-PveSdnVnet' }
|
||||
) {
|
||||
if ($null -eq $script:Manifest) { Set-ItResult -Skipped -Because 'Manifest not found'; return }
|
||||
$script:Manifest.CmdletsToExport | Should -Contain $cmdName
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -14,8 +14,8 @@
|
||||
BeforeAll {
|
||||
$moduleRoot = Resolve-Path (Join-Path $PSScriptRoot '../../../src/PSProxmoxVE')
|
||||
$dllCandidates = @(
|
||||
Join-Path $moduleRoot 'bin/Debug/net8.0/PSProxmoxVE.dll'
|
||||
Join-Path $moduleRoot 'bin/Release/net8.0/PSProxmoxVE.dll'
|
||||
Join-Path $moduleRoot 'bin/Debug/net9.0/PSProxmoxVE.dll'
|
||||
Join-Path $moduleRoot 'bin/Release/net9.0/PSProxmoxVE.dll'
|
||||
Join-Path $moduleRoot 'bin/Debug/net48/PSProxmoxVE.dll'
|
||||
Join-Path $moduleRoot 'bin/Release/net48/PSProxmoxVE.dll'
|
||||
)
|
||||
@@ -50,12 +50,14 @@ Describe 'Snapshot cmdlets — manifest declarations' {
|
||||
$script:Manifest = if (Test-Path $manifestPath) { Import-PowerShellDataFile $manifestPath } else { $null }
|
||||
}
|
||||
|
||||
foreach ($cmdName in @('Get-PveSnapshot', 'New-PveSnapshot',
|
||||
'Remove-PveSnapshot', 'Restore-PveSnapshot')) {
|
||||
It "$cmdName should be declared in CmdletsToExport" {
|
||||
if ($null -eq $script:Manifest) { Set-ItResult -Skipped -Because 'Manifest not found'; return }
|
||||
$script:Manifest.CmdletsToExport | Should -Contain $cmdName
|
||||
}
|
||||
It "<cmdName> should be declared in CmdletsToExport" -TestCases @(
|
||||
@{ cmdName = 'Get-PveSnapshot' }
|
||||
@{ cmdName = 'New-PveSnapshot' }
|
||||
@{ cmdName = 'Remove-PveSnapshot' }
|
||||
@{ cmdName = 'Restore-PveSnapshot' }
|
||||
) {
|
||||
if ($null -eq $script:Manifest) { Set-ItResult -Skipped -Because 'Manifest not found'; return }
|
||||
$script:Manifest.CmdletsToExport | Should -Contain $cmdName
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -11,8 +11,8 @@
|
||||
BeforeAll {
|
||||
$moduleRoot = Resolve-Path (Join-Path $PSScriptRoot '../../../src/PSProxmoxVE')
|
||||
$dllCandidates = @(
|
||||
Join-Path $moduleRoot 'bin/Debug/net8.0/PSProxmoxVE.dll'
|
||||
Join-Path $moduleRoot 'bin/Release/net8.0/PSProxmoxVE.dll'
|
||||
Join-Path $moduleRoot 'bin/Debug/net9.0/PSProxmoxVE.dll'
|
||||
Join-Path $moduleRoot 'bin/Release/net9.0/PSProxmoxVE.dll'
|
||||
Join-Path $moduleRoot 'bin/Debug/net48/PSProxmoxVE.dll'
|
||||
Join-Path $moduleRoot 'bin/Release/net48/PSProxmoxVE.dll'
|
||||
)
|
||||
@@ -143,7 +143,7 @@ Describe 'Get-PveStorageContent' {
|
||||
Context 'Without active session' {
|
||||
It 'Should throw when no session is active' {
|
||||
Skip-IfMissing 'Get-PveStorageContent'
|
||||
{ Get-PveStorageContent -ErrorAction Stop } |
|
||||
{ Get-PveStorageContent -Node 'pve-node1' -Storage 'local' -ErrorAction Stop } |
|
||||
Should -Throw '*No active Proxmox VE session*'
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
BeforeAll {
|
||||
$moduleRoot = Resolve-Path (Join-Path $PSScriptRoot '../../../src/PSProxmoxVE')
|
||||
$dllCandidates = @(
|
||||
Join-Path $moduleRoot 'bin/Debug/net8.0/PSProxmoxVE.dll'
|
||||
Join-Path $moduleRoot 'bin/Release/net8.0/PSProxmoxVE.dll'
|
||||
Join-Path $moduleRoot 'bin/Debug/net9.0/PSProxmoxVE.dll'
|
||||
Join-Path $moduleRoot 'bin/Release/net9.0/PSProxmoxVE.dll'
|
||||
Join-Path $moduleRoot 'bin/Debug/net48/PSProxmoxVE.dll'
|
||||
Join-Path $moduleRoot 'bin/Release/net48/PSProxmoxVE.dll'
|
||||
)
|
||||
@@ -169,8 +169,11 @@ Describe 'Send-PveIso' {
|
||||
Context 'Without active session' {
|
||||
It 'Should throw when no session is active (without -WhatIf)' {
|
||||
if (-not $script:CmdExists) { Set-ItResult -Skipped -Because 'Not yet compiled'; return }
|
||||
{ Send-PveIso -Node 'pve-node1' -Storage 'local' -Path '/tmp/test.iso' -ErrorAction Stop } |
|
||||
Should -Throw '*No active Proxmox VE session*'
|
||||
$tmpIso = [System.IO.Path]::GetTempFileName()
|
||||
try {
|
||||
{ Send-PveIso -Node 'pve-node1' -Storage 'local' -Path $tmpIso -Confirm:$false -ErrorAction Stop } |
|
||||
Should -Throw '*No active Proxmox VE session*'
|
||||
} finally { Remove-Item $tmpIso -ErrorAction SilentlyContinue }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,8 +15,8 @@
|
||||
BeforeAll {
|
||||
$moduleRoot = Resolve-Path (Join-Path $PSScriptRoot '../../../src/PSProxmoxVE')
|
||||
$dllCandidates = @(
|
||||
Join-Path $moduleRoot 'bin/Debug/net8.0/PSProxmoxVE.dll'
|
||||
Join-Path $moduleRoot 'bin/Release/net8.0/PSProxmoxVE.dll'
|
||||
Join-Path $moduleRoot 'bin/Debug/net9.0/PSProxmoxVE.dll'
|
||||
Join-Path $moduleRoot 'bin/Release/net9.0/PSProxmoxVE.dll'
|
||||
Join-Path $moduleRoot 'bin/Debug/net48/PSProxmoxVE.dll'
|
||||
Join-Path $moduleRoot 'bin/Release/net48/PSProxmoxVE.dll'
|
||||
)
|
||||
@@ -51,12 +51,14 @@ Describe 'Template cmdlets — manifest declarations' {
|
||||
$script:Manifest = if (Test-Path $manifestPath) { Import-PowerShellDataFile $manifestPath } else { $null }
|
||||
}
|
||||
|
||||
foreach ($cmdName in @('Get-PveTemplate', 'New-PveTemplate',
|
||||
'Remove-PveTemplate', 'New-PveVmFromTemplate')) {
|
||||
It "$cmdName should be declared in CmdletsToExport" {
|
||||
if ($null -eq $script:Manifest) { Set-ItResult -Skipped -Because 'Manifest not found'; return }
|
||||
$script:Manifest.CmdletsToExport | Should -Contain $cmdName
|
||||
}
|
||||
It "<cmdName> should be declared in CmdletsToExport" -TestCases @(
|
||||
@{ cmdName = 'Get-PveTemplate' }
|
||||
@{ cmdName = 'New-PveTemplate' }
|
||||
@{ cmdName = 'Remove-PveTemplate' }
|
||||
@{ cmdName = 'New-PveVmFromTemplate' }
|
||||
) {
|
||||
if ($null -eq $script:Manifest) { Set-ItResult -Skipped -Because 'Manifest not found'; return }
|
||||
$script:Manifest.CmdletsToExport | Should -Contain $cmdName
|
||||
}
|
||||
}
|
||||
|
||||
@@ -274,6 +276,7 @@ Describe 'New-PveVmFromTemplate' {
|
||||
elseif ($script:Cmd.Parameters.ContainsKey('SourceNode')) { $splat['SourceNode'] = 'pve-node1' }
|
||||
if ($script:Cmd.Parameters.ContainsKey('TemplateId')) { $splat['TemplateId'] = 9000 }
|
||||
elseif ($script:Cmd.Parameters.ContainsKey('VmId')) { $splat['VmId'] = 9000 }
|
||||
if ($script:Cmd.Parameters.ContainsKey('NewVmId')) { $splat['NewVmId'] = 9001 }
|
||||
& 'New-PveVmFromTemplate' @splat
|
||||
} | Should -Throw '*No active Proxmox VE session*'
|
||||
}
|
||||
|
||||
@@ -13,8 +13,8 @@
|
||||
BeforeAll {
|
||||
$moduleRoot = Resolve-Path (Join-Path $PSScriptRoot '../../../src/PSProxmoxVE')
|
||||
$dllCandidates = @(
|
||||
Join-Path $moduleRoot 'bin/Debug/net8.0/PSProxmoxVE.dll'
|
||||
Join-Path $moduleRoot 'bin/Release/net8.0/PSProxmoxVE.dll'
|
||||
Join-Path $moduleRoot 'bin/Debug/net9.0/PSProxmoxVE.dll'
|
||||
Join-Path $moduleRoot 'bin/Release/net9.0/PSProxmoxVE.dll'
|
||||
Join-Path $moduleRoot 'bin/Debug/net48/PSProxmoxVE.dll'
|
||||
Join-Path $moduleRoot 'bin/Release/net48/PSProxmoxVE.dll'
|
||||
)
|
||||
@@ -54,13 +54,19 @@ Describe 'User / Role / Permission cmdlets — manifest declarations' {
|
||||
$script:Manifest = if (Test-Path $manifestPath) { Import-PowerShellDataFile $manifestPath } else { $null }
|
||||
}
|
||||
|
||||
foreach ($cmdName in @('Get-PveUser', 'New-PveUser', 'Remove-PveUser', 'Set-PveUser',
|
||||
'Get-PveRole', 'New-PveRole', 'Remove-PveRole',
|
||||
'Get-PvePermission', 'Set-PvePermission')) {
|
||||
It "$cmdName should be declared in CmdletsToExport" {
|
||||
if ($null -eq $script:Manifest) { Set-ItResult -Skipped -Because 'Manifest not found'; return }
|
||||
$script:Manifest.CmdletsToExport | Should -Contain $cmdName
|
||||
}
|
||||
It "<cmdName> should be declared in CmdletsToExport" -TestCases @(
|
||||
@{ cmdName = 'Get-PveUser' }
|
||||
@{ cmdName = 'New-PveUser' }
|
||||
@{ cmdName = 'Remove-PveUser' }
|
||||
@{ cmdName = 'Set-PveUser' }
|
||||
@{ cmdName = 'Get-PveRole' }
|
||||
@{ cmdName = 'New-PveRole' }
|
||||
@{ cmdName = 'Remove-PveRole' }
|
||||
@{ cmdName = 'Get-PvePermission' }
|
||||
@{ cmdName = 'Set-PvePermission' }
|
||||
) {
|
||||
if ($null -eq $script:Manifest) { Set-ItResult -Skipped -Because 'Manifest not found'; return }
|
||||
$script:Manifest.CmdletsToExport | Should -Contain $cmdName
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
BeforeAll {
|
||||
$moduleRoot = Resolve-Path (Join-Path $PSScriptRoot '../../../src/PSProxmoxVE')
|
||||
$dllCandidates = @(
|
||||
Join-Path $moduleRoot 'bin/Debug/net8.0/PSProxmoxVE.dll'
|
||||
Join-Path $moduleRoot 'bin/Release/net8.0/PSProxmoxVE.dll'
|
||||
Join-Path $moduleRoot 'bin/Debug/net9.0/PSProxmoxVE.dll'
|
||||
Join-Path $moduleRoot 'bin/Release/net9.0/PSProxmoxVE.dll'
|
||||
Join-Path $moduleRoot 'bin/Debug/net48/PSProxmoxVE.dll'
|
||||
Join-Path $moduleRoot 'bin/Release/net48/PSProxmoxVE.dll'
|
||||
)
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
BeforeAll {
|
||||
$moduleRoot = Resolve-Path (Join-Path $PSScriptRoot '../../../src/PSProxmoxVE')
|
||||
$dllCandidates = @(
|
||||
Join-Path $moduleRoot 'bin/Debug/net8.0/PSProxmoxVE.dll'
|
||||
Join-Path $moduleRoot 'bin/Release/net8.0/PSProxmoxVE.dll'
|
||||
Join-Path $moduleRoot 'bin/Debug/net9.0/PSProxmoxVE.dll'
|
||||
Join-Path $moduleRoot 'bin/Release/net9.0/PSProxmoxVE.dll'
|
||||
Join-Path $moduleRoot 'bin/Debug/net48/PSProxmoxVE.dll'
|
||||
Join-Path $moduleRoot 'bin/Release/net48/PSProxmoxVE.dll'
|
||||
)
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
BeforeAll {
|
||||
$moduleRoot = Resolve-Path (Join-Path $PSScriptRoot '../../../src/PSProxmoxVE')
|
||||
$dllCandidates = @(
|
||||
Join-Path $moduleRoot 'bin/Debug/net8.0/PSProxmoxVE.dll'
|
||||
Join-Path $moduleRoot 'bin/Release/net8.0/PSProxmoxVE.dll'
|
||||
Join-Path $moduleRoot 'bin/Debug/net9.0/PSProxmoxVE.dll'
|
||||
Join-Path $moduleRoot 'bin/Release/net9.0/PSProxmoxVE.dll'
|
||||
Join-Path $moduleRoot 'bin/Debug/net48/PSProxmoxVE.dll'
|
||||
Join-Path $moduleRoot 'bin/Release/net48/PSProxmoxVE.dll'
|
||||
)
|
||||
@@ -132,8 +132,7 @@ Describe 'Remove-PveVm' {
|
||||
|
||||
Context 'Without active session' {
|
||||
It 'Should throw when no session is active (without -WhatIf)' {
|
||||
{ Remove-PveVm -Node 'pve-node1' -VmId 100 -ErrorAction Stop } |
|
||||
Should -Throw '*No active Proxmox VE session*'
|
||||
{ Remove-PveVm -Node 'pve-node1' -VmId 100 -Confirm:$false -ErrorAction Stop } | Should -Throw '*No active Proxmox VE session*'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,8 +19,8 @@
|
||||
BeforeAll {
|
||||
$moduleRoot = Resolve-Path (Join-Path $PSScriptRoot '../../../src/PSProxmoxVE')
|
||||
$dllCandidates = @(
|
||||
Join-Path $moduleRoot 'bin/Debug/net8.0/PSProxmoxVE.dll'
|
||||
Join-Path $moduleRoot 'bin/Release/net8.0/PSProxmoxVE.dll'
|
||||
Join-Path $moduleRoot 'bin/Debug/net9.0/PSProxmoxVE.dll'
|
||||
Join-Path $moduleRoot 'bin/Release/net9.0/PSProxmoxVE.dll'
|
||||
Join-Path $moduleRoot 'bin/Debug/net48/PSProxmoxVE.dll'
|
||||
Join-Path $moduleRoot 'bin/Release/net48/PSProxmoxVE.dll'
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user