-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathmain_test.go
42 lines (34 loc) · 1.3 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
package main
import (
"os"
"strconv"
"testing"
"time"
"github.com/jetstack/cert-manager/test/acme/dns"
)
var (
// Environment variable holding the name of the zone to test, ex: example.com however this needs to be a zone you have control over in Loopia.
// This needs to be set before running the test.
zone = os.Getenv("TEST_ZONE_NAME")
// Environment variable for enabling the strict mode testing.
strictmodeenv = os.Getenv("TEST_STRICT_MODE")
)
func TestRunsSuite(t *testing.T) {
// The manifest path should contain a file named config.json that is a sniplet of valid configuration that should be included on the ChallengeRequest passed as part of the test cases.
// The test fixture also requires the kubebuilder-tools binary for your os/architecture to be downloaded to testdata/bin, there is a script supplied that does this in testdata/scripts.
var strictmode, err = strconv.ParseBool(strictmodeenv)
if err != nil {
strictmode = false
}
solver := &loopiaDNSProviderSolver{}
fixture := dns.NewFixture(solver,
dns.SetStrict(strictmode),
dns.SetBinariesPath("testdata/bin"),
dns.SetResolvedZone(zone),
dns.SetAllowAmbientCredentials(false),
dns.SetManifestPath("testdata/loopia"),
dns.SetPollInterval(time.Second*60),
dns.SetPropagationLimit(time.Minute*30),
)
fixture.RunConformance(t)
}