diff options
Diffstat (limited to 'api/tests')
-rwxr-xr-x | api/tests/announce_zblock.sh | 6 | ||||
-rwxr-xr-x | api/tests/announce_zchain_link.sh | 6 | ||||
-rwxr-xr-x | api/tests/default_route.sh | 2 | ||||
-rwxr-xr-x | api/tests/gathered_zblocks.sh | 4 | ||||
-rwxr-xr-x | api/tests/gathered_zchain_zlatest_pairs.sh | 2 |
5 files changed, 10 insertions, 10 deletions
diff --git a/api/tests/announce_zblock.sh b/api/tests/announce_zblock.sh index ce3b1aa..15caec8 100755 --- a/api/tests/announce_zblock.sh +++ b/api/tests/announce_zblock.sh @@ -4,7 +4,7 @@ printf '[%s]\n' "$PROGRAM" printf "TEST\t/v0/announce/zblock\n" printf "\t01:\tendpoint with valid data" curl http://127.0.0.1:8610/v0/announce/zblock --header 'Content-Type: application/json' --data-raw '{"zblock":"'$(ak-get-zlatest)'"}' 2>/dev/null | jq -M -c > /dev/null -if [ "$?" == "0" ] +if [ $? -eq 0 ] then printf "\t\t\033[0;32mPASSED\033[0;0m" else @@ -14,7 +14,7 @@ printf "\n" printf "\t02:\tendpoint with invalid data" curl http://127.0.0.1:8610/v0/announce/zblock --header 'Content-Type: application/json' --data-raw '{"zblock":"'$(ak-get-zlatest)'sdfas"}' 2>/dev/null | jq -M -c > /dev/null -if [ "$?" == "0" ] +if [ $? -eq 0 ] then printf "\t\t\033[0;32mPASSED\033[0;0m" else @@ -24,7 +24,7 @@ printf "\n" printf "\t03:\tendpoint no data" curl http://127.0.0.1:8610/v0/announce/zblock --header 'Content-Type: application/json' --data-raw '{"zblock":""}' 2>/dev/null | jq -M -c > /dev/null -if [ "$?" == "0" ] +if [ $? -eq 0 ] then printf "\t\t\t\033[0;32mPASSED\033[0;0m" else diff --git a/api/tests/announce_zchain_link.sh b/api/tests/announce_zchain_link.sh index 9c9d381..c92a367 100755 --- a/api/tests/announce_zchain_link.sh +++ b/api/tests/announce_zchain_link.sh @@ -5,7 +5,7 @@ printf "TEST\t/v0/announce/zchain\n" # curl http://127.0.0.1:8610/v0/announce/zchain printf "\t01:\tendpoint with valid data" curl -POST http://localhost:8610/v0/announce/zchain --header 'Content-Type: application/json' --data-raw '{"zchain":"k51qzi5uqu5dgapvk7bhxmchuqya9immqdpbz0f1r91ckpdqzub63afn3d5apr"}' 2>/dev/null | jq -M -c > /dev/null -if [ "$?" == "0" ] +if [ $? -eq 0 ] then printf "\t\t\033[0;32mPASSED\033[0;0m" else @@ -15,7 +15,7 @@ printf "\n" printf "\t02:\tendpoint with invalid data" curl -POST http://localhost:8610/v0/announce/zchain --header 'Content-Type: application/json' --data-raw '{"zchain":"k51qzi5uqu5dgapvk7bhxmchuqya9immqdpbz0f1r91ckpdqzub63afn3d5aar"}' 2>/dev/null | jq -M -c > /dev/null -if [ "$?" == "0" ] +if [ $? -eq 0 ] then printf "\t\t\033[0;32mPASSED\033[0;0m" else @@ -25,7 +25,7 @@ printf "\n" printf "\t03:\tendpoint no data" curl -POST http://localhost:8610/v0/announce/zchain --header 'Content-Type: application/json' --data-raw '{"zchain":""}' 2>/dev/null | jq -M -c > /dev/null -if [ "$?" == "0" ] +if [ $? -eq 0 ] then printf "\t\t\t\033[0;32mPASSED\033[0;0m" else diff --git a/api/tests/default_route.sh b/api/tests/default_route.sh index 1505b68..950ce32 100755 --- a/api/tests/default_route.sh +++ b/api/tests/default_route.sh @@ -2,7 +2,7 @@ PROGRAM="$(basename $0)" printf '[%s]\n' "$PROGRAM" curl http://127.0.0.1:8610 2>/dev/null | jq > /dev/null -if [ "$?" == "0" ] +if [ $? -eq 0 ] then printf "\t\t\033[0;32mPASSED\033[0;0m" else diff --git a/api/tests/gathered_zblocks.sh b/api/tests/gathered_zblocks.sh index 35920e0..3e38ccc 100755 --- a/api/tests/gathered_zblocks.sh +++ b/api/tests/gathered_zblocks.sh @@ -6,7 +6,7 @@ printf '[%s]\n' "$PROGRAM" printf "TEST\t/see\n" printf "\t01:\tOutput is valid JSON format..." curl http://127.0.0.1:8610/v0/see 2>/dev/null | jq > /dev/null -if [ "$?" == "0" ] +if [ $? -eq 0 ] then printf "\t\t\033[0;32mPASSED\033[0;0m" else @@ -16,7 +16,7 @@ printf "\n" printf "\t02:\tFound blocks inside response..." curl http://127.0.0.1:8610/v0/see 2>/dev/null | grep block > /dev/null -if [ "$?" == "0" ] +if [ $? -eq 0 ] then printf "\t\t\033[0;32mPASSED\033[0;0m" else diff --git a/api/tests/gathered_zchain_zlatest_pairs.sh b/api/tests/gathered_zchain_zlatest_pairs.sh index d6c1274..361cc33 100755 --- a/api/tests/gathered_zchain_zlatest_pairs.sh +++ b/api/tests/gathered_zchain_zlatest_pairs.sh @@ -4,7 +4,7 @@ printf '[%s]\n' "$PROGRAM" printf "TEST\t/seens\n" printf "\t01:\tendpoint returns JSON..." curl http://127.0.0.1:8610/v0/seens 2>/dev/null | jq > /dev/null -if [ "$?" == "0" ] +if [ $? -eq 0 ] then printf '\t\t\033[0;32mPASSED\033[0;0m\n' else |