Skip to content
Merged
Show file tree
Hide file tree
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
5 changes: 2 additions & 3 deletions core/coreunix/metadata_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package coreunix

import (
"bytes"
"context"
"io"
"testing"

Expand Down Expand Up @@ -31,11 +30,11 @@ func getDagserv(t *testing.T) ipld.DAGService {
}

func TestMetadata(t *testing.T) {
ctx := context.Background()
ctx := t.Context()
// Make some random node
ds := getDagserv(t)
data := make([]byte, 1000)
_, err := io.ReadFull(random.NewRand(), data)
_, err := io.ReadFull(random.New(), data)
if err != nil {
t.Fatal(err)
}
Expand Down
8 changes: 8 additions & 0 deletions docs/changelogs/v0.43.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ This release was brought to you by the [Shipyard](https://ipshipyard.com/) team.
- [🏁 `ipfs routing findprovs` no longer crashes the daemon](#-ipfs-routing-findprovs-no-longer-crashes-the-daemon)
- [🛡️ Memory exhaustion fix for pubsub](#-memory-exhaustion-fix-for-pubsub)
- [📊 Telemetry is now opt-in](#-telemetry-is-now-opt-in)
- [🧪 Tests use new go-test and rand v2](#-tests-use-new-go-test-and-rand-v2)
- [🖥️ WebUI Improvements](#-webui-improvements)
- [📦️ Dependency updates](#-dependency-updates)
- [📝 Changelog](#-changelog)
Expand Down Expand Up @@ -131,6 +132,13 @@ This flaw is already public, which is why we name it here. libp2p disclosed it a

The telemetry plugin is now opt-in and ships with no built-in endpoint: a node sends nothing until you set `Plugins.Plugins.telemetry.Config.Mode` to `on` and `Endpoint` to a collector you run, documented along with the payload schema in [telemetry.md](https://github.com/ipfs/kubo/blob/master/docs/telemetry.md).

#### 🧪 Tests use new go-test and rand v2

The new `go-test` is upgraded to use `math/rand/v2` in all of its packages. The `/go-test/random` package now allows reuse of the random number generator for more efficiently generating sets of random values.

Additionally, the `/go-test/random` package removes support for a global seed for the random number generator. This led to the possibility of multiple tests setting the global seed to generate deterministic values, and breaking other tests by causing the generator to generate unexpected values. This breakage could be intermittent and difficult to debug, depending on the how/which tests ran at the same time.

Since the underlying pseudo-random number generator was changed in the go-test module, the data generated for a given seed also changed. This required updating tests that relied on seeding the generator and getting expected values.
#### 🖥️ WebUI Improvements

IPFS Web UI has been updated to [v4.13.0](https://github.com/ipfs/ipfs-webui/releases/tag/v4.13.0).
Expand Down
4 changes: 2 additions & 2 deletions docs/examples/kubo-as-a-library/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ go 1.26.4
replace github.com/ipfs/kubo => ./../../..

require (
github.com/ipfs/boxo v0.41.1-0.20260707130650-177b35c8ef09
github.com/ipfs/boxo v0.41.1-0.20260717051107-441032d6a863
github.com/ipfs/kubo v0.0.0-00010101000000-000000000000
github.com/libp2p/go-libp2p v0.48.1-0.20260708062241-95be6665b014
github.com/multiformats/go-multiaddr v0.16.1
Expand Down Expand Up @@ -99,7 +99,7 @@ require (
github.com/ipfs/go-log/v2 v2.9.2 // indirect
github.com/ipfs/go-metrics-interface v0.3.0 // indirect
github.com/ipfs/go-peertaskqueue v0.8.3 // indirect
github.com/ipfs/go-test v0.3.0 // indirect
github.com/ipfs/go-test v0.4.1 // indirect
github.com/ipfs/go-unixfsnode v1.10.5 // indirect
github.com/ipld/go-car/v2 v2.17.0 // indirect
github.com/ipld/go-codec-dagpb v1.7.0 // indirect
Expand Down
8 changes: 4 additions & 4 deletions docs/examples/kubo-as-a-library/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -273,8 +273,8 @@ github.com/ipfs-shipyard/nopfs/ipfs v0.25.0 h1:OqNqsGZPX8zh3eFMO8Lf8EHRRnSGBMqcd
github.com/ipfs-shipyard/nopfs/ipfs v0.25.0/go.mod h1:BxhUdtBgOXg1B+gAPEplkg/GpyTZY+kCMSfsJvvydqU=
github.com/ipfs/bbloom v0.1.0 h1:nIWwfIE3AaG7RCDQIsrUonGCOTp7qSXzxH7ab/ss964=
github.com/ipfs/bbloom v0.1.0/go.mod h1:lDy3A3i6ndgEW2z1CaRFvDi5/ZTzgM1IxA/pkL7Wgts=
github.com/ipfs/boxo v0.41.1-0.20260707130650-177b35c8ef09 h1:jl4/IHR4IRb0QOVw6vFxUL4NRnetk1V42HIdipWu+aw=
github.com/ipfs/boxo v0.41.1-0.20260707130650-177b35c8ef09/go.mod h1:mnR769LN1W7rDI6z1GBLmD15x4pvMdW0oWxik8j3y6g=
github.com/ipfs/boxo v0.41.1-0.20260717051107-441032d6a863 h1:C3Xufr5x4qxdhlR3LKL6eKBMJQKpzeNBoGCniXv448I=
github.com/ipfs/boxo v0.41.1-0.20260717051107-441032d6a863/go.mod h1:DLLtSR+2xJF3W5HRGPvL3H+y+MfBzdy1/IPlLwU0n1A=
github.com/ipfs/go-bitfield v1.1.0 h1:fh7FIo8bSwaJEh6DdTWbCeZ1eqOaOkKFI74SCnsWbGA=
github.com/ipfs/go-bitfield v1.1.0/go.mod h1:paqf1wjq/D2BBmzfTVFlJQ9IlFOZpg422HL0HqsGWHU=
github.com/ipfs/go-block-format v0.0.3/go.mod h1:4LmD4ZUw0mhO+JSKdpWwrzATiEfM7WWgQ8H5l6P8MVk=
Expand Down Expand Up @@ -339,8 +339,8 @@ github.com/ipfs/go-metrics-interface v0.3.0 h1:YwG7/Cy4R94mYDUuwsBfeziJCVm9pBMJ6
github.com/ipfs/go-metrics-interface v0.3.0/go.mod h1:OxxQjZDGocXVdyTPocns6cOLwHieqej/jos7H4POwoY=
github.com/ipfs/go-peertaskqueue v0.8.3 h1:tBPpGJy+A92RqtRFq5amJn0Uuj8Pw8tXi0X3eHfHM8w=
github.com/ipfs/go-peertaskqueue v0.8.3/go.mod h1:OqVync4kPOcXEGdj/LKvox9DCB5mkSBeXsPczCxLtYA=
github.com/ipfs/go-test v0.3.0 h1:0Y4Uve3tp9HI+2lIJjfOliOrOgv/YpXg/l1y3P4DEYE=
github.com/ipfs/go-test v0.3.0/go.mod h1:JK+U8pRpATZb7lsYNSJlCj3WYB3cFfWIbI6nWRM/GFk=
github.com/ipfs/go-test v0.4.1 h1:n6uNSakIgpTQIRorqNg2O02aMIFDLQk2z4rBfrlD3Uw=
github.com/ipfs/go-test v0.4.1/go.mod h1:QmvVBf9kClNtRuFow4DASq03eFvjKla4Fy/UAkeeLO8=
github.com/ipfs/go-unixfsnode v1.10.5 h1:V34JV7fM90y+2ZUef7ToShjmwAZ8oo1yP7zrpWzC5L4=
github.com/ipfs/go-unixfsnode v1.10.5/go.mod h1:u/9Ukl+XYpfKTMu+NXQqxbzAJVTwSCoyTYBGgE+JdSE=
github.com/ipld/go-car/v2 v2.17.0 h1:zgjSxf/lQNYcQPX08cvb5rSdEY8sv5OOnQIsZhZMPx4=
Expand Down
2 changes: 1 addition & 1 deletion fuse/readonly/ipfs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ func testMount(t *testing.T, root fs.InodeEmbedder) string {

func randObj(t *testing.T, nd *core.IpfsNode, size int64) (ipld.Node, []byte) {
buf := make([]byte, size)
_, err := io.ReadFull(random.NewRand(), buf)
_, err := io.ReadFull(random.New(), buf)
if err != nil {
t.Fatal(err)
}
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ require (
github.com/hashicorp/go-version v1.9.0
github.com/ipfs-shipyard/nopfs v0.0.14
github.com/ipfs-shipyard/nopfs/ipfs v0.25.0
github.com/ipfs/boxo v0.41.1-0.20260707130650-177b35c8ef09
github.com/ipfs/boxo v0.41.1-0.20260717051107-441032d6a863
github.com/ipfs/go-block-format v0.2.4
github.com/ipfs/go-cid v0.6.2
github.com/ipfs/go-cidutil v0.1.2
Expand All @@ -42,7 +42,7 @@ require (
github.com/ipfs/go-log/v2 v2.9.2
github.com/ipfs/go-metrics-interface v0.3.0
github.com/ipfs/go-metrics-prometheus v0.1.0
github.com/ipfs/go-test v0.3.0
github.com/ipfs/go-test v0.4.1
github.com/ipfs/go-unixfsnode v1.10.5
github.com/ipld/go-car/v2 v2.17.0
github.com/ipld/go-codec-dagpb v1.7.0
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -344,8 +344,8 @@ github.com/ipfs-shipyard/nopfs/ipfs v0.25.0 h1:OqNqsGZPX8zh3eFMO8Lf8EHRRnSGBMqcd
github.com/ipfs-shipyard/nopfs/ipfs v0.25.0/go.mod h1:BxhUdtBgOXg1B+gAPEplkg/GpyTZY+kCMSfsJvvydqU=
github.com/ipfs/bbloom v0.1.0 h1:nIWwfIE3AaG7RCDQIsrUonGCOTp7qSXzxH7ab/ss964=
github.com/ipfs/bbloom v0.1.0/go.mod h1:lDy3A3i6ndgEW2z1CaRFvDi5/ZTzgM1IxA/pkL7Wgts=
github.com/ipfs/boxo v0.41.1-0.20260707130650-177b35c8ef09 h1:jl4/IHR4IRb0QOVw6vFxUL4NRnetk1V42HIdipWu+aw=
github.com/ipfs/boxo v0.41.1-0.20260707130650-177b35c8ef09/go.mod h1:mnR769LN1W7rDI6z1GBLmD15x4pvMdW0oWxik8j3y6g=
github.com/ipfs/boxo v0.41.1-0.20260717051107-441032d6a863 h1:C3Xufr5x4qxdhlR3LKL6eKBMJQKpzeNBoGCniXv448I=
github.com/ipfs/boxo v0.41.1-0.20260717051107-441032d6a863/go.mod h1:DLLtSR+2xJF3W5HRGPvL3H+y+MfBzdy1/IPlLwU0n1A=
github.com/ipfs/go-bitfield v1.1.0 h1:fh7FIo8bSwaJEh6DdTWbCeZ1eqOaOkKFI74SCnsWbGA=
github.com/ipfs/go-bitfield v1.1.0/go.mod h1:paqf1wjq/D2BBmzfTVFlJQ9IlFOZpg422HL0HqsGWHU=
github.com/ipfs/go-block-format v0.0.3/go.mod h1:4LmD4ZUw0mhO+JSKdpWwrzATiEfM7WWgQ8H5l6P8MVk=
Expand Down Expand Up @@ -412,8 +412,8 @@ github.com/ipfs/go-metrics-prometheus v0.1.0 h1:bApWOHkrH3VTBHzTHrZSfq4n4weOZDzZ
github.com/ipfs/go-metrics-prometheus v0.1.0/go.mod h1:2GtL525C/4yxtvSXpRJ4dnE45mCX9AS0XRa03vHx7G0=
github.com/ipfs/go-peertaskqueue v0.8.3 h1:tBPpGJy+A92RqtRFq5amJn0Uuj8Pw8tXi0X3eHfHM8w=
github.com/ipfs/go-peertaskqueue v0.8.3/go.mod h1:OqVync4kPOcXEGdj/LKvox9DCB5mkSBeXsPczCxLtYA=
github.com/ipfs/go-test v0.3.0 h1:0Y4Uve3tp9HI+2lIJjfOliOrOgv/YpXg/l1y3P4DEYE=
github.com/ipfs/go-test v0.3.0/go.mod h1:JK+U8pRpATZb7lsYNSJlCj3WYB3cFfWIbI6nWRM/GFk=
github.com/ipfs/go-test v0.4.1 h1:n6uNSakIgpTQIRorqNg2O02aMIFDLQk2z4rBfrlD3Uw=
github.com/ipfs/go-test v0.4.1/go.mod h1:QmvVBf9kClNtRuFow4DASq03eFvjKla4Fy/UAkeeLO8=
github.com/ipfs/go-unixfsnode v1.10.5 h1:V34JV7fM90y+2ZUef7ToShjmwAZ8oo1yP7zrpWzC5L4=
github.com/ipfs/go-unixfsnode v1.10.5/go.mod h1:u/9Ukl+XYpfKTMu+NXQqxbzAJVTwSCoyTYBGgE+JdSE=
github.com/ipld/go-car/v2 v2.17.0 h1:zgjSxf/lQNYcQPX08cvb5rSdEY8sv5OOnQIsZhZMPx4=
Expand Down
5 changes: 3 additions & 2 deletions test/bench/bench_cli_ipfs_add/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ func compareResults() error {

func benchmarkAdd(amount int64) (*testing.BenchmarkResult, error) {
var benchmarkError error
seed := random.Uint64ToSeed(1)

results := testing.Benchmark(func(b *testing.B) {
b.SetBytes(amount)
for i := 0; i < b.N; i++ {
Expand All @@ -67,7 +69,6 @@ func benchmarkAdd(amount int64) (*testing.BenchmarkResult, error) {
b.Fatal(err)
}

const seed = 1
f, err := os.CreateTemp("", "")
if err != nil {
benchmarkError = err
Expand All @@ -76,7 +77,7 @@ func benchmarkAdd(amount int64) (*testing.BenchmarkResult, error) {
defer os.Remove(f.Name())

randReader := &io.LimitedReader{
R: random.NewSeededRand(seed),
R: random.NewSeeded(seed),
N: amount,
}
if _, err := io.Copy(f, randReader); err != nil {
Expand Down
4 changes: 2 additions & 2 deletions test/bench/offline_add/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ func compareResults() error {
}

func benchmarkAdd(amount int64) (*testing.BenchmarkResult, error) {
seed := random.Uint64ToSeed(1)
results := testing.Benchmark(func(b *testing.B) {
b.SetBytes(amount)
for i := 0; i < b.N; i++ {
Expand All @@ -51,15 +52,14 @@ func benchmarkAdd(amount int64) (*testing.BenchmarkResult, error) {
b.Fatal(err)
}

const seed = 1
f, err := os.CreateTemp("", "")
if err != nil {
b.Fatal(err)
}
defer os.Remove(f.Name())

randReader := &io.LimitedReader{
R: random.NewSeededRand(seed),
R: random.NewSeeded(seed),
N: amount,
}
_, err = io.Copy(f, randReader)
Expand Down
20 changes: 12 additions & 8 deletions test/cli/pins_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -223,8 +223,9 @@ func TestPins(t *testing.T) {
t.Parallel()

node := harness.NewT(t).NewNode().Init()
cidAStr := node.IPFSAddStr(string(random.Bytes(1000)), "--pin=false")
cidBStr := node.IPFSAddStr(string(random.Bytes(1000)), "--pin=false")
rnd := random.New()
cidAStr := node.IPFSAddStr(string(rnd.Bytes(1000)), "--pin=false")
cidBStr := node.IPFSAddStr(string(rnd.Bytes(1000)), "--pin=false")

_ = node.IPFS("pin", "add", "--name", "testPin", cidAStr)

Expand All @@ -251,9 +252,10 @@ func TestPins(t *testing.T) {
t.Parallel()

node := harness.NewT(t).NewNode().Init()
cidAStr := node.IPFSAddStr(string(random.Bytes(1000)), "--pin=false")
cidBStr := node.IPFSAddStr(string(random.Bytes(1000)), "--pin=false")
cidCStr := node.IPFSAddStr(string(random.Bytes(1000)), "--pin=false")
rnd := random.New()
cidAStr := node.IPFSAddStr(string(rnd.Bytes(1000)), "--pin=false")
cidBStr := node.IPFSAddStr(string(rnd.Bytes(1000)), "--pin=false")
cidCStr := node.IPFSAddStr(string(rnd.Bytes(1000)), "--pin=false")

outA := cidAStr + " recursive testPin"
outB := cidBStr + " recursive testPin"
Expand Down Expand Up @@ -289,7 +291,8 @@ func TestPins(t *testing.T) {
t.Parallel()

node := harness.NewT(t).NewNode().Init()
cidStr := node.IPFSAddStr(string(random.Bytes(1000)), "--pin=false")
rnd := random.New()
cidStr := node.IPFSAddStr(string(rnd.Bytes(1000)), "--pin=false")

outBefore := cidStr + " recursive A"
outAfter := cidStr + " recursive B"
Expand All @@ -310,8 +313,9 @@ func TestPins(t *testing.T) {
t.Parallel()

node := harness.NewT(t).NewNode().Init()
cidAStr := node.IPFSAddStr(string(random.Bytes(1000)), "--pin=false")
cidBStr := node.IPFSAddStr(string(random.Bytes(1000)), "--pin=false")
rnd := random.New()
cidAStr := node.IPFSAddStr(string(rnd.Bytes(1000)), "--pin=false")
cidBStr := node.IPFSAddStr(string(rnd.Bytes(1000)), "--pin=false")

_ = node.IPFS("pin", "add", "--name", "testPinJson", cidAStr)

Expand Down
4 changes: 2 additions & 2 deletions test/dependencies/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ require (
github.com/golangci/golangci-lint v1.64.8
github.com/ipfs/go-cidutil v0.1.2
github.com/ipfs/go-log/v2 v2.9.2
github.com/ipfs/go-test v0.3.0
github.com/ipfs/go-test v0.4.1
github.com/ipfs/hang-fds v0.1.0
github.com/ipfs/iptb v1.4.1
github.com/ipfs/iptb-plugins v0.5.1
Expand Down Expand Up @@ -137,7 +137,7 @@ require (
github.com/huin/goupnp v1.3.0 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/ipfs/bbloom v0.1.0 // indirect
github.com/ipfs/boxo v0.41.1-0.20260707130650-177b35c8ef09 // indirect
github.com/ipfs/boxo v0.41.1-0.20260717051107-441032d6a863 // indirect
github.com/ipfs/go-bitfield v1.1.0 // indirect
github.com/ipfs/go-block-format v0.2.4 // indirect
github.com/ipfs/go-cid v0.6.2 // indirect
Expand Down
8 changes: 4 additions & 4 deletions test/dependencies/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -301,8 +301,8 @@ github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2
github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw=
github.com/ipfs/bbloom v0.1.0 h1:nIWwfIE3AaG7RCDQIsrUonGCOTp7qSXzxH7ab/ss964=
github.com/ipfs/bbloom v0.1.0/go.mod h1:lDy3A3i6ndgEW2z1CaRFvDi5/ZTzgM1IxA/pkL7Wgts=
github.com/ipfs/boxo v0.41.1-0.20260707130650-177b35c8ef09 h1:jl4/IHR4IRb0QOVw6vFxUL4NRnetk1V42HIdipWu+aw=
github.com/ipfs/boxo v0.41.1-0.20260707130650-177b35c8ef09/go.mod h1:mnR769LN1W7rDI6z1GBLmD15x4pvMdW0oWxik8j3y6g=
github.com/ipfs/boxo v0.41.1-0.20260717051107-441032d6a863 h1:C3Xufr5x4qxdhlR3LKL6eKBMJQKpzeNBoGCniXv448I=
github.com/ipfs/boxo v0.41.1-0.20260717051107-441032d6a863/go.mod h1:DLLtSR+2xJF3W5HRGPvL3H+y+MfBzdy1/IPlLwU0n1A=
github.com/ipfs/go-bitfield v1.1.0 h1:fh7FIo8bSwaJEh6DdTWbCeZ1eqOaOkKFI74SCnsWbGA=
github.com/ipfs/go-bitfield v1.1.0/go.mod h1:paqf1wjq/D2BBmzfTVFlJQ9IlFOZpg422HL0HqsGWHU=
github.com/ipfs/go-block-format v0.2.4 h1:pgsT9i8zB4YQkBIQRrBwqbQiXPogRCiQnfxd2bC4koI=
Expand Down Expand Up @@ -339,8 +339,8 @@ github.com/ipfs/go-metrics-interface v0.3.0 h1:YwG7/Cy4R94mYDUuwsBfeziJCVm9pBMJ6
github.com/ipfs/go-metrics-interface v0.3.0/go.mod h1:OxxQjZDGocXVdyTPocns6cOLwHieqej/jos7H4POwoY=
github.com/ipfs/go-peertaskqueue v0.8.3 h1:tBPpGJy+A92RqtRFq5amJn0Uuj8Pw8tXi0X3eHfHM8w=
github.com/ipfs/go-peertaskqueue v0.8.3/go.mod h1:OqVync4kPOcXEGdj/LKvox9DCB5mkSBeXsPczCxLtYA=
github.com/ipfs/go-test v0.3.0 h1:0Y4Uve3tp9HI+2lIJjfOliOrOgv/YpXg/l1y3P4DEYE=
github.com/ipfs/go-test v0.3.0/go.mod h1:JK+U8pRpATZb7lsYNSJlCj3WYB3cFfWIbI6nWRM/GFk=
github.com/ipfs/go-test v0.4.1 h1:n6uNSakIgpTQIRorqNg2O02aMIFDLQk2z4rBfrlD3Uw=
github.com/ipfs/go-test v0.4.1/go.mod h1:QmvVBf9kClNtRuFow4DASq03eFvjKla4Fy/UAkeeLO8=
github.com/ipfs/go-unixfsnode v1.10.5 h1:V34JV7fM90y+2ZUef7ToShjmwAZ8oo1yP7zrpWzC5L4=
github.com/ipfs/go-unixfsnode v1.10.5/go.mod h1:u/9Ukl+XYpfKTMu+NXQqxbzAJVTwSCoyTYBGgE+JdSE=
github.com/ipfs/hang-fds v0.1.0 h1:deBiFlWHsVGzJ0ZMaqscEqRM1r2O1rFZ59UiQXb1Xko=
Expand Down
9 changes: 7 additions & 2 deletions test/integration/addcat_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ var log = logging.Logger("epictest")

const kSeed = 1

var randSeed [32]byte

func init() {
randSeed = random.Uint64ToSeed(kSeed)
}

func Test1KBInstantaneous(t *testing.T) {
conf := testutil.LatencyConfig{
NetworkLatency: 0,
Expand Down Expand Up @@ -84,8 +90,7 @@ func AddCatPowers(conf testutil.LatencyConfig, megabytesMax int64) error {
}

func RandomBytes(n int64) []byte {
random.SetSeed(kSeed)
return random.Bytes(int(n))
return random.NewSeeded(randSeed).Bytes(n)
}

func DirectAddCat(data []byte, conf testutil.LatencyConfig) error {
Expand Down
28 changes: 14 additions & 14 deletions test/sharness/t0040-add-and-cat.sh
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,7 @@ test_add_cat_5MB() {
'

test_expect_success "sha1 of the file looks ok" '
echo "11145b8c4bc8f87ea2fcfc3d55708b8cac2aadf12862" >sha1_expected &&
echo "11141d13cfb2c207591376e06bc2360741c2009b2898" >sha1_expected &&
multihash -a=sha1 -e=hex mountdir/bigfile >sha1_actual &&
test_cmp sha1_expected sha1_actual
'
Expand Down Expand Up @@ -599,7 +599,7 @@ test_add_cat_expensive() {
'

test_expect_success EXPENSIVE "sha1 of the file looks ok" '
echo "11141e8c04d7cd019cc0acf0311a8ca6cf2c18413c96" >sha1_expected &&
echo "1114acba57d18295a18b428faf88960fa47a71eb22cc" >sha1_expected &&
multihash -a=sha1 -e=hex mountdir/bigfile >sha1_actual &&
test_cmp sha1_expected sha1_actual
'
Expand All @@ -623,16 +623,16 @@ test_add_cat_expensive() {
'

test_expect_success EXPENSIVE "ipfs cat output hashed looks good" '
echo "11141e8c04d7cd019cc0acf0311a8ca6cf2c18413c96" >sha1_expected &&
echo "1114acba57d18295a18b428faf88960fa47a71eb22cc" >sha1_expected &&
test_cmp sha1_expected sha1_actual
'

test_expect_success FUSE,EXPENSIVE "cat ipfs/bigfile succeeds" '
cat "ipfs/$HASH" | multihash -a=sha1 -e=hex >sha1_actual
cat "ipfs/$HASH" | multihash -a=sha1 -e=hex >sha1_actual-Y
'

test_expect_success FUSE,EXPENSIVE "cat ipfs/bigfile looks good" '
test_cmp sha1_expected sha1_actual
test_cmp sha1_expected sha1_actual-Y
'
}

Expand Down Expand Up @@ -906,38 +906,38 @@ test_expect_success "random-data is installed" '
type random-data
'

test_add_cat_5MB "" "QmapAfmzmeWYTNztMQEhUXFcSGrsax22WRG7YN9xLdMeQq"
test_add_cat_5MB "" "QmbW8FAUE5nJ2EccaFGLQtubacZr9VP1m6KLBniL7yzXpF"

test_add_cat_5MB --raw-leaves "QmabWSFaPusmiZaaVZLhEUtHcj8CCvVeUfkBpKqAkKVMiS"
test_add_cat_5MB --raw-leaves "Qmf6a54RFHB3sAH5Beh5pha6Y8UZz22pfDKZAgmQ2UvLJH"

# note: the specified hash implies that internal nodes are stored
# using CidV1 and leaves are stored using raw blocks
test_add_cat_5MB --cid-version=1 "bafybeifwdkm32fmukqwh3jofm6ma76bcqvn6opxstsnzmya7utboi4cb2m"
test_add_cat_5MB --cid-version=1 "bafybeihy7ngsovmm2dqanlpjeddvs7kshb4bdwrue3pe5nsf6rkn3hg45y"

# note: the specified hash implies that internal nodes are stored
# using CidV1 and leaves are stored using CidV1 but using the legacy
# format (i.e. not raw)
test_add_cat_5MB '--cid-version=1 --raw-leaves=false' "bafybeifq4unep5w4agr3nlynxidj2rymf6dzu6bf4ieqqildkboe5mdmne"
test_add_cat_5MB '--cid-version=1 --raw-leaves=false' "bafybeie4nox52gy5qpv5bhbrzrfgpwwdfpk257v2ixy66whvqdjd67r3fq"

# note: --hash=blake2b-256 implies --cid-version=1 which implies --raw-leaves=true
# the specified hash represents the leaf nodes stored as raw leaves and
# encoded with the blake2b-256 hash function
test_add_cat_5MB '--hash=blake2b-256' "bafykbzacebxcnlql4oc3mtscqn32aumqkqxxv3wt7dkyrphgh6lc2gckiq6bw"
test_add_cat_5MB '--hash=blake2b-256' "bafykbzacebiss6bbf5ynrrcsweg66zau5p6w2a52scmpgcxaaeqremw5vpy22"

# the specified hash represents the leaf nodes stored as protoful nodes and
# encoded with the blake2b-256 hash function
test_add_cat_5MB '--hash=blake2b-256 --raw-leaves=false' "bafykbzacearibnoamkfmcagpfgk2sbgx65qftnsrh4ttd3g7ghooasfnyavme"
test_add_cat_5MB '--hash=blake2b-256 --raw-leaves=false' "bafykbzacecn3yylzcrinh2mf3kcwxrql4haddl6pb4wmnkc6wurtfqi2mghhy"

test_add_cat_expensive "" "Qma1WZKC3jad7e3F7GEDvkFdhPLyMEhKszBF4nBUCBGh6c"
test_add_cat_expensive "" "QmPYo95xiEmcqiqWpqg9iwHgcbWi7n4fQuP27xCNQLmytG"

# note: the specified hash implies that internal nodes are stored
# using CidV1 and leaves are stored using raw blocks
test_add_cat_expensive "--cid-version=1" "bafybeibdfw7nsmb3erhej2k6v4eopaswsf5yfv2ikweqa3qsc5no4jywqu"
test_add_cat_expensive "--cid-version=1" "bafybeidwwhjvrpu2j34ppvr2swm2u55ljcuhqzm7s5xd7rlsvlu7ny2rry"

# note: --hash=blake2b-256 implies --cid-version=1 which implies --raw-leaves=true
# the specified hash represents the leaf nodes stored as raw leaves and
# encoded with the blake2b-256 hash function
test_add_cat_expensive '--hash=blake2b-256' "bafykbzaceduy3thhmcf6ptfqzxberlvj7sgo4uokrvd6qwrhim6r3rgcb26qi"
test_add_cat_expensive '--hash=blake2b-256' "bafykbzacebosow2qjoynvjq2qmjuhh6qgkxqwjpqqreucu5idbq3n75wobtxa"

test_add_named_pipe

Expand Down
Loading
Loading