0
0
mirror of https://github.com/bpg/terraform-provider-proxmox.git synced 2025-07-01 11:02:59 +00:00

chore(vm): fix acceptance test for hardware mapping (#1223)

Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
This commit is contained in:
Pavel Boldyrev 2024-04-18 16:27:59 -04:00 committed by GitHub
parent 76c1c2282b
commit 653e6f25f8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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" {
@ -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"`),
},
},
},