-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #156 from chef-cookbooks/pw/chef13
update chef_ingredient resource timeout property to be chef 13 compliant - add appveyor tests
- Loading branch information
Showing
9 changed files
with
116 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
driver: | ||
name: proxy | ||
host: localhost | ||
reset_command: "exit 0" | ||
port: 5985 | ||
username: <%= ENV["machine_user"] %> | ||
password: <%= ENV["machine_pass"] %> | ||
|
||
provisioner: | ||
name: chef_zero | ||
|
||
platforms: | ||
- name: windows-2012R2 | ||
|
||
suites: | ||
- name: inspec | ||
run_list: | ||
- recipe[test::inspec] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
environment: | ||
machine_user: vagrant | ||
machine_pass: vagrant | ||
KITCHEN_YAML: .kitchen.appveyor.yml | ||
|
||
# Do not build on tags (GitHub only) | ||
skip_tags: true | ||
|
||
#faster cloning | ||
clone_depth: 1 | ||
|
||
# Install the latest nightly of ChefDK | ||
install: | ||
- ps: iex (irm https://omnitruck.chef.io/install.ps1); Install-Project -Project chefdk -channel current | ||
- ps: 'Get-CimInstance win32_operatingsystem -Property Caption, OSArchitecture, Version | fl Caption, OSArchitecture, Version' | ||
- ps: $PSVersionTable | ||
- c:\opscode\chefdk\bin\chef.bat exec ruby --version | ||
- ps: secedit /export /cfg $env:temp/export.cfg | ||
- ps: ((get-content $env:temp/export.cfg) -replace ('PasswordComplexity = 1', 'PasswordComplexity = 0')) | Out-File $env:temp/export.cfg | ||
- ps: ((get-content $env:temp/export.cfg) -replace ('MinimumPasswordLength = 8', 'MinimumPasswordLength = 0')) | Out-File $env:temp/export.cfg | ||
- ps: secedit /configure /db $env:windir/security/new.sdb /cfg $env:temp/export.cfg /areas SECURITYPOLICY | ||
- ps: net user /add $env:machine_user $env:machine_pass | ||
- ps: net localgroup administrators $env:machine_user /add | ||
|
||
build_script: | ||
- ps: c:\opscode\chefdk\bin\chef.bat shell-init powershell | iex; cmd /c c:\opscode\chefdk\bin\chef.bat --version | ||
|
||
test_script: | ||
- c:\opscode\chefdk\bin\cookstyle --version | ||
- c:\opscode\chefdk\bin\chef.bat exec foodcritic --version | ||
- c:\opscode\chefdk\bin\chef.bat exec delivery local all | ||
- c:\opscode\chefdk\bin\chef.bat exec kitchen verify | ||
|
||
deploy: off |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,11 @@ | ||
chef_ingredient 'install old chefdk version' do | ||
product_name 'chefdk' | ||
action :install | ||
channel :stable | ||
version '1.1.16' | ||
end | ||
|
||
chef_ingredient 'upgrade to newer chefdk version' do | ||
product_name 'chefdk' | ||
action :upgrade | ||
channel :stable | ||
version '1.2.22' | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
chef_ingredient 'install old inspec version' do | ||
product_name 'inspec' | ||
version '1.19.2' | ||
platform_version_compatibility_mode true | ||
end | ||
|
||
chef_ingredient 'upgrade to newer inspec version' do | ||
product_name 'inspec' | ||
action :upgrade | ||
version '1.20.0' | ||
platform_version_compatibility_mode true | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,5 @@ | ||
describe 'test::chefdk' do | ||
it 'chefdk should print a version' do | ||
command = if os.windows? | ||
`C:\\opscode\\chefdk\\bin\\chef --version` | ||
else | ||
`/opt/chefdk/bin/chef --version` | ||
end | ||
resource_command = os.windows? ? 'powershell' : 'command' | ||
|
||
expect(command).to include('Chef Development Kit Version:') | ||
end | ||
describe send(resource_command, 'chef --version') do | ||
its('stdout') { should match /Chef Development Kit Version: 1.2.22/ } | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# The way this spec is written is more of an experiment. Executing Windows programs for the first time | ||
# via inspec require the fully qualified path. Even though the bin has been added to $env:Path the session | ||
# has not been reloaded. This reloads $env:Path before calling the program. I could see this being beneficial to | ||
# inspec's default behavior. | ||
|
||
resource_command = 'command' | ||
|
||
if os.windows? | ||
resource_command = 'powershell' | ||
|
||
describe powershell('$env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User")') do | ||
its('exit_status') { should eq 0 } | ||
end | ||
end | ||
|
||
describe send(resource_command, 'inspec --version') do | ||
its('stdout') { should match /1.20.0/ } | ||
end |