From 2fda9a1de1930956b440e5a069a6b2892e7aa9c1 Mon Sep 17 00:00:00 2001 From: anshul sharma Date: Tue, 27 May 2025 13:49:50 +0530 Subject: [PATCH] changes for fixing the SHA mismatch test case --- packer_test/plugin_tests/loading_test.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packer_test/plugin_tests/loading_test.go b/packer_test/plugin_tests/loading_test.go index c3e87f0e7..60389c808 100644 --- a/packer_test/plugin_tests/loading_test.go +++ b/packer_test/plugin_tests/loading_test.go @@ -121,6 +121,7 @@ func (ts *PackerPluginTestSuite) TestLoadWithSHAMismatches() { pluginDestName := common.ExpectedInstalledName("1.0.10") common.CopyFile(ts.T(), filepath.Join(pluginDir.Dir(), "github.com", "hashicorp", "tester", pluginDestName), plugin) + common.WriteFile(ts.T(), filepath.Join(pluginDir.Dir(), "github.com", "hashicorp", "tester", fmt.Sprintf("%s_SHA256SUM", pluginDestName)), fmt.Sprintf("%x", sha256.New().Sum([]byte("Not the plugin's contents for sure.")))) @@ -131,7 +132,7 @@ func (ts *PackerPluginTestSuite) TestLoadWithSHAMismatches() { check.Grep("packer-plugin-tester_v1\\.0\\.9[^\\n]+", check.GrepStdout), check.GrepInverted("packer-plugin-tester_v1.0.10", check.GrepStdout), check.Grep("v1.0.10[^\\n]+ignoring possibly unsafe binary", check.GrepStderr), - check.Grep(`Checksums \(\*sha256\.digest\) did not match.`, check.GrepStderr)) + check.Grep(`Checksums \(\*sha256\.[dD]igest\) did not match.`, check.GrepStderr)) }) }