mirror of
https://github.com/bpg/terraform-provider-proxmox.git
synced 2025-06-30 02:31:10 +00:00
52 lines
1.1 KiB
Go
52 lines
1.1 KiB
Go
/*
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
|
*/
|
|
|
|
package tests
|
|
|
|
import (
|
|
"fmt"
|
|
"testing"
|
|
|
|
"github.com/hashicorp/terraform-plugin-testing/helper/resource"
|
|
)
|
|
|
|
func TestAccDatasourceNode(t *testing.T) {
|
|
t.Parallel()
|
|
|
|
te := initTestEnvironment(t)
|
|
|
|
tests := []struct {
|
|
name string
|
|
steps []resource.TestStep
|
|
}{
|
|
{"read node attributes", []resource.TestStep{{
|
|
Config: fmt.Sprintf(`data "proxmox_virtual_environment_node" "test" { node_name = "%s" }`, te.nodeName),
|
|
Check: resource.ComposeTestCheckFunc(
|
|
testResourceAttributesSet("data.proxmox_virtual_environment_node.test", []string{
|
|
"cpu_count",
|
|
"cpu_sockets",
|
|
"cpu_model",
|
|
"memory_available",
|
|
"memory_used",
|
|
"memory_total",
|
|
"uptime",
|
|
}),
|
|
),
|
|
}}},
|
|
}
|
|
|
|
for _, tt := range tests {
|
|
t.Run(tt.name, func(t *testing.T) {
|
|
t.Parallel()
|
|
|
|
resource.Test(t, resource.TestCase{
|
|
ProtoV6ProviderFactories: te.accProviders,
|
|
Steps: tt.steps,
|
|
})
|
|
})
|
|
}
|
|
}
|