aboutsummaryrefslogtreecommitdiff
path: root/api/tests
diff options
context:
space:
mode:
Diffstat (limited to 'api/tests')
-rwxr-xr-xapi/tests/get_peers.sh3
-rwxr-xr-xapi/tests/node_local_info.sh15
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"