Skip to content

Commit a6c8197

Browse files
committed
ci: use default & repo InSpec suites
* Automated using myii/ssf-formula#348
1 parent 060c8df commit a6c8197

File tree

6 files changed

+293
-33
lines changed

6 files changed

+293
-33
lines changed

.github/workflows/kitchen.vagrant.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,11 @@ jobs:
1515
matrix:
1616
instance:
1717
- default-freebsd-130-master-py3
18+
# - freebsd-130-master-py3
1819
- default-freebsd-122-master-py3
20+
# - freebsd-122-master-py3
1921
- default-freebsd-114-master-py3
22+
# - freebsd-114-master-py3
2023
# - default-freebsd-130-3002-6-py3
2124
# - default-freebsd-122-3002-6-py3
2225
# - default-freebsd-114-3002-6-py3

.gitlab-ci.yml

Lines changed: 60 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ rubocop:
102102
###############################################################################
103103
# Define `test` template
104104
###############################################################################
105-
.test_instance:
105+
.test_instance: &test_instance
106106
stage: *stage_test
107107
image: *image_dindruby
108108
services: *services_docker_dind
@@ -117,6 +117,13 @@ rubocop:
117117
# Alternative value to consider: `${CI_JOB_NAME}`
118118
- 'bin/kitchen verify "${DOCKER_ENV_CI_JOB_NAME}"'
119119

120+
###############################################################################
121+
# Define `test` template (`allow_failure: true`)
122+
###############################################################################
123+
.test_instance_failure_permitted:
124+
<<: *test_instance
125+
allow_failure: true
126+
120127
###############################################################################
121128
# `test` stage: each instance below uses the `test` template above
122129
###############################################################################
@@ -135,26 +142,62 @@ rubocop:
135142
# default-oraclelinux-7-tiamat-py3: {extends: '.test_instance'}
136143
# default-almalinux-8-tiamat-py3: {extends: '.test_instance'}
137144
# default-rockylinux-8-tiamat-py3: {extends: '.test_instance'}
138-
default-debian-11-master-py3: {extends: '.test_instance'}
139-
default-debian-10-master-py3: {extends: '.test_instance'}
140-
default-debian-9-master-py3: {extends: '.test_instance'}
141-
default-ubuntu-2004-master-py3: {extends: '.test_instance'}
142-
default-ubuntu-1804-master-py3: {extends: '.test_instance'}
143-
default-centos-8-master-py3: {extends: '.test_instance'}
144-
default-centos-7-master-py3: {extends: '.test_instance'}
145-
default-fedora-34-master-py3: {extends: '.test_instance'}
146-
default-fedora-33-master-py3: {extends: '.test_instance'}
147-
default-opensuse-leap-153-master-py3: {extends: '.test_instance'}
148-
default-opensuse-leap-152-master-py3: {extends: '.test_instance'}
145+
# default-debian-11-master-py3: {extends: '.test_instance'}
146+
# repo-debian-11-master-py3: {extends: '.test_instance'}
147+
debian-11-master-py3: {extends: '.test_instance'}
148+
# default-debian-10-master-py3: {extends: '.test_instance'}
149+
# repo-debian-10-master-py3: {extends: '.test_instance'}
150+
debian-10-master-py3: {extends: '.test_instance'}
151+
# default-debian-9-master-py3: {extends: '.test_instance'}
152+
# repo-debian-9-master-py3: {extends: '.test_instance'}
153+
debian-9-master-py3: {extends: '.test_instance'}
154+
# default-ubuntu-2004-master-py3: {extends: '.test_instance'}
155+
# repo-ubuntu-2004-master-py3: {extends: '.test_instance'}
156+
ubuntu-2004-master-py3: {extends: '.test_instance'}
157+
# default-ubuntu-1804-master-py3: {extends: '.test_instance'}
158+
# repo-ubuntu-1804-master-py3: {extends: '.test_instance'}
159+
ubuntu-1804-master-py3: {extends: '.test_instance'}
160+
# default-centos-8-master-py3: {extends: '.test_instance'}
161+
# repo-centos-8-master-py3: {extends: '.test_instance'}
162+
centos-8-master-py3: {extends: '.test_instance'}
163+
# default-centos-7-master-py3: {extends: '.test_instance'}
164+
# repo-centos-7-master-py3: {extends: '.test_instance'}
165+
centos-7-master-py3: {extends: '.test_instance'}
166+
# default-fedora-34-master-py3: {extends: '.test_instance'}
167+
# repo-fedora-34-master-py3: {extends: '.test_instance'}
168+
fedora-34-master-py3: {extends: '.test_instance'}
169+
# default-fedora-33-master-py3: {extends: '.test_instance'}
170+
# repo-fedora-33-master-py3: {extends: '.test_instance'}
171+
fedora-33-master-py3: {extends: '.test_instance'}
172+
# default-opensuse-leap-153-master-py3: {extends: '.test_instance'}
173+
# repo-opensuse-leap-153-master-py3: {extends: '.test_instance'}
174+
opensuse-leap-153-master-py3: {extends: '.test_instance'}
175+
# default-opensuse-leap-152-master-py3: {extends: '.test_instance'}
176+
# repo-opensuse-leap-152-master-py3: {extends: '.test_instance_failure_permitted'}
177+
opensuse-leap-152-master-py3: {extends: '.test_instance_failure_permitted'}
149178
default-opensuse-tmbl-latest-master-py3: {extends: '.test_instance'}
150-
default-amazonlinux-2-master-py3: {extends: '.test_instance'}
151-
default-oraclelinux-8-master-py3: {extends: '.test_instance'}
152-
default-oraclelinux-7-master-py3: {extends: '.test_instance'}
179+
# opensuse-tmbl-latest-master-py3: {extends: '.test_instance'}
180+
# default-amazonlinux-2-master-py3: {extends: '.test_instance'}
181+
# repo-amazonlinux-2-master-py3: {extends: '.test_instance'}
182+
amazonlinux-2-master-py3: {extends: '.test_instance'}
183+
# default-oraclelinux-8-master-py3: {extends: '.test_instance'}
184+
# repo-oraclelinux-8-master-py3: {extends: '.test_instance'}
185+
oraclelinux-8-master-py3: {extends: '.test_instance'}
186+
# default-oraclelinux-7-master-py3: {extends: '.test_instance'}
187+
# repo-oraclelinux-7-master-py3: {extends: '.test_instance'}
188+
oraclelinux-7-master-py3: {extends: '.test_instance'}
153189
default-arch-base-latest-master-py3: {extends: '.test_instance'}
190+
# arch-base-latest-master-py3: {extends: '.test_instance'}
154191
# default-gentoo-stage3-latest-master-py3: {extends: '.test_instance'}
192+
# gentoo-stage3-latest-master-py3: {extends: '.test_instance'}
155193
# default-gentoo-stage3-systemd-master-py3: {extends: '.test_instance'}
156-
default-almalinux-8-master-py3: {extends: '.test_instance'}
157-
default-rockylinux-8-master-py3: {extends: '.test_instance'}
194+
# gentoo-stage3-systemd-master-py3: {extends: '.test_instance'}
195+
# default-almalinux-8-master-py3: {extends: '.test_instance'}
196+
# repo-almalinux-8-master-py3: {extends: '.test_instance'}
197+
almalinux-8-master-py3: {extends: '.test_instance'}
198+
# default-rockylinux-8-master-py3: {extends: '.test_instance'}
199+
# repo-rockylinux-8-master-py3: {extends: '.test_instance'}
200+
rockylinux-8-master-py3: {extends: '.test_instance'}
158201
# default-debian-11-3003-1-py3: {extends: '.test_instance'}
159202
# default-debian-10-3003-1-py3: {extends: '.test_instance'}
160203
# default-debian-9-3003-1-py3: {extends: '.test_instance'}

.travis.yml

Lines changed: 52 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -95,26 +95,62 @@ jobs:
9595
# - env: INSTANCE=default-oraclelinux-7-tiamat-py3
9696
# - env: INSTANCE=default-almalinux-8-tiamat-py3
9797
# - env: INSTANCE=default-rockylinux-8-tiamat-py3
98-
- env: INSTANCE=default-debian-11-master-py3
99-
- env: INSTANCE=default-debian-10-master-py3
100-
- env: INSTANCE=default-debian-9-master-py3
101-
- env: INSTANCE=default-ubuntu-2004-master-py3
102-
- env: INSTANCE=default-ubuntu-1804-master-py3
103-
- env: INSTANCE=default-centos-8-master-py3
104-
- env: INSTANCE=default-centos-7-master-py3
105-
- env: INSTANCE=default-fedora-34-master-py3
106-
- env: INSTANCE=default-fedora-33-master-py3
107-
- env: INSTANCE=default-opensuse-leap-153-master-py3
108-
- env: INSTANCE=default-opensuse-leap-152-master-py3
98+
# - env: INSTANCE=default-debian-11-master-py3
99+
# - env: INSTANCE=repo-debian-11-master-py3
100+
- env: INSTANCE=debian-11-master-py3
101+
# - env: INSTANCE=default-debian-10-master-py3
102+
# - env: INSTANCE=repo-debian-10-master-py3
103+
- env: INSTANCE=debian-10-master-py3
104+
# - env: INSTANCE=default-debian-9-master-py3
105+
# - env: INSTANCE=repo-debian-9-master-py3
106+
- env: INSTANCE=debian-9-master-py3
107+
# - env: INSTANCE=default-ubuntu-2004-master-py3
108+
# - env: INSTANCE=repo-ubuntu-2004-master-py3
109+
- env: INSTANCE=ubuntu-2004-master-py3
110+
# - env: INSTANCE=default-ubuntu-1804-master-py3
111+
# - env: INSTANCE=repo-ubuntu-1804-master-py3
112+
- env: INSTANCE=ubuntu-1804-master-py3
113+
# - env: INSTANCE=default-centos-8-master-py3
114+
# - env: INSTANCE=repo-centos-8-master-py3
115+
- env: INSTANCE=centos-8-master-py3
116+
# - env: INSTANCE=default-centos-7-master-py3
117+
# - env: INSTANCE=repo-centos-7-master-py3
118+
- env: INSTANCE=centos-7-master-py3
119+
# - env: INSTANCE=default-fedora-34-master-py3
120+
# - env: INSTANCE=repo-fedora-34-master-py3
121+
- env: INSTANCE=fedora-34-master-py3
122+
# - env: INSTANCE=default-fedora-33-master-py3
123+
# - env: INSTANCE=repo-fedora-33-master-py3
124+
- env: INSTANCE=fedora-33-master-py3
125+
# - env: INSTANCE=default-opensuse-leap-153-master-py3
126+
# - env: INSTANCE=repo-opensuse-leap-153-master-py3
127+
- env: INSTANCE=opensuse-leap-153-master-py3
128+
# - env: INSTANCE=default-opensuse-leap-152-master-py3
129+
# - env: INSTANCE=repo-opensuse-leap-152-master-py3
130+
- env: INSTANCE=opensuse-leap-152-master-py3
109131
- env: INSTANCE=default-opensuse-tmbl-latest-master-py3
110-
- env: INSTANCE=default-amazonlinux-2-master-py3
111-
- env: INSTANCE=default-oraclelinux-8-master-py3
112-
- env: INSTANCE=default-oraclelinux-7-master-py3
132+
# - env: INSTANCE=opensuse-tmbl-latest-master-py3
133+
# - env: INSTANCE=default-amazonlinux-2-master-py3
134+
# - env: INSTANCE=repo-amazonlinux-2-master-py3
135+
- env: INSTANCE=amazonlinux-2-master-py3
136+
# - env: INSTANCE=default-oraclelinux-8-master-py3
137+
# - env: INSTANCE=repo-oraclelinux-8-master-py3
138+
- env: INSTANCE=oraclelinux-8-master-py3
139+
# - env: INSTANCE=default-oraclelinux-7-master-py3
140+
# - env: INSTANCE=repo-oraclelinux-7-master-py3
141+
- env: INSTANCE=oraclelinux-7-master-py3
113142
- env: INSTANCE=default-arch-base-latest-master-py3
143+
# - env: INSTANCE=arch-base-latest-master-py3
114144
# - env: INSTANCE=default-gentoo-stage3-latest-master-py3
145+
# - env: INSTANCE=gentoo-stage3-latest-master-py3
115146
# - env: INSTANCE=default-gentoo-stage3-systemd-master-py3
116-
- env: INSTANCE=default-almalinux-8-master-py3
117-
- env: INSTANCE=default-rockylinux-8-master-py3
147+
# - env: INSTANCE=gentoo-stage3-systemd-master-py3
148+
# - env: INSTANCE=default-almalinux-8-master-py3
149+
# - env: INSTANCE=repo-almalinux-8-master-py3
150+
- env: INSTANCE=almalinux-8-master-py3
151+
# - env: INSTANCE=default-rockylinux-8-master-py3
152+
# - env: INSTANCE=repo-rockylinux-8-master-py3
153+
- env: INSTANCE=rockylinux-8-master-py3
118154
# - env: INSTANCE=default-debian-11-3003-1-py3
119155
# - env: INSTANCE=default-debian-10-3003-1-py3
120156
# - env: INSTANCE=default-debian-9-3003-1-py3

kitchen.yml

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -445,3 +445,103 @@ suites:
445445
verifier:
446446
inspec_tests:
447447
- path: test/integration/default
448+
- name: repo
449+
includes:
450+
- debian-11-tiamat-py3
451+
- debian-10-tiamat-py3
452+
- debian-9-tiamat-py3
453+
- ubuntu-2004-tiamat-py3
454+
- ubuntu-1804-tiamat-py3
455+
- centos-8-tiamat-py3
456+
- centos-7-tiamat-py3
457+
- amazonlinux-2-tiamat-py3
458+
- oraclelinux-8-tiamat-py3
459+
- oraclelinux-7-tiamat-py3
460+
- almalinux-8-tiamat-py3
461+
- rockylinux-8-tiamat-py3
462+
- debian-11-master-py3
463+
- debian-10-master-py3
464+
- debian-9-master-py3
465+
- ubuntu-2004-master-py3
466+
- ubuntu-1804-master-py3
467+
- centos-8-master-py3
468+
- centos-7-master-py3
469+
- fedora-34-master-py3
470+
- fedora-33-master-py3
471+
- opensuse-leap-153-master-py3
472+
- opensuse-leap-152-master-py3
473+
- amazonlinux-2-master-py3
474+
- oraclelinux-8-master-py3
475+
- oraclelinux-7-master-py3
476+
- almalinux-8-master-py3
477+
- rockylinux-8-master-py3
478+
- debian-11-3003-1-py3
479+
- debian-10-3003-1-py3
480+
- debian-9-3003-1-py3
481+
- ubuntu-2004-3003-1-py3
482+
- ubuntu-1804-3003-1-py3
483+
- centos-8-3003-1-py3
484+
- centos-7-3003-1-py3
485+
- fedora-34-3003-1-py3
486+
- fedora-33-3003-1-py3
487+
- opensuse-leap-153-3003-1-py3
488+
- opensuse-leap-152-3003-1-py3
489+
- amazonlinux-2-3003-1-py3
490+
- oraclelinux-8-3003-1-py3
491+
- oraclelinux-7-3003-1-py3
492+
- debian-11-3002-6-py3
493+
- debian-10-3002-6-py3
494+
- debian-9-3002-6-py3
495+
- ubuntu-2004-3002-6-py3
496+
- ubuntu-1804-3002-6-py3
497+
- centos-8-3002-6-py3
498+
- centos-7-3002-6-py3
499+
- fedora-34-3002-6-py3
500+
- fedora-33-3002-6-py3
501+
- amazonlinux-2-3002-6-py3
502+
- oraclelinux-8-3002-6-py3
503+
- oraclelinux-7-3002-6-py3
504+
- opensuse-leap-153-3002-2-py3
505+
- opensuse-leap-152-3002-2-py3
506+
- debian-10-3001-7-py3
507+
- debian-9-3001-7-py3
508+
- ubuntu-2004-3001-7-py3
509+
- ubuntu-1804-3001-7-py3
510+
- centos-8-3001-7-py3
511+
- centos-7-3001-7-py3
512+
- fedora-34-3001-7-py3
513+
- fedora-33-3001-7-py3
514+
- opensuse-leap-153-3001-7-py3
515+
- opensuse-leap-152-3001-7-py3
516+
- amazonlinux-2-3001-7-py3
517+
- oraclelinux-8-3001-7-py3
518+
- oraclelinux-7-3001-7-py3
519+
- debian-10-3000-9-py3
520+
- debian-9-3000-9-py3
521+
- ubuntu-1804-3000-9-py3
522+
- centos-8-3000-9-py3
523+
- centos-7-3000-9-py3
524+
- opensuse-leap-153-3000-9-py3
525+
- opensuse-leap-152-3000-9-py3
526+
- amazonlinux-2-3000-9-py3
527+
- oraclelinux-8-3000-9-py3
528+
- oraclelinux-7-3000-9-py3
529+
- ubuntu-1804-3000-9-py2
530+
provisioner:
531+
state_top:
532+
base:
533+
'*':
534+
- postgres._mapdata
535+
- postgres
536+
pillars:
537+
top.sls:
538+
base:
539+
'*':
540+
- postgres
541+
- repo
542+
pillars_from_files:
543+
postgres.sls: test/salt/pillar/postgres.sls
544+
repo.sls: test/salt/pillar/repo.sls
545+
verifier:
546+
inspec_tests:
547+
- path: test/integration/repo

test/integration/repo/README.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# InSpec Profile: `repo`
2+
3+
This shows the implementation of the `repo` 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 repo
11+
Summary
12+
-------
13+
Location: repo
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 repo
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 repo --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).

test/integration/repo/inspec.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# -*- coding: utf-8 -*-
2+
# vim: ft=yaml
3+
---
4+
name: repo
5+
title: postgres formula
6+
maintainer: SaltStack Formulas
7+
license: Apache-2.0
8+
# yamllint disable-line rule:line-length
9+
summary: Verify that the postgres formula is setup and configured correctly (when installing from the upstream repo)
10+
depends:
11+
- name: share
12+
path: test/integration/share
13+
supports:
14+
- platform-name: debian
15+
- platform-name: ubuntu
16+
- platform-name: centos
17+
- platform-name: fedora
18+
- platform-name: opensuse
19+
- platform-name: suse
20+
- platform-name: freebsd
21+
- platform-name: openbsd
22+
- platform-name: amazon
23+
- platform-name: oracle
24+
- platform-name: arch
25+
- platform-name: gentoo
26+
- platform-name: almalinux
27+
- platform-name: rocky
28+
- platform: windows

0 commit comments

Comments
 (0)