initial commit
* Downstream tempest with set of downstream plugins
* Align to upstream openstack upper-constraints.txt
* No-auto-magic things, by default.
* All configs should be **connected** as volumes to container.
* All preconfigured things, like:
-create networks
-create tempest conf
-add\patch plugin
should be done in separate steps.
* Open entrypoint - any customization allowed and could be passed:
- via cmdline for docker run
- via SWITCH env variables + new func in entrypoint
* If needed, any custom scripts could be added, but should be disable by default.
Change-Id: Iec219f3f23f06ee08f7761cf78f478ca0b0ca04f
diff --git a/Dockerfile b/Dockerfile
new file mode 100644
index 0000000..160f399
--- /dev/null
+++ b/Dockerfile
@@ -0,0 +1,93 @@
+FROM ubuntu:16.04
+
+LABEL maintainer="qa@mirantis.com"
+
+ARG TEMPEST_TAG="mcp/pike"
+# Tempest plugins
+ARG HORIZON_TAG="mcp/pike"
+ARG BARBICAN_TAG="master"
+ARG DESIGNATE_TAG="mcp/pike"
+ARG HEAT_TAG="mcp/pike"
+ARG IRONIC_TAG="master"
+ARG MANILA_TAG="master"
+ARG TELEMETRY_TAG="master"
+# global openstack requirements repo
+ARG UPPER_CONSTRAINTS_TAG="stable/pike"
+#
+ENV DEBIAN_FRONTEND=noninteractive \
+ DEBCONF_NONINTERACTIVE_SEEN=true \
+ LANG=C.UTF-8 \
+ LANGUAGE=$LANG
+SHELL ["/bin/bash", "-xec"]
+USER root
+# pre-update
+RUN cd /etc/apt/ && echo > sources.list \
+ && echo "deb [arch=amd64] http://cz.archive.ubuntu.com/ubuntu xenial main restricted universe multiverse" >> sources.list \
+ && echo "deb [arch=amd64] http://cz.archive.ubuntu.com/ubuntu xenial-updates main restricted universe multiverse" >> sources.list \
+ && echo "deb [arch=amd64] http://cz.archive.ubuntu.com/ubuntu xenial-backports main restricted universe multiverse" >> sources.list \
+ && echo 'Acquire::Languages "none";' > apt.conf.d/docker-no-languages \
+ && echo 'Acquire::GzipIndexes "true"; Acquire::CompressionTypes::Order:: "gz";' > apt.conf.d/docker-gzip-indexes \
+ && echo 'APT::Get::Install-Recommends "false"; APT::Get::Install-Suggests "false";' > apt.conf.d/docker-recommends \
+ && apt-get update && apt-get upgrade -y \
+ && apt-get install -y vim-tiny git-core python-pip libffi-dev libssl-dev python-dev python3-dev
+
+RUN pip install -U pip
+WORKDIR /var/lib/
+# TODO migrate to downstrem mirror?
+RUN git clone https://github.com/openstack/requirements.git openstack_requirements && \
+ pushd openstack_requirements; git checkout $UPPER_CONSTRAINTS_TAG; popd ;
+
+RUN git clone https://gerrit.mcp.mirantis.net/packaging/sources/tempest && \
+ pushd tempest; git checkout $TEMPEST_TAG; \
+ pip install --constraint /var/lib/openstack_requirements/upper-constraints.txt -r requirements.txt ; \
+ pip install . ; popd;
+
+RUN git clone https://gerrit.mcp.mirantis.net/packaging/sources/tempest-horizon tempest-horizon-plugin ; \
+ pushd tempest-horizon-plugin ; git checkout $HORIZON_TAG; \
+ pip install --constraint /var/lib/openstack_requirements/upper-constraints.txt -r requirements.txt ; \
+ pip install . ; popd;
+
+RUN git clone https://gerrit.mcp.mirantis.net/packaging/sources/barbican-tempest-plugin && \
+ pushd barbican-tempest-plugin; git checkout $BARBICAN_TAG; \
+ pip install --constraint /var/lib/openstack_requirements/upper-constraints.txt -r requirements.txt ; \
+ pip install . ; popd;
+
+RUN git clone https://gerrit.mcp.mirantis.net/packaging/sources/designate-tempest-plugin && \
+ pushd designate-tempest-plugin; git checkout $DESIGNATE_TAG; \
+ pip install --constraint /var/lib/openstack_requirements/upper-constraints.txt -r requirements.txt ; \
+ pip install . ; popd;
+
+RUN git clone https://gerrit.mcp.mirantis.net/packaging/sources/heat-tempest-plugin && \
+ pushd heat-tempest-plugin; git checkout $HEAT_TAG; \
+ pip install --constraint /var/lib/openstack_requirements/upper-constraints.txt -r requirements.txt ; \
+ pip install . ; popd;
+
+RUN git clone https://gerrit.mcp.mirantis.net/packaging/sources/ironic-tempest-plugin && \
+ pushd ironic-tempest-plugin; git checkout $IRONIC_TAG; \
+ pip install --constraint /var/lib/openstack_requirements/upper-constraints.txt -r requirements.txt ; \
+ pip install . ; popd;
+
+RUN git clone https://gerrit.mcp.mirantis.net/packaging/sources/manila-tempest-plugin && \
+ pushd manila-tempest-plugin; git checkout $MANILA_TAG; \
+ pip install --constraint /var/lib/openstack_requirements/upper-constraints.txt -r requirements.txt ; \
+ pip install . ; popd;
+
+RUN git clone https://gerrit.mcp.mirantis.net/packaging/sources/telemetry-tempest-plugin && \
+ pushd telemetry-tempest-plugin; git checkout $TELEMETRY_TAG; \
+ pip install --constraint /var/lib/openstack_requirements/upper-constraints.txt -r requirements.txt ; \
+ pip install . ; popd;
+
+# Cleanup.
+RUN apt-get -y purge libx11-data xauth libxmuu1 libxcb1 libx11-6 libxext6 \
+ ppp pppconfig pppoeconf popularity-contest cpp gcc g++ libssl-doc
+RUN apt-get -y autoremove; apt-get -y clean;
+RUN rm -rf /root/.cache
+RUN rm -rf /var/lib/apt/lists/*
+#
+COPY bin/entrypoint.sh /usr/bin/entrypoint.sh
+
+WORKDIR /var/lib/tempest/
+ENTRYPOINT ["/usr/bin/entrypoint.sh"]
+
+# Build
+# docker build -t docker-ci-tempest:$(date "+%Y_%m_%d_%H_%M_%S") .
diff --git a/README.rst b/README.rst
new file mode 100644
index 0000000..91ea745
--- /dev/null
+++ b/README.rst
@@ -0,0 +1,53 @@
+
+==========================================
+Tempest with plugins environment container
+==========================================
+
+
+Tempest with plugins environment container.
+Those container supposed to have any needed set of tempest tests
+for running on any custom cloud.
+
+Container statements:
+=====================
+
+ * Downstream tempest with set of downstream plugins
+ * Align to upstream openstack upper-constraints.txt
+ * No-auto-magic things, by default.
+ * All configs should be **connected** as volumes to container.
+ * All preconfigured things, like:
+ -create networks
+ -create tempest conf
+ -add\patch plugin
+ should be done in separate steps.
+ * Open entrypoint - any customization allowed and could be passed:
+ - via cmdline for docker run
+ - via SWITCH env variables + new func in entrypoint
+ * If needed, any custom scripts could be added, but should be disable by default.
+
+
+
+Example run:
+============
+
+Example for custom tempest run:
+
+.. caution::
+
+ **tempest_generated.conf** should be previously generated, along with all needed resources in cloud.
+
+ ``log_dir`` variable in conf, should be pointed to ``/temepest_reports`` - otherwise, you need to
+ change cmdline accordingly.
+
+
+
+.. code-block:: bash
+
+ mkdir -p /root/test_example/; cd /root/test_example/ ;
+ mkdir -p temepest_reports/ # create local folder, to save results
+ rm -rf temepest_reports/test1 # remove old results, ff was
+ docker run -v $(pwd)/tempest_generated.conf:/etc/tempest/tempest.conf -v $(pwd)/temepest_reports:/temepest_reports --rm -it 858b99100d04 /bin/bash -c "cd /temepest_reports; tempest init test1 ; cd test1; tempest run --debug -r heat_tempest_plugin.tests.api.test_heat_api.stacks_patch_update_stack.test_request
+
+
+
+
diff --git a/bin/entrypoint.sh b/bin/entrypoint.sh
new file mode 100755
index 0000000..18c8d80
--- /dev/null
+++ b/bin/entrypoint.sh
@@ -0,0 +1,18 @@
+#!/bin/bash
+
+set -xe
+
+function _info(){
+ set +x
+ echo -e "=== INFO: tempest version:"
+ tempest --version
+ echo -e "=== INFO: installed plugins:"
+ tempest list-plugins
+ echo -e "=== INFO: tempest pip's:"
+ pip freeze |grep -i tempest | sort
+ echo -e "============================"
+ set -x
+}
+
+_info
+exec "$@"