chore: rename e2e files related to DNS

This commit is contained in:
Fernandez Ludovic 2026-03-11 15:16:05 +01:00
commit a604fd6684
No known key found for this signature in database
GPG key ID: 581FF80B781EF668
3 changed files with 44 additions and 36 deletions

View 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)
}

View file

@ -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())