forked from jcmturner/gokrb5
-
Notifications
You must be signed in to change notification settings - Fork 1
/
test.go
35 lines (30 loc) · 867 Bytes
/
test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
// Package test provides useful resources for the testing of gokrb5.
package test
import (
"os"
"testing"
)
// Test enabling environment variable key values.
const (
IntegrationEnvVar = "INTEGRATION"
ADIntegrationEnvVar = "TESTAD"
PrivIntegrationEnvVar = "TESTPRIVILEGED"
)
// Integration skips the test unless the integration test environment variable is set.
func Integration(t *testing.T) {
if os.Getenv(IntegrationEnvVar) != "1" {
t.Skip("Skipping integration test")
}
}
// AD skips the test unless the AD test environment variable is set.
func AD(t *testing.T) {
if os.Getenv(ADIntegrationEnvVar) != "1" {
t.Skip("Skipping AD integration test")
}
}
// Privileged skips the test that require local root privilege.
func Privileged(t *testing.T) {
if os.Getenv(PrivIntegrationEnvVar) != "1" {
t.Skip("Skipping DNS integration test")
}
}