test: add test for loading plugins with wd plugin

Add one more test to ensure we don't load plugins with the old naming
convention in the workdir for a packer run.
pull/12983/head
Lucas Bajolet 2 years ago
parent 91eaf93375
commit 6f93eec99b

@ -62,6 +62,17 @@ func (ts *PackerTestSuite) TestLoadWithLegacyPluginName() {
SetArgs("build", "templates/simple.pkr.hcl").
Assert(ts.T(), MustSucceed(), Grep("packer-plugin-tester_v1\\.0\\.0[^\\n]+ plugin:", grepStderr))
})
wd, cleanup := TempWorkdir(ts.T(), "./templates/simple.pkr.hcl")
defer cleanup()
CopyFile(ts.T(), filepath.Join(wd, "packer-plugin-tester"), plugin)
ts.Run("multiple plugins installed: 1.0.0 in plugin dir with sum, one in workdir (no version). Should load 1.0.0", func() {
ts.PackerCommand().UsePluginDir(pluginDir).SetWD(wd).
SetArgs("build", "simple.pkr.hcl").
Assert(ts.T(), MustSucceed(), Grep("packer-plugin-tester_v1\\.0\\.0[^\\n]+ plugin:", grepStderr))
})
}
func (ts *PackerTestSuite) TestLoadWithSHAMismatches() {

Loading…
Cancel
Save