2023-05-02 10:33:06 -05:00
|
|
|
// Copyright (c) HashiCorp, Inc.
|
|
|
|
// SPDX-License-Identifier: MPL-2.0
|
|
|
|
|
2020-06-24 13:09:59 -05:00
|
|
|
package e2etest
|
|
|
|
|
|
|
|
import (
|
|
|
|
"path/filepath"
|
|
|
|
"testing"
|
|
|
|
|
2023-08-17 07:45:11 -05:00
|
|
|
"github.com/placeholderplaceholderplaceholder/opentf/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")
|
2022-04-08 11:34:16 -05:00
|
|
|
tf := e2e.NewBinary(t, terraformBin, fixturePath)
|
2020-06-24 13:09:59 -05:00
|
|
|
|
|
|
|
//// 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)
|
|
|
|
}
|
|
|
|
}
|