Skip to content

Commit c00b9a6

Browse files
committed
add test to ensure that network devices are inherited from the template VM
1 parent 56e2053 commit c00b9a6

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

fwprovider/test/resource_vm_test.go

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -963,6 +963,29 @@ func TestAccResourceVMClone(t *testing.T) {
963963
}),
964964
),
965965
}}},
966+
{"clone with network devices", []resource.TestStep{{
967+
Config: te.RenderConfig(`
968+
resource "proxmox_virtual_environment_vm" "template" {
969+
node_name = "{{.NodeName}}"
970+
started = false
971+
network_device {
972+
bridge = "vmbr0"
973+
}
974+
}
975+
resource "proxmox_virtual_environment_vm" "clone" {
976+
node_name = "{{.NodeName}}"
977+
started = false
978+
clone {
979+
vm_id = proxmox_virtual_environment_vm.template.vm_id
980+
}
981+
}`),
982+
Check: resource.ComposeTestCheckFunc(
983+
ResourceAttributes("proxmox_virtual_environment_vm.clone", map[string]string{
984+
"network_device.#": "1",
985+
"network_device.0.bridge": "vmbr0",
986+
}),
987+
),
988+
}}},
966989
{"clone initialization datastore does not exist", []resource.TestStep{{
967990
Config: te.RenderConfig(`
968991
resource "proxmox_virtual_environment_vm" "template" {

0 commit comments

Comments
 (0)