Add unit test for acmedns

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>
This commit is contained in:
Max Ehrlich 2018-08-03 11:53:24 -04:00
parent 2da7fa7261
commit 310a6f8689
No known key found for this signature in database
GPG Key ID: 439AC62D3C8A495A

View File

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