File tree Expand file tree Collapse file tree 11 files changed +202
-3
lines changed Expand file tree Collapse file tree 11 files changed +202
-3
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ name : CI
3+
4+ ' on ' : [push, pull_request]
5+
6+ env :
7+ machine_user : kitchen
8+ machine_pass : Pass@word1
9+ machine_port : 5985
10+ KITCHEN_LOCAL_YAML : kitchen.github.yml
11+
12+ jobs :
13+ build :
14+ runs-on : windows-latest
15+
16+ steps :
17+ - uses : actions/checkout@v2
18+ - uses : actions/cache@v1
19+ with :
20+ path : vendor/bundle
21+ key : ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
22+ restore-keys : |
23+ ${{ runner.os }}-gems-
24+ - shell : powershell
25+ run : |
26+ $password = ConvertTo-SecureString $env:machine_pass -AsPlainText -Force
27+ New-LocalUser $env:machine_user -Password $password
28+ Add-LocalGroupMember -Group "Administrators" -Member $env:machine_user
29+ - shell : powershell
30+ run : >
31+ Set-WSManQuickConfig -Force;
32+ Set-WSManInstance -ResourceURI winrm/config/service
33+ -ValueSet @{AllowUnencrypted="true"}
34+ - run : gem install bundler --quiet --no-document
35+ - name : Bundle install
36+ run : |
37+ bundle config path vendor/bundle
38+ bundle install --jobs 4 --retry 3
39+ - run : bundle exec kitchen test
Original file line number Diff line number Diff line change @@ -5,3 +5,7 @@ source 'https://rubygems.org'
55gem 'kitchen-docker' , '>= 2.9'
66gem 'kitchen-inspec' , '>= 1.1'
77gem 'kitchen-salt' , '>= 0.6.0'
8+
9+ group :vagrant do
10+ gem 'kitchen-vagrant'
11+ end
Original file line number Diff line number Diff line change 287287 kitchen-salt (0.6.3 )
288288 hashie (>= 3.5 )
289289 test-kitchen (>= 1.4 )
290+ kitchen-vagrant (1.6.1 )
291+ test-kitchen (>= 1.4 , < 3 )
290292 libyajl2 (1.2.0 )
291293 license-acceptance (1.0.19 )
292294 pastel (~> 0.7 )
@@ -526,6 +528,7 @@ DEPENDENCIES
526528 kitchen-docker (>= 2.9 )
527529 kitchen-inspec (>= 1.1 )
528530 kitchen-salt (>= 0.6.0 )
531+ kitchen-vagrant
529532
530533BUNDLED WITH
531534 2.1.2
Original file line number Diff line number Diff line change 1+ ---
2+ driver :
3+ name : proxy
4+ host : localhost
5+ reset_command : " exit 0"
6+ port : 5985
7+ username : kitchen
8+ password : Pass@word1
9+
10+ platforms :
11+ - name : windows-81-latest-py3
12+
13+ provisioner :
14+ salt_install : bootstrap
15+ salt_bootstrap_options : -pythonVersion 3
16+ init_environment : " "
Original file line number Diff line number Diff line change 1+ # -*- coding: utf-8 -*-
2+ # vim: ft=yaml
3+ ---
4+ driver :
5+ name : vagrant
6+
7+ platforms :
8+ - name : windows-81-latest-py3
9+ driver :
10+ box : techneg/win81x64-pro-salt
11+ gui : false
12+ linked_clone : true
13+ provisioner :
14+ init_environment : " "
Original file line number Diff line number Diff line change @@ -333,3 +333,21 @@ suites:
333333 verifier :
334334 inspec_tests :
335335 - path : test/integration/default
336+ - name : windows
337+ includes :
338+ - windows-81-latest-py3
339+ provisioner :
340+ state_top :
341+ base :
342+ ' * ' :
343+ - packages.chocolatey
344+ pillars :
345+ top.sls :
346+ base :
347+ ' * ' :
348+ - packages
349+ pillars_from_files :
350+ packages.sls : test/salt/pillar/windows.sls
351+ verifier :
352+ inspec_tests :
353+ - path : test/integration/windows
Original file line number Diff line number Diff line change @@ -64,14 +64,14 @@ packages:
6464
6565 chocolatey :
6666 wanted :
67- firefox :
68- install_args : " l=fr-FR "
67+ Firefox :
68+ package_args : " /l:en-GB "
6969 packagename :
7070 version : ' 12.04'
7171 source : ' mychocolatey/source'
7272 force : true
7373 unwanted :
74- - googlechrome
74+ - GoogleChrome
7575
7676 snaps :
7777 wanted :
Original file line number Diff line number Diff line change 1+ # InSpec Profile: ` windows `
2+
3+ This shows the implementation of the ` windows ` 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 windows
11+ Summary
12+ -------
13+ Location: windows
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 windows
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 windows --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 ) .
Original file line number Diff line number Diff line change 1+ # frozen_string_literal: true
2+
3+ pkgs_wanted = %w[ Firefox jq notepadplusplus ]
4+ pkgs_unwanted = %w[ GoogleChrome hg ]
5+
6+ ### WANTED
7+ control 'Wanted packages' do
8+ title 'should be installed'
9+
10+ pkgs_wanted . each do |p |
11+ describe chocolatey_package ( p ) do
12+ it { should be_installed }
13+ end
14+ end
15+ end
16+
17+ ### UNWANTED
18+ control 'Unwanted packages' do
19+ title 'should be uninstalled'
20+
21+ pkgs_unwanted . each do |p |
22+ describe chocolatey_package ( p ) do
23+ it { should_not be_installed }
24+ end
25+ end
26+ end
Original file line number Diff line number Diff line change 1+ # -*- coding: utf-8 -*-
2+ # vim: ft=yaml
3+ ---
4+ name : windows
5+ title : packages formula
6+ maintainer : SaltStack Formulas
7+ license : Apache-2.0
8+ summary : Verify that the packages formula is setup and configured correctly (on Windows)
9+ supports :
10+ - platform : windows
You can’t perform that action at this time.
0 commit comments