0
0
mirror of https://github.com/bpg/terraform-provider-proxmox.git synced 2025-06-29 18:21:10 +00:00

misc(provider): add missing acc tests (#1755)

a follow-up on #1754, tests missed from the PR

Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
This commit is contained in:
Pavel Boldyrev 2025-02-09 16:46:52 -05:00 committed by GitHub
parent f221a85f8f
commit b8751c4d42
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -174,6 +174,15 @@ func TestProviderAuth(t *testing.T) {
`,
ExpectError: regexp.MustCompile(`must provide either username and password, an API token, or a ticket`),
}}},
{"invalid api token", []resource.TestStep{{
Config: `
provider "proxmox" {
api_token = "invalid-token"
}
data "proxmox_virtual_environment_version" "test" {}
`,
ExpectError: regexp.MustCompile(`the API token must be in the format 'USER@REALM!TOKENID=UUID'`),
}}},
{"invalid username", []resource.TestStep{{
Config: `
provider "proxmox" {
@ -184,6 +193,17 @@ func TestProviderAuth(t *testing.T) {
`,
ExpectError: regexp.MustCompile(`username must end with '@pve' or '@pam'`),
}}},
{"missing password", []resource.TestStep{{
Config: `
provider "proxmox" {
api_token = ""
username = "root@pam"
password = ""
}
data "proxmox_virtual_environment_version" "test" {}
`,
ExpectError: regexp.MustCompile(`must provide either username and password, an API token, or a ticket`),
}}},
}
for _, tt := range tests {