Skip to content

Commit

Permalink
Cover the conflicting auth case in a test
Browse files Browse the repository at this point in the history
Signed-off-by: Dom Del Nano <ddelnano@gmail.com>
  • Loading branch information
ddelnano committed Mar 15, 2024
1 parent 36d28f4 commit d83313f
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions xoa/data_source_host_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,32 @@ func TestAccXenorchestraDataSource_hostXoTokenAuth(t *testing.T) {
)
}

func TestAccXenorchestraDataSource_hostXoTokenAuthShouldFail(t *testing.T) {
resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProviders,
Steps: []resource.TestStep{
{
// Specify all the parameters to the provider to force the validation
// to fail
Config: `provider xenorchestra {
alias = "token_auth"
username = "test"
password = "test"
token = "token"
}
data "xenorchestra_host" "host" {
provider = xenorchestra.token_auth
name_label = "%s"
}
`,
ExpectError: regexp.MustCompile(`Error: Conflicting configuration arguments`),
},
},
},
)
}

func TestAccXenorchestraDataSource_hostNotFound(t *testing.T) {
resourceName := "data.xenorchestra_host.host"
resource.Test(t, resource.TestCase{
Expand Down

0 comments on commit d83313f

Please sign in to comment.