~anjan/sxmo-check

6f1e485e834904469a34e520144e9b9a9df9dfb9 — Anjandev Momi 2 years ago b34f8af
recieving test working with go-sendxmpp
1 files changed, 4 insertions(+), 8 deletions(-)

M lib/text.sh
M lib/text.sh => lib/text.sh +4 -8
@@ 3,17 3,13 @@
recieving() {
	. ./.secrets

	mkfifo /tmp/xmpp
	RECIEVE_ME="TESTDATA - Testing plain text at $(date)"
	xmppipe --chat "$PHONE_NUM@cheogram.com" <> /tmp/xmpp > /tmp/outdata
	echo "$RECIEVE_ME" > /tmp/xmpp
	echo "$RECIEVE_ME" | go-sendxmpp "$PHONE_NUM@cheogram.com"
	
	sleep 30s
	sleep 4s
	RECIEVED="$(tail -n 2 "$XDG_DATA_HOME/sxmo/modem/$CHEOGRAM_NUM/sms.txt" | grep -v "^$")"

	[ "$RECIEVE_ME" = "$RECIEVED" ] && echo "Good"
	[ "$RECIEVE_ME" != "$RECIEVED" ] && echo "Bad"
	[ "$RECIEVE_ME" = "$RECIEVED" ] && echo "Good" && return 0
	[ "$RECIEVE_ME" != "$RECIEVED" ] && echo "Bad" && return 1

	rm /tmp/xmpp
	rm /tmp/outdata
}