MCPcopy
hub / github.com/helm/helm / TestVerifyPluginMissingProvenance

Function TestVerifyPluginMissingProvenance

internal/plugin/verify_test.go:183–203  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

181}
182
183func TestVerifyPluginMissingProvenance(t *testing.T) {
184 tempDir := t.TempDir()
185 tarballPath := filepath.Join(tempDir, "no-prov.tar.gz")
186
187 // Create a minimal tarball
188 if err := os.WriteFile(tarballPath, []byte("dummy"), 0644); err != nil {
189 t.Fatal(err)
190 }
191
192 // Read the tarball data
193 archiveData, err := os.ReadFile(tarballPath)
194 if err != nil {
195 t.Fatal(err)
196 }
197
198 // Try to verify with empty provenance data
199 _, err = VerifyPlugin(archiveData, nil, filepath.Base(tarballPath), testPubFile)
200 if err == nil {
201 t.Error("Expected verification to fail with empty provenance data")
202 }
203}
204
205func TestVerifyPluginMalformedData(t *testing.T) {
206 // Test with malformed tarball data - should fail

Callers

nothing calls this directly

Calls 4

VerifyPluginFunction · 0.85
FatalMethod · 0.80
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…