mirror of
https://github.com/hashicorp/packer.git
synced 2026-09-23 00:11:41 -04:00
backport of commit 28bf784869
This commit is contained in:
@@ -3,6 +3,7 @@ package packer_test
|
||||
import (
|
||||
"crypto/sha256"
|
||||
"fmt"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"runtime"
|
||||
"strings"
|
||||
@@ -140,3 +141,26 @@ func (ts *PackerTestSuite) TestLoadWithSHAMismatches() {
|
||||
Grep(`Checksums \(\*sha256\.digest\) did not match.`, grepStderr))
|
||||
})
|
||||
}
|
||||
|
||||
func (ts *PackerTestSuite) TestPluginPathEnvvarWithMultiplePaths() {
|
||||
pluginDirOne, cleanup := ts.MakePluginDir("1.0.10")
|
||||
defer cleanup()
|
||||
|
||||
pluginDirTwo, cleanup := ts.MakePluginDir("1.0.9")
|
||||
defer cleanup()
|
||||
|
||||
pluginDirVal := fmt.Sprintf("%s%c%s", pluginDirOne, os.PathListSeparator, pluginDirTwo)
|
||||
ts.Run("load plugin with two dirs - not supported anymore, should error", func() {
|
||||
ts.PackerCommand().UsePluginDir(pluginDirVal).
|
||||
SetArgs("plugins", "installed").
|
||||
Assert(ts.T(), MustFail(),
|
||||
Grep("Multiple paths are no longer supported for PACKER_PLUGIN_PATH"),
|
||||
PipeChecker{
|
||||
check: IntCompare(eq, 2),
|
||||
pipers: []Pipe{
|
||||
PipeGrep(`\* PACKER_PLUGIN_PATH=`),
|
||||
LineCount(),
|
||||
},
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user