MCPcopy
hub / github.com/helm/helm / TestPluginVerifyCmd_InvalidProvenance

Function TestPluginVerifyCmd_InvalidProvenance

pkg/cmd/plugin_verify_test.go:96–118  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

94}
95
96func TestPluginVerifyCmd_InvalidProvenance(t *testing.T) {
97 ensure.HelmHome(t)
98
99 // Create a plugin tarball with invalid .prov file
100 pluginTgz := createTestPluginTarball(t)
101 defer os.Remove(pluginTgz)
102
103 // Create invalid .prov file
104 provFile := pluginTgz + ".prov"
105 if err := os.WriteFile(provFile, []byte("invalid provenance"), 0644); err != nil {
106 t.Fatal(err)
107 }
108 defer os.Remove(provFile)
109
110 out := &bytes.Buffer{}
111 cmd := newPluginVerifyCmd(out)
112 cmd.SetArgs([]string{pluginTgz})
113
114 err := cmd.Execute()
115 if err == nil {
116 t.Error("expected error when .prov file is invalid")
117 }
118}
119
120func TestPluginVerifyCmd_DirectoryNotSupported(t *testing.T) {
121 ensure.HelmHome(t)

Callers

nothing calls this directly

Calls 7

HelmHomeFunction · 0.92
createTestPluginTarballFunction · 0.85
newPluginVerifyCmdFunction · 0.85
FatalMethod · 0.80
RemoveMethod · 0.45
WriteFileMethod · 0.45
ErrorMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…