From 1f8ec4f1a9d4affbd590fadf20011fe50ab29721 Mon Sep 17 00:00:00 2001 From: Patrick Uiterwijk Date: Feb 14 2017 14:14:44 +0000 Subject: Add container tests Signed-off-by: Patrick Uiterwijk --- diff --git a/Makefile b/Makefile index 5b28433..e5ff5bd 100644 --- a/Makefile +++ b/Makefile @@ -142,3 +142,40 @@ releaserpms: rpmroot rpmdistdir sdist mv $(RPMBUILD)/RPMS/*/ipsilon-*.rpm dist/rpms/ mv $(RPMBUILD)/SRPMS/ipsilon-*.src.rpm dist/srpms/ rm -rf $(RPMBUILD) + +# Testing within containers +container-centos7: + echo "Building CentOS 7 container ..." + (cat tests/containers/Dockerfile-base tests/containers/Dockerfile-centos tests/containers/Dockerfile-rpm; echo "USER testuser") | sed -e 's/BASE/centos:7/' | sudo docker build -f - -q -t ipsilon-centos7 - + echo "CentOS 7 container built" + +container-fedora24: + echo "Building Fedora 24 container ..." + (cat tests/containers/Dockerfile-base tests/containers/Dockerfile-fedora tests/containers/Dockerfile-rpm; echo "USER testuser") | sed -e 's/BASE/fedora:24/' | sudo docker build -f - -q -t ipsilon-fedora24 - + echo "Fedora 24 container built" + +container-fedora25: + echo "Building Fedora 25 container ..." + (cat tests/containers/Dockerfile-base tests/containers/Dockerfile-fedora tests/containers/Dockerfile-rpm; echo "USER testuser") | sed -e 's/BASE/fedora:25/' | sudo docker build -f - -q -t ipsilon-fedora25 - + echo "Fedora 25 container built" + +containers: container-fedora24 container-fedora25 + echo "Containers built" + +containertest-centos7: container-centos7 + echo "Starting CentOS 7 tests ..." + sudo docker run -v `pwd`:/code -t --rm -a stderr ipsilon-centos7 + echo "CentOS 7 passed" + +containertest-fedora24: container-fedora24 + echo "Starting Fedora 24 tests ..." + sudo docker run -v `pwd`:/code -t --rm -a stderr ipsilon-fedora24 + echo "Fedora 24 passed" + +containertest-fedora25: container-fedora25 + echo "Starting Fedora 25 tests ..." + sudo docker run -v `pwd`:/code -t --rm -a stderr ipsilon-fedora25 + echo "Fedora 25 passed" + +containertest: containertest-centos7 containertest-fedora24 containertest-fedora25 + echo "Container tests passed" diff --git a/tests/containers/Dockerfile-base b/tests/containers/Dockerfile-base new file mode 100644 index 0000000..bb0da78 --- /dev/null +++ b/tests/containers/Dockerfile-base @@ -0,0 +1,6 @@ +FROM BASE +VOLUME ["/code"] +RUN useradd testuser \ + && chown testuser:testuser /code +WORKDIR /code +ENTRYPOINT ["/usr/bin/make", "testdeps", "test"] diff --git a/tests/containers/Dockerfile-centos b/tests/containers/Dockerfile-centos new file mode 100644 index 0000000..7e7e72b --- /dev/null +++ b/tests/containers/Dockerfile-centos @@ -0,0 +1 @@ +RUN yum install -y epel-release diff --git a/tests/containers/Dockerfile-fedora b/tests/containers/Dockerfile-fedora new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/tests/containers/Dockerfile-fedora diff --git a/tests/containers/Dockerfile-rpm b/tests/containers/Dockerfile-rpm new file mode 100644 index 0000000..d3f5346 --- /dev/null +++ b/tests/containers/Dockerfile-rpm @@ -0,0 +1,13 @@ +RUN yum update -y \ + && yum install -y which +# This should be kept in sync with the develop page on the website. +# Distro-specific packages should go in the distro sub-dockerfiles. +RUN yum install -y make pylint python-pep8 python-openid python-openid-teams \ + python-openid-cla python-cherrypy m2crypto lasso-python \ + python-sqlalchemy python-ldap python-pam python-fedora \ + freeipa-python httpd mod_auth_mellon postgresql-server \ + openssl mod_wsgi python-jinja2 python-psycopg2 sssd \ + libsss_simpleifp openldap-servers mod_auth_gssapi krb5-server \ + socket_wrapper nss_wrapper python-requests-kerberos python-lesscpy\ + nodejs-less krb5-workstation python-sssdconfig sqlite python-jwcrypto \ + mod_ssl mod_auth_openidc python-jwcrypto