Add unit test for acmedns
Signed-off-by: Max Ehrlich <max.ehr@gmail.com>
This commit is contained in:
parent
2da7fa7261
commit
310a6f8689
@ -1 +1,33 @@
|
||||
package acmedns
|
||||
|
||||
import (
|
||||
"github.com/stretchr/testify/assert"
|
||||
"os"
|
||||
"testing"
|
||||
)
|
||||
|
||||
var (
|
||||
acmednsLiveTest bool
|
||||
acmednsHost string
|
||||
acmednsAccountsJson []byte
|
||||
acmednsDomain string
|
||||
)
|
||||
|
||||
func init() {
|
||||
acmednsHost = os.Getenv("")
|
||||
acmednsAccountsJson = []byte(os.Getenv("AZURE_CLIENT_SECRET"))
|
||||
if len(acmednsHost) > 0 && len(acmednsAccountsJson) > 0 {
|
||||
acmednsLiveTest = true
|
||||
}
|
||||
}
|
||||
|
||||
func TestLiveAzureDnsPresent(t *testing.T) {
|
||||
if !acmednsLiveTest {
|
||||
t.Skip("skipping live test")
|
||||
}
|
||||
provider, err := NewDNSProviderHostBytes(acmednsHost, acmednsAccountsJson)
|
||||
assert.NoError(t, err)
|
||||
|
||||
err = provider.Present(acmednsDomain, "", "123d==")
|
||||
assert.NoError(t, err)
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user