mirror of
https://github.com/hashicorp/packer.git
synced 2026-09-23 08:21:43 -04:00
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.
This commit is contained in:
@@ -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))
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user