Documentation ¶
Overview ¶
Package acctest contains for Terraform Acceptance Tests
Index ¶
- Constants
- func RandInt() int
- func RandIntRange(min int, max int) int
- func RandSSHKeyPair(comment string) (string, string, error)
- func RandString(strlen int) string
- func RandStringFromCharSet(strlen int, charSet string) string
- func RandTLSCert(orgName string) (string, string, error)
- func RandomWithPrefix(name string) string
- func RemoteTestPrecheck(t *testing.T)
Constants ¶
const ( // CharSetAlphaNum is the alphanumeric character set for use with // RandStringFromCharSet CharSetAlphaNum = "abcdefghijklmnopqrstuvwxyz012346789" // CharSetAlpha is the alphabetical character set for use with // RandStringFromCharSet CharSetAlpha = "abcdefghijklmnopqrstuvwxyz" )
const SkipRemoteTestsEnvVar = "TF_SKIP_REMOTE_TESTS"
SkipRemoteTestsEnvVar is an environment variable that can be set by a user running the tests in an environment with limited network connectivity. By default, tests requiring internet connectivity make an effort to skip if no internet is available, but in some cases the smoke test will pass even though the test should still be skipped.
Variables ¶
This section is empty.
Functions ¶
func RandIntRange ¶ added in v0.9.3
func RandSSHKeyPair ¶ added in v0.9.2
RandSSHKeyPair generates a public and private SSH key pair. The public key is returned in OpenSSH format, and the private key is PEM encoded.
func RandString ¶
RandString generates a random alphanumeric string of the length specified
func RandStringFromCharSet ¶
RandStringFromCharSet generates a random string by selecting characters from the charset provided
func RandTLSCert ¶ added in v0.9.7
RandTLSCert generates a self-signed TLS certificate with a newly created private key, and returns both the cert and the private key PEM encoded.
func RandomWithPrefix ¶ added in v0.9.3
RandomWithPrefix is used to generate a unique name with a prefix, for randomizing names in acceptance tests
func RemoteTestPrecheck ¶ added in v0.6.10
RemoteTestPrecheck is meant to be run by any unit test that requires outbound internet connectivity. The test will be skipped if it's unavailable.
Types ¶
This section is empty.