opentofu/internal/command/e2etest/remote_state_test.go

30 lines
630 B
Go
Raw Normal View History

2020-06-24 13:09:59 -05:00
package e2etest
import (
"path/filepath"
"testing"
"github.com/hashicorp/terraform/internal/e2e"
2020-06-24 13:09:59 -05:00
)
func TestTerraformProviderRead(t *testing.T) {
// Ensure the terraform provider can correctly read a remote state
t.Parallel()
fixturePath := filepath.Join("testdata", "terraform-provider")
tf := e2e.NewBinary(terraformBin, fixturePath)
defer tf.Close()
//// INIT
_, stderr, err := tf.Run("init")
if err != nil {
t.Fatalf("unexpected init error: %s\nstderr:\n%s", err, stderr)
}
//// PLAN
_, stderr, err = tf.Run("plan")
if err != nil {
t.Fatalf("unexpected plan error: %s\nstderr:\n%s", err, stderr)
}
}