From 302a36db99b8783357b5b303864b40cbbd5fb50a Mon Sep 17 00:00:00 2001 From: Matt Clay Date: Wed, 29 Aug 2018 15:59:36 -0700 Subject: [PATCH] Remove obsolete `test/utils/docker/` directory. (cherry picked from commit 78bd02042945ac6c8397be0a1e960549fe2a2625) --- test/utils/docker/centos6/Dockerfile | 63 ---- test/utils/docker/centos7/Dockerfile | 70 ---- .../docker/cloudstack-simulator/Dockerfile | 66 ---- .../docker/cloudstack-simulator/Makefile | 14 - .../docker/cloudstack-simulator/README.rst | 31 -- .../cloudstack-simulator/nginx_default.conf | 23 -- test/utils/docker/cloudstack-simulator/run.sh | 15 - .../cloudstack-simulator/supervisord.conf | 28 -- .../docker/cloudstack-simulator/zones.cfg | 310 ------------------ test/utils/docker/fedora24/Dockerfile | 79 ----- test/utils/docker/fedora25/Dockerfile | 75 ----- test/utils/docker/fedora25py3/Dockerfile | 70 ---- test/utils/docker/fedora26py3/Dockerfile | 71 ---- test/utils/docker/httptester/Dockerfile | 33 -- test/utils/docker/httptester/httptester.yml | 146 --------- test/utils/docker/httptester/nginx.sites.conf | 68 ---- test/utils/docker/httptester/packer.json | 44 --- test/utils/docker/httptester/services.sh | 3 - test/utils/docker/opensuse42.1/Dockerfile | 78 ----- test/utils/docker/opensuse42.2/Dockerfile | 78 ----- test/utils/docker/opensuse42.3/Dockerfile | 78 ----- test/utils/docker/ubuntu1204/Dockerfile | 98 ------ test/utils/docker/ubuntu1204/init-fake.conf | 13 - test/utils/docker/ubuntu1404/Dockerfile | 98 ------ test/utils/docker/ubuntu1404/init-fake.conf | 13 - test/utils/docker/ubuntu1604/Dockerfile | 73 ----- test/utils/docker/ubuntu1604py3/Dockerfile | 69 ---- .../utils/docker/vcenter-simulator/Dockerfile | 39 --- .../docker/vcenter-simulator/flask_control.py | 309 ----------------- test/utils/docker/vcenter-simulator/make.sh | 3 - 30 files changed, 2158 deletions(-) delete mode 100644 test/utils/docker/centos6/Dockerfile delete mode 100644 test/utils/docker/centos7/Dockerfile delete mode 100644 test/utils/docker/cloudstack-simulator/Dockerfile delete mode 100644 test/utils/docker/cloudstack-simulator/Makefile delete mode 100644 test/utils/docker/cloudstack-simulator/README.rst delete mode 100644 test/utils/docker/cloudstack-simulator/nginx_default.conf delete mode 100755 test/utils/docker/cloudstack-simulator/run.sh delete mode 100644 test/utils/docker/cloudstack-simulator/supervisord.conf delete mode 100644 test/utils/docker/cloudstack-simulator/zones.cfg delete mode 100644 test/utils/docker/fedora24/Dockerfile delete mode 100644 test/utils/docker/fedora25/Dockerfile delete mode 100644 test/utils/docker/fedora25py3/Dockerfile delete mode 100644 test/utils/docker/fedora26py3/Dockerfile delete mode 100644 test/utils/docker/httptester/Dockerfile delete mode 100644 test/utils/docker/httptester/httptester.yml delete mode 100644 test/utils/docker/httptester/nginx.sites.conf delete mode 100644 test/utils/docker/httptester/packer.json delete mode 100755 test/utils/docker/httptester/services.sh delete mode 100644 test/utils/docker/opensuse42.1/Dockerfile delete mode 100644 test/utils/docker/opensuse42.2/Dockerfile delete mode 100644 test/utils/docker/opensuse42.3/Dockerfile delete mode 100644 test/utils/docker/ubuntu1204/Dockerfile delete mode 100644 test/utils/docker/ubuntu1204/init-fake.conf delete mode 100644 test/utils/docker/ubuntu1404/Dockerfile delete mode 100644 test/utils/docker/ubuntu1404/init-fake.conf delete mode 100644 test/utils/docker/ubuntu1604/Dockerfile delete mode 100644 test/utils/docker/ubuntu1604py3/Dockerfile delete mode 100644 test/utils/docker/vcenter-simulator/Dockerfile delete mode 100755 test/utils/docker/vcenter-simulator/flask_control.py delete mode 100755 test/utils/docker/vcenter-simulator/make.sh diff --git a/test/utils/docker/centos6/Dockerfile b/test/utils/docker/centos6/Dockerfile deleted file mode 100644 index 21e76aa2796..00000000000 --- a/test/utils/docker/centos6/Dockerfile +++ /dev/null @@ -1,63 +0,0 @@ -FROM centos:centos6 - -RUN yum clean all && \ - yum -y install epel-release && \ - yum -y install \ - acl \ - asciidoc \ - bzip2 \ - file \ - gcc \ - git \ - libffi \ - libffi-devel \ - make \ - mercurial \ - mysql \ - MySQL-python \ - mysql-server \ - openssh-clients \ - openssh-server \ - openssl-devel \ - python-argparse \ - pass \ - python-devel \ - python-httplib2 \ - python-jinja2 \ - python-keyczar \ - python-lxml \ - python-mock \ - python-nose \ - python-paramiko \ - python-passlib \ - python-pip \ - python-setuptools \ - python-virtualenv \ - PyYAML \ - rpm-build \ - rubygems \ - sed \ - sshpass \ - subversion \ - sudo \ - unzip \ - which \ - zip \ - && \ - yum clean all - -RUN rpm -e --nodeps python-crypto && pip install --upgrade pycrypto cryptography - -RUN /bin/sed -i -e 's/^\(Defaults\s*requiretty\)/#--- \1/' /etc/sudoers -RUN mkdir /etc/ansible/ -RUN /bin/echo -e '[local]\nlocalhost ansible_connection=local' > /etc/ansible/hosts -VOLUME /sys/fs/cgroup /run /tmp -RUN ssh-keygen -q -t rsa1 -N '' -f /etc/ssh/ssh_host_key && \ - ssh-keygen -q -t dsa -N '' -f /etc/ssh/ssh_host_dsa_key && \ - ssh-keygen -q -t rsa -N '' -f /etc/ssh/ssh_host_rsa_key && \ - ssh-keygen -q -t rsa -N '' -f /root/.ssh/id_rsa && \ - cp /root/.ssh/id_rsa.pub /root/.ssh/authorized_keys && \ - for key in /etc/ssh/ssh_host_*_key.pub; do echo "localhost $(cat ${key})" >> /root/.ssh/known_hosts; done -RUN pip install coverage junit-xml -ENV container=docker -CMD ["/sbin/init"] diff --git a/test/utils/docker/centos7/Dockerfile b/test/utils/docker/centos7/Dockerfile deleted file mode 100644 index 703ff8cde07..00000000000 --- a/test/utils/docker/centos7/Dockerfile +++ /dev/null @@ -1,70 +0,0 @@ -FROM centos:centos7 - -RUN (cd /lib/systemd/system/sysinit.target.wants/; for i in *; do [ $i == systemd-tmpfiles-setup.service ] || rm -f $i; done); \ -rm -f /lib/systemd/system/multi-user.target.wants/*; \ -rm -f /etc/systemd/system/*.wants/*; \ -rm -f /lib/systemd/system/local-fs.target.wants/*; \ -rm -f /lib/systemd/system/sockets.target.wants/*udev*; \ -rm -f /lib/systemd/system/sockets.target.wants/*initctl*; \ -rm -f /lib/systemd/system/basic.target.wants/*; \ -rm -f /lib/systemd/system/anaconda.target.wants/*; - -RUN yum clean all && \ - yum -y install epel-release && \ - yum -y install \ - acl \ - asciidoc \ - bzip2 \ - dbus-python \ - file \ - gcc \ - git \ - iproute \ - libffi \ - libffi-devel \ - make \ - mariadb-server \ - mercurial \ - MySQL-python \ - openssh-clients \ - openssh-server \ - openssl-devel \ - python-cryptography \ - pass \ - python-devel \ - python-httplib2 \ - python-jinja2 \ - python-keyczar \ - python-lxml \ - python-mock \ - python-nose \ - python-paramiko \ - python-passlib \ - python-pip \ - python-setuptools \ - python-virtualenv \ - PyYAML \ - rpm-build \ - rubygems \ - sshpass \ - subversion \ - sudo \ - unzip \ - which \ - && \ - yum -y swap fakesystemd systemd && \ - yum clean all - -RUN /usr/bin/sed -i -e 's/^\(Defaults\s*requiretty\)/#--- \1/' /etc/sudoers -RUN mkdir /etc/ansible/ -RUN /usr/bin/echo -e '[local]\nlocalhost ansible_connection=local' > /etc/ansible/hosts -VOLUME /sys/fs/cgroup /run /tmp -RUN ssh-keygen -q -t rsa1 -N '' -f /etc/ssh/ssh_host_key && \ - ssh-keygen -q -t dsa -N '' -f /etc/ssh/ssh_host_dsa_key && \ - ssh-keygen -q -t rsa -N '' -f /etc/ssh/ssh_host_rsa_key && \ - ssh-keygen -q -t rsa -N '' -f /root/.ssh/id_rsa && \ - cp /root/.ssh/id_rsa.pub /root/.ssh/authorized_keys && \ - for key in /etc/ssh/ssh_host_*_key.pub; do echo "localhost $(cat ${key})" >> /root/.ssh/known_hosts; done -RUN pip install coverage junit-xml -ENV container=docker -CMD ["/usr/sbin/init"] diff --git a/test/utils/docker/cloudstack-simulator/Dockerfile b/test/utils/docker/cloudstack-simulator/Dockerfile deleted file mode 100644 index 8083b441fc1..00000000000 --- a/test/utils/docker/cloudstack-simulator/Dockerfile +++ /dev/null @@ -1,66 +0,0 @@ -FROM ubuntu:16.04 - -MAINTAINER "René Moser" - -RUN echo 'mysql-server mysql-server/root_password password root' | debconf-set-selections; \ - echo 'mysql-server mysql-server/root_password_again password root' | debconf-set-selections; - -RUN apt-get -y update && apt-get install -y \ - genisoimage \ - libffi-dev \ - libssl-dev \ - sudo \ - ipmitool \ - maven \ - netcat \ - openjdk-8-jdk \ - python-dev \ - python-mysql.connector \ - python-pip \ - python-setuptools \ - supervisor \ - wget \ - nginx \ - jq \ - mysql-server \ - openssh-client \ - && apt-get clean all \ - && rm -rf /var/lib/apt/lists/*; - -# TODO: check if and why this is needed -RUN mkdir -p /root/.ssh \ - && chmod 0700 /root/.ssh \ - && ssh-keygen -t rsa -N "" -f id_rsa.cloud - -RUN mkdir -p /var/run/mysqld; \ - chown mysql /var/run/mysqld; \ - echo '''sql_mode = "STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"''' >> /etc/mysql/mysql.conf.d/mysqld.cnf - -RUN (/usr/bin/mysqld_safe &); sleep 5; mysqladmin -u root -proot password '' - -RUN wget https://github.com/apache/cloudstack/archive/4.9.2.0.tar.gz -O /opt/cloudstack.tar.gz; \ - mkdir -p /opt/cloudstack; \ - tar xvzf /opt/cloudstack.tar.gz -C /opt/cloudstack --strip-components=1 - -WORKDIR /opt/cloudstack - -RUN mvn -Pdeveloper -Dsimulator -DskipTests clean install -RUN mvn -Pdeveloper -Dsimulator dependency:go-offline -RUN mvn -pl client jetty:run -Dsimulator -Djetty.skip -Dorg.eclipse.jetty.annotations.maxWait=120 - -RUN (/usr/bin/mysqld_safe &); \ - sleep 5; \ - mvn -Pdeveloper -pl developer -Ddeploydb; \ - mvn -Pdeveloper -pl developer -Ddeploydb-simulator; \ - MARVIN_FILE=$(find /opt/cloudstack/tools/marvin/dist/ -name "Marvin*.tar.gz"); \ - pip install $MARVIN_FILE; - -COPY zones.cfg /opt/zones.cfg -COPY nginx_default.conf /etc/nginx/sites-available/default -RUN pip install cs -COPY run.sh /opt/run.sh -COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf - -EXPOSE 8888 8080 8096 - -CMD ["/usr/bin/supervisord"] diff --git a/test/utils/docker/cloudstack-simulator/Makefile b/test/utils/docker/cloudstack-simulator/Makefile deleted file mode 100644 index 52985bf5a0c..00000000000 --- a/test/utils/docker/cloudstack-simulator/Makefile +++ /dev/null @@ -1,14 +0,0 @@ -build: - docker build -t cloudstack-sim . - -clean: - docker rm -f cloudstack - -run: - docker run --name cloudstack -d -p 8080:8080 -p 8888:8888 cloudstack-sim - -shell: - docker exec -it cloudstack /bin/bash - -logs: - docker logs -f cloudstack diff --git a/test/utils/docker/cloudstack-simulator/README.rst b/test/utils/docker/cloudstack-simulator/README.rst deleted file mode 100644 index aa65580cd43..00000000000 --- a/test/utils/docker/cloudstack-simulator/README.rst +++ /dev/null @@ -1,31 +0,0 @@ -CloudStack Simulator as Docker Image -==================================== - -The purpose of this docker image is to run automated integration tests for the CloudStack modules in Ansible. - -Setup ------ - -The docker image runs the CloudStack simulator and contains two zones for the different network setups: `basic` and `advanced` networking. - -- CloudStack Zone: Sandbox-simulator-advanced -- Zone: Sandbox-simulator-basic - -Build ------ - -.. code-block:: shell - - docker build -t ansible/cloudstack-simulator . - -Run ---- - -.. code-block:: shell - - docker run --name cloudstack-simulator -d -p 8888:8888 ansible/cloudstack-simulator - - -.. Note:: - - It may take some time until the zones are deployed. The web server will respond with HTTP 503 on port 8888 unless the zones are fully deployed. diff --git a/test/utils/docker/cloudstack-simulator/nginx_default.conf b/test/utils/docker/cloudstack-simulator/nginx_default.conf deleted file mode 100644 index 8df35c57a70..00000000000 --- a/test/utils/docker/cloudstack-simulator/nginx_default.conf +++ /dev/null @@ -1,23 +0,0 @@ -upstream cloudstack-backend { - server 127.0.0.1:8080; -} - -server { - listen 8888 default_server; - - root /var/www/html; - - server_name _; - - # waiting for zone to be deployed - if (!-f /var/www/html/admin.json) { - return 503; - } - - location /client { - proxy_pass http://cloudstack-backend; - } - location / { - - } -} diff --git a/test/utils/docker/cloudstack-simulator/run.sh b/test/utils/docker/cloudstack-simulator/run.sh deleted file mode 100755 index 107045c1962..00000000000 --- a/test/utils/docker/cloudstack-simulator/run.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash -until nc -z localhost 8096; do - echo "waiting for port 8096..." - sleep 3 -done - -sleep 3 -if [ ! -e /var/www/html/admin.json ] -then - python /opt/cloudstack/tools/marvin/marvin/deployDataCenter.py -i /opt/zones.cfg - export CLOUDSTACK_ENDPOINT=http://127.0.0.1:8096 - export CLOUDSTACK_KEY="" - export CLOUDSTACK_SECRET="" - cs listUsers account=admin | jq .user[0] > /var/www/html/admin.json -fi diff --git a/test/utils/docker/cloudstack-simulator/supervisord.conf b/test/utils/docker/cloudstack-simulator/supervisord.conf deleted file mode 100644 index d9cfd08fbf9..00000000000 --- a/test/utils/docker/cloudstack-simulator/supervisord.conf +++ /dev/null @@ -1,28 +0,0 @@ -[supervisord] -nodaemon=true - -[program:mysqld] -command=/usr/bin/mysqld_safe -autostart=true -autorestart=true -user=root - -[program:cloudstack] -command=/bin/bash -c "mvn -pl client jetty:run-forked -Dsimulator -Dorg.eclipse.jetty.annotations.maxWait=120" -directory=/opt/cloudstack -stdout_logfile=/dev/stdout -stdout_logfile_maxbytes=0 -user=root - -[program:nginx] -command=/usr/sbin/nginx -autostart=true -autorestart=false -user=root - -[program:deploy-zones] -command = /opt/run.sh -startsecs = 0 -autorestart = false -startretries = 1 -user=root diff --git a/test/utils/docker/cloudstack-simulator/zones.cfg b/test/utils/docker/cloudstack-simulator/zones.cfg deleted file mode 100644 index ea3560c6bc0..00000000000 --- a/test/utils/docker/cloudstack-simulator/zones.cfg +++ /dev/null @@ -1,310 +0,0 @@ -{ - "zones": [ - { - "name": "Sandbox-simulator-basic", - "dns1": "8.8.8.8", - "physical_networks": [ - { - "broadcastdomainrange": "Zone", - "name": "Sandbox-pnet", - "traffictypes": [ - { - "typ": "Guest" - }, - { - "typ": "Management" - } - ], - "providers": [ - { - "broadcastdomainrange": "ZONE", - "name": "VirtualRouter" - }, - { - "broadcastdomainrange": "Pod", - "name": "SecurityGroupProvider" - } - ], - "isolationmethods": [ - "L3" - ] - } - ], - "securitygroupenabled": "true", - "networktype": "Basic", - "pods": [ - { - "endip": "172.16.15.254", - "name": "POD0-basic", - "startip": "172.16.15.2", - "guestIpRanges": [ - { - "startip": "60.147.41.2", - "endip": "60.147.41.254", - "netmask": "255.255.255.0", - "gateway": "60.147.41.1" - } - ], - "netmask": "255.255.255.0", - "clusters": [ - { - "clustername": "C0-basic", - "hypervisor": "simulator", - "hosts": [ - { - "username": "root", - "url": "http://sim/c0-basic/h0", - "password": "password" - }, - { - "username": "root", - "url": "http://sim/c0-basic/h1", - "password": "password" - } - ], - "clustertype": "CloudManaged", - "primaryStorages": [ - { - "url": "nfs://nfsstor:/export/home/sandbox/primary", - "name": "PS0-basic" - } - ] - } - ], - "gateway": "172.16.15.1" - } - ], - "internaldns1": "8.8.8.8", - "secondaryStorages": [ - { - "url": "nfs://nfsstor:/export/home/sandbox/secondary", - "provider" : "NFS" - } - ] - }, - { - "name": "Sandbox-simulator-advanced", - "guestcidraddress": "10.1.1.0/24", - "dns1": "10.147.28.7", - "physical_networks": [ - { - "broadcastdomainrange": "Zone", - "vlan": "100-200", - "name": "Sandbox-pnet", - "traffictypes": [ - { - "typ": "Guest" - }, - { - "typ": "Management" - }, - { - "typ": "Public" - } - ], - "providers": [ - { - "broadcastdomainrange": "ZONE", - "name": "VirtualRouter" - }, - { - "broadcastdomainrange": "ZONE", - "name": "VpcVirtualRouter" - }, - { - "broadcastdomainrange": "ZONE", - "name": "InternalLbVm" - } - ], - "isolationmethods": [ - "VLAN" - ] - } - ], - "vmwaredc": { - "username": "", - "vcenter": "", - "password": "", - "name": "" - }, - "ipranges": [ - { - "startip": "192.168.2.2", - "endip": "192.168.2.200", - "netmask": "255.255.255.0", - "vlan": "50", - "gateway": "192.168.2.1" - } - ], - "networktype": "Advanced", - "pods": [ - { - "endip": "172.16.15.200", - "name": "POD0-adv", - "startip": "172.16.15.2", - "netmask": "255.255.255.0", - "clusters": [ - { - "clustername": "C0-adv", - "hypervisor": "simulator", - "hosts": [ - { - "username": "root", - "url": "http://sim/c0-adv/h0", - "password": "password" - }, - { - "username": "root", - "url": "http://sim/c0-adv/h1", - "password": "password" - } - ], - "clustertype": "CloudManaged", - "primaryStorages": [ - { - "url": "nfs://10.147.28.7:/export/home/sandbox/primary0", - "name": "PS0-adv" - }, - { - "url": "nfs://10.147.28.7:/export/home/sandbox/primary1", - "name": "PS1-adv" - } - ] - }, - { - "clustername": "C1-adv", - "hypervisor": "simulator", - "hosts": [ - { - "username": "root", - "url": "http://sim/c1-adv/h0", - "password": "password" - } - ], - "clustertype": "CloudManaged", - "primaryStorages": [ - { - "url": "nfs://10.147.28.7:/export/home/sandbox/primary2", - "name": "PS2-adv" - } - ] - } - ], - "gateway": "172.16.15.1" - } - ], - "internaldns1": "10.147.28.7", - "secondaryStorages": [ - { - "url": "nfs://10.147.28.7:/export/home/sandbox/secondary", - "provider" : "NFS" - } - ] - } - ], - "dbSvr": { - "dbSvr": "localhost", - "passwd": "cloud", - "db": "cloud", - "port": 3306, - "user": "cloud" - }, - "logger": - { - "LogFolderPath": "/tmp/" - }, - "globalConfig": [ - { - "name": "network.gc.wait", - "value": "20" - }, - { - "name": "storage.cleanup.interval", - "value": "40" - }, - { - "name": "vm.op.wait.interval", - "value": "5" - }, - { - "name": "default.page.size", - "value": "500" - }, - { - "name": "network.gc.interval", - "value": "20" - }, - { - "name": "instance.name", - "value": "QA" - }, - { - "name": "workers", - "value": "10" - }, - { - "name": "account.cleanup.interval", - "value": "20" - }, - { - "name": "guest.domain.suffix", - "value": "sandbox.simulator" - }, - { - "name": "expunge.delay", - "value": "20" - }, - { - "name": "vm.allocation.algorithm", - "value": "random" - }, - { - "name": "expunge.interval", - "value": "20" - }, - { - "name": "expunge.workers", - "value": "3" - }, - { - "name": "check.pod.cidrs", - "value": "true" - }, - { - "name": "secstorage.allowed.internal.sites", - "value": "10.147.28.0/24" - }, - { - "name": "direct.agent.load.size", - "value": "1000" - }, - { - "name": "enable.dynamic.scale.vm", - "value": "true" - }, - { - "name": "ping.interval", - "value": "10" - }, - { - "name": "ping.timeout", - "value": "1.5" - }, - { - "name": "outofbandmanagement.sync.interval", - "value": "1000" - } - ], - "mgtSvr": [ - { - "mgtSvrIp": "localhost", - "passwd": "password", - "user": "root", - "port": 8096, - "hypervisor": "simulator", - "useHttps": "False", - "certCAPath": "NA", - "certPath": "NA" - } - ] -} diff --git a/test/utils/docker/fedora24/Dockerfile b/test/utils/docker/fedora24/Dockerfile deleted file mode 100644 index 603eaf460fa..00000000000 --- a/test/utils/docker/fedora24/Dockerfile +++ /dev/null @@ -1,79 +0,0 @@ -FROM fedora:24 - -RUN (cd /lib/systemd/system/sysinit.target.wants/; for i in *; do [ $i == systemd-tmpfiles-setup.service ] || rm -f $i; done); \ -rm -f /lib/systemd/system/multi-user.target.wants/*; \ -rm -f /etc/systemd/system/*.wants/*; \ -rm -f /lib/systemd/system/local-fs.target.wants/*; \ -rm -f /lib/systemd/system/sockets.target.wants/*udev*; \ -rm -f /lib/systemd/system/sockets.target.wants/*initctl*; \ -rm -f /lib/systemd/system/basic.target.wants/*; \ -rm -f /lib/systemd/system/anaconda.target.wants/*; - -RUN dnf clean all && \ - dnf -y update libsolv && \ - dnf clean all - -RUN dnf clean all && \ - dnf -y --setopt=install_weak_deps=false install \ - acl \ - asciidoc \ - bzip2 \ - dbus-python \ - file \ - findutils \ - gcc \ - git \ - glibc-locale-source \ - iproute \ - libffi \ - libffi-devel \ - make \ - mariadb-server \ - mercurial \ - MySQL-python \ - openssh-clients \ - openssh-server \ - openssl-devel \ - pass \ - procps \ - python-cryptography \ - python-devel \ - python-httplib2 \ - python-jinja2 \ - python-keyczar \ - python-lxml \ - python-mock \ - python-nose \ - python-paramiko \ - python-passlib \ - python-pip \ - python-setuptools \ - python-virtualenv \ - python2-dnf \ - PyYAML \ - rpm-build \ - rubygems \ - sshpass \ - subversion \ - sudo \ - tar \ - unzip \ - which \ - yum \ - zip \ - && \ - dnf clean all - -RUN localedef --quiet -c -i en_US -f UTF-8 en_US.UTF-8 -RUN /usr/bin/sed -i -e 's/^\(Defaults\s*requiretty\)/#--- \1/' /etc/sudoers -RUN mkdir /etc/ansible/ -RUN /usr/bin/echo -e '[local]\nlocalhost ansible_connection=local' > /etc/ansible/hosts -VOLUME /sys/fs/cgroup /run /tmp -RUN ssh-keygen -q -t dsa -N '' -f /etc/ssh/ssh_host_dsa_key && \ - ssh-keygen -q -t rsa -N '' -f /etc/ssh/ssh_host_rsa_key && \ - ssh-keygen -q -t rsa -N '' -f /root/.ssh/id_rsa && \ - cp /root/.ssh/id_rsa.pub /root/.ssh/authorized_keys && \ - for key in /etc/ssh/ssh_host_*_key.pub; do echo "localhost $(cat ${key})" >> /root/.ssh/known_hosts; done -RUN pip install coverage junit-xml -ENV container=docker -CMD ["/usr/sbin/init"] diff --git a/test/utils/docker/fedora25/Dockerfile b/test/utils/docker/fedora25/Dockerfile deleted file mode 100644 index e1812a4eb9e..00000000000 --- a/test/utils/docker/fedora25/Dockerfile +++ /dev/null @@ -1,75 +0,0 @@ -FROM fedora:25 - -RUN (cd /lib/systemd/system/sysinit.target.wants/; for i in *; do [ $i == systemd-tmpfiles-setup.service ] || rm -f $i; done); \ -rm -f /lib/systemd/system/multi-user.target.wants/*; \ -rm -f /etc/systemd/system/*.wants/*; \ -rm -f /lib/systemd/system/local-fs.target.wants/*; \ -rm -f /lib/systemd/system/sockets.target.wants/*udev*; \ -rm -f /lib/systemd/system/sockets.target.wants/*initctl*; \ -rm -f /lib/systemd/system/basic.target.wants/*; \ -rm -f /lib/systemd/system/anaconda.target.wants/*; - -RUN dnf clean all && \ - dnf -y --setopt=install_weak_deps=false install \ - acl \ - asciidoc \ - bzip2 \ - dbus-python \ - file \ - findutils \ - gcc \ - git \ - glibc-locale-source \ - iproute \ - libffi \ - libffi-devel \ - make \ - mariadb-server \ - mercurial \ - MySQL-python \ - openssh-clients \ - openssh-server \ - openssl-devel \ - pass \ - procps \ - python-cryptography \ - python-devel \ - python-httplib2 \ - python-jinja2 \ - python-keyczar \ - python-lxml \ - python-mock \ - python-nose \ - python-paramiko \ - python-passlib \ - python-pip \ - python-setuptools \ - python-virtualenv \ - python2-dnf \ - PyYAML \ - rpm-build \ - rubygems \ - sshpass \ - subversion \ - sudo \ - tar \ - unzip \ - which \ - yum \ - zip \ - && \ - dnf clean all - -RUN localedef --quiet -c -i en_US -f UTF-8 en_US.UTF-8 -RUN /usr/bin/sed -i -e 's/^\(Defaults\s*requiretty\)/#--- \1/' /etc/sudoers -RUN mkdir /etc/ansible/ -RUN /usr/bin/echo -e '[local]\nlocalhost ansible_connection=local' > /etc/ansible/hosts -VOLUME /sys/fs/cgroup /run /tmp -RUN ssh-keygen -q -t dsa -N '' -f /etc/ssh/ssh_host_dsa_key && \ - ssh-keygen -q -t rsa -N '' -f /etc/ssh/ssh_host_rsa_key && \ - ssh-keygen -q -t rsa -N '' -f /root/.ssh/id_rsa && \ - cp /root/.ssh/id_rsa.pub /root/.ssh/authorized_keys && \ - for key in /etc/ssh/ssh_host_*_key.pub; do echo "localhost $(cat ${key})" >> /root/.ssh/known_hosts; done -RUN pip install coverage junit-xml -ENV container=docker -CMD ["/usr/sbin/init"] diff --git a/test/utils/docker/fedora25py3/Dockerfile b/test/utils/docker/fedora25py3/Dockerfile deleted file mode 100644 index 55e57665cab..00000000000 --- a/test/utils/docker/fedora25py3/Dockerfile +++ /dev/null @@ -1,70 +0,0 @@ -FROM fedora:25 - -RUN (cd /lib/systemd/system/sysinit.target.wants/; for i in *; do [ $i == systemd-tmpfiles-setup.service ] || rm -f $i; done); \ -rm -f /lib/systemd/system/multi-user.target.wants/*; \ -rm -f /etc/systemd/system/*.wants/*; \ -rm -f /lib/systemd/system/local-fs.target.wants/*; \ -rm -f /lib/systemd/system/sockets.target.wants/*udev*; \ -rm -f /lib/systemd/system/sockets.target.wants/*initctl*; \ -rm -f /lib/systemd/system/basic.target.wants/*; \ -rm -f /lib/systemd/system/anaconda.target.wants/*; - -RUN dnf clean all && \ - dnf -y --setopt=install_weak_deps=false install \ - acl \ - bzip2 \ - file \ - findutils \ - gcc \ - git \ - glibc-locale-source \ - iproute \ - libffi \ - libffi-devel \ - make \ - mariadb-server \ - openssh-clients \ - openssh-server \ - openssl-devel \ - pass \ - procps \ - python3-cryptography \ - python3-dbus \ - python3-devel \ - python3-dnf \ - python3-httplib2 \ - python3-jinja2 \ - python3-lxml \ - python3-mock \ - python3-mysql \ - python3-nose \ - python3-paramiko \ - python3-passlib \ - python3-pip \ - python3-PyYAML \ - python3-setuptools \ - python3-virtualenv \ - rubygems \ - sshpass \ - subversion \ - sudo \ - tar \ - unzip \ - which \ - zip \ - && \ - dnf clean all - -RUN localedef --quiet -c -i en_US -f UTF-8 en_US.UTF-8 -RUN /usr/bin/sed -i -e 's/^\(Defaults\s*requiretty\)/#--- \1/' /etc/sudoers -RUN mkdir /etc/ansible/ -RUN /usr/bin/echo -e '[local]\nlocalhost ansible_connection=local' > /etc/ansible/hosts -VOLUME /sys/fs/cgroup /run /tmp -RUN ssh-keygen -q -t dsa -N '' -f /etc/ssh/ssh_host_dsa_key && \ - ssh-keygen -q -t rsa -N '' -f /etc/ssh/ssh_host_rsa_key && \ - ssh-keygen -q -t rsa -N '' -f /root/.ssh/id_rsa && \ - cp /root/.ssh/id_rsa.pub /root/.ssh/authorized_keys && \ - for key in /etc/ssh/ssh_host_*_key.pub; do echo "localhost $(cat ${key})" >> /root/.ssh/known_hosts; done -RUN pip3 install coverage junit-xml -ENV container=docker -CMD ["/usr/sbin/init"] diff --git a/test/utils/docker/fedora26py3/Dockerfile b/test/utils/docker/fedora26py3/Dockerfile deleted file mode 100644 index f8c174992f8..00000000000 --- a/test/utils/docker/fedora26py3/Dockerfile +++ /dev/null @@ -1,71 +0,0 @@ -FROM fedora:26 - -RUN (cd /lib/systemd/system/sysinit.target.wants/; for i in *; do [ $i == systemd-tmpfiles-setup.service ] || rm -f $i; done); \ -rm -f /lib/systemd/system/multi-user.target.wants/*; \ -rm -f /etc/systemd/system/*.wants/*; \ -rm -f /lib/systemd/system/local-fs.target.wants/*; \ -rm -f /lib/systemd/system/sockets.target.wants/*udev*; \ -rm -f /lib/systemd/system/sockets.target.wants/*initctl*; \ -rm -f /lib/systemd/system/basic.target.wants/*; \ -rm -f /lib/systemd/system/anaconda.target.wants/*; - -RUN dnf clean all && \ - dnf -y --setopt=install_weak_deps=false install \ - acl \ - bzip2 \ - file \ - findutils \ - gcc \ - git \ - glibc-locale-source \ - iproute \ - libffi \ - libffi-devel \ - make \ - mariadb-server \ - openssh-clients \ - openssh-server \ - openssl-devel \ - pass \ - procps \ - python3-cryptography \ - python3-dbus \ - python3-devel \ - python3-dnf \ - python3-httplib2 \ - python3-jinja2 \ - python3-lxml \ - python3-mock \ - python3-mysql \ - python3-nose \ - python3-paramiko \ - python3-passlib \ - python3-pip \ - python3-PyYAML \ - python3-setuptools \ - python3-virtualenv \ - rpm-build \ - rubygems \ - sshpass \ - subversion \ - sudo \ - tar \ - unzip \ - which \ - zip \ - && \ - dnf clean all - -RUN localedef --quiet -c -i en_US -f UTF-8 en_US.UTF-8 -RUN /usr/bin/sed -i -e 's/^\(Defaults\s*requiretty\)/#--- \1/' /etc/sudoers -RUN mkdir /etc/ansible/ -RUN /usr/bin/echo -e '[local]\nlocalhost ansible_connection=local' > /etc/ansible/hosts -VOLUME /sys/fs/cgroup /run /tmp -RUN ssh-keygen -q -t dsa -N '' -f /etc/ssh/ssh_host_dsa_key && \ - ssh-keygen -q -t rsa -N '' -f /etc/ssh/ssh_host_rsa_key && \ - ssh-keygen -q -t rsa -N '' -f /root/.ssh/id_rsa && \ - cp /root/.ssh/id_rsa.pub /root/.ssh/authorized_keys && \ - for key in /etc/ssh/ssh_host_*_key.pub; do echo "localhost $(cat ${key})" >> /root/.ssh/known_hosts; done -RUN pip3 install coverage junit-xml -ENV container=docker -CMD ["/usr/sbin/init"] diff --git a/test/utils/docker/httptester/Dockerfile b/test/utils/docker/httptester/Dockerfile deleted file mode 100644 index d9a8e6e76c8..00000000000 --- a/test/utils/docker/httptester/Dockerfile +++ /dev/null @@ -1,33 +0,0 @@ -FROM nginx:alpine - -RUN set -x && \ - apk add -U openssl py-pip && \ - mkdir -p /root/ca/certs /root/ca/private /root/ca/newcerts && \ - echo 1000 > /root/ca/serial && \ - touch /root/ca/index.txt && \ - sed -i 's/\.\/demoCA/\/root\/ca/g' /etc/ssl/openssl.cnf && \ - openssl req -new -x509 -days 3650 -nodes -extensions v3_ca -keyout /root/ca/private/cakey.pem -out /root/ca/cacert.pem \ - -subj "/C=US/ST=North Carolina/L=Durham/O=Ansible/CN=ansible.http.tests" && \ - openssl req -new -nodes -out /root/ca/ansible.http.tests-req.pem -keyout /root/ca/private/ansible.http.tests-key.pem \ - -subj "/C=US/ST=North Carolina/L=Durham/O=Ansible/CN=ansible.http.tests" && \ - yes | openssl ca -config /etc/ssl/openssl.cnf -out /root/ca/ansible.http.tests-cert.pem -infiles /root/ca/ansible.http.tests-req.pem && \ - openssl req -new -nodes -out /root/ca/sni1.ansible.http.tests-req.pem -keyout /root/ca/private/sni1.ansible.http.tests-key.pem -config /etc/ssl/openssl.cnf \ - -subj "/C=US/ST=North Carolina/L=Durham/O=Ansible/CN=sni1.ansible.http.tests" && \ - yes | openssl ca -config /etc/ssl/openssl.cnf -out /root/ca/sni1.ansible.http.tests-cert.pem -infiles /root/ca/sni1.ansible.http.tests-req.pem && \ - openssl req -new -nodes -out /root/ca/sni2.ansible.http.tests-req.pem -keyout /root/ca/private/sni2.ansible.http.tests-key.pem -config /etc/ssl/openssl.cnf \ - -subj "/C=US/ST=North Carolina/L=Durham/O=Ansible/CN=sni2.ansible.http.tests" && \ - yes | openssl ca -config /etc/ssl/openssl.cnf -out /root/ca/sni2.ansible.http.tests-cert.pem -infiles /root/ca/sni2.ansible.http.tests-req.pem && \ - openssl req -new -nodes -out /root/ca/client.ansible.http.tests-req.pem -keyout /root/ca/private/client.ansible.http.tests-key.pem -config /etc/ssl/openssl.cnf \ - -subj "/C=US/ST=North Carolina/L=Durham/O=Ansible/CN=client.ansible.http.tests" && \ - yes | openssl ca -config /etc/ssl/openssl.cnf -out /root/ca/client.ansible.http.tests-cert.pem -infiles /root/ca/client.ansible.http.tests-req.pem && \ - cp /root/ca/cacert.pem /usr/share/nginx/html/cacert.pem && \ - cp /root/ca/client.ansible.http.tests-cert.pem /usr/share/nginx/html/client.pem && \ - cp /root/ca/private/client.ansible.http.tests-key.pem /usr/share/nginx/html/client.key && \ - pip install gunicorn httpbin - -ADD services.sh /services.sh -ADD nginx.sites.conf /etc/nginx/conf.d/default.conf - -EXPOSE 80 443 - -CMD ["/services.sh"] diff --git a/test/utils/docker/httptester/httptester.yml b/test/utils/docker/httptester/httptester.yml deleted file mode 100644 index 55a8decc1a2..00000000000 --- a/test/utils/docker/httptester/httptester.yml +++ /dev/null @@ -1,146 +0,0 @@ ---- -- name: Configure httptester - hosts: all - vars: - os_packages: - apk: - - openssl - - py-pip - apt: - - openssl - - python-pip - yum: - - openssl - - python-pip - dnf: - - openssl - - python-pip - tasks: - - name: Check for nginx - stat: - path: /usr/sbin/nginx - register: nginx - - - name: Install nginx - package: - name: nginx - update_cache: "{{ (ansible_pkg_mgr == 'dnf')|ternary(omit, 'yes') }}" - when: not nginx.stat.exists - - - name: Install OS Packages - package: - name: "{{ item }}" - update_cache: "{{ (ansible_pkg_mgr == 'dnf')|ternary(omit, 'yes') }}" - with_items: "{{ os_packages[ansible_pkg_mgr] }}" - - - name: Create cert directories - file: - path: "{{ item }}" - state: directory - with_items: - - /root/ca/certs - - /root/ca/private - - /root/ca/newcerts - - - name: Set ca serial - copy: - dest: /root/ca/serial - content: 1000 - - - name: Create ca index - copy: - dest: /root/ca/index.txt - content: "" - - - name: Check for /etc/pki/tls/openssl.cnf - stat: - path: /etc/pki/tls/openssl.cnf - register: etc_pki_tls_openssl - - - name: Copy openssl.cnf to /etc/ssl - copy: - src: /etc/pki/tls/openssl.cnf - dest: /etc/ssl/openssl.cnf - remote_src: true - when: etc_pki_tls_openssl.stat.exists - - - name: Update openssl ca path - replace: - dest: /etc/ssl/openssl.cnf - regexp: '(\./demoCA|/etc/pki/CA)' - replace: '/root/ca' - - - name: Generate ca key - command: > - openssl req -new -x509 -days 3650 -nodes -extensions v3_ca -keyout /root/ca/private/cakey.pem -out /root/ca/cacert.pem - -subj "/C=US/ST=North Carolina/L=Durham/O=Ansible/CN=ansible.http.tests" - - - name: Generate ansible.http.tests key - command: > - openssl req -new -nodes -out /root/ca/ansible.http.tests-req.pem -keyout /root/ca/private/ansible.http.tests-key.pem - -subj "/C=US/ST=North Carolina/L=Durham/O=Ansible/CN=ansible.http.tests" - - - name: Generate ansible.http.tests cert - shell: > - yes | openssl ca -config /etc/ssl/openssl.cnf -out /root/ca/ansible.http.tests-cert.pem -infiles /root/ca/ansible.http.tests-req.pem - - - name: Generate sni1.ansible.http.tests key - command: > - openssl req -new -nodes -out /root/ca/sni1.ansible.http.tests-req.pem -keyout /root/ca/private/sni1.ansible.http.tests-key.pem -config /etc/ssl/openssl.cnf - -subj "/C=US/ST=North Carolina/L=Durham/O=Ansible/CN=sni1.ansible.http.tests" - - - name: Generate sni1.ansible.http.tests cert - shell: > - yes | openssl ca -config /etc/ssl/openssl.cnf -out /root/ca/sni1.ansible.http.tests-cert.pem -infiles /root/ca/sni1.ansible.http.tests-req.pem - - - name: Generate sni2.ansible.http.tests key - command: > - openssl req -new -nodes -out /root/ca/sni2.ansible.http.tests-req.pem -keyout /root/ca/private/sni2.ansible.http.tests-key.pem -config /etc/ssl/openssl.cnf - -subj "/C=US/ST=North Carolina/L=Durham/O=Ansible/CN=sni2.ansible.http.tests" - - - name: Generate sni2.ansible.http.tests cert - shell: > - yes | openssl ca -config /etc/ssl/openssl.cnf -out /root/ca/sni2.ansible.http.tests-cert.pem -infiles /root/ca/sni2.ansible.http.tests-req.pem - - - name: Generate client key - command: > - openssl req -new -nodes -out /root/ca/client.ansible.http.tests-req.pem -keyout /root/ca/private/client.ansible.http.tests-key.pem -config /etc/ssl/openssl.cnf - -subj "/C=US/ST=North Carolina/L=Durham/O=Ansible/CN=client.ansible.http.tests" - - - name: Generate client.ansible.http.tests cert - shell: > - yes | openssl ca -config /etc/ssl/openssl.cnf -out /root/ca/client.ansible.http.tests-cert.pem -infiles /root/ca/client.ansible.http.tests-req.pem - - - name: Copy cacert.pem into nginx doc root for easy retrieval - copy: - src: "/root/ca/cacert.pem" - dest: "/usr/share/nginx/html/cacert.pem" - remote_src: true - - - copy: - src: /root/ca/client.ansible.http.tests-cert.pem - dest: /usr/share/nginx/html/client.pem - remote_src: true - - - copy: - src: /root/ca/private/client.ansible.http.tests-key.pem - dest: /usr/share/nginx/html/client.key - remote_src: true - - - name: Install gunicorn and httpbin - pip: - name: "{{ item }}" - with_items: - - gunicorn - - httpbin - - - name: Copy services.sh script - copy: - src: services.sh - dest: /services.sh - mode: 0755 - - - name: Copy nginx sites configuration - copy: - src: nginx.sites.conf - dest: /etc/nginx/conf.d/default.conf diff --git a/test/utils/docker/httptester/nginx.sites.conf b/test/utils/docker/httptester/nginx.sites.conf deleted file mode 100644 index 7d33f9b0ac7..00000000000 --- a/test/utils/docker/httptester/nginx.sites.conf +++ /dev/null @@ -1,68 +0,0 @@ -server { - listen 80 default_server; - listen 443 ssl default_server; - - server_name ansible.http.tests _; - - ssl_certificate /root/ca/ansible.http.tests-cert.pem; - ssl_certificate_key /root/ca/private/ansible.http.tests-key.pem; - - ssl_client_certificate /root/ca/cacert.pem; - ssl_verify_client optional; - - location =/cacert.pem { - alias /usr/share/nginx/html/cacert.pem; - } - - location =/client.key { - alias /usr/share/nginx/html/client.key; - } - - location =/client.pem { - alias /usr/share/nginx/html/client.pem; - } - - location =/ssl_client_verify { - return 200 "ansible.http.tests:$ssl_client_verify"; - } - - location / { - proxy_pass http://127.0.0.1:8000; - } -} - -server { - listen 80; - listen 443 ssl; - - server_name sni1.ansible.http.tests; - - ssl_certificate /root/ca/sni1.ansible.http.tests-cert.pem; - ssl_certificate_key /root/ca/private/sni1.ansible.http.tests-key.pem; - - location / { - return 200 "sni1.ansible.http.tests"; - } -} - -server { - listen 80; - listen 443 ssl; - - server_name sni2.ansible.http.tests; - - ssl_certificate /root/ca/sni2.ansible.http.tests-cert.pem; - ssl_certificate_key /root/ca/private/sni2.ansible.http.tests-key.pem; - - location / { - return 200 "sni2.ansible.http.tests"; - } -} - -server { - listen 80; - - server_name fail.ansible.http.tests; - - rewrite /(.*) https://$host/$1 permanent; -} diff --git a/test/utils/docker/httptester/packer.json b/test/utils/docker/httptester/packer.json deleted file mode 100644 index bf2a0084560..00000000000 --- a/test/utils/docker/httptester/packer.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "builders": [ - { - "type": "docker", - "image": "nginx:alpine", - "commit": true, - "run_command": [ - "-d", - "-i", - "-t", - "{{.Image}}", - "/bin/sh" - ] - } - ], - "provisioners": [ - { - "type": "shell", - "inline": [ - "set -x", - "[ -f /sbin/apk ] && /sbin/apk add -U ansible || true", - "[ -f /usr/bin/dnf ] && /usr/bin/dnf -y install ansible python2-dnf || true", - "[ ! -f /usr/bin/dnf -a -f /usr/bin/yum ] && /usr/bin/yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-`grep -o [0-9] /etc/redhat-release | head -1`.noarch.rpm || true", - "[ ! -f /usr/bin/dnf -a -f /usr/bin/yum ] && /usr/bin/yum -y install ansible || true", - "[ -f /usr/bin/apt-get ] && /usr/bin/apt-get update && /usr/bin/apt-get -y install ansible || true" - ] - }, - { - "type": "ansible-local", - "playbook_file": "httptester.yml", - "playbook_dir": "{{template_dir}}", - "extra_arguments": [ - "-v" - ] - } - ], - "post-processors": [ - { - "type": "docker-tag", - "repository": "ansible/ansible", - "tag": "httptester" - } - ] -} diff --git a/test/utils/docker/httptester/services.sh b/test/utils/docker/httptester/services.sh deleted file mode 100755 index c319aaa4167..00000000000 --- a/test/utils/docker/httptester/services.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh -gunicorn -D httpbin:app -nginx -g "daemon off;" diff --git a/test/utils/docker/opensuse42.1/Dockerfile b/test/utils/docker/opensuse42.1/Dockerfile deleted file mode 100644 index 0caae9984ca..00000000000 --- a/test/utils/docker/opensuse42.1/Dockerfile +++ /dev/null @@ -1,78 +0,0 @@ -FROM opensuse:42.1 - -RUN zypper --non-interactive --gpg-auto-import-keys refresh && \ - zypper --non-interactive install --force systemd-sysvinit && \ - zypper --non-interactive install --auto-agree-with-licenses --no-recommends \ - acl \ - apache2 \ - asciidoc \ - bzip2 \ - curl \ - dbus-1-python \ - gcc \ - git \ - glibc-i18ndata \ - glibc-locale \ - iproute2 \ - lsb-release \ - make \ - mariadb \ - mercurial \ - openssh \ - password-store \ - postgresql-server \ - python-cryptography \ - python-devel \ - python-httplib2 \ - python-jinja2 \ - python-keyczar \ - python-lxml \ - python-mock \ - python-MySQL-python \ - python-nose \ - python-paramiko \ - python-passlib \ - python-pip \ - python-psycopg2 \ - python-PyYAML \ - python-setuptools \ - python-virtualenv \ - rpm-build \ - ruby \ - sshpass \ - subversion \ - sudo \ - tar \ - unzip \ - which \ - zip \ - && \ - zypper clean - -# systemd path differs from rhel -ENV LIBSYSTEMD=/usr/lib/systemd/system -RUN (cd ${LIBSYSTEMD}/sysinit.target.wants/; for i in *; do [ $i == systemd-tmpfiles-setup.service ] || rm -f $i; done); \ -rm -f ${LIBSYSTEMD}/multi-user.target.wants/*; \ -rm -f /etc/systemd/system/*.wants/*; \ -rm -f ${LIBSYSTEMD}/local-fs.target.wants/*; \ -rm -f ${LIBSYSTEMD}/sockets.target.wants/*udev*; \ -rm -f ${LIBSYSTEMD}/sockets.target.wants/*initctl*; \ -rm -f ${LIBSYSTEMD}/basic.target.wants/*; - -# don't create systemd-session for ssh connections -RUN sed -i /pam_systemd/d /etc/pam.d/common-session-pc - -RUN mkdir /etc/ansible/ -RUN /usr/bin/echo -e '[local]\nlocalhost ansible_connection=local' > /etc/ansible/hosts -VOLUME /sys/fs/cgroup /run /tmp -RUN ssh-keygen -q -t rsa1 -N '' -f /etc/ssh/ssh_host_key && \ - ssh-keygen -q -t dsa -N '' -f /etc/ssh/ssh_host_dsa_key && \ - ssh-keygen -q -t rsa -N '' -f /etc/ssh/ssh_host_rsa_key && \ - ssh-keygen -q -t rsa -N '' -f /root/.ssh/id_rsa && \ - cp /root/.ssh/id_rsa.pub /root/.ssh/authorized_keys && \ - for key in /etc/ssh/ssh_host_*_key.pub; do echo "localhost $(cat ${key})" >> /root/.ssh/known_hosts; done -# explicitly enable the service, opensuse default to disabled services -RUN systemctl enable sshd.service -RUN pip install coverage junit-xml -ENV container=docker -CMD ["/sbin/init"] diff --git a/test/utils/docker/opensuse42.2/Dockerfile b/test/utils/docker/opensuse42.2/Dockerfile deleted file mode 100644 index 215b44fa20c..00000000000 --- a/test/utils/docker/opensuse42.2/Dockerfile +++ /dev/null @@ -1,78 +0,0 @@ -FROM opensuse:42.2 - -RUN zypper --non-interactive --gpg-auto-import-keys refresh && \ - zypper --non-interactive install --force systemd-sysvinit && \ - zypper --non-interactive install --auto-agree-with-licenses --no-recommends \ - acl \ - apache2 \ - asciidoc \ - bzip2 \ - curl \ - dbus-1-python \ - gcc \ - git \ - glibc-i18ndata \ - glibc-locale \ - iproute2 \ - lsb-release \ - make \ - mariadb \ - mercurial \ - openssh \ - password-store \ - postgresql-server \ - python-cryptography \ - python-devel \ - python-httplib2 \ - python-jinja2 \ - python-keyczar \ - python-lxml \ - python-mock \ - python-MySQL-python \ - python-nose \ - python-paramiko \ - python-passlib \ - python-pip \ - python-psycopg2 \ - python-PyYAML \ - python-setuptools \ - python-virtualenv \ - rpm-build \ - ruby \ - sshpass \ - subversion \ - sudo \ - tar \ - unzip \ - which \ - zip \ - && \ - zypper clean - -# systemd path differs from rhel -ENV LIBSYSTEMD=/usr/lib/systemd/system -RUN (cd ${LIBSYSTEMD}/sysinit.target.wants/; for i in *; do [ $i == systemd-tmpfiles-setup.service ] || rm -f $i; done); \ -rm -f ${LIBSYSTEMD}/multi-user.target.wants/*; \ -rm -f /etc/systemd/system/*.wants/*; \ -rm -f ${LIBSYSTEMD}/local-fs.target.wants/*; \ -rm -f ${LIBSYSTEMD}/sockets.target.wants/*udev*; \ -rm -f ${LIBSYSTEMD}/sockets.target.wants/*initctl*; \ -rm -f ${LIBSYSTEMD}/basic.target.wants/*; - -# don't create systemd-session for ssh connections -RUN sed -i /pam_systemd/d /etc/pam.d/common-session-pc - -RUN mkdir /etc/ansible/ -RUN /usr/bin/echo -e '[local]\nlocalhost ansible_connection=local' > /etc/ansible/hosts -VOLUME /sys/fs/cgroup /run /tmp -RUN ssh-keygen -q -t rsa1 -N '' -f /etc/ssh/ssh_host_key && \ - ssh-keygen -q -t dsa -N '' -f /etc/ssh/ssh_host_dsa_key && \ - ssh-keygen -q -t rsa -N '' -f /etc/ssh/ssh_host_rsa_key && \ - ssh-keygen -q -t rsa -N '' -f /root/.ssh/id_rsa && \ - cp /root/.ssh/id_rsa.pub /root/.ssh/authorized_keys && \ - for key in /etc/ssh/ssh_host_*_key.pub; do echo "localhost $(cat ${key})" >> /root/.ssh/known_hosts; done -# explicitly enable the service, opensuse default to disabled services -RUN systemctl enable sshd.service -RUN pip install coverage junit-xml -ENV container=docker -CMD ["/sbin/init"] diff --git a/test/utils/docker/opensuse42.3/Dockerfile b/test/utils/docker/opensuse42.3/Dockerfile deleted file mode 100644 index 7c12ce21203..00000000000 --- a/test/utils/docker/opensuse42.3/Dockerfile +++ /dev/null @@ -1,78 +0,0 @@ -FROM opensuse:42.3 - -RUN zypper --non-interactive --gpg-auto-import-keys refresh && \ - zypper --non-interactive install --force systemd-sysvinit && \ - zypper --non-interactive install --auto-agree-with-licenses --no-recommends \ - acl \ - apache2 \ - asciidoc \ - bzip2 \ - curl \ - dbus-1-python \ - gcc \ - git \ - glibc-i18ndata \ - glibc-locale \ - iproute2 \ - lsb-release \ - make \ - mariadb \ - mercurial \ - openssh \ - password-store \ - postgresql-server \ - python-cryptography \ - python-devel \ - python-httplib2 \ - python-jinja2 \ - python-keyczar \ - python-lxml \ - python-mock \ - python-MySQL-python \ - python-nose \ - python-paramiko \ - python-passlib \ - python-pip \ - python-psycopg2 \ - python-PyYAML \ - python-setuptools \ - python-virtualenv \ - rpm-build \ - ruby \ - sshpass \ - subversion \ - sudo \ - tar \ - unzip \ - which \ - zip \ - && \ - zypper clean - -# systemd path differs from rhel -ENV LIBSYSTEMD=/usr/lib/systemd/system -RUN (cd ${LIBSYSTEMD}/sysinit.target.wants/; for i in *; do [ $i == systemd-tmpfiles-setup.service ] || rm -f $i; done); \ -rm -f ${LIBSYSTEMD}/multi-user.target.wants/*; \ -rm -f /etc/systemd/system/*.wants/*; \ -rm -f ${LIBSYSTEMD}/local-fs.target.wants/*; \ -rm -f ${LIBSYSTEMD}/sockets.target.wants/*udev*; \ -rm -f ${LIBSYSTEMD}/sockets.target.wants/*initctl*; \ -rm -f ${LIBSYSTEMD}/basic.target.wants/*; - -# don't create systemd-session for ssh connections -RUN sed -i /pam_systemd/d /etc/pam.d/common-session-pc - -RUN mkdir /etc/ansible/ -RUN /usr/bin/echo -e '[local]\nlocalhost ansible_connection=local' > /etc/ansible/hosts -VOLUME /sys/fs/cgroup /run /tmp -RUN ssh-keygen -q -t rsa1 -N '' -f /etc/ssh/ssh_host_key && \ - ssh-keygen -q -t dsa -N '' -f /etc/ssh/ssh_host_dsa_key && \ - ssh-keygen -q -t rsa -N '' -f /etc/ssh/ssh_host_rsa_key && \ - ssh-keygen -q -t rsa -N '' -f /root/.ssh/id_rsa && \ - cp /root/.ssh/id_rsa.pub /root/.ssh/authorized_keys && \ - for key in /etc/ssh/ssh_host_*_key.pub; do echo "localhost $(cat ${key})" >> /root/.ssh/known_hosts; done -# explicitly enable the service, opensuse default to disabled services -RUN systemctl enable sshd.service -RUN pip install coverage junit-xml -ENV container=docker -CMD ["/sbin/init"] diff --git a/test/utils/docker/ubuntu1204/Dockerfile b/test/utils/docker/ubuntu1204/Dockerfile deleted file mode 100644 index ec0e8a7e9da..00000000000 --- a/test/utils/docker/ubuntu1204/Dockerfile +++ /dev/null @@ -1,98 +0,0 @@ -FROM ubuntu:12.04 - -RUN apt-get update -y && \ - DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ - acl \ - apache2 \ - asciidoc \ - bzip2 \ - cdbs \ - curl \ - debhelper \ - debianutils \ - devscripts \ - docbook-xml \ - dpkg-dev \ - fakeroot \ - gawk \ - gcc \ - git \ - libffi-dev \ - libssl-dev \ - libxml2-utils \ - locales \ - make \ - mercurial \ - mysql-server \ - openssh-client \ - openssh-server \ - python-dev \ - python-httplib2 \ - python-jinja2 \ - python-keyczar \ - python-lxml \ - python-mock \ - python-mysqldb \ - python-nose \ - python-paramiko \ - python-passlib \ - python-pip \ - python-setuptools \ - python-virtualenv \ - python-yaml \ - reprepro \ - rsync \ - ruby \ - rubygems \ - sshpass \ - subversion \ - sudo \ - tzdata \ - unzip \ - xsltproc \ - zip \ - && \ - apt-get clean - -RUN pip install --upgrade pycrypto cryptography - -# helpful things taken from the ubuntu-upstart Dockerfile: -# https://github.com/tianon/dockerfiles/blob/4d24a12b54b75b3e0904d8a285900d88d3326361/sbin-init/ubuntu/upstart/14.04/Dockerfile -ADD init-fake.conf /etc/init/fake-container-events.conf - -# undo some leet hax of the base image -RUN rm /usr/sbin/policy-rc.d; \ - rm /sbin/initctl; dpkg-divert --rename --remove /sbin/initctl -# remove some pointless services -RUN /usr/sbin/update-rc.d -f ondemand remove; \ - for f in \ - /etc/init/u*.conf \ - /etc/init/mounted-dev.conf \ - /etc/init/mounted-proc.conf \ - /etc/init/mounted-run.conf \ - /etc/init/mounted-tmp.conf \ - /etc/init/mounted-var.conf \ - /etc/init/hostname.conf \ - /etc/init/networking.conf \ - /etc/init/tty*.conf \ - /etc/init/plymouth*.conf \ - /etc/init/hwclock*.conf \ - /etc/init/module*.conf\ - ; do \ - dpkg-divert --local --rename --add "$f"; \ - done; \ - echo '# /lib/init/fstab: cleared out for bare-bones Docker' > /lib/init/fstab -# end things from ubuntu-upstart Dockerfile - -RUN rm /etc/apt/apt.conf.d/docker-clean -RUN mkdir /etc/ansible/ -RUN /bin/echo -e "[local]\nlocalhost ansible_connection=local" > /etc/ansible/hosts -RUN locale-gen en_US.UTF-8 -RUN ssh-keygen -q -t rsa -N '' -f /root/.ssh/id_rsa && \ - cp /root/.ssh/id_rsa.pub /root/.ssh/authorized_keys && \ - for key in /etc/ssh/ssh_host_*_key.pub; do echo "localhost $(cat ${key})" >> /root/.ssh/known_hosts; done -VOLUME /sys/fs/cgroup /run/lock /run /tmp -RUN pip install pip --upgrade -RUN pip install coverage junit-xml -ENV container=docker -CMD ["/sbin/init"] diff --git a/test/utils/docker/ubuntu1204/init-fake.conf b/test/utils/docker/ubuntu1204/init-fake.conf deleted file mode 100644 index f5db965051e..00000000000 --- a/test/utils/docker/ubuntu1204/init-fake.conf +++ /dev/null @@ -1,13 +0,0 @@ -# fake some events needed for correct startup other services - -description "In-Container Upstart Fake Events" - -start on startup - -script - rm -rf /var/run/*.pid - rm -rf /var/run/network/* - /sbin/initctl emit stopped JOB=udevtrigger --no-wait - /sbin/initctl emit started JOB=udev --no-wait - /sbin/initctl emit runlevel RUNLEVEL=3 --no-wait -end script diff --git a/test/utils/docker/ubuntu1404/Dockerfile b/test/utils/docker/ubuntu1404/Dockerfile deleted file mode 100644 index eea658a9fc2..00000000000 --- a/test/utils/docker/ubuntu1404/Dockerfile +++ /dev/null @@ -1,98 +0,0 @@ -FROM ubuntu:14.04 - -RUN apt-get update -y && \ - DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ - acl \ - apache2 \ - asciidoc \ - bzip2 \ - cdbs \ - curl \ - debhelper \ - debianutils \ - devscripts \ - docbook-xml \ - dpkg-dev \ - fakeroot \ - gawk \ - gcc \ - git \ - libffi-dev \ - libssl-dev \ - libxml2-utils \ - locales \ - make \ - mercurial \ - mysql-server \ - openssh-client \ - openssh-server \ - python-dev \ - pass \ - python-httplib2 \ - python-jinja2 \ - python-keyczar \ - python-lxml \ - python-mock \ - python-mysqldb \ - python-nose \ - python-paramiko \ - python-passlib \ - python-pip \ - python-setuptools \ - python-virtualenv \ - python-yaml \ - reprepro \ - rsync \ - ruby \ - sshpass \ - subversion \ - sudo \ - tzdata \ - unzip \ - xsltproc \ - zip \ - && \ - apt-get clean - -RUN pip install --upgrade pycrypto cryptography - -# helpful things taken from the ubuntu-upstart Dockerfile: -# https://github.com/tianon/dockerfiles/blob/4d24a12b54b75b3e0904d8a285900d88d3326361/sbin-init/ubuntu/upstart/14.04/Dockerfile -ADD init-fake.conf /etc/init/fake-container-events.conf - -# undo some leet hax of the base image -RUN rm /usr/sbin/policy-rc.d; \ - rm /sbin/initctl; dpkg-divert --rename --remove /sbin/initctl -# remove some pointless services -RUN /usr/sbin/update-rc.d -f ondemand remove; \ - for f in \ - /etc/init/u*.conf \ - /etc/init/mounted-dev.conf \ - /etc/init/mounted-proc.conf \ - /etc/init/mounted-run.conf \ - /etc/init/mounted-tmp.conf \ - /etc/init/mounted-var.conf \ - /etc/init/hostname.conf \ - /etc/init/networking.conf \ - /etc/init/tty*.conf \ - /etc/init/plymouth*.conf \ - /etc/init/hwclock*.conf \ - /etc/init/module*.conf\ - ; do \ - dpkg-divert --local --rename --add "$f"; \ - done; \ - echo '# /lib/init/fstab: cleared out for bare-bones Docker' > /lib/init/fstab -# end things from ubuntu-upstart Dockerfile - -RUN rm /etc/apt/apt.conf.d/docker-clean -RUN mkdir /etc/ansible/ -RUN /bin/echo -e "[local]\nlocalhost ansible_connection=local" > /etc/ansible/hosts -RUN locale-gen en_US.UTF-8 -RUN ssh-keygen -q -t rsa -N '' -f /root/.ssh/id_rsa && \ - cp /root/.ssh/id_rsa.pub /root/.ssh/authorized_keys && \ - for key in /etc/ssh/ssh_host_*_key.pub; do echo "localhost $(cat ${key})" >> /root/.ssh/known_hosts; done -VOLUME /sys/fs/cgroup /run/lock /run /tmp -RUN pip install pip --upgrade -RUN pip install coverage junit-xml -ENV container=docker -CMD ["/sbin/init"] diff --git a/test/utils/docker/ubuntu1404/init-fake.conf b/test/utils/docker/ubuntu1404/init-fake.conf deleted file mode 100644 index f5db965051e..00000000000 --- a/test/utils/docker/ubuntu1404/init-fake.conf +++ /dev/null @@ -1,13 +0,0 @@ -# fake some events needed for correct startup other services - -description "In-Container Upstart Fake Events" - -start on startup - -script - rm -rf /var/run/*.pid - rm -rf /var/run/network/* - /sbin/initctl emit stopped JOB=udevtrigger --no-wait - /sbin/initctl emit started JOB=udev --no-wait - /sbin/initctl emit runlevel RUNLEVEL=3 --no-wait -end script diff --git a/test/utils/docker/ubuntu1604/Dockerfile b/test/utils/docker/ubuntu1604/Dockerfile deleted file mode 100644 index eb5a4dc7f41..00000000000 --- a/test/utils/docker/ubuntu1604/Dockerfile +++ /dev/null @@ -1,73 +0,0 @@ -FROM ubuntu:16.04 - -RUN apt-get update -y && \ - DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ - acl \ - apache2 \ - asciidoc \ - bzip2 \ - cdbs \ - curl \ - debhelper \ - debianutils \ - devscripts \ - docbook-xml \ - dpkg-dev \ - fakeroot \ - gawk \ - gcc \ - git \ - iproute2 \ - libffi-dev \ - libssl-dev \ - libxml2-utils \ - locales \ - lsb-release \ - make \ - mercurial \ - mysql-server \ - openssh-client \ - openssh-server \ - python-cryptography \ - python-dev \ - pass \ - python-dbus \ - python-httplib2 \ - python-jinja2 \ - python-keyczar \ - python-lxml \ - python-mock \ - python-mysqldb \ - python-nose \ - python-paramiko \ - python-passlib \ - python-pip \ - python-setuptools \ - python-virtualenv \ - python-wheel \ - python-yaml \ - reprepro \ - rsync \ - ruby \ - sshpass \ - subversion \ - sudo \ - tzdata \ - unzip \ - virtualenv \ - xsltproc \ - zip \ - && \ - apt-get clean - -RUN rm /etc/apt/apt.conf.d/docker-clean -RUN mkdir /etc/ansible/ -RUN /bin/echo -e "[local]\nlocalhost ansible_connection=local" > /etc/ansible/hosts -RUN locale-gen en_US.UTF-8 -RUN ssh-keygen -q -t rsa -N '' -f /root/.ssh/id_rsa && \ - cp /root/.ssh/id_rsa.pub /root/.ssh/authorized_keys && \ - for key in /etc/ssh/ssh_host_*_key.pub; do echo "localhost $(cat ${key})" >> /root/.ssh/known_hosts; done -VOLUME /sys/fs/cgroup /run/lock /run /tmp -RUN pip install coverage junit-xml -ENV container=docker -CMD ["/sbin/init"] diff --git a/test/utils/docker/ubuntu1604py3/Dockerfile b/test/utils/docker/ubuntu1604py3/Dockerfile deleted file mode 100644 index a48eb327d08..00000000000 --- a/test/utils/docker/ubuntu1604py3/Dockerfile +++ /dev/null @@ -1,69 +0,0 @@ -FROM ubuntu:16.04 - -RUN apt-get update -y && \ - DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ - acl \ - apache2 \ - bzip2 \ - curl \ - debhelper \ - debianutils \ - devscripts \ - docbook-xml \ - dpkg-dev \ - fakeroot \ - gawk \ - gcc \ - git \ - iproute2 \ - libffi-dev \ - libssl-dev \ - libxml2-utils \ - locales \ - lsb-release \ - make \ - mysql-server \ - pass \ - openssh-client \ - openssh-server \ - python3-cryptography \ - python3-dev \ - python3-dbus \ - python3-httplib2 \ - python3-jinja2 \ - python3-lxml \ - python3-mock \ - python3-mysqldb \ - python3-nose \ - python3-paramiko \ - python3-passlib \ - python3-pip \ - python3-setuptools \ - python3-virtualenv \ - python3-wheel \ - python3-yaml \ - reprepro \ - rsync \ - ruby \ - sshpass \ - subversion \ - sudo \ - tzdata \ - unzip \ - virtualenv \ - xsltproc \ - zip \ - && \ - apt-get clean - -RUN rm /etc/apt/apt.conf.d/docker-clean -RUN mkdir /etc/ansible/ -RUN /bin/echo -e "[local]\nlocalhost ansible_connection=local" > /etc/ansible/hosts -RUN locale-gen en_US.UTF-8 -RUN ssh-keygen -q -t rsa -N '' -f /root/.ssh/id_rsa && \ - cp /root/.ssh/id_rsa.pub /root/.ssh/authorized_keys && \ - for key in /etc/ssh/ssh_host_*_key.pub; do echo "localhost $(cat ${key})" >> /root/.ssh/known_hosts; done -VOLUME /sys/fs/cgroup /run/lock /run /tmp -RUN pip3 install coverage junit-xml python3-keyczar -ENV container=docker -CMD ["/sbin/init"] diff --git a/test/utils/docker/vcenter-simulator/Dockerfile b/test/utils/docker/vcenter-simulator/Dockerfile deleted file mode 100644 index 96926687863..00000000000 --- a/test/utils/docker/vcenter-simulator/Dockerfile +++ /dev/null @@ -1,39 +0,0 @@ -FROM fedora:26 - -RUN (cd /lib/systemd/system/sysinit.target.wants/; for i in *; do [ $i == systemd-tmpfiles-setup.service ] || rm -f $i; done); \ -rm -f /lib/systemd/system/multi-user.target.wants/*; \ -rm -f /etc/systemd/system/*.wants/*; \ -rm -f /lib/systemd/system/local-fs.target.wants/*; \ -rm -f /lib/systemd/system/sockets.target.wants/*udev*; \ -rm -f /lib/systemd/system/sockets.target.wants/*initctl*; \ -rm -f /lib/systemd/system/basic.target.wants/*; \ -rm -f /lib/systemd/system/anaconda.target.wants/*; - -RUN dnf clean all && \ - dnf -y --setopt=install_weak_deps=false install \ - git \ - glibc \ - gcc \ - golang-bin \ - python-devel \ - python-pip \ - python-setuptools \ - redhat-rpm-config \ - yum \ - && \ - dnf clean all - -VOLUME /sys/fs/cgroup /run /tmp -ENV container=docker -RUN mkdir -p /opt/gocode -RUN chmod -R 777 /opt/gocode -ENV GOPATH=/opt/gocode -RUN go get -u github.com/vmware/govmomi/vcsim -RUN go get github.com/vmware/govmomi/govc -RUN pip install psutil -RUN pip install flask -ADD flask_control.py /root/flask_control.py - - -EXPOSE 5000 8989 443 80 8080 -CMD ["/root/flask_control.py"] diff --git a/test/utils/docker/vcenter-simulator/flask_control.py b/test/utils/docker/vcenter-simulator/flask_control.py deleted file mode 100755 index 1ea8cb5b34e..00000000000 --- a/test/utils/docker/vcenter-simulator/flask_control.py +++ /dev/null @@ -1,309 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- -# (c) 2017 James Tanner (@jctanner) -# Abhijeet Kasurde (@akasurde) -# -# Written by James Tanner -# This file is part of Ansible -# -# Ansible is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# Ansible is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Ansible. If not, see . - -import os -import psutil -import socket -import subprocess - -from flask import Flask -from flask import jsonify -from flask import request - - -app = Flask(__name__) -GOPATH = os.path.expanduser('/opt/gocode') -VCSIMPATH = os.path.join(GOPATH, 'bin', 'vcsim') -GOVCPATH = os.path.join(GOPATH, 'bin', 'govc') -GOVCURL = None - - -@app.route('/') -def m_index(): - return 'vcsim controller' - - -@app.route('/kill/') -def kill_one(number): - """Kill any arbitrary process id""" - - success = False - e = None - - try: - p = psutil.Process(number) - p.terminate() - success = True - except Exception as e: - pass - - return jsonify({'success': success, 'e': str(e)}) - - -@app.route('/killall') -def kill_all(): - """Kill ALL of the running vcsim pids""" - - results = [] - - for x in psutil.pids(): - p = psutil.Process(x) - if VCSIMPATH in p.cmdline(): - success = False - e = None - try: - p.terminate() - success = True - except Exception as e: - pass - results.append( - {'pid': x, 'cmdline': p.cmdline(), - 'success': success, 'e': str(e)} - ) - - return jsonify(results) - - -@app.route('/spawn') -def spawn_vcsim(): - """Launch vcsim in a background process and return the pid+govcm_url""" - - global GOVCURL - - username = request.args.get('username') or 'user' - password = request.args.get('password') or 'pass' - hostname = request.args.get('hostname') or \ - socket.gethostbyname(socket.gethostname()) - port = request.args.get('port') or '443' - port = int(port) - - # FIXME - enable tracing - if request.args.get('trace'): - trace = True - else: - trace = False - - # vcsim cli options and their default values - cli_opts = [ - ['app', 0], - ['cluster', 0], - ['dc', 1], - ['ds', 1], - ['folder', 1], - ['host', 3], - ['pg', 1], - ['pod', 1], - ['pool', 1], - ['vm', 2] - ] - - # useful for client govc commands - govc_url = 'https://%s:%s@%s:%s' % (username, password, hostname, port) - GOVCURL = govc_url - - # need these to run the service - env = { - 'GOPATH': GOPATH, - 'GOVC_URL': govc_url, - 'GOVC_INSECURE': '1' - } - - # build the command - cmd = [ - VCSIMPATH, - '-httptest.serve', - '%s:%s' % (hostname, port), - ] - for x in cli_opts: - name = x[0] - default = x[1] - if request.args.get(name): - default = request.args.get(name) - cmd.append('-%s=%s' % (name, default)) - cmd = ' '.join(cmd) - cmd += ' 2>&1 > vcsim.log' - - # run it with environment settings - p = subprocess.Popen( - cmd, - env=env, - shell=True - ) - - # return the relevant data - pid = p.pid - rdata = { - 'cmd': cmd, - 'pid': pid, - 'host': hostname, - 'port': port, - 'username': username, - 'password': password, - 'GOVC_URL': govc_url - } - - return jsonify(rdata) - - -@app.route('/govc_find') -def govc_find(): - """Run govc find and optionally filter results""" - ofilter = request.args.get('filter') or None - stdout_lines = _get_all_objs(ofilter=ofilter) - return jsonify(stdout_lines) - - -@app.route('/govc_vm_info') -def get_govc_vm_info(): - """Run govc vm info """ - vm_name = request.args.get('vm_name') or None - vm_output = {} - if vm_name: - all_vms = [vm_name] - else: - # Get all VMs - all_vms = _get_all_objs(ofilter='VM') - - for vm_name in all_vms: - vm_info = _get_vm_info(vm_name=vm_name) - name = vm_info.get('Name', vm_name) - vm_output[name] = vm_info - - return jsonify(vm_output) - - -@app.route('/govc_host_info') -def get_govc_host_info(): - """ Run govc host.info """ - host_name = request.args.get("host_name") or None - host_output = {} - if host_name: - all_hosts = [host_name] - else: - all_hosts = _get_all_objs(ofilter='H') - for host_system in all_hosts: - host_info = _get_host_info(host_name=host_system) - name = host_info.get('Name', host_system) - host_output[name] = host_info - - return jsonify(host_output) - - -def _get_host_info(host_name=None): - """ - Get all information of host from vcsim - :param vm_name: Name of host - :return: Dictionary containing information about VM, - where KEY represent attributes and VALUE represent attribute's value - """ - cmd = '%s host.info -host=%s 2>&1' % (GOVCPATH, host_name) - - host_info = {} - if host_name is None: - return host_info - host_info = parse_govc_info(cmd) - - return host_info - - -def _get_vm_info(vm_name=None): - """ - Get all information of VM from vcsim - :param vm_name: Name of VM - :return: Dictionary containing information about VM, - where KEY represent attributes and VALUE represent attribute's value - """ - cmd = '%s vm.info %s 2>&1' % (GOVCPATH, vm_name) - - vm_info = {} - if vm_name is None: - return vm_info - vm_info = parse_govc_info(cmd) - - return vm_info - - -def parse_govc_info(cmd): - """ - Helper function to parse output of govc info commands - :param cmd: command variable to run and parse output for - :return: Dictionary containing information about object - """ - so, se = run_cmd(cmd) - stdout_lines = so.splitlines() - info = {} - for line in stdout_lines: - if ":" in line: - key, value = line.split(":", 1) - key = key.lstrip() - info[key] = value.strip() - - return info - - -def _get_all_objs(ofilter=None): - """ - Get all VM Objects from vcsim - :param ofilter: Specify which object to get - :return: list of Object specified by ofilter - """ - cmd = '%s find ' % GOVCPATH - filter_mapping = dict(VA='a', CCR='c', DC='d', F='f', DVP='g', H='h', - VM='m', N='n', ON='o', RP='p', CR='r', D='s', DVS='w') - if ofilter: - type_filter = filter_mapping.get(ofilter, '') - if type_filter != '': - cmd += '-type %s ' % type_filter - - cmd += "2>&1" - so, se = run_cmd(cmd) - stdout_lines = so.splitlines() - return stdout_lines - - -def run_cmd(cmd): - """ - Helper Function to run commands - :param cmd: Command string to execute - :return: StdOut and StdErr in string format - """ - global GOVCURL - - env = { - 'GOPATH': GOPATH, - 'GOVC_URL': GOVCURL, - 'GOVC_INSECURE': '1' - } - - p = subprocess.Popen( - cmd, - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - env=env, - shell=True - ) - - (so, se) = p.communicate() - return so, se - - -if __name__ == "__main__": - app.run(debug=False, host='0.0.0.0') diff --git a/test/utils/docker/vcenter-simulator/make.sh b/test/utils/docker/vcenter-simulator/make.sh deleted file mode 100755 index 775c29302fd..00000000000 --- a/test/utils/docker/vcenter-simulator/make.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -docker build -t ansible:vcenter-simulator .