Skip to content

Commit

Permalink
add input seed
Browse files Browse the repository at this point in the history
  • Loading branch information
nonsense committed Mar 19, 2019
1 parent a22e569 commit d972357
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
7 changes: 7 additions & 0 deletions cmd/swarm/swarm-smoke/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ var (
allhosts string
hosts []string
filesize int
inputSeed int
syncDelay int
httpPort int
wsPort int
Expand Down Expand Up @@ -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,
Expand Down
5 changes: 5 additions & 0 deletions cmd/swarm/swarm-smoke/upload_and_sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit d972357

Please sign in to comment.