basic tests are now covered no need for this file

This commit is contained in:
shockrah 2020-08-20 19:22:04 -07:00
parent 296fde9954
commit 0d146f5dc1

View File

@ -1,38 +0,0 @@
#!/bin/bash
# Available tests marked with `TEST` - ez grep usage
active_tests='list_all_channels create_channel delete_channel
send_message
'
delete_channel() {
kv="{\"id\":$id,\"secret\":\"$secret\", \"name\":\"sample\"}"
result=$($crl $POST $url/channels/delete -d "$kv")
code=$(echo "$result" | grep HTTP\/1.1 | awk '{print $2}')
log_result good_delete_channel 200 $code "$result"
}
send_message() {
# ignoring the reaction to this as its not _completely_ relevant for this test
$crl $POST $url/channels/create -d "{\"id\":$id, \"secret\":\"$secret\",\"name\":\"msgchannel\",\"kind\":2}" > /dev/null
# now we can try sending the right parameters to send a basic message
kv="{\"id\":$id,\"secret\":\"$secret\", \"content\":\"message sample\", \"channel\":\"msgchannel\"}"
result=$($crl $POST $url/message/send -d "$kv")
code=$(echo "$result" | grep HTTP\/1.1 | awk '{print $2}')
# non-existant channel for now but whatever ignore for now
log_result good_send_message 200 $code "$result"
}
# Dispatcher to run our tests
if [ -z $1 ];then
for cmd in $active_tests;do
$cmd
done
else
for cmd in $@;do
$cmd
echo '\n'$?
done
fi