diff --git a/.travis.yml b/.travis.yml index abc583a44f62a169059b177cabed55bfe3ab9183..b6502e54a81be24b4c391b7fb5dc4305bb6832a4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,23 +1,38 @@ --- language: python -python: "2.7" +python: ["2.7", "3.4"] dist: trusty -sudo: false +sudo: True group: beta services: [docker] +env: + - platform: openbsd60 + driver: vagrant + - &openbsd59 platform=openbsd59 driver=vagrant + - driver: docker + platform: all +matrix: + fast_finish: True + allow_failures: + - python: "3.4" + - env: *openbsd59 cache: - pip - directories: - $HOME/.pre-commit install: + - sudo apt-get update + - sudo apt-get install -y linux-headers-$(uname -r) virtualbox + - wget https://releases.hashicorp.com/vagrant/1.9.1/vagrant_1.9.1_x86_64.deb + - sudo dpkg -i vagrant_1.9.1_x86_64.deb - pip install -r tests/requirements.txt | cat - ansible-galaxy install git+file://$(pwd),$(git rev-parse --abbrev-ref HEAD) -p .molecule/roles - molecule dependency script: - pre-commit run --all-files - - molecule test --driver docker + - molecule test --driver $driver --platform $platform notifications: webhooks: https://galaxy.ansible.com/api/v1/notifications/ diff --git a/molecule.yml b/molecule.yml index 1dfb9a113e45543fd0871b7b9dd7032af3eb1d10..f730df6f3c03caff662374ccfc2b3c43ec065c20 100644 --- a/molecule.yml +++ b/molecule.yml @@ -13,25 +13,48 @@ vagrant: providers: - name: virtualbox type: virtualbox + options: + cpus: 1 platforms: - - name: openbsd - box: kaorimatz/openbsd-6.0-amd64 + - name: openbsd60 + box: fnichol/openbsd-6.0-i386 + - name: openbsd59 + box: fnichol/openbsd-5.9-i386 + - name: xenial + box: ubuntu/xenial32 - name: trusty - box: ubuntu/trusty64 + box: ubuntu/trusty32 - name: jessie - box: debian/jessie64 + box: debian/jessie32 + - name: wheezy + box: debian/wheezy32 instances: - name: php-fpm options: append_platform_to_hostname: yes raw_config_args: - 'vm.synced_folder ".", "/vagrant", disabled: true' - - 'vbguest.auto_update = false' - - 'landrush.enabled = false' - - 'landrush_ip.override = false' + - 'vbguest.auto_update = false if Vagrant.has_plugin?("vbguest")' + - 'landrush.enabled = false if Vagrant.has_plugin?("landrush")' + - 'landrush_ip.override = false if Vagrant.has_plugin?("landrush")' + - | + vm.provider "virtualbox" do |v| + v.customize "pre-boot", ["modifyvm", :id, "--hwvirtex", "off"] + end docker: containers: + - name: php-fpm-xenial + image: ubuntu + image_version: xenial + command: /sbin/init + privileged: True + volume_mounts: + - /sys/fs/cgroup:/sys/fs/cgroup + - /var/run/dbus/system_bus_socket:/var/run/dbus/system_bus_socket + environment: + DEBIAN_FRONTEND: noninteractive + container: docker - name: php-fpm-trusty image: ubuntu-upstart image_version: trusty @@ -51,3 +74,11 @@ docker: environment: DEBIAN_FRONTEND: noninteractive container: docker + - name: php-fpm-wheezy + image: debian + image_version: wheezy + command: /sbin/init + privileged: True + environment: + DEBIAN_FRONTEND: noninteractive + container: docker diff --git a/tests/playbook.yml b/tests/playbook.yml index fced2f6bd4d562575d8a3bfa7efaecae9b0d1bb7..af5468fa0316f4034b737edef3c3ee4a2d4a154e 100644 --- a/tests/playbook.yml +++ b/tests/playbook.yml @@ -1,5 +1,5 @@ --- -- hosts: php-fpm-openbsd +- hosts: php-fpm-openbsd* gather_facts: false roles: [openbsd-bootstrap] @@ -8,7 +8,6 @@ roles: [debian-bootstrap] - hosts: all - strategy: free roles: - role: nginx - role: php-fpm diff --git a/tests/requirements.txt b/tests/requirements.txt index f222e79fb237292bf6403d90bcf0a54a1709f450..1c8ea361c0af0ec637c22c71f1acdb9cd22295a0 100644 --- a/tests/requirements.txt +++ b/tests/requirements.txt @@ -2,7 +2,7 @@ ansible==2.2.0.0 testinfra==1.5.1 molecule==1.17.3 ansible-lint==3.4.9 -pre-commit==0.9.4 +pre-commit==0.10.1 piprot==0.9.7 python-vagrant==0.5.14 docker-py==1.10.6 diff --git a/tests/test_php-fpm.py b/tests/test_php-fpm.py index f54a80bd26c66c7b745f3af147ec4e1c42a7c8c8..1df008bf5f5e9be12ef1256240db86ab81fe9462 100644 --- a/tests/test_php-fpm.py +++ b/tests/test_php-fpm.py @@ -37,3 +37,12 @@ def test_php_fpm_config(Command, Sudo, SystemInfo): 'debian', 'ubuntu' ]: assert Command('php5-fpm -t').rc == 0 + + +def test_php_fpm_status(Command): + assert 'PHP version 5' in Command( + 'curl http://localhost/status.php').stdout + + +def test_php_fpm_ping(Command): + assert 'pong' in Command('curl http://localhost/ping.php').stdout