From 9dbb6a101d2d1fc5bd42222273a3f94f12e21476 Mon Sep 17 00:00:00 2001 From: Egon Elbre Date: Wed, 16 Jan 2019 18:09:57 -0500 Subject: [PATCH] Rename storj-sdk to storj-sim (#1078) --- .travis.yml | 5 +++-- Makefile | 14 +++++++------- cmd/{storj-sdk => storj-sim}/cancelable.go | 0 cmd/{storj-sdk => storj-sim}/main.go | 4 ++-- cmd/{storj-sdk => storj-sim}/network.go | 2 +- cmd/{storj-sdk => storj-sim}/prefix.go | 0 cmd/{storj-sdk => storj-sim}/process.go | 2 +- cmd/{storj-sdk => storj-sim}/testplanet.go | 0 scripts/{test-sdk-aws.sh => test-sim-aws.sh} | 0 scripts/{test-sdk.sh => test-sim.sh} | 14 +++++++------- 10 files changed, 21 insertions(+), 20 deletions(-) rename cmd/{storj-sdk => storj-sim}/cancelable.go (100%) rename cmd/{storj-sdk => storj-sim}/main.go (97%) rename cmd/{storj-sdk => storj-sim}/network.go (99%) rename cmd/{storj-sdk => storj-sim}/prefix.go (100%) rename cmd/{storj-sdk => storj-sim}/process.go (99%) rename cmd/{storj-sdk => storj-sim}/testplanet.go (100%) rename scripts/{test-sdk-aws.sh => test-sim-aws.sh} (100%) rename scripts/{test-sdk.sh => test-sim.sh} (60%) diff --git a/.travis.yml b/.travis.yml index b26002562..7481dbcd6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -70,9 +70,10 @@ matrix: - redis install: - source scripts/install-awscli.sh - - go install -race storj.io/storj/cmd/{storj-sdk,bootstrap,satellite,storagenode,uplink,gateway,certificates} + - make install-sim + - go install -race storj.io/storj/cmd/certificates script: - - set -o pipefail && make test-sdk |& go run scripts/fail-on-race.go + - set -o pipefail && make test-sim |& go run scripts/fail-on-race.go - set -o pipefail && make test-certificate-signing |& go run scripts/fail-on-race.go ### Docker tests ### diff --git a/Makefile b/Makefile index ab9cd5fe4..918579f6f 100644 --- a/Makefile +++ b/Makefile @@ -65,12 +65,12 @@ proto: ## Rebuild protobuf files go run scripts/protobuf.go install go run scripts/protobuf.go generate -##@ SDK +##@ Simulator -.PHONY: install-sdk -install-sdk: ## install storj-sdk +.PHONY: install-sim +install-sim: ## install storj-sim @echo "Running ${@}" - @go install -race -v storj.io/storj/cmd/storj-sdk storj.io/storj/cmd/bootstrap storj.io/storj/cmd/satellite storj.io/storj/cmd/storagenode storj.io/storj/cmd/uplink storj.io/storj/cmd/gateway + @go install -race -v storj.io/storj/cmd/storj-sim storj.io/storj/cmd/bootstrap storj.io/storj/cmd/satellite storj.io/storj/cmd/storagenode storj.io/storj/cmd/uplink storj.io/storj/cmd/gateway ##@ Test @@ -84,10 +84,10 @@ test-captplanet: ## Test source with captain planet (travis) @echo "Running ${@}" @./scripts/test-captplanet.sh -.PHONY: test-sdk -test-sdk: ## Test source with storj-sdk (travis) +.PHONY: test-sim +test-sim: ## Test source with storj-sim (travis) @echo "Running ${@}" - @./scripts/test-sdk.sh + @./scripts/test-sim.sh .PHONY: test-certificate-signing test-certificate-signing: ## Test certificate signing service and storagenode setup (travis) diff --git a/cmd/storj-sdk/cancelable.go b/cmd/storj-sim/cancelable.go similarity index 100% rename from cmd/storj-sdk/cancelable.go rename to cmd/storj-sim/cancelable.go diff --git a/cmd/storj-sdk/main.go b/cmd/storj-sim/main.go similarity index 97% rename from cmd/storj-sdk/main.go rename to cmd/storj-sim/main.go index 10d9aedba..ae9a17cd7 100644 --- a/cmd/storj-sdk/main.go +++ b/cmd/storj-sim/main.go @@ -29,8 +29,8 @@ func main() { var flags Flags rootCmd := &cobra.Command{ - Use: "storj-sdk", - Short: "Storj SDK", + Use: "storj-sim", + Short: "Storj Network Simulator", } defaultConfigDir := fpath.ApplicationDir("storj", "local-network") diff --git a/cmd/storj-sdk/network.go b/cmd/storj-sim/network.go similarity index 99% rename from cmd/storj-sdk/network.go rename to cmd/storj-sim/network.go index 6e241d505..feb5f98ae 100644 --- a/cmd/storj-sdk/network.go +++ b/cmd/storj-sim/network.go @@ -77,7 +77,7 @@ func networkDestroy(flags *Flags, args []string) error { return errors.New("safety check: disallowed to remove root directory " + flags.Directory) } if printCommands { - fmt.Println("sdk | exec: rm -rf", flags.Directory) + fmt.Println("sim | exec: rm -rf", flags.Directory) } return os.RemoveAll(flags.Directory) } diff --git a/cmd/storj-sdk/prefix.go b/cmd/storj-sim/prefix.go similarity index 100% rename from cmd/storj-sdk/prefix.go rename to cmd/storj-sim/prefix.go diff --git a/cmd/storj-sdk/process.go b/cmd/storj-sim/process.go similarity index 99% rename from cmd/storj-sdk/process.go rename to cmd/storj-sim/process.go index 5cf16108f..f8b408a92 100644 --- a/cmd/storj-sdk/process.go +++ b/cmd/storj-sim/process.go @@ -32,7 +32,7 @@ type Processes struct { // NewProcesses returns a group of processes func NewProcesses() *Processes { return &Processes{ - Output: NewPrefixWriter("sdk", os.Stdout), + Output: NewPrefixWriter("sim", os.Stdout), List: nil, } } diff --git a/cmd/storj-sdk/testplanet.go b/cmd/storj-sim/testplanet.go similarity index 100% rename from cmd/storj-sdk/testplanet.go rename to cmd/storj-sim/testplanet.go diff --git a/scripts/test-sdk-aws.sh b/scripts/test-sim-aws.sh similarity index 100% rename from scripts/test-sdk-aws.sh rename to scripts/test-sim-aws.sh diff --git a/scripts/test-sdk.sh b/scripts/test-sim.sh similarity index 60% rename from scripts/test-sdk.sh rename to scripts/test-sim.sh index b17694b7b..68cfe0ea4 100755 --- a/scripts/test-sdk.sh +++ b/scripts/test-sim.sh @@ -3,7 +3,7 @@ set -ueo pipefail SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" -make -C $SCRIPTDIR/.. install-sdk +make -C $SCRIPTDIR/.. install-sim # setup tmpdir for testfiles and cleanup TMP=$(mktemp -d -t tmp.XXXXXXXXXX) @@ -15,15 +15,15 @@ trap cleanup EXIT export STORJ_LOCAL_NETWORK=$TMP # setup the network -storj-sdk -x network setup +storj-sim -x network setup # run aws-cli tests -storj-sdk -x network test bash $SCRIPTDIR/test-sdk-aws.sh -storj-sdk -x network destroy +storj-sim -x network test bash $SCRIPTDIR/test-sim-aws.sh +storj-sim -x network destroy # ipv6 tests disabled because aws-cli doesn't seem to support connecting to ipv6 host # # setup the network with ipv6 -# storj-sdk -x --host "::1" network setup +# storj-sim -x --host "::1" network setup # # run aws-cli tests using ipv6 -# storj-sdk -x --host "::1" network test bash $SCRIPTDIR/test-storj-sdk-aws.sh -# storj-sdk -x network destroy \ No newline at end of file +# storj-sim -x --host "::1" network test bash $SCRIPTDIR/test-storj-sim-aws.sh +# storj-sim -x network destroy \ No newline at end of file