mirror of
https://github.com/go-acme/lego
synced 2026-03-14 14:35:48 +01:00
chore: rename e2e files related to DNS
This commit is contained in:
parent
8997304f93
commit
a604fd6684
3 changed files with 44 additions and 36 deletions
44
e2e/dnschallenge/challenges_test.go
Normal file
44
e2e/dnschallenge/challenges_test.go
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
package dnschallenge
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"os"
|
||||
"testing"
|
||||
|
||||
"github.com/go-acme/lego/v5/e2e/loader"
|
||||
)
|
||||
|
||||
const caDirectory = "https://localhost:15000/dir"
|
||||
|
||||
var load = loader.EnvLoader{
|
||||
PebbleOptions: &loader.CmdOption{
|
||||
HealthCheckURL: caDirectory,
|
||||
Args: []string{"-strict", "-config", "fixtures/pebble-config-dns.json", "-dnsserver", "localhost:8053"},
|
||||
Env: []string{"PEBBLE_VA_NOSLEEP=1", "PEBBLE_WFE_NONCEREJECT=20"},
|
||||
Dir: "../",
|
||||
},
|
||||
LegoOptions: []string{
|
||||
"LEGO_CA_CERTIFICATES=../fixtures/certs/pebble.minica.pem",
|
||||
"EXEC_PATH=../fixtures/update-dns.sh",
|
||||
"EXEC_SEQUENCE_INTERVAL=5",
|
||||
"LEGO_DEBUG_ACME_HTTP_CLIENT=1",
|
||||
},
|
||||
ChallSrv: &loader.CmdOption{
|
||||
Args: []string{"-http01", ":5012", "-tlsalpn01", ":5011"},
|
||||
},
|
||||
}
|
||||
|
||||
func TestMain(m *testing.M) {
|
||||
os.Exit(load.MainTest(context.Background(), m))
|
||||
}
|
||||
|
||||
func TestDNSHelp(t *testing.T) {
|
||||
output, err := load.RunLegoCombinedOutput(t.Context(), "dnshelp")
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "%s\n", output)
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
fmt.Fprintf(os.Stdout, "%s\n", output)
|
||||
}
|
||||
|
|
@ -1,10 +1,8 @@
|
|||
package dnschallenge
|
||||
|
||||
import (
|
||||
"context"
|
||||
"crypto/rand"
|
||||
"crypto/rsa"
|
||||
"fmt"
|
||||
"os"
|
||||
"testing"
|
||||
|
||||
|
|
@ -24,40 +22,6 @@ const (
|
|||
testDomain2 = "*.légo.localhost"
|
||||
)
|
||||
|
||||
const caDirectory = "https://localhost:15000/dir"
|
||||
|
||||
var load = loader.EnvLoader{
|
||||
PebbleOptions: &loader.CmdOption{
|
||||
HealthCheckURL: caDirectory,
|
||||
Args: []string{"-strict", "-config", "fixtures/pebble-config-dns.json", "-dnsserver", "localhost:8053"},
|
||||
Env: []string{"PEBBLE_VA_NOSLEEP=1", "PEBBLE_WFE_NONCEREJECT=20"},
|
||||
Dir: "../",
|
||||
},
|
||||
LegoOptions: []string{
|
||||
"LEGO_CA_CERTIFICATES=../fixtures/certs/pebble.minica.pem",
|
||||
"EXEC_PATH=../fixtures/update-dns.sh",
|
||||
"EXEC_SEQUENCE_INTERVAL=5",
|
||||
"LEGO_DEBUG_ACME_HTTP_CLIENT=1",
|
||||
},
|
||||
ChallSrv: &loader.CmdOption{
|
||||
Args: []string{"-http01", ":5012", "-tlsalpn01", ":5011"},
|
||||
},
|
||||
}
|
||||
|
||||
func TestMain(m *testing.M) {
|
||||
os.Exit(load.MainTest(context.Background(), m))
|
||||
}
|
||||
|
||||
func TestDNSHelp(t *testing.T) {
|
||||
output, err := load.RunLegoCombinedOutput(t.Context(), "dnshelp")
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "%s\n", output)
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
fmt.Fprintf(os.Stdout, "%s\n", output)
|
||||
}
|
||||
|
||||
func TestChallengeDNS_Run(t *testing.T) {
|
||||
loader.CleanLegoFiles(t.Context())
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue