From f46b2272283056876fb9df794e3c67d3a2c3c059 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Tue, 22 Nov 2022 12:10:18 +0100 Subject: executor: add test for zlib decompression --- pkg/testutil/testutil.go | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'pkg/testutil') diff --git a/pkg/testutil/testutil.go b/pkg/testutil/testutil.go index 9a8de26bd..566d728ef 100644 --- a/pkg/testutil/testutil.go +++ b/pkg/testutil/testutil.go @@ -22,3 +22,11 @@ func RandSource(t *testing.T) rand.Source { t.Logf("seed=%v", seed) return rand.NewSource(seed) } + +func RandMountImage(r *rand.Rand) []byte { + const maxLen = 1 << 20 // 1 MB. + len := r.Intn(maxLen) + slice := make([]byte, len) + r.Read(slice) + return slice +} -- cgit mrf-deployment