Skip to content

Commit a263a62

Browse files
committed
ci(kitchen+travis+inspec): add vimrc suite
* Automated using myii/ssf-formula#91
1 parent a1ef7e5 commit a263a62

4 files changed

Lines changed: 93 additions & 1 deletion

File tree

.travis.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ jobs:
5050
## Define the rest of the matrix based on Kitchen testing
5151
# Make sure the instances listed below match up with
5252
# the `platforms` defined in `kitchen.yml`
53-
- env: INSTANCE=default-debian-10-master-py3
53+
# - env: INSTANCE=default-debian-10-master-py3
54+
- env: INSTANCE=vimrc-debian-10-master-py3
5455
# - env: INSTANCE=default-ubuntu-1804-master-py3
5556
# - env: INSTANCE=default-centos-8-master-py3
5657
# - env: INSTANCE=default-fedora-31-master-py3

kitchen.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,3 +190,26 @@ suites:
190190
verifier:
191191
inspec_tests:
192192
- path: test/integration/default
193+
- name: vimrc
194+
provisioner:
195+
state_top:
196+
base:
197+
'*':
198+
- users.vimrc
199+
pillars:
200+
top.sls:
201+
base:
202+
'*':
203+
- users
204+
- vimrc
205+
pillars_from_files:
206+
users.sls: test/salt/pillar/default.sls
207+
vimrc.sls: test/salt/pillar/vimrc.sls
208+
dependencies:
209+
- name: vim
210+
repo: git
211+
source: https://github.com/saltstack-formulas/vim-formula.git
212+
verifier:
213+
inspec_tests:
214+
- path: test/integration/default
215+
- path: test/integration/vimrc

test/integration/vimrc/README.md

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

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: vimrc
5+
title: users formula
6+
maintainer: SaltStack Formulas
7+
license: Apache-2.0
8+
summary: Verify that the `.vimrc` file is configured correctly for specified users
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

0 commit comments

Comments
 (0)