From 609320ccc98555c39da0dca6bf44d5db026fb5f9 Mon Sep 17 00:00:00 2001 From: Lucas Bajolet Date: Tue, 7 May 2024 15:03:38 +0000 Subject: [PATCH] backport of commit 6f93eec99ba558eab37c2f2ef68b5aa6c4eeaf5a --- test/loading_test.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/test/loading_test.go b/test/loading_test.go index a5715317c..20ff7071d 100644 --- a/test/loading_test.go +++ b/test/loading_test.go @@ -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() {