(t *testing.T)
| 181 | } |
| 182 | |
| 183 | func 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 | |
| 205 | func TestVerifyPluginMalformedData(t *testing.T) { |
| 206 | // Test with malformed tarball data - should fail |
nothing calls this directly
no test coverage detected
searching dependent graphs…