github.com/Racer159/jackal@v0.32.7-0.20240401174413-0bd2339e4f2e/src/test/e2e/34_manifest_with_symlink_test.go (about)

     1  // SPDX-License-Identifier: Apache-2.0
     2  // SPDX-FileCopyrightText: 2021-Present The Jackal Authors
     3  
     4  // Package test provides e2e tests for Jackal.
     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  
    18  	// Build the package, should succeed, even though there is a symlink in the package.
    19  	buildPath := filepath.Join("src", "test", "packages", "34-manifest-with-symlink")
    20  	stdOut, stdErr, err := e2e.Jackal("package", "create", buildPath, "-o=build", "--confirm")
    21  	require.NoError(t, err, stdOut, stdErr)
    22  
    23  	path := fmt.Sprintf("build/jackal-package-manifest-with-symlink-%s-0.0.1.tar.zst", e2e.Arch)
    24  	require.FileExists(t, path)
    25  	defer e2e.CleanFiles(path)
    26  
    27  	stdOut, stdErr, err = e2e.Jackal("package", "deploy", path, "--confirm")
    28  	defer e2e.CleanFiles("temp/manifests")
    29  	require.NoError(t, err, stdOut, stdErr)
    30  	require.FileExists(t, "temp/manifests/resources/img", "Symlink does not exist in the package as expected.")
    31  }