Skip to content

Commit 63cfb1e

Browse files
fix(script): fix some travis tests
1 parent f56ba6a commit 63cfb1e

File tree

8 files changed

+121
-139
lines changed

8 files changed

+121
-139
lines changed

.travis.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,15 +60,15 @@ jobs:
6060
# the `platforms` defined in `kitchen.yml`
6161
- env: INSTANCE=default-debian-10-master-py3
6262
# - env: INSTANCE=default-ubuntu-1804-master-py3
63-
- env: INSTANCE=default-centos-8-master-py3
64-
- env: INSTANCE=default-fedora-31-master-py3
65-
- env: INSTANCE=default-opensuse-leap-151-master-py3
63+
- env: INSTANCE=archive-centos-8-master-py3
64+
- env: INSTANCE=archive-fedora-31-master-py3
65+
- env: INSTANCE=archive-opensuse-leap-151-master-py3
6666
# - env: INSTANCE=default-amazonlinux-2-master-py3
6767
# - env: INSTANCE=default-debian-10-3000-2-py3
6868
# - env: INSTANCE=default-debian-9-3000-2-py3
6969
# - env: INSTANCE=default-ubuntu-1804-3000-2-py3
7070
# - env: INSTANCE=default-centos-8-3000-2-py3
71-
# - env: INSTANCE=default-centos-7-3000-2-py3
71+
- env: INSTANCE=default-centos-7-3000-2-py3
7272
# - env: INSTANCE=default-fedora-31-3000-2-py3
7373
# - env: INSTANCE=default-opensuse-leap-151-3000-2-py3
7474
# - env: INSTANCE=default-amazonlinux-2-3000-2-py3
@@ -86,7 +86,7 @@ jobs:
8686
# - env: INSTANCE=default-amazonlinux-2-2019-2-py3
8787
# - env: INSTANCE=default-centos-6-2019-2-py2
8888
# - env: INSTANCE=default-amazonlinux-1-2019-2-py2
89-
# - env: INSTANCE=default-arch-base-latest-2019-2-py2
89+
- env: INSTANCE=archive-arch-base-latest-2019-2-py2
9090

9191
## Define the release stage that runs `semantic-release`
9292
- stage: 'release'

kitchen.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ suites:
147147
state_top:
148148
base:
149149
'*':
150+
- mongodb.clean
150151
- mongodb
151152
pillars:
152153
top.sls:
@@ -158,3 +159,20 @@ suites:
158159
verifier:
159160
inspec_tests:
160161
- path: test/integration/default
162+
- name: archive
163+
provisioner:
164+
state_top:
165+
base:
166+
'*':
167+
- mongodb.clean
168+
- mongodb
169+
pillars:
170+
top.sls:
171+
base:
172+
'*':
173+
- mongodb
174+
pillars_from_files:
175+
mongodb.sls: test/salt/pillar/archive.sls
176+
verifier:
177+
inspec_tests:
178+
- path: test/integration/archive

test/integration/archive/README.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# InSpec Profile: `archive`
2+
3+
This shows the implementation of the `archive` InSpec [profile](https://github.com/inspec/inspec/blob/master/docs/profiles.md).
4+
5+
## Verify a profile
6+
7+
InSpec ships with built-in features to verify a profile structure.
8+
9+
```bash
10+
$ inspec check archive
11+
Summary
12+
-------
13+
Location: archive
14+
Profile: profile
15+
Controls: 4
16+
Timestamp: 2019-06-24T23:09:01+00:00
17+
Valid: true
18+
19+
Errors
20+
------
21+
22+
Warnings
23+
--------
24+
```
25+
26+
## Execute a profile
27+
28+
To run all **supported** controls on a local machine use `inspec exec /path/to/profile`.
29+
30+
```bash
31+
$ inspec exec archive
32+
..
33+
34+
Finished in 0.0025 seconds (files took 0.12449 seconds to load)
35+
8 examples, 0 failures
36+
```
37+
38+
## Execute a specific control from a profile
39+
40+
To run one control from the profile use `inspec exec /path/to/profile --controls name`.
41+
42+
```bash
43+
$ inspec exec archive --controls package
44+
.
45+
46+
Finished in 0.0025 seconds (files took 0.12449 seconds to load)
47+
1 examples, 0 failures
48+
```
49+
50+
See an [example control here](https://github.com/inspec/inspec/blob/master/examples/profile/controls/example.rb).
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# frozen_string_literal: true
2+
3+
control 'mongodb package' do
4+
title 'should be installed'
5+
end
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# -*- coding: utf-8 -*-
2+
# vim: ft=yaml
3+
---
4+
name: archive
5+
title: mongodb formula
6+
maintainer: SaltStack Formulas
7+
license: Apache-2.0
8+
summary: Verify that the mongodb formula is setup and configured correctly
9+
supports:
10+
- platform-name: debian
11+
- platform-name: ubuntu
12+
- platform-name: centos
13+
- platform-name: fedora
14+
- platform-name: opensuse
15+
- platform-name: suse
16+
- platform-name: freebsd
17+
- platform-name: amazon
18+
- platform-name: arch
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import testinfra
2+
3+
def test_service_is_running_and_enabled(host):
4+
mongodb = host.service('mongod')
5+
assert mongodb.is_running
6+
assert mongodb.is_enabled

test/salt/pillar/archive.sls

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# -*- coding: utf-8 -*-
2+
# vim: ft=yaml
3+
---
4+
mongodb:
5+
robo3t:
6+
version: 1.2.1
7+
# yamllint disable-line rule:line-length
8+
source_hash: sha512=ead2c4847dc1cd4024f60f34a142af6c6818f90a37b5ae075c8b65414ee8ca8074355446c9e264094f776f7798bfba37a7c7018f94d0bec109715061ab3a57c3
9+
compass:
10+
version: 1.17.0
11+
server:
12+
package: mongodb-org
13+
version: 4.2
14+
use_repo: false
15+
use_archive: true
16+
bic:
17+
version: 2.7.0
18+
use_repo: false
19+
use_archive: true

test/salt/pillar/default.sls

Lines changed: 0 additions & 134 deletions
Original file line numberDiff line numberDiff line change
@@ -3,28 +3,11 @@
33
---
44
mongodb:
55
robo3t:
6-
######## install from archive file
76
version: 1.2.1
87
# yamllint disable-line rule:line-length
98
source_hash: sha512=ead2c4847dc1cd4024f60f34a142af6c6818f90a37b5ae075c8b65414ee8ca8074355446c9e264094f776f7798bfba37a7c7018f94d0bec109715061ab3a57c3
10-
119
compass:
12-
######## install from archive file
1310
version: 1.17.0
14-
15-
system:
16-
userhome: /home
17-
use_firewalld: false
18-
use_selinux: false
19-
pidpath: /var/run/mongodb
20-
deps:
21-
- curl
22-
- openssl
23-
dl:
24-
interval: 60
25-
retries: 2
26-
tmpdir: /tmp/mongodbtmp
27-
2811
server:
2912
package: mongodb-org
3013
version: 4.2
@@ -33,124 +16,7 @@ mongodb:
3316
# `keyid` for version `4.2` (Debian-based)
3417
keyid: E162F504A20CDF15827F718D4B7C549A058F8B6B
3518
use_archive: false
36-
use_schema: false
37-
disable_transparent_hugepages: true
38-
binpath: /usr # could be /usr/local/mongodb when use_archive=true
39-
user: mongodb
40-
group: mongodb
41-
mongod:
42-
service: mongod
43-
shortcut: false
44-
package: mongodb-org-server
45-
conf_path: /etc/mongod.conf
46-
conf:
47-
systemLog:
48-
logAppend: false
49-
destination: file
50-
path: /var/log/mongodb/mongod.log
51-
storage:
52-
dbPath: /var/lib/mongodb/mongod
53-
journal:
54-
enabled: true
55-
replication:
56-
replSetName: "rs1"
57-
sharding:
58-
clusterRole: shardsvr
59-
net:
60-
bindIp: '{{ grains.ipv4[-1] or grains.ipv6[-1] }}'
61-
port: 27018
62-
processManagement:
63-
timeZoneInfo: /usr/share/zoneinfo
64-
fork: true
65-
pidFilePath: /var/run/mongodb/mongod.pid
66-
systemd:
67-
file: /usr/lib/systemd/system/mongod.service
68-
conf:
69-
Type: forking
70-
LimitFSIZE: infinity
71-
LimitCPU: infinity
72-
LimitAS: infinity
73-
LimitNOFILE: 64000
74-
LimitNPROC: 64000
75-
LimitMEMLOCK: infinity
76-
TasksMax: infinity
77-
TasksAccounting: false
78-
79-
mongos:
80-
service: mongos
81-
shortcut: false
82-
package: mongodb-org-mongos
83-
conf_path: /etc/mongos.conf
84-
conf:
85-
systemLog:
86-
destination: file
87-
path: /var/log/mongodb/mongos.log
88-
processManagement:
89-
timeZoneInfo: /usr/share/zoneinfo
90-
fork: true
91-
pidFilePath: /var/run/mongodb/mongos.pid
92-
net:
93-
bindIp: '{{ grains.ipv4[-1] or grains.ipv6[-1] }}'
94-
port: 28017
95-
sharding:
96-
configDB: 'rs1/{{ grains.ipv4[-1] or grains.ipv6[-1] }}:27018'
97-
systemd:
98-
file: /usr/lib/systemd/system/mongos.service
99-
conf:
100-
Type: simple
101-
LimitFSIZE: infinity
102-
LimitCPU: infinity
103-
LimitAS: infinity
104-
LimitNOFILE: 64000
105-
LimitNPROC: 64000
106-
LimitMEMLOCK: infinity
107-
TasksMax: infinity
108-
TasksAccounting: false
109-
shell:
110-
package: mongodb-org-shell
111-
mongorc: /etc/mongorc.js
112-
tools:
113-
package: mongodb-org-tools
114-
11519
bic:
116-
######### install from archive file
11720
version: 2.7.0
11821
use_repo: false
11922
use_archive: true
120-
use_schema: true
121-
binpath: /usr/local/bic
122-
user: mongodb
123-
group: mongodb
124-
mongosqld:
125-
service: mongosqld
126-
shortcut: false
127-
conf_path: /etc/mongosqld.conf
128-
conf:
129-
systemLog:
130-
logAppend: true
131-
path: /var/log/mongodb/mongosqld.log
132-
schema:
133-
path: /etc/mongosqld/schema
134-
security:
135-
enabled: false
136-
mongodb:
137-
net:
138-
uri: '{{ grains.ipv4[-1] or grains.ipv6[-1] }}:27018'
139-
# auth:
140-
# username: root
141-
# password: changeme
142-
net:
143-
bindIp: '{{ grains.ipv4[-1] or grains.ipv6[-1] }}'
144-
port: 3307
145-
systemd:
146-
file: /usr/lib/systemd/system/mongosqld.service
147-
conf:
148-
Type: simple
149-
LimitFSIZE: infinity
150-
LimitCPU: infinity
151-
LimitAS: infinity
152-
LimitNOFILE: 64000
153-
LimitNPROC: 64000
154-
LimitMEMLOCK: infinity
155-
TasksMax: infinity
156-
TasksAccounting: false

0 commit comments

Comments
 (0)