mirror of
https://github.com/bpg/terraform-provider-proxmox.git
synced 2025-06-30 02:31: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:
parent
f221a85f8f
commit
b8751c4d42
@ -174,6 +174,15 @@ func TestProviderAuth(t *testing.T) {
|
|||||||
`,
|
`,
|
||||||
ExpectError: regexp.MustCompile(`must provide either username and password, an API token, or a ticket`),
|
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{{
|
{"invalid username", []resource.TestStep{{
|
||||||
Config: `
|
Config: `
|
||||||
provider "proxmox" {
|
provider "proxmox" {
|
||||||
@ -184,6 +193,17 @@ func TestProviderAuth(t *testing.T) {
|
|||||||
`,
|
`,
|
||||||
ExpectError: regexp.MustCompile(`username must end with '@pve' or '@pam'`),
|
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 {
|
for _, tt := range tests {
|
||||||
|
Loading…
Reference in New Issue
Block a user