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.
49 lines
1.2 KiB
49 lines
1.2 KiB
#!/bin/bash
|
|
|
|
set -e
|
|
|
|
REPORT_DIRECTORY='reports/'
|
|
|
|
diag() {
|
|
echo "$@" 2>&1
|
|
}
|
|
|
|
goss="goss-0.3.9-linux-amd64"
|
|
|
|
if [ ! -x "/usr/sbin/${goss}" ] ; then
|
|
diag "Downloading goss and installing as /usr/sbin/${goss}"
|
|
curl -L "https://deb.sipwise.com/files/${goss}" > "/usr/sbin/${goss}"
|
|
chmod +x "/usr/sbin/${goss}"
|
|
fi
|
|
|
|
rm -f /usr/sbin/goss
|
|
ln -s "/usr/sbin/${goss}" /usr/sbin/goss
|
|
|
|
diag "Rebuilding test configs in /etc/ngcp-system-tests/"
|
|
ngcpcfg build /etc/ngcp-system-tests/* 2>&1
|
|
|
|
rm -rf "${REPORT_DIRECTORY}"
|
|
mkdir -p "${REPORT_DIRECTORY}"
|
|
TAP_RESULTS="${REPORT_DIRECTORY}/goss_results.tap"
|
|
|
|
DEBIAN_RELEASE=$(sed -e 's/\([0-9]*\)\..*/\1/' /etc/debian_version)
|
|
# translate Debian codenames that don't have a version number (yet) into according numbers
|
|
case "${DEBIAN_RELEASE}" in
|
|
buster*)
|
|
DEBIAN_RELEASE=10
|
|
;;
|
|
bullseye*)
|
|
DEBIAN_RELEASE=11
|
|
;;
|
|
esac
|
|
export DEBIAN_RELEASE
|
|
|
|
# We need to export these, so that goss sees existent variables.
|
|
export SKIP_DNS_CHECK_TEST=${SKIP_DNS_CHECK_TEST:-false}
|
|
export SKIP_STRICT_HOSTNAME_TEST=${SKIP_STRICT_HOSTNAME_TEST:-false}
|
|
|
|
goss -g "/etc/ngcp-system-tests/goss.yaml" validate --format tap \
|
|
| tee "${TAP_RESULTS}"
|
|
|
|
exit "${PIPESTATUS[0]}"
|