Skip to content

Commit b8751c4

Browse files
authored
misc(provider): add missing acc tests (#1755)
a follow-up on #1754, tests missed from the PR Signed-off-by: Pavel Boldyrev <[email protected]>
1 parent f221a85 commit b8751c4

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

fwprovider/provider_test.go

+20
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,15 @@ func TestProviderAuth(t *testing.T) {
174174
`,
175175
ExpectError: regexp.MustCompile(`must provide either username and password, an API token, or a ticket`),
176176
}}},
177+
{"invalid api token", []resource.TestStep{{
178+
Config: `
179+
provider "proxmox" {
180+
api_token = "invalid-token"
181+
}
182+
data "proxmox_virtual_environment_version" "test" {}
183+
`,
184+
ExpectError: regexp.MustCompile(`the API token must be in the format 'USER@REALM!TOKENID=UUID'`),
185+
}}},
177186
{"invalid username", []resource.TestStep{{
178187
Config: `
179188
provider "proxmox" {
@@ -184,6 +193,17 @@ func TestProviderAuth(t *testing.T) {
184193
`,
185194
ExpectError: regexp.MustCompile(`username must end with '@pve' or '@pam'`),
186195
}}},
196+
{"missing password", []resource.TestStep{{
197+
Config: `
198+
provider "proxmox" {
199+
api_token = ""
200+
username = "root@pam"
201+
password = ""
202+
}
203+
data "proxmox_virtual_environment_version" "test" {}
204+
`,
205+
ExpectError: regexp.MustCompile(`must provide either username and password, an API token, or a ticket`),
206+
}}},
187207
}
188208

189209
for _, tt := range tests {

0 commit comments

Comments
 (0)