@@ -37,6 +37,7 @@ before_install:
37
37
- sudo ln -s ${PWD} /etc/ansible/roles/greendayonfire.mongodb
38
38
39
39
script :
40
+ # Test 1
40
41
- sudo ansible-playbook -i tests/hosts tests/site.yml -e target=mongo1 -e mongodb_version=${MONGODB_VERSION}
41
42
# Idempotence test
42
43
- >
@@ -47,4 +48,48 @@ script:
47
48
48
49
# Delete all containers
49
50
- sudo docker kill mongo{1,2,3} && docker rm mongo{1,2,3}
50
-
51
+
52
+ # Test 2
53
+ - >
54
+ sudo ansible-playbook -i tests/hosts tests/site.yml -e target=mongo1
55
+ -e mongodb_version=${MONGODB_VERSION} -e mongodb_security_authorization='enabled'
56
+ # Idempotence test
57
+ - >
58
+ sudo ansible-playbook -i tests/hosts tests/site.yml -e target=mongo1
59
+ -e mongodb_version=${MONGODB_VERSION} -e mongodb_security_authorization='enabled'
60
+ | grep -q 'changed=0.*failed=0'
61
+ && (echo 'Idempotence test: pass' && exit 0)
62
+ || (echo 'Idempotence test: fail' && exit 1)
63
+
64
+ # Delete all containers
65
+ - sudo docker kill mongo{1,2,3} && docker rm mongo{1,2,3}
66
+
67
+ # Test 3
68
+ - >
69
+ sudo ansible-playbook -i tests/hosts tests/site.yml -e target=mongo
70
+ -e mongodb_version=${MONGODB_VERSION} -e mongodb_replication_replset='testrs'
71
+ # Idempotence test
72
+ - >
73
+ sudo ansible-playbook -i tests/hosts tests/site.yml -e target=mongo
74
+ -e mongodb_version=${MONGODB_VERSION} -e mongodb_replication_replset='testrs'
75
+ | grep -q 'changed=0.*failed=0'
76
+ && (echo 'Idempotence test: pass' && exit 0)
77
+ || (echo 'Idempotence test: fail' && exit 1)
78
+
79
+ # Delete all containers
80
+ - sudo docker kill mongo{1,2,3} && docker rm mongo{1,2,3}
81
+
82
+ # Test 4
83
+ - >
84
+ sudo ansible-playbook -i tests/hosts tests/site.yml -e target=mongo
85
+ -e mongodb_version=${MONGODB_VERSION} -e mongodb_replication_replset='testrs'
86
+ -e mongodb_security_authorization='enabled'
87
+ # Idempotence test
88
+ - >
89
+ sudo ansible-playbook -i tests/hosts tests/site.yml -e target=mongo
90
+ -e mongodb_version=${MONGODB_VERSION} -e mongodb_replication_replset='testrs'
91
+ -e mongodb_security_authorization='enabled'
92
+ | grep -q 'changed=0.*failed=0'
93
+ && (echo 'Idempotence test: pass' && exit 0)
94
+ || (echo 'Idempotence test: fail' && exit 1)
95
+
0 commit comments