File tree 1 file changed +2
-16
lines changed 1 file changed +2
-16
lines changed Original file line number Diff line number Diff line change @@ -6,8 +6,6 @@ package vsphere
6
6
import (
7
7
"fmt"
8
8
"os"
9
- "regexp"
10
- "strconv"
11
9
"testing"
12
10
13
11
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
@@ -25,30 +23,18 @@ func TestAccDataSourceVSphereHostPciDevice_basic(t *testing.T) {
25
23
{
26
24
Config : testAccDataSourceVSphereHostPciDeviceConfig (),
27
25
Check : resource .ComposeTestCheckFunc (
28
- resource .TestCheckResourceAttrWith (
26
+ resource .TestCheckResourceAttrSet (
29
27
"data.vsphere_host_pci_device.device" ,
30
28
"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
- },
42
29
),
43
30
),
44
31
},
45
32
{
46
33
Config : testAccDataSourceVSphereHostPciDeviceConfig (),
47
34
Check : resource .ComposeTestCheckFunc (
48
- resource .TestMatchResourceAttr (
35
+ resource .TestCheckResourceAttrSet (
49
36
"data.vsphere_host_pci_device.device" ,
50
37
"pci_devices.0.name" ,
51
- regexp .MustCompile ("(.*?)" ),
52
38
),
53
39
),
54
40
},
You can’t perform that action at this time.
0 commit comments