diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml index 4ca699b..305c7e4 100644 --- a/.github/workflows/integration-tests.yml +++ b/.github/workflows/integration-tests.yml @@ -137,6 +137,7 @@ jobs: TF_VAR_disk_storage: ${{ vars.DISK_STORAGE }} TF_VAR_iso_storage: ${{ vars.ISO_STORAGE }} TF_VAR_network_bridge: ${{ vars.NETWORK_BRIDGE }} + TF_VAR_pool_id: ${{ vars.POOL_ID }} run: bash ${SCRIPTS_DIR}/run-integration.sh provision # ── Integration tests (self-hosted, per PVE version) ──────────────── @@ -215,6 +216,7 @@ jobs: TF_VAR_disk_storage: ${{ vars.DISK_STORAGE }} TF_VAR_iso_storage: ${{ vars.ISO_STORAGE }} TF_VAR_network_bridge: ${{ vars.NETWORK_BRIDGE }} + TF_VAR_pool_id: ${{ vars.POOL_ID }} # Always use force-cleanup in CI — handles corrupted state from # cancelled runs, timeouts, or partial provisioning failures. run: bash ${SCRIPTS_DIR}/run-integration.sh force-cleanup diff --git a/tests/.env.test.example b/tests/.env.test.example index 0f6e083..e0984c8 100644 --- a/tests/.env.test.example +++ b/tests/.env.test.example @@ -22,7 +22,7 @@ PVE_PASSWORD= # PVE_VERSIONS=9 8 # # ── VMID overrides ─────────────────────────────────────────────────── -# PVE9A_VMID=99091 -# PVE9B_VMID=99092 -# PVE8A_VMID=99081 -# PVE8B_VMID=99082 +# PVE9A_VMID=5091 +# PVE9B_VMID=5092 +# PVE8A_VMID=5081 +# PVE8B_VMID=5082 diff --git a/tests/infrastructure/main.tf b/tests/infrastructure/main.tf index a1e07f2..675adab 100644 --- a/tests/infrastructure/main.tf +++ b/tests/infrastructure/main.tf @@ -42,6 +42,7 @@ resource "proxmox_virtual_environment_vm" "nested_pve" { name = each.value.vm_name node_name = var.target_node vm_id = each.value.vm_id + pool_id = var.pool_id machine = "q35" bios = "ovmf" diff --git a/tests/infrastructure/scripts/run-integration.sh b/tests/infrastructure/scripts/run-integration.sh index 5a749c0..1e6726c 100755 --- a/tests/infrastructure/scripts/run-integration.sh +++ b/tests/infrastructure/scripts/run-integration.sh @@ -75,8 +75,8 @@ pve_iso() { pve_vmid() { case "$1" in - 9a) echo "${PVE9A_VMID:-99091}" ;; 9b) echo "${PVE9B_VMID:-99092}" ;; - 8a) echo "${PVE8A_VMID:-99081}" ;; 8b) echo "${PVE8B_VMID:-99082}" ;; + 9a) echo "${PVE9A_VMID:-5091}" ;; 9b) echo "${PVE9B_VMID:-5092}" ;; + 8a) echo "${PVE8A_VMID:-5081}" ;; 8b) echo "${PVE8B_VMID:-5082}" ;; *) echo "ERROR: unknown node '$1'" >&2; exit 1 ;; esac } diff --git a/tests/infrastructure/variables.tf b/tests/infrastructure/variables.tf index 8380983..111ee50 100644 --- a/tests/infrastructure/variables.tf +++ b/tests/infrastructure/variables.tf @@ -100,3 +100,9 @@ variable "answer_server_dir" { type = string } + +variable "pool_id" { + description = "Resource pool the nested VMs are created in (a pool-scoped API token can only allocate here)" + type = string + default = null +}