2017-04-22 22:42:37 +02:00
|
|
|
package swift
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
"testing"
|
|
|
|
"time"
|
|
|
|
|
|
|
|
"github.com/hashicorp/terraform/backend"
|
|
|
|
"github.com/hashicorp/terraform/state/remote"
|
|
|
|
)
|
|
|
|
|
|
|
|
func TestRemoteClient_impl(t *testing.T) {
|
|
|
|
var _ remote.Client = new(RemoteClient)
|
|
|
|
}
|
|
|
|
|
|
|
|
func TestRemoteClient(t *testing.T) {
|
|
|
|
testACC(t)
|
|
|
|
|
|
|
|
container := fmt.Sprintf("terraform-state-swift-test-%x", time.Now().Unix())
|
|
|
|
|
2018-03-21 02:43:02 +01:00
|
|
|
b := backend.TestBackendConfig(t, New(), backend.TestWrapConfig(map[string]interface{}{
|
2017-04-22 22:42:37 +02:00
|
|
|
"container": container,
|
2018-03-21 02:43:02 +01:00
|
|
|
})).(*Backend)
|
2017-04-22 22:42:37 +02:00
|
|
|
|
|
|
|
state, err := b.State(backend.DefaultStateName)
|
|
|
|
if err != nil {
|
|
|
|
t.Fatal(err)
|
|
|
|
}
|
|
|
|
|
|
|
|
defer deleteSwiftContainer(t, b.client, container)
|
|
|
|
|
|
|
|
remote.TestClient(t, state.(*remote.State).Client)
|
|
|
|
}
|