tests can be run in a dockercontainer now. (just start ./tests/run_tests_docker to magically do it) changed time patching during testing to use mocktime() instead. fixed alpine issues. fixed #206

This commit is contained in:
Edwin Eefting
2023-10-02 23:15:37 +02:00
parent 5cca819916
commit 8b8be80ab7
24 changed files with 236 additions and 202 deletions

27
tests/tests_docker Executable file
View File

@ -0,0 +1,27 @@
#!/bin/sh
#NOTE: This script will started inside the test docker container
set -e
if ! [ -e /dev/ram0 ]; then
echo "Please run this outside container:" >&2
echo "sudo modprobe brd rd_size=512000" >&2
exit 1
fi
#start sshd and other stuff
ssh-keygen -A
/usr/sbin/sshd
udevd -d
#test ssh localhost
if ! [ -e /root/.ssh/id_rsa ]; then
ssh-keygen -t rsa -f /root/.ssh/id_rsa -P ''
fi
cat /root/.ssh/id_rsa.pub >> /root/.ssh/authorized_keys
ssh -oStrictHostKeyChecking=no localhost 'echo SSH OK'
cd /app
python -m unittest discover /app/tests -vvvvf $@