Skip to content

Commit e1d7069

Browse files
committed
test: assert prefix rather than exact match for GOFIPS140 env
Signed-off-by: Dominik Rosiek <dominik.rosiek@elastic.co>
1 parent 74ac2ea commit e1d7069

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

dev-tools/packaging/testing/package_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -877,7 +877,8 @@ func checkFIPS(t *testing.T, agentPackageRootDir string) {
877877
continue
878878
case "GOFIPS140":
879879
foundFIPS = true
880-
require.Equal(t, "v1.0.0", setting.Value, "GOFIPS140 must reference the certified module version")
880+
// Go embeds a commit hash suffix (e.g. v1.0.0-c2097c7c), so check by prefix.
881+
require.True(t, strings.HasPrefix(setting.Value, "v1.0.0"), "GOFIPS140 must reference the certified module version v1.0.0, got: %s", setting.Value)
881882
continue
882883
case "DefaultGODEBUG":
883884
if strings.Contains(setting.Value, "fips140=on") {

0 commit comments

Comments
 (0)