2023-05-02 11:33:06 -04:00
|
|
|
// Copyright IBM Corp. 2014, 2026
|
2023-08-10 18:43:27 -04:00
|
|
|
// SPDX-License-Identifier: BUSL-1.1
|
2023-05-02 11:33:06 -04:00
|
|
|
|
2020-06-24 14:09:59 -04:00
|
|
|
package e2etest
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"path/filepath"
|
|
|
|
|
"testing"
|
|
|
|
|
|
2021-05-17 12:48:22 -04:00
|
|
|
"github.com/hashicorp/terraform/internal/e2e"
|
2020-06-24 14:09:59 -04: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 12:34:16 -04:00
|
|
|
tf := e2e.NewBinary(t, terraformBin, fixturePath)
|
2020-06-24 14:09:59 -04: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)
|
|
|
|
|
}
|
|
|
|
|
}
|