MCPcopy Index your code
hub / github.com/cloudfoundry/cli / VerifyAppPackageContentsV3

Function VerifyAppPackageContentsV3

integration/helpers/package.go:16–35  ·  view source on GitHub ↗

VerifyAppPackageContentsV3 verifies the contents of a V3 app package by downloading the package zip and verifying the zipped files match the passed files.

(appName string, files ...string)

Source from the content-addressed store, hash-verified

14// VerifyAppPackageContentsV3 verifies the contents of a V3 app package by downloading the package zip and
15// verifying the zipped files match the passed files.
16func VerifyAppPackageContentsV3(appName string, files ...string) {
17 tmpZipFilepath, err := os.CreateTemp("", "")
18 defer os.Remove(tmpZipFilepath.Name())
19 Expect(err).ToNot(HaveOccurred())
20
21 downloadFirstAppPackage(appName, tmpZipFilepath.Name())
22 Expect(err).ToNot(HaveOccurred())
23
24 info, err := tmpZipFilepath.Stat()
25 Expect(err).ToNot(HaveOccurred())
26 reader, err := ykk.NewReader(tmpZipFilepath, info.Size())
27 Expect(err).ToNot(HaveOccurred())
28
29 seenFiles := []string{}
30 for _, file := range reader.File {
31 seenFiles = append(seenFiles, file.Name)
32 }
33
34 Expect(seenFiles).To(ConsistOf(files))
35}
36
37func GetFirstAppPackageGuid(appName string) string {
38 commandName := "v3-packages"

Callers 2

cfignore_test.goFile · 0.92

Calls 3

downloadFirstAppPackageFunction · 0.85
NameMethod · 0.80
SizeMethod · 0.80

Tested by

no test coverage detected