get.porter.sh/porter@v1.3.0/tests/integration/pull_test.go (about)

     1  //go:build integration
     2  
     3  package integration
     4  
     5  import (
     6  	"testing"
     7  
     8  	"get.porter.sh/porter/pkg/cache"
     9  	"get.porter.sh/porter/pkg/porter"
    10  	"github.com/stretchr/testify/require"
    11  )
    12  
    13  func TestPull_ContentDigestMissing(t *testing.T) {
    14  	t.Parallel()
    15  
    16  	p := porter.NewTestPorter(t)
    17  	defer p.Close()
    18  	ctx := p.SetupIntegrationTest()
    19  
    20  	opts := porter.BundlePullOptions{}
    21  	opts.Reference = "getporterci/mysql:no-content-digest"
    22  	require.NoError(t, opts.Validate())
    23  
    24  	cachedBun, err := p.PullBundle(ctx, opts)
    25  	require.Contains(t, err.Error(),
    26  		"unable to verify that the pulled image getporterci/mysql-installer:no-content-digest is the bundle image referenced by the bundle because the bundle does not specify a content digest. This could allow for the bundle image to be replaced or tampered with")
    27  	require.Equal(t, cache.CachedBundle{}, cachedBun)
    28  }