forked from hpi-schul-cloud/infra-otc-cert-manager-webhook
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main_test.go
48 lines (41 loc) · 1.42 KB
/
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
42
43
44
45
46
47
48
package main
import (
"os"
"testing"
"github.com/cert-manager/cert-manager/pkg/acme/webhook"
dns "github.com/cert-manager/cert-manager/test/acme"
"github.com/hpi-schul-cloud/infra-otc-cert-manager-webhook/otcdns"
"k8s.io/klog"
)
// Allows to overwrite the default value with a custom value.
func getTestZone() string {
var testZone string = "hpi-schul-cloud.dev."
if os.Getenv("TEST_ZONE_NAME") == "" {
return testZone
} else {
return os.Getenv("TEST_ZONE_NAME")
}
}
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.
klog.Info("Running test")
klog.V(2).Infof("Verbosity 2 message")
var otcdnsSolver webhook.Solver = otcdns.NewSolver()
// The test will automatically discover these authorative servers.
// ns1.open-telekom-cloud.com. = 80.158.48.19
// ns2.open-telekom-cloud.com. = 93.188.242.252
fixture := dns.NewFixture(otcdnsSolver,
dns.SetResolvedZone(getTestZone()),
//dns.SetResolvedFQDN(fqdn),
dns.SetAllowAmbientCredentials(false),
dns.SetManifestPath("testdata/otcdns/manifests"),
//dns.SetBinariesPath("_test/kubebuilder/bin"),
dns.SetDNSServer("80.158.48.19:53"),
//dns.SetDNSName(testZone),
// Enable extended tests with multiple TXT entries in one recordset.
dns.SetStrict(true),
)
fixture.RunConformance(t)
}