forked from nic-at/certmanager-webhook-rcodezero
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main_test.go
41 lines (34 loc) · 919 Bytes
/
main_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
36
37
38
39
40
41
package main
import (
"os"
"testing"
"time"
dns "github.com/cert-manager/cert-manager/test/acme"
)
var (
zone = getEnv("TEST_ZONE_NAME", "test.")
dnsServer = getEnv("TEST_DNS_SERVER", "8.8.8.8:53")
)
func TestRunsSuite(t *testing.T) {
// The manifest path should contain a file named config.json that is a
// snippet of valid configuration that should be included on the
// ChallengeRequest passed as part of the test cases.
//
fixture := dns.NewFixture(&RcodeZeroDNSProviderSolver{},
dns.SetDNSServer(dnsServer),
dns.SetResolvedZone(zone),
dns.SetAllowAmbientCredentials(false),
dns.SetManifestPath("testdata/rcodezero"),
dns.SetStrict(true),
dns.SetPropagationLimit(240*time.Second),
)
fixture.RunConformance(t)
fixture.RunBasic(t)
fixture.RunExtended(t)
}
func getEnv(key, fallback string) string {
if value, ok := os.LookupEnv(key); ok {
return value
}
return fallback
}