Skip to content

Commit 0e7e738

Browse files
author
Sergei Antipov
committed
Fixed problem with testing for 12.04 version
1 parent 9f208d1 commit 0e7e738

File tree

3 files changed

+24
-17
lines changed

3 files changed

+24
-17
lines changed

.travis.yml

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -17,22 +17,16 @@ env:
1717
MONGODB_VERSION=2.6
1818
- >
1919
DISTRIBUTION=ubuntu-upstart
20-
DIST_VERSION=12.04
20+
DIST_VERSION=12.04-builded
2121
MONGODB_VERSION=3.2
2222
- >
2323
DISTRIBUTION=ubuntu-upstart
24-
DIST_VERSION=12.04
24+
DIST_VERSION=12.04-builded
2525
MONGODB_VERSION=3.0
2626
- >
2727
DISTRIBUTION=ubuntu-upstart
28-
DIST_VERSION=12.04
28+
DIST_VERSION=12.04-builded
2929
MONGODB_VERSION=2.6
30-
# - >
31-
# distribution=ubuntu-upstart
32-
# version=12.04
33-
# - >
34-
# distribution=debian
35-
# version=7
3630
3731
services:
3832
- docker
@@ -59,7 +53,7 @@ script:
5953
# Idempotence test
6054
- >
6155
sudo ansible-playbook -i tests/hosts tests/site.yml -e target=mongo1 -e mongodb_version=${MONGODB_VERSION}
62-
| grep -q 'changed=0.*failed=0'
56+
-e image_name=${DISTRIBUTION}:${DIST_VERSION} | grep -q 'changed=0.*failed=0'
6357
&& (echo 'Idempotence test: pass' && exit 0)
6458
|| (echo 'Idempotence test: fail' && exit 1)
6559
@@ -68,11 +62,11 @@ script:
6862

6963
# Test 2
7064
- >
71-
sudo ansible-playbook -i tests/hosts tests/site.yml -e target=mongo1
65+
sudo ansible-playbook -i tests/hosts tests/site.yml -e target=mongo1 -e image_name=${DISTRIBUTION}:${DIST_VERSION}
7266
-e mongodb_version=${MONGODB_VERSION} -e mongodb_security_authorization='enabled'
7367
# Idempotence test
7468
- >
75-
sudo ansible-playbook -i tests/hosts tests/site.yml -e target=mongo1
69+
sudo ansible-playbook -i tests/hosts tests/site.yml -e target=mongo1 -e image_name=${DISTRIBUTION}:${DIST_VERSION}
7670
-e mongodb_version=${MONGODB_VERSION} -e mongodb_security_authorization='enabled'
7771
| grep -q 'changed=0.*failed=0'
7872
&& (echo 'Idempotence test: pass' && exit 0)
@@ -83,11 +77,11 @@ script:
8377

8478
# Test 3
8579
- >
86-
sudo ansible-playbook -i tests/hosts tests/site.yml -e target=mongo
80+
sudo ansible-playbook -i tests/hosts tests/site.yml -e target=mongo -e image_name=${DISTRIBUTION}:${DIST_VERSION}
8781
-e mongodb_version=${MONGODB_VERSION} -e mongodb_replication_replset='testrs'
8882
# Idempotence test
8983
- >
90-
sudo ansible-playbook -i tests/hosts tests/site.yml -e target=mongo
84+
sudo ansible-playbook -i tests/hosts tests/site.yml -e target=mongo -e image_name=${DISTRIBUTION}:${DIST_VERSION}
9185
-e mongodb_version=${MONGODB_VERSION} -e mongodb_replication_replset='testrs'
9286
| grep -q 'changed=0.*failed=0'
9387
&& (echo 'Idempotence test: pass' && exit 0)
@@ -98,12 +92,12 @@ script:
9892

9993
# Test 4
10094
- >
101-
sudo ansible-playbook -i tests/hosts tests/site.yml -e target=mongo
95+
sudo ansible-playbook -i tests/hosts tests/site.yml -e target=mongo -e image_name=${DISTRIBUTION}:${DIST_VERSION}
10296
-e mongodb_version=${MONGODB_VERSION} -e mongodb_replication_replset='testrs'
10397
-e mongodb_security_authorization='enabled'
10498
# Idempotence test
10599
- >
106-
sudo ansible-playbook -i tests/hosts tests/site.yml -e target=mongo
100+
sudo ansible-playbook -i tests/hosts tests/site.yml -e target=mongo -e image_name=${DISTRIBUTION}:${DIST_VERSION}
107101
-e mongodb_version=${MONGODB_VERSION} -e mongodb_replication_replset='testrs'
108102
-e mongodb_security_authorization='enabled'
109103
| grep -q 'changed=0.*failed=0'

tests/Dockerfile.ubuntu-upstart_12.04-builded

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ FROM ubuntu:12.04
66
# we're going to want this bad boy installed so we can connect :)
77
RUN apt-get update && apt-get install -y ssh python
88

9-
ADD init-fake.conf /etc/init/fake-container-events.conf
9+
ADD builds/init-fake.conf /etc/init/fake-container-events.conf
1010

1111
# undo some leet hax of the base image
1212
RUN rm /usr/sbin/policy-rc.d; \

tests/builds/init-fake.conf

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# fake some events needed for correct startup other services
2+
3+
description "In-Container Upstart Fake Events"
4+
5+
start on startup
6+
7+
script
8+
rm -rf /var/run/*.pid
9+
rm -rf /var/run/network/*
10+
/sbin/initctl emit stopped JOB=udevtrigger --no-wait
11+
/sbin/initctl emit started JOB=udev --no-wait
12+
/sbin/initctl emit runlevel RUNLEVEL=3 --no-wait
13+
end script

0 commit comments

Comments
 (0)