diff options
author | kaotisk <kaotisk@arching-kaos.org> | 2025-03-14 01:02:07 +0200 |
---|---|---|
committer | kaotisk <kaotisk@arching-kaos.org> | 2025-03-14 01:02:07 +0200 |
commit | 468d96147c5345924e5136f0cfb5fd156dcb15f9 (patch) | |
tree | 3bc95d6b05f798cc9b305ac844149b161f610efe /api/tests | |
parent | 48e044e9b6968729cbd86e14ef49dbdb7c45110b (diff) | |
download | arching-kaos-tools-468d96147c5345924e5136f0cfb5fd156dcb15f9.tar.gz arching-kaos-tools-468d96147c5345924e5136f0cfb5fd156dcb15f9.tar.bz2 arching-kaos-tools-468d96147c5345924e5136f0cfb5fd156dcb15f9.zip |
A couple of tests for the nodeJS API
Diffstat (limited to 'api/tests')
-rwxr-xr-x | api/tests/get_peers.sh | 3 | ||||
-rwxr-xr-x | api/tests/node_local_info.sh | 15 |
2 files changed, 18 insertions, 0 deletions
diff --git a/api/tests/get_peers.sh b/api/tests/get_peers.sh new file mode 100755 index 0000000..14d7a54 --- /dev/null +++ b/api/tests/get_peers.sh @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +curl -s -o soe "http://[`cjdns-online`]:8610/v0/peers" | jq diff --git a/api/tests/node_local_info.sh b/api/tests/node_local_info.sh new file mode 100755 index 0000000..0d45438 --- /dev/null +++ b/api/tests/node_local_info.sh @@ -0,0 +1,15 @@ +#!/usr/bin/env bash +PROGRAM="$(basename $0)" +source $AK_LIBDIR/_ak_ipfs +printf '[%s]\n' "$PROGRAM" +API_RES="$(curl -s http://127.0.0.1:8610/v0/node_info 2>/dev/null | sha512sum - | awk '{ printf $1 }')" +CMD_RES="$(_ak_ipfs_cat $(ak-node-info --ipfs) | sha512sum - | awk '{ printf $1 }')" +printf "TEST /node_info\n" +printf "\t01:\tLatest is the same between API response and CLI..." +if [ "$API_RES" == "$CMD_RES" ] +then + printf "\t\t\033[0;32mPASSED\033[0;0m" +else + printf "\t\t\033[0;31mFAILED\033[0;0m" +fi +printf "\n" |