Files
terraform-provider-unifi/internal/provider/v1/resource_port_profile_test.go
Mateusz Filipowicz 325d7b7f20 feat: initialize Terraform Plugin Framework (#23)
* feat: initialize Terraform Plugin Framework

* fix docker-compose path for tests

* fix: ensure documentation can be generated with old provider SDK and new plugin framework

* lint
2025-02-24 00:11:41 +01:00

44 lines
1005 B
Go

package v1
import (
"fmt"
"github.com/hashicorp/terraform-plugin-testing/helper/acctest"
"testing"
"github.com/hashicorp/terraform-plugin-testing/helper/resource"
)
func TestAccPortProfile_basic(t *testing.T) {
name := acctest.RandomWithPrefix("tfacc")
resource.ParallelTest(t, resource.TestCase{
PreCheck: func() {
preCheck(t)
preCheckVersionConstraint(t, "< 7.4")
},
ProviderFactories: providerFactories,
// TODO: CheckDestroy: ,
Steps: []resource.TestStep{
{
Config: testAccPortProfileConfig(name),
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttr("unifi_port_profile.test", "poe_mode", "off"),
resource.TestCheckResourceAttr("unifi_port_profile.test", "name", name),
),
},
importStep("unifi_port_profile.test"),
},
})
}
func testAccPortProfileConfig(name string) string {
return fmt.Sprintf(`
resource "unifi_port_profile" "test" {
name = "%s"
poe_mode = "off"
speed = 1000
stp_port_mode = false
}
`, name)
}