github.com/opentofu/opentofu@v1.7.1/internal/command/e2etest/remote_state_test.go (about)

     1  // Copyright (c) The OpenTofu Authors
     2  // SPDX-License-Identifier: MPL-2.0
     3  // Copyright (c) 2023 HashiCorp, Inc.
     4  // SPDX-License-Identifier: MPL-2.0
     5  
     6  package e2etest
     7  
     8  import (
     9  	"path/filepath"
    10  	"testing"
    11  
    12  	"github.com/opentofu/opentofu/internal/e2e"
    13  )
    14  
    15  func TestOpenTofuProviderRead(t *testing.T) {
    16  	// Ensure the tofu provider can correctly read a remote state
    17  
    18  	t.Parallel()
    19  	fixturePath := filepath.Join("testdata", "tf-provider")
    20  	tf := e2e.NewBinary(t, tofuBin, fixturePath)
    21  
    22  	//// INIT
    23  	_, stderr, err := tf.Run("init")
    24  	if err != nil {
    25  		t.Fatalf("unexpected init error: %s\nstderr:\n%s", err, stderr)
    26  	}
    27  
    28  	//// PLAN
    29  	_, stderr, err = tf.Run("plan")
    30  	if err != nil {
    31  		t.Fatalf("unexpected plan error: %s\nstderr:\n%s", err, stderr)
    32  	}
    33  }