#!/bin/sh

# Smoke test to install mumble and mumble-server to insure that the binaries
# are built and installed, then get some simple text output

set -e

echo "Starting basic smoke test."

## Mumble test currently causes a QT error:
##   qt.qpa.xcb: could not connect to display
## This test is commented out until the required test dependencies are found
##
#MUMBLE_VERSION=$(/usr/bin/mumble -h | head -n 1 | grep "Usage: mumble")
#if [ -n "$MUMBLE_VERSION" ] ; then
#   echo "Found: $MUMBLE_VERSION"
#else
#   echo "Error: Mumble version found: $MUMBLE_VERSION" >&2
#   exit 1
#fi

MURMUR_VERSION=$(/usr/sbin/murmurd --version 2>&1| grep "/usr/sbin/murmurd")
if [ -n "$MURMUR_VERSION" ] ; then
   echo "Found: $MURMUR_VERSION"
else
   echo "Error: Murmur version found: $MURMUR_VERSION" >&2
   exit 1
fi
# If script gets to this point, smoke tests pass
echo "Smoke test passed."
exit 0
