summaryrefslogtreecommitdiff
path: root/scripts/test-in-container.sh
blob: 21a99697f40406f256d66a75bc59d78801449743 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/bin/bash -e
#
# Run this script in mscp docker containers.
# This script runs end-to-end test with installed mscp.

script_dir=$(cd $(dirname ${0}) && pwd)
cd $script_dir

set -x

# sshd Linsten on 22 and 8022
echo "Port 22" >> /etc/ssh/sshd_config
echo "Port 8022" >> /etc/ssh/sshd_config

# Run sshd
if [ ! -e /var/run/sshd.pid ]; then
	/usr/sbin/sshd
	sleep 1
fi

for port in 22 8022; do
	ssh-keyscan -p $port localhost >> ${HOME}/.ssh/known_hosts
	ssh-keyscan -p $port ip6-localhost >> ${HOME}/.ssh/known_hosts
	ssh-keyscan -p $port 127.0.0.1 >> ${HOME}/.ssh/known_hosts
	ssh-keyscan -p $port ::1 >> ${HOME}/.ssh/known_hosts
done

# Run test
python3 -m pytest -v ../test