fix(test): fix integration test failures for SDN, containers, OVA, suspend

- SDN: zone ID cannot contain hyphens — rename 'pester-zone' to 'pesterz'
- SDN: subnet removal uses original CIDR, not transformed ID
- Containers: New-PveContainer now auto-assigns VM ID via /cluster/nextid
  when -VmId is omitted (was missing, unlike New-PveVm)
- OVA: enable 'images' content type on local storage for import-from
- Suspend: add delay before status check, use Should -Not -Throw pattern

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Clint Branham
2026-03-20 14:35:53 -05:00
parent 1c4c112565
commit 531deafdb7
3 changed files with 26 additions and 12 deletions
@@ -2,6 +2,8 @@ using System.Collections.Generic;
using System.Management.Automation;
using System.Net;
using System.Runtime.InteropServices;
using Newtonsoft.Json.Linq;
using PSProxmoxVE.Core.Client;
using PSProxmoxVE.Core.Models.Vms;
using PSProxmoxVE.Core.Services;
@@ -133,7 +135,17 @@ namespace PSProxmoxVE.Cmdlets.Containers
var config = new Dictionary<string, object>();
if (VmId.HasValue)
{
config["vmid"] = VmId.Value.ToString();
}
else
{
// Auto-allocate the next available ID from the cluster.
using var allocClient = new PveHttpClient(session);
var nextIdJson = allocClient.GetAsync("cluster/nextid").GetAwaiter().GetResult();
var nextIdData = JObject.Parse(nextIdJson)["data"];
config["vmid"] = int.Parse(nextIdData!.ToString());
}
if (!string.IsNullOrEmpty(Hostname))
config["hostname"] = Hostname!;
if (Memory.HasValue)