8784: Fix test for latest firefox.
[arvados.git] / sdk / pam / Dockerfile
1 # These tests assume you have a real API server running on the docker host.
2 #
3 # Build the test container:
4 #   First, replace 3000 below with your api server's port number if necessary.
5 #   host$ python setup.py sdist rotate --keep=1 --match .tar.gz
6 #   host$ docker build --tag=arvados/pam_test .
7 #
8 # Automated integration test:
9 #   host$ docker run -it --add-host zzzzz.arvadosapi.com:"$(hostname -I |awk '{print $1}')" arvados/pam_test
10 # You should see "=== OK ===", followed by a Perl stack trace due to a
11 # yet-unidentified pam_python.so bug.
12 #
13 # Manual integration test:
14 #   host$ docker run -it --add-host zzzzz.arvadosapi.com:"$(hostname -I |awk '{print $1}')" arvados/pam_test bash -c 'rsyslogd & tail -F /var/log/auth.log & sleep 1 & bash'
15 #   container# login
16 #   login: active
17 #   Arvados API token: 3kg6k6lzmp9kj5cpkcoxie963cmvjahbt2fod9zru30k1jqdmi
18 # You should now be logged in to the "active" shell account in the
19 # container. You should also see arvados_pam log entries in
20 # /var/log/auth.log (and in your terminal, thanks to "tail -F").
21
22 FROM debian:wheezy
23 RUN apt-get update
24 RUN apt-get -qy dist-upgrade
25 RUN apt-get -qy install python python-virtualenv libpam-python rsyslog
26 # Packages required by pycurl, ciso8601
27 RUN apt-get -qy install libcurl4-gnutls-dev python2.7-dev
28
29 # for jessie (which also has other snags)
30 # RUN apt-get -qy install python-pip libgnutls28-dev
31
32 RUN pip install --upgrade setuptools
33 RUN pip install python-pam
34 ADD dist /dist
35 RUN pip install /dist/arvados-pam-*.tar.gz
36
37 # Configure and enable the module (hopefully vendor packages will offer a neater way)
38 RUN perl -pi -e 's{api.example}{zzzzz.arvadosapi.com:3000}; s{shell\.example}{testvm2.shell insecure};' /usr/share/pam-configs/arvados
39 RUN DEBIAN_FRONTEND=noninteractive pam-auth-update arvados --remove unix
40
41 # Add a user account matching the fixture
42 RUN useradd -ms /bin/bash active
43
44 # Test with python (SIGSEGV during tests)
45 #ADD . /pam
46 #WORKDIR /pam
47 #CMD rsyslogd & tail -F /var/log/auth.log & python setup.py test --test-suite integration_tests
48
49 # Test with perl (SIGSEGV when program exits)
50 RUN apt-get install -qy libauthen-pam-perl
51 ADD tests/integration_test.pl /integration_test.pl
52 CMD rsyslogd & tail -F /var/log/auth.log & sleep 1 && /integration_test.pl