opentofu/internal/command/e2etest/module_archive_test.go
namgyalangmo cb2e9119aa
Update copyright notice (#1232)
Signed-off-by: namgyalangmo <75657887+namgyalangmo@users.noreply.github.com>
2024-02-08 09:48:59 +00:00

38 lines
830 B
Go

// Copyright (c) The OpenTofu Authors
// SPDX-License-Identifier: MPL-2.0
// Copyright (c) 2023 HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0
package e2etest
import (
"path/filepath"
"strings"
"testing"
"github.com/opentofu/opentofu/internal/e2e"
)
func TestInitModuleArchive(t *testing.T) {
t.Parallel()
// this fetches a module archive from github
skipIfCannotAccessNetwork(t)
fixturePath := filepath.Join("testdata", "module-archive")
tf := e2e.NewBinary(t, tofuBin, fixturePath)
stdout, stderr, err := tf.Run("init")
if err != nil {
t.Errorf("unexpected error: %s", err)
}
if stderr != "" {
t.Errorf("unexpected stderr output:\n%s", stderr)
}
if !strings.Contains(stdout, "OpenTofu has been successfully initialized!") {
t.Errorf("success message is missing from output:\n%s", stdout)
}
}