From 7d69b66c7ccd9dda9962f7665145d8a7489a889f Mon Sep 17 00:00:00 2001 From: Svarog Date: Wed, 17 Mar 2021 17:34:03 +0200 Subject: [PATCH] Change --datadir to --appdir and remove symmetrical connection in stability tests (#1617) * Don't do simetric connects in netsync stability test * Convert --datadir to --appdir everywhere Co-authored-by: Ori Newman --- stability-tests/application-level-garbage/run/run.sh | 2 +- stability-tests/infra-level-garbage/run/run.sh | 2 +- stability-tests/kaspadsanity/README.md | 4 ++-- stability-tests/kaspadsanity/commandloop.go | 6 +++--- stability-tests/netsync/node.go | 8 +++++--- stability-tests/orphans/run/run.sh | 2 +- stability-tests/rpc-idle-clients/run/run.sh | 2 +- stability-tests/rpc-stability/run/run.sh | 2 +- stability-tests/simple-sync/start-nodes.go | 4 ++-- 9 files changed, 17 insertions(+), 15 deletions(-) diff --git a/stability-tests/application-level-garbage/run/run.sh b/stability-tests/application-level-garbage/run/run.sh index cca9cd9e9..33871dfc1 100755 --- a/stability-tests/application-level-garbage/run/run.sh +++ b/stability-tests/application-level-garbage/run/run.sh @@ -1,7 +1,7 @@ #!/bin/bash rm -rf /tmp/kaspad-temp -kaspad --devnet --nobanning --datadir=/tmp/kaspad-temp --profile=6061 --loglevel=debug & +kaspad --devnet --nobanning --appdir=/tmp/kaspad-temp --profile=6061 --loglevel=debug & KASPAD_PID=$! KASPAD_KILLED=0 function killKaspadIfNotKilled() { diff --git a/stability-tests/infra-level-garbage/run/run.sh b/stability-tests/infra-level-garbage/run/run.sh index 890c89cad..06ae3cec4 100755 --- a/stability-tests/infra-level-garbage/run/run.sh +++ b/stability-tests/infra-level-garbage/run/run.sh @@ -1,7 +1,7 @@ #!/bin/bash rm -rf /tmp/kaspad-temp -kaspad --devnet --nobanning --datadir=/tmp/kaspad-temp --profile=6061 & +kaspad --devnet --nobanning --appdir=/tmp/kaspad-temp --profile=6061 & KASPAD_PID=$! sleep 1 diff --git a/stability-tests/kaspadsanity/README.md b/stability-tests/kaspadsanity/README.md index b7e9b8fb7..dec27bd43 100644 --- a/stability-tests/kaspadsanity/README.md +++ b/stability-tests/kaspadsanity/README.md @@ -1,9 +1,9 @@ # Kaspad Sanity tool This tries to run kapad with different sets of arguments for sanity. -In order to get clean run for each command, the tool injects its own --datadir +In order to get clean run for each command, the tool injects its own --appdir argument so it will be able to clean it between runs, so it's forbidden to use ---datadir as part of the arguments set. +--appdir as part of the arguments set. ## Running 1. `go install` kaspad and kaspadsanity. diff --git a/stability-tests/kaspadsanity/commandloop.go b/stability-tests/kaspadsanity/commandloop.go index 964875307..c9a26c36a 100644 --- a/stability-tests/kaspadsanity/commandloop.go +++ b/stability-tests/kaspadsanity/commandloop.go @@ -72,9 +72,9 @@ func commandLoop(argsChan <-chan []string) ([]commandFailure, error) { func handleDataDirArg(args []string, dataDir string) ([]string, error) { for _, arg := range args { - if strings.HasPrefix(arg, "--datadir") { - return nil, errors.New("invalid argument --datadir") + if strings.HasPrefix(arg, "--appdir") { + return nil, errors.New("invalid argument --appdir") } } - return append([]string{"--datadir", dataDir}, args...), nil + return append([]string{"--appdir", dataDir}, args...), nil } diff --git a/stability-tests/netsync/node.go b/stability-tests/netsync/node.go index e1d4537ca..e32b8aff0 100644 --- a/stability-tests/netsync/node.go +++ b/stability-tests/netsync/node.go @@ -31,14 +31,16 @@ func startNode(name string, rpcAddress, listen, connect, profilePort, dataDir st args := []string{ "kaspad", common.NetworkCliArgumentFromNetParams(activeConfig().NetParams()), - "--datadir", dataDir, + "--appdir", dataDir, "--logdir", dataDir, "--rpclisten", rpcAddress, "--listen", listen, - "--connect", connect, "--profile", profilePort, "--loglevel", "debug", } + if connect != "" { + args = append(args, "--connect", connect) + } if activeConfig().OverrideDAGParamsFile != "" { args = append(args, "--override-dag-params-file", activeConfig().OverrideDAGParamsFile) @@ -132,7 +134,7 @@ func setupSyncer() (*rpc.Client, func(), error) { return nil, nil, err } - rpcClient, teardown, err := setupNodeWithRPC("SYNCER", syncerListen, syncerRPCAddress, syncedListen, + rpcClient, teardown, err := setupNodeWithRPC("SYNCER", syncerListen, syncerRPCAddress, "", syncerProfilePort, syncerDataDir) if err != nil { return nil, nil, err diff --git a/stability-tests/orphans/run/run.sh b/stability-tests/orphans/run/run.sh index 297564645..9b138e8e5 100755 --- a/stability-tests/orphans/run/run.sh +++ b/stability-tests/orphans/run/run.sh @@ -1,7 +1,7 @@ #!/bin/bash rm -rf /tmp/kaspad-temp -kaspad --devnet --datadir=/tmp/kaspad-temp --profile=6061 & +kaspad --devnet --appdir=/tmp/kaspad-temp --profile=6061 & KASPAD_PID=$! sleep 1 diff --git a/stability-tests/rpc-idle-clients/run/run.sh b/stability-tests/rpc-idle-clients/run/run.sh index 0e9b9097f..5c1399f68 100755 --- a/stability-tests/rpc-idle-clients/run/run.sh +++ b/stability-tests/rpc-idle-clients/run/run.sh @@ -2,7 +2,7 @@ rm -rf /tmp/kaspad-temp NUM_CLIENTS=1000 -kaspad --devnet --datadir=/tmp/kaspad-temp --profile=6061 --rpcmaxwebsockets=$NUM_CLIENTS & +kaspad --devnet --appdir=/tmp/kaspad-temp --profile=6061 --rpcmaxwebsockets=$NUM_CLIENTS & KASPAD_PID=$! KASPAD_KILLED=0 function killKaspadIfNotKilled() { diff --git a/stability-tests/rpc-stability/run/run.sh b/stability-tests/rpc-stability/run/run.sh index 817b94772..f9546764d 100755 --- a/stability-tests/rpc-stability/run/run.sh +++ b/stability-tests/rpc-stability/run/run.sh @@ -1,7 +1,7 @@ #!/bin/bash rm -rf /tmp/kaspad-temp -kaspad --devnet --datadir=/tmp/kaspad-temp --profile=6061 --loglevel=debug & +kaspad --devnet --appdir=/tmp/kaspad-temp --profile=6061 --loglevel=debug & KASPAD_PID=$! sleep 1 diff --git a/stability-tests/simple-sync/start-nodes.go b/stability-tests/simple-sync/start-nodes.go index e05a0ef44..41399a514 100644 --- a/stability-tests/simple-sync/start-nodes.go +++ b/stability-tests/simple-sync/start-nodes.go @@ -39,7 +39,7 @@ func startNodes() (teardown func(), err error) { syncerCmd, err := common.StartCmd("KASPAD-SYNCER", "kaspad", common.NetworkCliArgumentFromNetParams(activeConfig().NetParams()), - "--datadir", syncerDataDir, + "--appdir", syncerDataDir, "--logdir", syncerDataDir, "--rpclisten", syncerRPCAddress, "--listen", syncerListen, @@ -52,7 +52,7 @@ func startNodes() (teardown func(), err error) { syncedCmd, err := common.StartCmd("KASPAD-SYNCED", "kaspad", common.NetworkCliArgumentFromNetParams(activeConfig().NetParams()), - "--datadir", syncedDataDir, + "--appdir", syncedDataDir, "--logdir", syncedDataDir, "--rpclisten", syncedRPCAddress, "--listen", syncedListen,