4
mirror of git://git.acid.vegas/unrealircd.git synced 2024-11-24 00:46:47 +00:00
unrealircd/extras/build-tests/nix/run-tests

66 lines
1.7 KiB
Plaintext
Raw Normal View History

2020-03-29 09:16:53 +00:00
#!/bin/bash
#
# This script fires up a two-server IRC network and runs the test framework
#
# Exit on error:
set -e
# Verbose:
set -x
# Kill old instances
killall -9 unrealircd || true
# Remove old junk
rm -rf cipherscan/ unrealircd-tests/
if [ ! -d ~/cipherscan ]; then
# Install 'cipherscan'
git clone -q https://github.com/mozilla/cipherscan
fi
2022-01-15 05:16:34 +00:00
if [ "$HOSTNAME" = "deb8" ]; then
echo "Not running tests on Debian 8. It's LTS is EOL and trouble with running tests."
exit 0
fi
2020-03-29 09:16:53 +00:00
# Install 'unrealircd-tests'
2022-01-15 05:16:34 +00:00
git clone -q --branch unreal60 https://github.com/unrealircd/unrealircd-tests.git unrealircd-tests
2020-03-29 09:16:53 +00:00
cd unrealircd-tests
2020-05-29 02:06:50 +00:00
# FreeBSD has various issues with the tests from us and others,
# better set a flag to keep it simple:
FREEBSD=0
2020-03-29 09:16:53 +00:00
if uname -a|grep -q FreeBSD; then
2020-05-29 02:06:50 +00:00
FREEBSD=1
fi
# Run the test framework, testing both services:
if [ "$FREEBSD" = 1 ]; then
2020-03-29 09:16:53 +00:00
# FreeBSD runs without services since they fail mysteriously:
./run -services none || exit 1
else
# Linux tests both with anope and atheme services:
./run -services anope || exit 1
./run -services atheme || exit 1
fi
2021-06-19 15:52:51 +00:00
# Database writing/reading tests
## unencrypted:
./run -services none -boot tests/db/writing/* || exit 1
./run -services none -keepdbs -boot tests/db/reading/* || exit 1
## encrypted:
./run -services none -include db_crypted.conf -boot tests/db/writing/* || exit 1
./run -services none -include db_crypted.conf -keepdbs -boot tests/db/reading/* || exit 1
2020-03-29 09:16:53 +00:00
# Do cipherscan test at the end
2020-05-29 02:06:50 +00:00
# Has problems on non-Linux-64-bit, so we skip there:
if [ "$FREEBSD" = 0 -a "$HOSTNAME" != "ub18-ia32" ]; then
2020-03-29 09:16:53 +00:00
sleep 2
cd ../extras/tests/tls
./tls-tests
cd -
fi
killall -15 unrealircd atheme-services services anope || true