diff --git a/cmd/swarm/swarm-smoke/main.go b/cmd/swarm/swarm-smoke/main.go index 43d2c1ff51..860fbcc1dd 100644 --- a/cmd/swarm/swarm-smoke/main.go +++ b/cmd/swarm/swarm-smoke/main.go @@ -40,6 +40,7 @@ var ( allhosts string hosts []string filesize int + inputSeed int syncDelay int httpPort int wsPort int @@ -74,6 +75,12 @@ func main() { Usage: "ws port", Destination: &wsPort, }, + cli.IntFlag{ + Name: "seed", + Value: 0, + Usage: "input seed in case we need deterministic upload", + Destination: &inputSeed, + }, cli.IntFlag{ Name: "filesize", Value: 1024, diff --git a/cmd/swarm/swarm-smoke/upload_and_sync.go b/cmd/swarm/swarm-smoke/upload_and_sync.go index a3fa10fedd..515b469966 100644 --- a/cmd/swarm/swarm-smoke/upload_and_sync.go +++ b/cmd/swarm/swarm-smoke/upload_and_sync.go @@ -39,6 +39,11 @@ import ( ) func uploadAndSyncCmd(ctx *cli.Context, tuid string) error { + // use input seed if it has been set + if inputSeed != 0 { + seed = inputSeed + } + randomBytes := testutil.RandomBytes(seed, filesize*1000) errc := make(chan error)