Skip to content

Commit 5704d2d

Browse files
committed
tests: added testing script
1 parent dbf2578 commit 5704d2d

File tree

2 files changed

+52
-0
lines changed

2 files changed

+52
-0
lines changed

rpc

100644100755
File mode changed.

scripts/test-cli.sh

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
#!/bin/bash
2+
echo "\033[0;32mstarting rpc connection(might error if already connected)..."
3+
./rpc
4+
echo "\033[0;32mbuilding cli..."
5+
sh path
6+
7+
tinydancer
8+
9+
read cont
10+
if [ "$cont" != "y" ]; then
11+
exit 1
12+
fi
13+
14+
tput setaf 2; echo "testing config..."
15+
tinydancer config get
16+
tinydancer config set --cluster Localnet --log-path /tmp/client.logPath
17+
# tinydancer config get
18+
19+
echo "Continue? (y/n)"
20+
read cont
21+
if [ "$cont" != "y" ]; then
22+
exit 1
23+
fi
24+
25+
echo "\033[0;32mtesting slot..."
26+
slot=$(tinydancer slot)
27+
slot_number=$(echo $slot | cut -d':' -f 2 | xargs | sed 's/\x1B\[[0-9;]\{1,\}[A-Za-z]//g')
28+
sleep 1
29+
tinydancer verify --slot "$slot_number"
30+
31+
echo "Continue? (y/n)"
32+
read cont
33+
if [ "$cont" != "y" ]; then
34+
exit 1
35+
# fi
36+
37+
echo "\033[0;32mtesting daemon..."
38+
# should handle gracefully
39+
tinydancer start
40+
sleep 1
41+
tinydancer start "/tmp"
42+
PID=$!
43+
kill -INT $PID # kill if still running
44+
45+
echo "Continue? (y/n)"
46+
read cont
47+
if [ "$cont" != "y" ]; then
48+
exit 1
49+
fi
50+
51+
52+
echo "\033[0;32mtests complete"

0 commit comments

Comments
 (0)