Skip to content

Commit

Permalink
chore(vm): fix acceptance test for hardware mapping (#1223)
Browse files Browse the repository at this point in the history
Signed-off-by: Pavel Boldyrev <[email protected]>
  • Loading branch information
bpg authored Apr 18, 2024
1 parent 76c1c22 commit 653e6f2
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions fwprovider/tests/resource_hardware_mapping_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -664,19 +664,6 @@ func TestAccResourceHardwareMappingUSBInvalidInput(t *testing.T) {
// Test the "Create" method implementation where all possible attributes are specified, but an error is expected
// when using an invalid device path.
{
ExpectError: regexp.MustCompile(
fmt.Sprintf(
// The error line is, for whatever reason, broken down into multiple lines in acceptance tests, so we need
// to capture newline characters.
// Note that the regular expression syntax used by Go does not capture newlines with the "." matcher,
// so we need to enable the "s" flag that enabled "."
// to match "\n".
// References:
// 1. https://pkg.go.dev/regexp/syntax
`(?s).*%s(?s).*`,
hwm.ErrResourceMessageInvalidPath(proxmoxtypes.TypeUSB),
),
),
Config: fmt.Sprintf(
`
resource "proxmox_virtual_environment_hardware_mapping_usb" "test" {
Expand All @@ -699,6 +686,7 @@ func TestAccResourceHardwareMappingUSBInvalidInput(t *testing.T) {
data.MapDeviceIDs[0],
te.nodeName,
),
ExpectError: regexp.MustCompile(`valid Linux device path for hardware mapping of type "usb"`),
},
},
},
Expand Down

0 comments on commit 653e6f2

Please sign in to comment.