diff --git a/internal/backend/remote-state/consul/client_test.go b/internal/backend/remote-state/consul/client_test.go index 133122a68..85842be5e 100644 --- a/internal/backend/remote-state/consul/client_test.go +++ b/internal/backend/remote-state/consul/client_test.go @@ -136,11 +136,6 @@ func TestConsul_largeState(t *testing.T) { t.Fatal(err) } - // md5 := md5.Sum(payload) - // if !bytes.Equal(md5[:], remote.MD5) { - // t.Fatal("the md5 sums do not match") - // } - if !bytes.Equal(payload, remote.Data) { t.Fatal("the data do not match") } @@ -161,6 +156,19 @@ func TestConsul_largeState(t *testing.T) { }, ) + // This payload is just short enough to be stored but will be bigger when + // going through the Transaction API as it will be base64 encoded + testPayload( + t, + map[string]string{ + "foo": strings.Repeat("a", 524288-10), + }, + []string{ + "tf-unit/test-large-state", + "tf-unit/test-large-state/tfstate.4f407ace136a86521fd0d366972fe5c7/0", + }, + ) + // We try to replace the payload with a small one, the old chunks should be removed testPayload( t,