Files
terraform-provider-unifi/internal/provider/testing/test_helpers_random.go
Mateusz Filipowicz e7164c0460 feat: add DNS record resource and datasources (#25)
* add DNS record

* revamp tests

* lint

* cleanup

* feat dns test

* chore: add DNS Record tests

* linting

* f
2025-02-26 01:17:59 +01:00

24 lines
476 B
Go

package testing
import (
"fmt"
"github.com/hashicorp/terraform-plugin-testing/helper/acctest"
)
func RandHostname() string {
return RandHostnameWithSuffix("test.com")
}
func RandHostnameWithSuffix(suffix string) string {
return fmt.Sprintf("%s.%s", RandAlpha(10), suffix)
}
func RandAlpha(len int) string {
return acctest.RandStringFromCharSet(len, acctest.CharSetAlpha)
}
func RandIpAddress() string {
ip, _ := acctest.RandIpAddress("192.168.0.1/24")
return ip
}