packer_test: add test for plugin with meta in name

Plugins with metadata information in their file name (i.e.
v1.0.0+metadata) should be ignored by Packer as they could introduce
ambiguity since the metadata is free-form, so we add that test to make
sure Packer behaves coherently.
pull/13032/head
Lucas Bajolet 2 years ago committed by Lucas Bajolet
parent a49da98350
commit 66e70a863d

@ -177,3 +177,21 @@ func (ts *PackerTestSuite) TestInstallNonCanonicalPluginVersion() {
MkPipeCheck("no output in stdout").SetTester(ExpectEmptyInput()).SetStream(OnlyStdout))
})
}
func (ts *PackerTestSuite) TestLoadPluginWithMetadataInName() {
pluginPath, cleanup := ts.MakePluginDir()
defer cleanup()
ManualPluginInstall(ts.T(),
filepath.Join(pluginPath, "github.com", "hashicorp", "tester"),
BuildSimplePlugin("1.0.10+metadata", ts.T()),
"1.0.10+metadata")
ts.Run("try listing plugins with metadata in name - report none", func() {
ts.PackerCommand().UsePluginDir(pluginPath).
SetArgs("plugins", "installed").
Assert(MustSucceed(),
Grep("found version .* with metadata in the name", grepStderr),
MkPipeCheck("no output in stdout").SetTester(ExpectEmptyInput()).SetStream(OnlyStdout))
})
}

Loading…
Cancel
Save