xenserver / terraform-provider-xenserver

XenServer provider for Terraform
Other
18 stars 5 forks source link

CP-49367 Implement xenserver_pif provider data source #18

Closed acefei closed 5 months ago

acefei commented 5 months ago
source .env && TF_ACC=1 go test ./xenserver/ -v   -timeout 120m
=== RUN   TestAccNetworkResource
--- PASS: TestAccNetworkResource (50.38s)
=== RUN   TestAccPifDataSource
--- PASS: TestAccPifDataSource (19.44s)
=== RUN   TestAccSRDataSource
--- PASS: TestAccSRDataSource (18.06s)
=== RUN   TestAccVMResource
--- PASS: TestAccVMResource (52.08s)
PASS
ok      terraform-provider-xenserver/xenserver  139.970s
pif_data_out = tolist([
  {
    "bond_master_of" = tolist([])
    "bond_slave_of" = "OpaqueRef:NULL"
    "capabilities" = tolist([
      "sriov",
    ])
    "currently_attached" = true
    "device" = "eth0"
    "disallow_unplug" = false
    "dns" = "10.71.56.11"
    "gateway" = "10.71.56.1"
    "host" = "OpaqueRef:041ade78-40d3-1ecd-3d3c-b7b7e91e4f76"
    "igmp_snooping_status" = "disabled"
    "ip" = "10.71.56.50"
    "ip_configuration_mode" = "DHCP"
    "ipv6" = tolist([])
    "ipv6_configuration_mode" = "None"
    "ipv6_gateway" = ""
    "mac" = "0c:c4:7a:e7:b5:e8"
    "managed" = true
    "management" = true
    "mtu" = 1500
    "netmask" = "255.255.248.0"
    "network" = "OpaqueRef:ce271ed2-87c5-ee24-0e71-0fead2417986"
    "other_config" = tomap({})
    "pci" = "OpaqueRef:a7e83bf8-0967-e886-818a-e259bda0d98e"
    "physical" = true
    "primary_address_type" = "IPv4"
    "properties" = tomap({
      "gro" = "on"
    })
    "sriov_logical_pif_of" = tolist([])
    "sriov_physical_pif_of" = tolist([])
    "tunnel_access_pif_of" = tolist([])
    "tunnel_transport_pif_of" = tolist([])
    "uuid" = "d9e981a6-7251-8794-7bbd-acb8662b9633"
    "vlan" = -1
    "vlan_master_of" = "OpaqueRef:NULL"
    "vlan_slave_of" = tolist([])
  },
])
vm_out = {
  "id" = "c43e9f42-c48d-2dce-19cd-2a2b7ba447ef"
  "name_label" = "Test CentOS VM"
  "other_config" = tomap({
    "flag" = "1"
  })
  "snapshots" = tolist([])
  "template_name" = "CentOS 7"
}
xueqingz commented 5 months ago

Could you also update the pif_data_source_test.go base on your changes, include the new fields.

acefei commented 5 months ago

Could you also update the pif_data_source_test.go base on your changes, include the new fields.

Sorry, I have no idea to add test for the new option network which is an uuid, I can't use the hard code for testing.