File: tests_docker

package info (click to toggle)
zfs-autobackup 3.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 616 kB
  • sloc: python: 5,044; sh: 94; makefile: 3
file content (42 lines) | stat: -rwxr-xr-x 831 bytes parent folder | download
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
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/bin/sh

#NOTE: This script will started inside the test docker container

set -e

if ! [ -e /.dockerenv ]; then
  echo "only run this script inside a docker container!"
  exit 1
fi

if ! [ -e /dev/ram0 ]; then
    echo "Please load this module 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


#config ssh
if ! [ -e /root/.ssh/id_rsa ]; then
    ssh-keygen -t rsa -f /root/.ssh/id_rsa -P ''
fi

cat >> ~/.ssh/config <<EOF
Host *
    addkeystoagent yes
    controlpath ~/.ssh/control-master-%r@%h:%p
    controlmaster auto
    controlpersist 3600
EOF

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 $@