76b08b9a60e46ad2c9e183699d5c5c60662a3ea0
[arvados.git] / sdk / pam / Dockerfile
1 # Manual integration test:
2 # 0. python setup.py sdist rotate --keep=1 --match .tar.gz
3 # 1. replace 53015 below with your api server's port number
4 # 2. docker build -name arvados:pam_test .
5 # 3. docker run -it --add-host zzzzz.arvadosapi.com:"$(hostname -I |awk '{print $1}')" arvados:pam_test
6 # 4. container# useradd testusername
7 # 5. container# login                  # enter username and token
8
9 FROM debian:wheezy
10 RUN apt-get update
11 RUN apt-get -qy dist-upgrade
12 RUN apt-get -qy install python python-virtualenv libpam-python rsyslog
13 # Packages required by pycurl, ciso8601
14 RUN apt-get -qy install libcurl4-gnutls-dev python2.7-dev
15
16 # for jessie (which also has other snags)
17 # RUN apt-get -qy install python-pip libgnutls28-dev
18
19 RUN pip install --upgrade setuptools
20 RUN pip install python-pam
21 ADD dist /dist
22 RUN pip install /dist/arvados-pam-*.tar.gz
23
24 # Configure and enable the module (hopefully vendor packages will offer a neater way)
25 RUN perl -pi -e 's{api.example}{zzzzz.arvadosapi.com:53015}; s{shell\.example}{testvm2.shell insecure};' /usr/share/pam-configs/arvados
26 RUN DEBIAN_FRONTEND=noninteractive pam-auth-update arvados --remove unix
27
28 # Add a user account matching the fixture
29 RUN useradd -ms /bin/bash active
30
31 # Test with python (SIGSEGV during tests)
32 #ADD . /pam
33 #WORKDIR /pam
34 #CMD rsyslogd & tail -F /var/log/auth.log & python setup.py test
35
36 # Test with perl (SIGSEGV when program exits)
37 RUN apt-get install -qy libauthen-pam-perl
38 ADD tests/integration_test.pl /integration_test.pl
39 CMD rsyslogd & tail -F /var/log/auth.log & sleep 1 && /integration_test.pl