File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -6,8 +6,6 @@ package vsphere
66import (
77 "fmt"
88 "os"
9- "regexp"
10- "strconv"
119 "testing"
1210
1311 "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
@@ -25,30 +23,18 @@ func TestAccDataSourceVSphereHostPciDevice_basic(t *testing.T) {
2523 {
2624 Config : testAccDataSourceVSphereHostPciDeviceConfig (),
2725 Check : resource .ComposeTestCheckFunc (
28- resource .TestCheckResourceAttrWith (
26+ resource .TestCheckResourceAttrSet (
2927 "data.vsphere_host_pci_device.device" ,
3028 "pci_devices.#" ,
31- func (value string ) error {
32- valueInt , err := strconv .Atoi (value )
33- if err != nil {
34- return err
35- }
36-
37- if valueInt <= 0 {
38- return fmt .Errorf ("number of PCI devices should be greater than 0" )
39- }
40- return nil
41- },
4229 ),
4330 ),
4431 },
4532 {
4633 Config : testAccDataSourceVSphereHostPciDeviceConfig (),
4734 Check : resource .ComposeTestCheckFunc (
48- resource .TestMatchResourceAttr (
35+ resource .TestCheckResourceAttrSet (
4936 "data.vsphere_host_pci_device.device" ,
5037 "pci_devices.0.name" ,
51- regexp .MustCompile ("(.*?)" ),
5238 ),
5339 ),
5440 },
You can’t perform that action at this time.
0 commit comments