Skip to content

Commit

Permalink
F #485: data_opennebula_virtual_machines add infoextended
Browse files Browse the repository at this point in the history
Signed-off-by: Jaime <[email protected]>
  • Loading branch information
jaimecb committed Nov 26, 2024
1 parent 8b18221 commit 1ea12b7
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 81 deletions.
2 changes: 1 addition & 1 deletion opennebula/data_opennebula_virtual_machines.go
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ func virtualMachinesFilter(d *schema.ResourceData, meta interface{}) ([]*vmSc.VM
config := meta.(*Configuration)
controller := config.Controller

vms, err := controller.VMs().Info()
vms, err := controller.VMs().InfoExtended()
if err != nil {
return nil, err
}
Expand Down
80 changes: 0 additions & 80 deletions opennebula/data_opennebula_virtual_machines_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,6 @@ func TestAccVirtualMachineDataSource(t *testing.T) {
{
Config: testAccVirtualMachinesDataSourceBasic,
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttr(
"data.opennebula_virtual_machines.basic",
"virtual_machines.0.id",
"0",
),
resource.TestCheckResourceAttr(
"data.opennebula_virtual_machines.basic",
"virtual_machines.0.name",
Expand Down Expand Up @@ -90,111 +85,56 @@ func TestAccVirtualMachineDataSource(t *testing.T) {
{
Config: testAccVirtualMachinesDataSourceBasicSort,
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttr(
"data.opennebula_virtual_machines.id_asc",
"virtual_machines.0.id",
"1",
),
resource.TestCheckResourceAttr(
"data.opennebula_virtual_machines.id_asc",
"virtual_machines.0.name",
"vm-1",
),
resource.TestCheckResourceAttr(
"data.opennebula_virtual_machines.id_asc",
"virtual_machines.1.id",
"0",
),
resource.TestCheckResourceAttr(
"data.opennebula_virtual_machines.id_asc",
"virtual_machines.1.name",
"vm-0",
),
resource.TestCheckResourceAttr(
"data.opennebula_virtual_machines.cpu_desc",
"virtual_machines.0.id",
"0",
),
resource.TestCheckResourceAttr(
"data.opennebula_virtual_machines.cpu_desc",
"virtual_machines.0.name",
"vm-0",
),
resource.TestCheckResourceAttr(
"data.opennebula_virtual_machines.cpu_desc",
"virtual_machines.1.id",
"1",
),
resource.TestCheckResourceAttr(
"data.opennebula_virtual_machines.cpu_desc",
"virtual_machines.1.name",
"vm-1",
),
resource.TestCheckResourceAttr(
"data.opennebula_virtual_machines.mem_asc",
"virtual_machines.0.id",
"0",
),
resource.TestCheckResourceAttr(
"data.opennebula_virtual_machines.mem_asc",
"virtual_machines.0.name",
"vm-0",
),
resource.TestCheckResourceAttr(
"data.opennebula_virtual_machines.mem_asc",
"virtual_machines.1.id",
"1",
),
resource.TestCheckResourceAttr(
"data.opennebula_virtual_machines.mem_asc",
"virtual_machines.1.name",
"vm-1",
),
resource.TestCheckResourceAttr(
"data.opennebula_virtual_machines.vcpu_asc",
"virtual_machines.0.id",
"1",
),
resource.TestCheckResourceAttr(
"data.opennebula_virtual_machines.vcpu_asc",
"virtual_machines.0.name",
"vm-1",
),
resource.TestCheckResourceAttr(
"data.opennebula_virtual_machines.vcpu_asc",
"virtual_machines.1.id",
"0",
),
resource.TestCheckResourceAttr(
"data.opennebula_virtual_machines.vcpu_asc",
"virtual_machines.1.name",
"vm-0",
),
resource.TestCheckResourceAttr(
"data.opennebula_virtual_machines.name_desc",
"virtual_machines.0.id",
"0",
),
resource.TestCheckResourceAttr(
"data.opennebula_virtual_machines.name_desc",
"virtual_machines.0.name",
"vm-0",
),
resource.TestCheckResourceAttr(
"data.opennebula_virtual_machines.name_desc",
"virtual_machines.1.id",
"1",
),
resource.TestCheckResourceAttr(
"data.opennebula_virtual_machines.name_desc",
"virtual_machines.1.name",
"vm-1",
),
resource.TestCheckResourceAttr(
"data.opennebula_virtual_machines.id_desc_cpu",
"virtual_machines.0.id",
"0",
),
resource.TestCheckResourceAttr(
"data.opennebula_virtual_machines.id_desc_cpu",
"virtual_machines.0.name",
Expand All @@ -205,11 +145,6 @@ func TestAccVirtualMachineDataSource(t *testing.T) {
"virtual_machines.0.cpu",
"0.1",
),
resource.TestCheckResourceAttr(
"data.opennebula_virtual_machines.mem_asc_vcpu",
"virtual_machines.0.id",
"1",
),
resource.TestCheckResourceAttr(
"data.opennebula_virtual_machines.mem_asc_vcpu",
"virtual_machines.0.name",
Expand All @@ -220,31 +155,16 @@ func TestAccVirtualMachineDataSource(t *testing.T) {
"virtual_machines.0.vcpu",
"1",
),
resource.TestCheckResourceAttr(
"data.opennebula_virtual_machines.static_name",
"virtual_machines.0.id",
"0",
),
resource.TestCheckResourceAttr(
"data.opennebula_virtual_machines.static_name",
"virtual_machines.0.name",
"vm-0",
),
resource.TestCheckResourceAttr(
"data.opennebula_virtual_machines.static_mem",
"virtual_machines.0.id",
"1",
),
resource.TestCheckResourceAttr(
"data.opennebula_virtual_machines.static_mem",
"virtual_machines.0.name",
"vm-1",
),
resource.TestCheckResourceAttr(
"data.opennebula_virtual_machines.static_tags",
"virtual_machines.0.id",
"0",
),
resource.TestCheckResourceAttr(
"data.opennebula_virtual_machines.static_tags",
"virtual_machines.0.name",
Expand Down

0 comments on commit 1ea12b7

Please sign in to comment.