Main image for tests
246
We have 3 Docker images (all Fedora 23 based):
integration_tests_base - this is base image with all packages which won't be changing often
integration_tests_config - this is small image which contains Ansible. Before every initialization/re-configuration of integration_tests e.g. changing URL of appliance, this image is executed with specific playbook which will configure mounted directories from host system. This directory is then mounted by integraton_tests image.
integration_tests - is the main image which will be used for executing py.test, ipython, vnc commands Both images are linked to integration_tests_base image, so when any change to this image is detected, these 2 images will be rebuilt automatically by Dockerhub
bash wrapper script which is responsible:
Ansible playbooks + 1 custom action-plugin
Updating of Docker images works by pushing changes to integration_tests Dockerfiles.
Example: ssh-keyscan -H gitlab.com >> ~/.ssh/known_hosts ssh-keyscan -H github.com >> ~/.ssh/known_hosts If public keys of remote servers won't be stored in known_hosts file, cloning of remote repo will probably fail.
getenforce
command. If Enforcing is displayed, it means that the SELinux policy is in effect. You can solve this issue by TODOD.
export PROJECTS="${HOME}/projects"
source <(curl -sL https://git.io/fpZ7w)
First go to your working directory:
cd ${PROJECTS}/integration_tests_files
Get information about how to use the wrapper script:
./integration_tests_init.sh
Configure or re-configure environment:
./integration_tests_init.sh init
Note: Answers collected from user during init phase are stored inside .vars_config.yml.
Run test: Note: This test requires to have YAML files configured.
./integration_tests_init.sh cmd "py.test cfme/tests/test_login.py -k test_login -v"
Run ipython with VNC and Selenium servers running:
./integration_tests_init.sh ipython
You can enable debugging of wrapper script/containers. First expoert DEBUG variable:
export INT_TESTS_DEBUG=1
Then run any commands from here
Clone integration_tests repo which contains Dockerfiles:
cd /var/tmp/
# git clone https://github.com/ManageIQ/integration_tests
# Testing:
git clone -b integration_tests_container https://github.com/patchkez/cfme_tests
#cd integration_tests/integration_tests_install/dockerfiles
# testing:
cd cfme_tests/integration_tests_install/dockerfiles/
Build image:
cd integration_tests_base;docker build -t redhatqe/integration_tests_base:`date "+%Y%m%d-%H%M"` .
Tag new built image as latest:
docker tag <image_id> redhatqe/integration_tests_base:latest
Build image:
cd integration_tests_config; docker build -t redhatqe/integration_tests_config:`date "+%Y%m%d-%H%M"` .
We can use image id, instead of name which we do not know after successfull build, because we use date format as a version Tag new built image as latest:
docker tag <image_id> redhatqe/integration_tests_config:latest
Build image:
cd integration_tests; docker build -t redhatqe/integration_tests:`date "+%Y%m%d-%H%M"` .
Tag new built image as latest:
docker tag <image_id> redhatqe/integration_tests:latest
Double check if we have something like this (image tagged as latest must point to our new images):
% docker images | grep integration
redhatqe/integration_tests 20160624-1302 d650af89ca31 5 minutes ago 1.63 GB
redhatqe/integration_tests latest d650af89ca31 5 minutes ago 1.63 GB
redhatqe/integration_tests_config 20160624-1226 e530dbc0c3bc 41 minutes ago 1.699 GB
redhatqe/integration_tests_config latest e530dbc0c3bc 41 minutes ago 1.699 GB
redhatqe/integration_tests_base latest 6e0e1aff46b9 About an hour ago 1.59 GB
redhatqe/integration_tests_base 20160624-1004 97cb61206b92 3 hours ago 1.106 GB
docker run -it redhatqe/integration_tests:latest /bin/bash
Export paths:
export WORK_DIR="~/projects/integration_tests_files"
export INT_TESTS="${WORKDIR}/integration_tests/integrations_tests_install"
export PLAY_LOCATION="${INT_TESTS}/inetgration_tests_config"
docker run -it \
-v ${PLAY_LOCATION:/projects/ansible_virtenv/ansible_work \
-v ${WORK_DIR}:/projects/cfme_env/cfme_vol/ \
redhatqe/integration_tests_config:latest /bin/bash
docker run -it \
-v ${PLAY_LOCATION}:/projects/ansible_virtenv/ansible_work \
-v ${WORKDIR}:/projects/cfme_env/cfme_vol/ \
redhatqe/integration_tests_config:latest
docker run -it \
-v ${PLAY_LOCATION}:/projects/ansible_virtenv/ansible_work \
-v ${WORKDIR}:/projects/cfme_env/cfme_vol/ \
-v ~/.ssh:/home/${USERNAME}/.ssh:ro \
-e "USER_ID=$(id -u)" -e "GROUP_ID=$(id -g)" -e "USERNAME=$(whoami)" -e "GROUPNAME=$(id -gn)" \
redhatqe/integration_tests_config:latest
docker run -it \
-v ${PLAY_LOCATION}:/projects/ansible_virtenv/ansible_work \
-v ${WORKDIR}:/projects/cfme_env/cfme_vol/ \
-v ~/.ssh:/home/${USERNAME}/.ssh:ro \
-e "USER_ID=$(id -u)" -e "GROUP_ID=$(id -g)" -e "USERNAME=$(whoami)" -e "GROUPNAME=$(id -gn)" \
redhatqe/integration_tests_config:latest \
/bin/bash -l -c "ansible-playbook -i inventory -c local configure_integration_tests.yml -vvvv"
docker run -it -p 5999:5999 \
-v ${WORKDIR}:/projects/cfme_env/cfme_vol/ \
-e DISPLAY=$DISPLAY \
redhatqe/integration_tests:latest \
/bin/bash -l -c "vncserver :99 -SecurityTypes None && tail -F /root/.vnc/*.log"
docker run -it redhatqe/integration_tests:latest ipython
docker run -it -v ${WORKDIR}:/projects/cfme_env/cfme_vol/ redhatqe/integration_tests:latest ipython
docker run -it \
-v ${WORKDIR}:/projects/cfme_env/cfme_vol/ \
redhatqe/integration_tests:latest \
"py.test tests/configure/test_access_control.py -k superadmin_tenant -v"
docker run -it \
-v ${WORKDIR}:/projects/cfme_env/cfme_vol/ \
redhatqe/integration_tests:latest \
/bin/bash -l -c "py.test cfme_vol/cfme_tests/cfme/tests/configure/test_access_control.py -k superadmin_tenant -v"
docker run -it \
-v ${WORKDIR}:/projects/cfme_env/cfme_vol/ \
redhatqe/integration_tests:latest \
/bin/bash -l -c \
"cd cfme_vol/cfme_tests/cfme; py.test tests/configure/test_access_control.py -k superadmin_tenant -v"
Remove all not running containers which were started from redhatqe/integration_tests image
docker rm $(docker ps -q -f ancestor=redhatqe/integration_tests -f status=created)
Content type
Image
Digest
Size
754.4 MB
Last updated
almost 8 years ago
docker pull patchkez/integration_tests_docker