diff --git a/Makefile b/Makefile index 46e4d9670..ebf000058 100644 --- a/Makefile +++ b/Makefile @@ -29,8 +29,10 @@ help: @echo "distclean - remove node files & logs created by localnet, and all libs" @echo "test - run the entire test suite (go test & Node API test)" @echo "test-go - run the go test (with go lint, fmt, imports, mod, and generate checks)" - @echo "test-api - run the Node API test" - @echo "test-api-attach - attach onto the Node API testing docker container for inspection" + @echo "test-rpc - run the rpc tests" + @echo "test-rpc-attach - attach onto the rpc testing docker container for inspection" + @echo "test-rosetta - run the rosetta tests" + @echo "test-rosetta-attach - attach onto the rosetta testing docker container for inspection" @echo "linux_static - static build the harmony binary & bootnode along with the MCL & BLS libs (for linux)" @echo "arm_static - static build the harmony binary & bootnode on ARM64 platform" @echo "rpm - build a harmony RPM pacakge" @@ -82,11 +84,17 @@ test: test-go: bash ./test/go.sh -test-api: - bash ./test/api.sh run +test-rpc: + bash ./test/rpc.sh run -test-api-attach: - bash ./test/api.sh attach +test-rpc-attach: + bash ./test/rpc.sh attach + +test-rosetta: + bash ./test/rosetta.sh run + +test-rosetta-attach: + bash ./test/rosetta.sh attach linux_static: make -C $(TOP)/mcl -j8 diff --git a/test/all.sh b/test/all.sh index cda933e3a..df55e8a76 100644 --- a/test/all.sh +++ b/test/all.sh @@ -2,4 +2,6 @@ DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)" bash "$DIR/kill_node.sh" docker pull harmonyone/localnet-test -docker run -it --expose 9000-9999 -v "$DIR/../:/go/src/github.com/harmony-one/harmony" harmonyone/localnet-test \ No newline at end of file +docker run -it \ + -p 9500:9500 -p 9501:9501 -p 9599:9599 -p 9598:9598 -p 9799:9799 -p 9798:9798 -p 9899:9899 -p 9898:9898 \ + -v "$DIR/../:/go/src/github.com/harmony-one/harmony" harmonyone/localnet-test \ No newline at end of file diff --git a/test/api.sh b/test/rosetta.sh old mode 100755 new mode 100644 similarity index 66% rename from test/api.sh rename to test/rosetta.sh index 1dd47dc20..22dc5c1ce --- a/test/api.sh +++ b/test/rosetta.sh @@ -8,7 +8,9 @@ case ${1} in run) docker pull harmonyone/localnet-test docker rm "$docker_name" - docker run -it --name "$docker_name" --expose 9000-9999 -v "$DIR/../:/go/src/github.com/harmony-one/harmony" harmonyone/localnet-test -n -k + docker run -it --name "$docker_name" \ + -p 9500:9500 -p 9501:9501 -p 9599:9599 -p 9598:9598 -p 9799:9799 -p 9798:9798 -p 9899:9899 -p 9898:9898 \ + -v "$DIR/../:/go/src/github.com/harmony-one/harmony" harmonyone/localnet-test -r -k ;; attach) docker exec -it "$docker_name" /bin/bash diff --git a/test/rpc.sh b/test/rpc.sh new file mode 100755 index 000000000..32ef8f4f4 --- /dev/null +++ b/test/rpc.sh @@ -0,0 +1,29 @@ +#!/usr/bin/env bash +DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)" +bash "$DIR/kill_node.sh" + +docker_name="harmony-localnet-test" + +case ${1} in +run) + docker pull harmonyone/localnet-test + docker rm "$docker_name" + docker run -it --name "$docker_name" \ + -p 9500:9500 -p 9501:9501 -p 9599:9599 -p 9598:9598 -p 9799:9799 -p 9798:9798 -p 9899:9899 -p 9898:9898 \ + -v "$DIR/../:/go/src/github.com/harmony-one/harmony" harmonyone/localnet-test -n -k + ;; +attach) + docker exec -it "$docker_name" /bin/bash + ;; +*) + echo " +Node API tests + +Param: Help: +run Run the Node API tests +attach Attach onto the Node API testing docker image for inspection +" + exit 0 + ;; +esac +