mirror of https://github.com/sipwise/ngcpcfg.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
79 lines
2.0 KiB
79 lines
2.0 KiB
#!/bin/bash
|
|
|
|
set -e
|
|
set -u
|
|
|
|
# when invoked under DEBUG_SHELL=1 then provide
|
|
# interactive shell before exiting
|
|
if [ -n "${DEBUG_SHELL:-}" ] ; then
|
|
bailout() { bash; exit 1; }
|
|
else
|
|
bailout() { exit 1; }
|
|
fi
|
|
|
|
export testsuite="$(dirname $PWD/$0)"
|
|
|
|
TMPDIR="$(mktemp -d)"
|
|
echo "Switching to temporary directory $TMPDIR"
|
|
cd "$TMPDIR"
|
|
cp -a ${testsuite}/* .
|
|
|
|
export FUNCTIONS="$testsuite/../functions/"
|
|
export HELPER="$testsuite/../helper/"
|
|
export SCRIPTS="$testsuite/../scripts/"
|
|
|
|
echo -n "Testing ngcpcfg without any arguments: "
|
|
if $testsuite/../sbin/ngcpcfg 2>&1 | grep -q "^Usage:$" ; then
|
|
echo OK
|
|
else
|
|
echo "Error with executing ngcpcfg without any arguments" >&2
|
|
bailout
|
|
fi
|
|
|
|
echo -n "Testing ngcpcfg --help: "
|
|
if $testsuite/../sbin/ngcpcfg --help 2>&1 | grep -q "^Usage:$" ; then
|
|
echo OK
|
|
else
|
|
echo "Error with executing ngcpcfg --help" >&2
|
|
bailout
|
|
fi
|
|
|
|
echo -n "Testing ngcpcfg --version: "
|
|
if $testsuite/../sbin/ngcpcfg --version 2>&1 | grep -q "version" ; then
|
|
echo OK
|
|
else
|
|
echo "Error with executing ngcpcfg --version" >&2
|
|
bailout
|
|
fi
|
|
|
|
echo "Testing ngcpcfg values: database.dbhost"
|
|
value=$($testsuite/../sbin/ngcpcfg values database.dbhost)
|
|
if [ "${value}" != "localhost" ] ; then
|
|
echo "Error caught: database.dbhost != 'localhost'"
|
|
bailout
|
|
fi
|
|
|
|
echo "Testing ngcpcfg values: ossbss.provisioning.database.user"
|
|
value=$($testsuite/../sbin/ngcpcfg values ossbss.provisioning.database.user)
|
|
if [ "${value}" != "soap" ] ; then
|
|
echo "Error caught: ossbss.provisioning.database.user != 'soap'"
|
|
bailout
|
|
fi
|
|
|
|
echo "Testing ngcpcfg values: www_admin.fees_csv.element_order"
|
|
value=$($testsuite/../sbin/ngcpcfg values www_admin.fees_csv.element_order)
|
|
if [ "${value}" != "destination zone zone_detail onpeak_init_rate \
|
|
onpeak_init_interval onpeak_follow_rate onpeak_follow_interval \
|
|
offpeak_init_rate offpeak_init_interval offpeak_follow_rate \
|
|
offpeak_follow_interval use_free_time" ] ;
|
|
then
|
|
echo "Error caught: www_admin.fees_csv.element_order != expected value"
|
|
bailout
|
|
fi
|
|
|
|
rm -rf "$TMPDIR"
|
|
|
|
echo "Everything seems to be ok."
|
|
|
|
# EOF
|