Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[8.x](backport #6380) test: increase passwd length in crypto io tests #6407

Merged
merged 2 commits into from
Dec 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions internal/pkg/crypto/io_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (

func TestIO(t *testing.T) {
t.Run("encode and decode with the right password", func(t *testing.T) {
passwd := []byte("hello")
passwd := bytes.Repeat([]byte("hello"), 10)
msg := []byte("bonjour la famille")
dest := new(bytes.Buffer)

Expand All @@ -40,7 +40,7 @@ func TestIO(t *testing.T) {
})

t.Run("Large single write", func(t *testing.T) {
passwd := []byte("hello")
passwd := bytes.Repeat([]byte("hello"), 10)
msg, err := randomBytes(1327)

require.NoError(t, err)
Expand All @@ -67,7 +67,7 @@ func TestIO(t *testing.T) {
})

t.Run("try to decode with the wrong password", func(t *testing.T) {
passwd := []byte("hello")
passwd := bytes.Repeat([]byte("hello"), 10)
msg := []byte("bonjour la famille")
dest := new(bytes.Buffer)

Expand All @@ -90,7 +90,7 @@ func TestIO(t *testing.T) {
})

t.Run("Make sure that buffered IO works with the encoder", func(t *testing.T) {
passwd := []byte("hello")
passwd := bytes.Repeat([]byte("hello"), 10)
msg, err := randomBytes(2048)
require.NoError(t, err)
dest := new(bytes.Buffer)
Expand Down Expand Up @@ -121,7 +121,7 @@ func TestIO(t *testing.T) {
})

t.Run("Make sure that buffered IO works with the decoder", func(t *testing.T) {
passwd := []byte("hello")
passwd := bytes.Repeat([]byte("hello"), 10)
msg, err := randomBytes(2048)
require.NoError(t, err)
dest := new(bytes.Buffer)
Expand Down Expand Up @@ -163,7 +163,7 @@ func TestIO(t *testing.T) {
})

t.Run("works with multiple writes", func(t *testing.T) {
passwd := []byte("hello")
passwd := bytes.Repeat([]byte("hello"), 10)

expected := []byte("hello world bonjour la famille")

Expand Down
Loading