|
| 1 | +// SPDX-License-Identifier: Apache-2.0 |
| 2 | +// SPDX-FileCopyrightText: 2021-Present The Zarf Authors |
| 3 | + |
| 4 | +// Package test provides e2e tests for Zarf. |
| 5 | +package test |
| 6 | + |
| 7 | +import ( |
| 8 | + "fmt" |
| 9 | + "path/filepath" |
| 10 | + "testing" |
| 11 | + |
| 12 | + "github.com/stretchr/testify/require" |
| 13 | +) |
| 14 | + |
| 15 | +func TestManifestWithSymlink(t *testing.T) { |
| 16 | + t.Log("E2E: Manifest With Symlink") |
| 17 | + tmpdir := t.TempDir() |
| 18 | + cachePath := filepath.Join(tmpdir, ".cache-location") |
| 19 | + |
| 20 | + // Build the package, should succeed, even though there is a symlink in the package. |
| 21 | + buildPath := filepath.Join("src", "test", "packages", "34-manifest-with-symlink") |
| 22 | + stdOut, stdErr, err := e2e.Zarf("package", "create", buildPath, "--zarf-cache", cachePath, "-o=build", "--confirm") |
| 23 | + require.NoError(t, err, stdOut, stdErr) |
| 24 | + |
| 25 | + path := fmt.Sprintf("build/zarf-package-manifest-with-symlink-%s-0.0.1.tar.zst", e2e.Arch) |
| 26 | + require.FileExists(t, path) |
| 27 | + defer e2e.CleanFiles(path) |
| 28 | + |
| 29 | + stdOut, stdErr, err = e2e.Zarf("package", "deploy", path, "--zarf-cache", cachePath, "--confirm") |
| 30 | + defer e2e.CleanFiles("temp/manifests") |
| 31 | + require.NoError(t, err, stdOut, stdErr) |
| 32 | + require.FileExists(t, "temp/manifests/resources/img", "Symlink does not exist in the package as expected.") |
| 33 | +} |
0 commit comments