Skip to content

Commit

Permalink
Fixed problem with testing for 12.04 version
Browse files Browse the repository at this point in the history
  • Loading branch information
Sergei Antipov committed May 9, 2016
1 parent 9f208d1 commit 0e7e738
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 17 deletions.
26 changes: 10 additions & 16 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,16 @@ env:
MONGODB_VERSION=2.6
- >
DISTRIBUTION=ubuntu-upstart
DIST_VERSION=12.04
DIST_VERSION=12.04-builded
MONGODB_VERSION=3.2
- >
DISTRIBUTION=ubuntu-upstart
DIST_VERSION=12.04
DIST_VERSION=12.04-builded
MONGODB_VERSION=3.0
- >
DISTRIBUTION=ubuntu-upstart
DIST_VERSION=12.04
DIST_VERSION=12.04-builded
MONGODB_VERSION=2.6
# - >
# distribution=ubuntu-upstart
# version=12.04
# - >
# distribution=debian
# version=7
services:
- docker
Expand All @@ -59,7 +53,7 @@ script:
# Idempotence test
- >
sudo ansible-playbook -i tests/hosts tests/site.yml -e target=mongo1 -e mongodb_version=${MONGODB_VERSION}
| grep -q 'changed=0.*failed=0'
-e image_name=${DISTRIBUTION}:${DIST_VERSION} | grep -q 'changed=0.*failed=0'
&& (echo 'Idempotence test: pass' && exit 0)
|| (echo 'Idempotence test: fail' && exit 1)
Expand All @@ -68,11 +62,11 @@ script:

# Test 2
- >
sudo ansible-playbook -i tests/hosts tests/site.yml -e target=mongo1
sudo ansible-playbook -i tests/hosts tests/site.yml -e target=mongo1 -e image_name=${DISTRIBUTION}:${DIST_VERSION}
-e mongodb_version=${MONGODB_VERSION} -e mongodb_security_authorization='enabled'
# Idempotence test
- >
sudo ansible-playbook -i tests/hosts tests/site.yml -e target=mongo1
sudo ansible-playbook -i tests/hosts tests/site.yml -e target=mongo1 -e image_name=${DISTRIBUTION}:${DIST_VERSION}
-e mongodb_version=${MONGODB_VERSION} -e mongodb_security_authorization='enabled'
| grep -q 'changed=0.*failed=0'
&& (echo 'Idempotence test: pass' && exit 0)
Expand All @@ -83,11 +77,11 @@ script:

# Test 3
- >
sudo ansible-playbook -i tests/hosts tests/site.yml -e target=mongo
sudo ansible-playbook -i tests/hosts tests/site.yml -e target=mongo -e image_name=${DISTRIBUTION}:${DIST_VERSION}
-e mongodb_version=${MONGODB_VERSION} -e mongodb_replication_replset='testrs'
# Idempotence test
- >
sudo ansible-playbook -i tests/hosts tests/site.yml -e target=mongo
sudo ansible-playbook -i tests/hosts tests/site.yml -e target=mongo -e image_name=${DISTRIBUTION}:${DIST_VERSION}
-e mongodb_version=${MONGODB_VERSION} -e mongodb_replication_replset='testrs'
| grep -q 'changed=0.*failed=0'
&& (echo 'Idempotence test: pass' && exit 0)
Expand All @@ -98,12 +92,12 @@ script:

# Test 4
- >
sudo ansible-playbook -i tests/hosts tests/site.yml -e target=mongo
sudo ansible-playbook -i tests/hosts tests/site.yml -e target=mongo -e image_name=${DISTRIBUTION}:${DIST_VERSION}
-e mongodb_version=${MONGODB_VERSION} -e mongodb_replication_replset='testrs'
-e mongodb_security_authorization='enabled'
# Idempotence test
- >
sudo ansible-playbook -i tests/hosts tests/site.yml -e target=mongo
sudo ansible-playbook -i tests/hosts tests/site.yml -e target=mongo -e image_name=${DISTRIBUTION}:${DIST_VERSION}
-e mongodb_version=${MONGODB_VERSION} -e mongodb_replication_replset='testrs'
-e mongodb_security_authorization='enabled'
| grep -q 'changed=0.*failed=0'
Expand Down
2 changes: 1 addition & 1 deletion tests/Dockerfile.ubuntu-upstart_12.04-builded
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ FROM ubuntu:12.04
# we're going to want this bad boy installed so we can connect :)
RUN apt-get update && apt-get install -y ssh python

ADD init-fake.conf /etc/init/fake-container-events.conf
ADD builds/init-fake.conf /etc/init/fake-container-events.conf

# undo some leet hax of the base image
RUN rm /usr/sbin/policy-rc.d; \
Expand Down
13 changes: 13 additions & 0 deletions tests/builds/init-fake.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# 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

0 comments on commit 0e7e738

Please sign in to comment.