(t *testing.T)
| 94 | } |
| 95 | |
| 96 | func 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 | |
| 120 | func TestPluginVerifyCmd_DirectoryNotSupported(t *testing.T) { |
| 121 | ensure.HelmHome(t) |
nothing calls this directly
no test coverage detected
searching dependent graphs…