onceover 3.20.0 → 3.22.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (150) hide show
  1. checksums.yaml +4 -4
  2. data/.devcontainer/devcontainer.json +31 -0
  3. data/.github/workflows/release.yaml +24 -0
  4. data/.github/workflows/tests.yaml +5 -8
  5. data/.gitignore +0 -1
  6. data/.rubocop.yml +1 -1
  7. data/.vscode/extensions.json +4 -0
  8. data/Gemfile +12 -0
  9. data/README.md +46 -2
  10. data/Rakefile +1 -0
  11. data/cucumber.yml +1 -0
  12. data/factsets/Windows_Server-2008r2-64.json +184 -184
  13. data/factsets/Windows_Server-2012r2-64.json +165 -165
  14. data/factsets/windows-10-64.json +104 -104
  15. data/features/step_definitions/run.rb +4 -0
  16. data/features/zzz_run.feature +2 -8
  17. data/lib/onceover/beaker/spec_helper.rb +8 -8
  18. data/lib/onceover/cli/run.rb +1 -0
  19. data/lib/onceover/cli/show.rb +1 -1
  20. data/lib/onceover/controlrepo.rb +62 -34
  21. data/lib/onceover/deploy.rb +6 -3
  22. data/lib/onceover/rspec/formatters.rb +2 -4
  23. data/lib/onceover/runner.rb +2 -1
  24. data/lib/onceover/test.rb +1 -1
  25. data/lib/onceover/testconfig.rb +4 -2
  26. data/onceover.gemspec +6 -11
  27. data/spec/fixtures/controlrepos/caching/Puppetfile +17 -17
  28. data/spec/fixtures/controlrepos/puppet_controlrepo/.atom-build.json +9 -0
  29. data/spec/fixtures/controlrepos/puppet_controlrepo/.gitignore +5 -0
  30. data/spec/fixtures/controlrepos/puppet_controlrepo/.ruby-version +1 -0
  31. data/spec/fixtures/controlrepos/puppet_controlrepo/.travis.yml +13 -0
  32. data/spec/fixtures/controlrepos/puppet_controlrepo/Gemfile +22 -0
  33. data/spec/fixtures/controlrepos/puppet_controlrepo/Jenkinsfile +50 -0
  34. data/spec/fixtures/controlrepos/puppet_controlrepo/Puppetfile +102 -0
  35. data/spec/fixtures/controlrepos/puppet_controlrepo/README.md +4 -0
  36. data/spec/fixtures/controlrepos/puppet_controlrepo/Rakefile +6 -0
  37. data/spec/fixtures/controlrepos/puppet_controlrepo/data/common.yaml +558 -0
  38. data/spec/fixtures/controlrepos/puppet_controlrepo/data/datacenter/melbourne.yaml +12 -0
  39. data/spec/fixtures/controlrepos/puppet_controlrepo/data/datacenter/singapore.yaml +12 -0
  40. data/spec/fixtures/controlrepos/puppet_controlrepo/data/environments/development.yaml +3 -0
  41. data/spec/fixtures/controlrepos/puppet_controlrepo/data/environments/production.yaml +3 -0
  42. data/spec/fixtures/controlrepos/puppet_controlrepo/data/size/vol.large.yaml +27 -0
  43. data/spec/fixtures/controlrepos/puppet_controlrepo/environment.conf +3 -0
  44. data/spec/fixtures/controlrepos/puppet_controlrepo/hiera.yaml +25 -0
  45. data/spec/fixtures/controlrepos/puppet_controlrepo/manifests/site.pp +11 -0
  46. data/spec/fixtures/controlrepos/puppet_controlrepo/scripts/code_manager_config_version.rb +19 -0
  47. data/spec/fixtures/controlrepos/puppet_controlrepo/scripts/config_version.rb +25 -0
  48. data/spec/fixtures/controlrepos/puppet_controlrepo/scripts/config_version.sh +12 -0
  49. data/spec/fixtures/controlrepos/puppet_controlrepo/scripts/count_changed_classes.rb +26 -0
  50. data/spec/fixtures/controlrepos/puppet_controlrepo/scripts/get_changed_classes.rb +26 -0
  51. data/spec/fixtures/controlrepos/puppet_controlrepo/site-modules/console/functions/user/token.pp +10 -0
  52. data/spec/fixtures/controlrepos/puppet_controlrepo/site-modules/console/manifests/init.pp +14 -0
  53. data/spec/fixtures/controlrepos/puppet_controlrepo/site-modules/console/manifests/user.pp +35 -0
  54. data/spec/fixtures/controlrepos/puppet_controlrepo/site-modules/deployments/lib/puppet/functions/deployments/generate.rb +15 -0
  55. data/spec/fixtures/controlrepos/puppet_controlrepo/site-modules/deployments/plans/signed_deployment.pp +126 -0
  56. data/spec/fixtures/controlrepos/puppet_controlrepo/site-modules/profile/facts.d/test.sh +2 -0
  57. data/spec/fixtures/controlrepos/puppet_controlrepo/site-modules/profile/files/artifactory/config_descriptor.xml +265 -0
  58. data/spec/fixtures/controlrepos/puppet_controlrepo/site-modules/profile/files/autosign.sh +23 -0
  59. data/spec/fixtures/controlrepos/puppet_controlrepo/site-modules/profile/files/hudson.tasks.Shell.xml +4 -0
  60. data/spec/fixtures/controlrepos/puppet_controlrepo/site-modules/profile/files/motd +4 -0
  61. data/spec/fixtures/controlrepos/puppet_controlrepo/site-modules/profile/files/polar_clock/index.html +198 -0
  62. data/spec/fixtures/controlrepos/puppet_controlrepo/site-modules/profile/manifests/apt.pp +9 -0
  63. data/spec/fixtures/controlrepos/puppet_controlrepo/site-modules/profile/manifests/aws_nodes.pp +54 -0
  64. data/spec/fixtures/controlrepos/puppet_controlrepo/site-modules/profile/manifests/base/aws.pp +9 -0
  65. data/spec/fixtures/controlrepos/puppet_controlrepo/site-modules/profile/manifests/base/rhel.pp +50 -0
  66. data/spec/fixtures/controlrepos/puppet_controlrepo/site-modules/profile/manifests/base/windows/hardening.pp +57 -0
  67. data/spec/fixtures/controlrepos/puppet_controlrepo/site-modules/profile/manifests/base/windows.pp +52 -0
  68. data/spec/fixtures/controlrepos/puppet_controlrepo/site-modules/profile/manifests/base.pp +79 -0
  69. data/spec/fixtures/controlrepos/puppet_controlrepo/site-modules/profile/manifests/cd4pe/artifactory.pp +64 -0
  70. data/spec/fixtures/controlrepos/puppet_controlrepo/site-modules/profile/manifests/cd4pe/connection.pp +95 -0
  71. data/spec/fixtures/controlrepos/puppet_controlrepo/site-modules/profile/manifests/cd4pe/haproxy.pp +65 -0
  72. data/spec/fixtures/controlrepos/puppet_controlrepo/site-modules/profile/manifests/cd4pe/replicated.pp +53 -0
  73. data/spec/fixtures/controlrepos/puppet_controlrepo/site-modules/profile/manifests/compile/balancer.pp +28 -0
  74. data/spec/fixtures/controlrepos/puppet_controlrepo/site-modules/profile/manifests/compile/master.pp +19 -0
  75. data/spec/fixtures/controlrepos/puppet_controlrepo/site-modules/profile/manifests/dns/host_record.pp +16 -0
  76. data/spec/fixtures/controlrepos/puppet_controlrepo/site-modules/profile/manifests/dns/server.pp +66 -0
  77. data/spec/fixtures/controlrepos/puppet_controlrepo/site-modules/profile/manifests/docker.pp +5 -0
  78. data/spec/fixtures/controlrepos/puppet_controlrepo/site-modules/profile/manifests/eyeunify/base.pp +43 -0
  79. data/spec/fixtures/controlrepos/puppet_controlrepo/site-modules/profile/manifests/eyeunify/core/database_connection.pp +42 -0
  80. data/spec/fixtures/controlrepos/puppet_controlrepo/site-modules/profile/manifests/eyeunify/core.pp +72 -0
  81. data/spec/fixtures/controlrepos/puppet_controlrepo/site-modules/profile/manifests/eyeunify/ctrl.pp +57 -0
  82. data/spec/fixtures/controlrepos/puppet_controlrepo/site-modules/profile/manifests/eyeunify/database.pp +32 -0
  83. data/spec/fixtures/controlrepos/puppet_controlrepo/site-modules/profile/manifests/eyeunify/exec.pp +11 -0
  84. data/spec/fixtures/controlrepos/puppet_controlrepo/site-modules/profile/manifests/file_sync/client.pp +165 -0
  85. data/spec/fixtures/controlrepos/puppet_controlrepo/site-modules/profile/manifests/file_sync/master_patch.pp +37 -0
  86. data/spec/fixtures/controlrepos/puppet_controlrepo/site-modules/profile/manifests/grafana/dashboard.pp +17 -0
  87. data/spec/fixtures/controlrepos/puppet_controlrepo/site-modules/profile/manifests/haproxy.pp +43 -0
  88. data/spec/fixtures/controlrepos/puppet_controlrepo/site-modules/profile/manifests/init.pp +3 -0
  89. data/spec/fixtures/controlrepos/puppet_controlrepo/site-modules/profile/manifests/jenkins/plugins.pp +87 -0
  90. data/spec/fixtures/controlrepos/puppet_controlrepo/site-modules/profile/manifests/jenkins.pp +65 -0
  91. data/spec/fixtures/controlrepos/puppet_controlrepo/site-modules/profile/manifests/jira/aio.pp +39 -0
  92. data/spec/fixtures/controlrepos/puppet_controlrepo/site-modules/profile/manifests/jira/app.pp +27 -0
  93. data/spec/fixtures/controlrepos/puppet_controlrepo/site-modules/profile/manifests/jira/db.pp +25 -0
  94. data/spec/fixtures/controlrepos/puppet_controlrepo/site-modules/profile/manifests/metrics/collectd/compile.pp +82 -0
  95. data/spec/fixtures/controlrepos/puppet_controlrepo/site-modules/profile/manifests/metrics/collectd.pp +28 -0
  96. data/spec/fixtures/controlrepos/puppet_controlrepo/site-modules/profile/manifests/metrics/dashboard.pp +28 -0
  97. data/spec/fixtures/controlrepos/puppet_controlrepo/site-modules/profile/manifests/mysql_server.pp +7 -0
  98. data/spec/fixtures/controlrepos/puppet_controlrepo/site-modules/profile/manifests/nginx.pp +24 -0
  99. data/spec/fixtures/controlrepos/puppet_controlrepo/site-modules/profile/manifests/polar_clock.pp +55 -0
  100. data/spec/fixtures/controlrepos/puppet_controlrepo/site-modules/profile/manifests/puppetmaster/api_auth.pp +82 -0
  101. data/spec/fixtures/controlrepos/puppet_controlrepo/site-modules/profile/manifests/puppetmaster/autosign.pp +33 -0
  102. data/spec/fixtures/controlrepos/puppet_controlrepo/site-modules/profile/manifests/puppetmaster/aws.pp +58 -0
  103. data/spec/fixtures/controlrepos/puppet_controlrepo/site-modules/profile/manifests/puppetmaster/tuning.pp +139 -0
  104. data/spec/fixtures/controlrepos/puppet_controlrepo/site-modules/profile/manifests/puppetmaster.pp +139 -0
  105. data/spec/fixtures/controlrepos/puppet_controlrepo/site-modules/profile/manifests/rvm.pp +13 -0
  106. data/spec/fixtures/controlrepos/puppet_controlrepo/site-modules/profile/manifests/sumologic.pp +11 -0
  107. data/spec/fixtures/controlrepos/puppet_controlrepo/site-modules/profile/manifests/sunburst/windows.pp +104 -0
  108. data/spec/fixtures/controlrepos/puppet_controlrepo/site-modules/profile/manifests/vagrant.pp +25 -0
  109. data/spec/fixtures/controlrepos/puppet_controlrepo/site-modules/profile/manifests/windows/webserver.pp +27 -0
  110. data/spec/fixtures/controlrepos/puppet_controlrepo/site-modules/profile/templates/cd4pe/connection_script.sh.epp +110 -0
  111. data/spec/fixtures/controlrepos/puppet_controlrepo/site-modules/profile/templates/controlrepo_deploy_jenkins_job.xml.epp +51 -0
  112. data/spec/fixtures/controlrepos/puppet_controlrepo/site-modules/profile/templates/dashboard.json.epp +403 -0
  113. data/spec/fixtures/controlrepos/puppet_controlrepo/site-modules/profile/templates/jenkins_secret_text.json.epp +1 -0
  114. data/spec/fixtures/controlrepos/puppet_controlrepo/site-modules/profile/templates/onceover_jenkins_job.xml.epp +51 -0
  115. data/spec/fixtures/controlrepos/puppet_controlrepo/site-modules/profile/templates/userdata.epp +17 -0
  116. data/spec/fixtures/controlrepos/puppet_controlrepo/site-modules/role/manifests/cd4pe.pp +29 -0
  117. data/spec/fixtures/controlrepos/puppet_controlrepo/site-modules/role/manifests/clock.pp +16 -0
  118. data/spec/fixtures/controlrepos/puppet_controlrepo/site-modules/role/manifests/compile/balancer.pp +5 -0
  119. data/spec/fixtures/controlrepos/puppet_controlrepo/site-modules/role/manifests/compile/master.pp +5 -0
  120. data/spec/fixtures/controlrepos/puppet_controlrepo/site-modules/role/manifests/eyeunify/aio.pp +10 -0
  121. data/spec/fixtures/controlrepos/puppet_controlrepo/site-modules/role/manifests/eyeunify/controller.pp +10 -0
  122. data/spec/fixtures/controlrepos/puppet_controlrepo/site-modules/role/manifests/eyeunify/database.pp +7 -0
  123. data/spec/fixtures/controlrepos/puppet_controlrepo/site-modules/role/manifests/eyeunify/exec.pp +6 -0
  124. data/spec/fixtures/controlrepos/puppet_controlrepo/site-modules/role/manifests/init.pp +3 -0
  125. data/spec/fixtures/controlrepos/puppet_controlrepo/site-modules/role/manifests/lb.pp +14 -0
  126. data/spec/fixtures/controlrepos/puppet_controlrepo/site-modules/role/manifests/metrics.pp +5 -0
  127. data/spec/fixtures/controlrepos/puppet_controlrepo/site-modules/role/manifests/mysql.pp +13 -0
  128. data/spec/fixtures/controlrepos/puppet_controlrepo/site-modules/role/manifests/windows/base.pp +5 -0
  129. data/spec/fixtures/controlrepos/puppet_controlrepo/site-modules/role/manifests/windows/webserver.pp +6 -0
  130. data/spec/fixtures/controlrepos/puppet_controlrepo/spec/.gitignore +5 -0
  131. data/spec/fixtures/controlrepos/puppet_controlrepo/spec/acceptance/nodesets/onceover-nodes.yml +94 -0
  132. data/spec/fixtures/controlrepos/puppet_controlrepo/spec/classes/test_spec.rb +8 -0
  133. data/spec/fixtures/controlrepos/puppet_controlrepo/spec/factsets/CentOS-7.0-64-master-2017.3.2.json +531 -0
  134. data/spec/fixtures/controlrepos/puppet_controlrepo/spec/factsets/CentOS-7.0-64-master.json +429 -0
  135. data/spec/fixtures/controlrepos/puppet_controlrepo/spec/factsets/CentOS-7.0-64.json +353 -0
  136. data/spec/fixtures/controlrepos/puppet_controlrepo/spec/factsets/Windows_Server-2008r2-64.json +184 -0
  137. data/spec/fixtures/controlrepos/puppet_controlrepo/spec/factsets/Windows_Server-2012r2-64.json +165 -0
  138. data/spec/fixtures/controlrepos/puppet_controlrepo/spec/hiera.yaml +18 -0
  139. data/spec/fixtures/controlrepos/puppet_controlrepo/spec/matchers/file_matchers.rb +16 -0
  140. data/spec/fixtures/controlrepos/puppet_controlrepo/spec/onceover.yaml +54 -0
  141. data/spec/fixtures/controlrepos/puppet_controlrepo/spec/pre_conditions/site.pp +150 -0
  142. data/spec/fixtures/controlrepos/puppet_controlrepo/spec/r10k.yaml +2 -0
  143. data/spec/fixtures/controlrepos/puppet_controlrepo/spec/shared_examples/helper.rb +91 -0
  144. data/spec/fixtures/controlrepos/puppet_controlrepo/spec/unit/00_parse_spec.rb +76 -0
  145. data/spec/fixtures/controlrepos/puppet_controlrepo/spec/unit/01_linting_spec_example.rb +69 -0
  146. data/spec/fixtures/controlrepos/puppet_controlrepo/spec/unit/03_puppetfile_spec_example.rb +35 -0
  147. data/templates/spec_helper.rb.erb +0 -2
  148. data/templates/test_spec.rb.erb +3 -0
  149. metadata +136 -77
  150. data/.gitmodules +0 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2811ab38a0c86a251a20d2a95ad90781aad02860f5c914c7b8390999514ac633
4
- data.tar.gz: 912c30b4f6269bdb34ea097bc8f8594fc53e41b7ac279fb9cb1c3c921ec53966
3
+ metadata.gz: f3673b1ea11e712766d85ddd0c97ff68671d698acdb0fd0f0e516182f18a3ef1
4
+ data.tar.gz: 11037d12d4734ad69b94f335824154dc5056b61adb118c7a32a10ebb8f1034e7
5
5
  SHA512:
6
- metadata.gz: 46aadcc7dff48722a888c12e1508ac055060ae7408277b5fc25ad6abdfb56996ed93c63445ddfa7d714026512a87dc8f5df73d6618c4ad7c44ab9d76fefdbec2
7
- data.tar.gz: f0a9c6fa5c62f1f0e2b50a3a688bd476f7c6f8462dccc9c3ee4a484b1ff287172974ca24f38ff55dbbb19c839b36fc6eaf1b150c7beb1b5f8eafc84096c35f7b
6
+ metadata.gz: 2294e1581eadcda9f2305f2c63941c7f58d00ed9e232bd19b3f40a58b1e15a7c8aa6b56750c3a480694f3e2fdc2cf74b314363cf5fca84c4a07b24607cbc6d94
7
+ data.tar.gz: 250fed721814af4074477bd83d9ca77f41442c39d2476b09bd0fe15fba675a0d604077ca69d33cf861a4d318d4fe4785580b6dd8b30989ea5c7cd5e628314897
@@ -0,0 +1,31 @@
1
+ // For format details, see https://aka.ms/devcontainer.json. For config options, see the
2
+ // README at: https://github.com/devcontainers/templates/tree/main/src/debian
3
+ {
4
+ "name": "Debian",
5
+ // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
6
+ "image": "mcr.microsoft.com/devcontainers/ruby:3.2",
7
+ "features": {
8
+ "ghcr.io/devcontainers/features/github-cli:1": {}
9
+ },
10
+
11
+ "customizations": {
12
+ "vscode": {
13
+ "extensions": [
14
+ "CucumberOpen.cucumber-official",
15
+ "Shopify.ruby-extensions-pack"
16
+ ]
17
+ }
18
+ },
19
+
20
+ // Features to add to the dev container. More info: https://containers.dev/features.
21
+ // "features": {},
22
+
23
+ // Use 'forwardPorts' to make a list of ports inside the container available locally.
24
+ // "forwardPorts": [],
25
+
26
+ // Configure tool-specific properties.
27
+ // "customizations": {},
28
+
29
+ // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
30
+ // "remoteUser": "root"
31
+ }
@@ -0,0 +1,24 @@
1
+ name: Publish Gem
2
+
3
+ on:
4
+ workflow_dispatch:
5
+ jobs:
6
+ build:
7
+ runs-on: ubuntu-latest
8
+ permissions:
9
+ contents: write
10
+
11
+ steps:
12
+ - uses: actions/checkout@v3
13
+ - uses: fregante/setup-git-user@v2
14
+ - uses: ruby/setup-ruby@v1
15
+ with:
16
+ ruby-version: 3.2.3
17
+ bundler-cache: true # runs 'bundle install' and caches installed gems automatically
18
+
19
+ - name: Release Gem
20
+ uses: cadwallion/publish-rubygems-action@master
21
+ env:
22
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
23
+ RUBYGEMS_API_KEY: ${{ secrets.RUBYGEMS_API_KEY }}
24
+ RELEASE_COMMAND: bundle exec rake release
@@ -8,20 +8,17 @@ jobs:
8
8
  fail-fast: false
9
9
  matrix:
10
10
  os:
11
- - windows-2016
11
+ - windows-latest
12
12
  - ubuntu-latest
13
13
  - macos-latest
14
14
  puppet:
15
- - "~> 5.0"
16
- - "~> 6.0"
17
15
  - "~> 7.0"
16
+ - "~> 8.0"
18
17
  include:
19
- - puppet: "~> 5.0"
20
- ruby: 2.4
21
- - puppet: "~> 6.0"
22
- ruby: 2.5
23
18
  - puppet: "~> 7.0"
24
19
  ruby: 2.7
20
+ - puppet: "~> 8.0"
21
+ ruby: 3.2
25
22
 
26
23
  runs-on: ${{ matrix.os }}
27
24
  steps:
@@ -33,7 +30,7 @@ jobs:
33
30
  env:
34
31
  PUPPET_VERSION: ${{ matrix.puppet }}
35
32
  - name: Set long paths on Windows
36
- if: ${{ matrix.os == 'windows-2016' }}
33
+ if: ${{ matrix.os == 'windows-latest' }}
37
34
  run: Set-ItemProperty 'HKLM:\System\CurrentControlSet\Control\FileSystem' -Name 'LongPathsEnabled' -value 1
38
35
  - env:
39
36
  PUPPET_VERSION: ${{ matrix.puppet }}
data/.gitignore CHANGED
@@ -15,5 +15,4 @@ vendor
15
15
  /tags
16
16
 
17
17
  .cucumber
18
- .vscode
19
18
  .idea
data/.rubocop.yml CHANGED
@@ -1,5 +1,5 @@
1
1
  AllCops:
2
- TargetRubyVersion: 2.4 # this should match the oldest version in .github/workflows/tests.yaml's matrix
2
+ TargetRubyVersion: 2.4 # this should match the oldest version in .github/workflows/tests.yaml's matrix
3
3
  NewCops: enable
4
4
  Include:
5
5
  - "lib/**/*.rb"
@@ -0,0 +1,4 @@
1
+ {
2
+ "recommendations": [
3
+ ]
4
+ }
data/Gemfile CHANGED
@@ -8,6 +8,18 @@ if ENV['PUPPET_VERSION']
8
8
  gem 'puppet', ENV['PUPPET_VERSION']
9
9
  end
10
10
 
11
+ group :test do
12
+ # Required for the final controlrepo tests
13
+ gem 'toml-rb'
14
+ end
15
+
16
+ group :development do
17
+ gem 'pry'
18
+ gem 'cucumber'
19
+ gem 'rubocop'
20
+ gem 'rubygems-tasks'
21
+ end
22
+
11
23
  # Evaluate Gemfile.local if it exists
12
24
  if File.exist? "#{__FILE__}.local"
13
25
  eval(File.read("#{__FILE__}.local"), binding)
data/README.md CHANGED
@@ -146,7 +146,7 @@ Hopefully this config file will be fairly self explanatory once you see it, but
146
146
 
147
147
  In this section we can add functions that we want to mock when running spec tests.
148
148
 
149
- Each function takes the `return` arguments, e.g.
149
+ Each function takes the `returns` arguments, e.g.
150
150
 
151
151
  ```yaml
152
152
  functions:
@@ -225,7 +225,7 @@ node_groups:
225
225
  exclude: 'windows_nodes' # Then remove the windows ones from that list
226
226
  ```
227
227
 
228
- It's important to note that in order to reference a group using the *include/exclude* syntax is has to have been defined already i.e. it has to come above the group that references it
228
+ It's important to note that in order to reference a group using the *include/exclude* syntax it has to have been defined already i.e. it has to come above the group that references it
229
229
 
230
230
  #### Examples
231
231
 
@@ -384,6 +384,50 @@ In this case, you're all set and onceover will auto-magically pick those up for
384
384
 
385
385
  **Note**: The top level `trusted` hash takes precidence over the `trusted[extensions]` hash nested under `values`. Meaning that if you have any specified at the top level, any nested ones will not be considered. So pick **ONE** method and stick with that.
386
386
 
387
+ #### Trusted Certname
388
+ **Note:** When testing with Puppet >= 4.3 the trusted facts hash will have the standard trusted fact keys (certname, domain, and hostname) populated based on the node name (as set with :node).
389
+
390
+ To support the resolution of the trusted fact `certname` in auto-generated spec tests, onceover will set `:node` to the value of `trusted[certname]` where present in the source factset.
391
+
392
+ For example: A spec test generated by the factset below would result in `:node` == `node.puppetlabs.net`.
393
+
394
+ ```json
395
+ {
396
+ "name": "node.puppetlabs.net",
397
+ "values": {
398
+ "aio_agent_build": "1.10.4",
399
+ "aio_agent_version": "1.10.4",
400
+ "architecture": "x86_64",
401
+ "trusted": {
402
+ "certname": "node.puppetlabs.net",
403
+ "extensions": {
404
+ "pp_role": "agent",
405
+ "pp_datacenter": "puppet"
406
+ }
407
+ }
408
+ ```
409
+
410
+ If `trusted[certname]` is absent, the value of `:node` will default to the FQDN of the host running onceover. For example:
411
+
412
+ ```json
413
+ {
414
+ "name": "node.puppetlabs.net",
415
+ "values": {
416
+ "aio_agent_build": "1.10.4",
417
+ "aio_agent_version": "1.10.4",
418
+ "architecture": "x86_64",
419
+ "trusted": {
420
+ "extensions": {
421
+ "pp_role": "agent",
422
+ "pp_datacenter": "puppet"
423
+ }
424
+ }
425
+ ```
426
+
427
+ See the following rspec-puppet links for more information:
428
+ - [Specifying the FQDN of the test node](https://github.com/puppetlabs/rspec-puppet#specifying-the-fqdn-of-the-test-node)
429
+ - [Specifying trusted facts](https://github.com/puppetlabs/rspec-puppet#specifying-trusted-facts)
430
+
387
431
  #### Trusted External Data
388
432
 
389
433
  **Note:** This feature requires `rspec-puppet` >= 2.8.0.
data/Rakefile CHANGED
@@ -51,6 +51,7 @@ task :syntax do
51
51
  require 'find'
52
52
  Find.find(*paths) do |path|
53
53
  next unless path =~ /\.rb$/
54
+
54
55
  if windows?
55
56
  sh "ruby -cw #{path} > NUL"
56
57
  else
data/cucumber.yml ADDED
@@ -0,0 +1 @@
1
+ default: --publish-quiet
@@ -1,184 +1,184 @@
1
- {
2
- "name": "server2008r2a.pdx.puppetlabs.demo",
3
- "values": {
4
- "agent_specified_environment": "production",
5
- "aio_agent_build": "1.2.2",
6
- "aio_agent_version": "1.2.2",
7
- "architecture": "x64",
8
- "common_appdata": "C:\\ProgramData",
9
- "concat_basedir": "C:/ProgramData/PuppetLabs/puppet/cache/concat",
10
- "custom_auth_conf": "false",
11
- "datacenter": "portland",
12
- "dhcp_servers": {
13
- "Local Area Connection": "10.0.2.2"
14
- },
15
- "dmi": {
16
- "manufacturer": "innotek GmbH",
17
- "product": {
18
- "name": "VirtualBox",
19
- "serial_number": "0"
20
- }
21
- },
22
- "domain": "pdx.puppetlabs.demo",
23
- "env_windows_installdir": "C:\\Program Files\\Puppet Labs\\Puppet",
24
- "facterversion": "3.0.2",
25
- "fqdn": "server2008r2a.pdx.puppetlabs.demo",
26
- "hardwareisa": "x64",
27
- "hardwaremodel": "x86_64",
28
- "hostname": "server2008r2a",
29
- "id": "SERVER2008R2A\\vagrant",
30
- "identity": {
31
- "user": "SERVER2008R2A\\vagrant"
32
- },
33
- "iis_version": "Get-ItemProperty : Cannot find path 'HKLM:\\SOFTWARE\\Microsoft\\InetStp\\' because it does not exist.\nAt line:1 char:18\n+ (Get-ItemProperty <<<< HKLM:\\SOFTWARE\\Microsoft\\InetStp\\ -Name VersionString).VersionString.SubString(8,3)\n + CategoryInfo : ObjectNotFound: (HKLM:\\SOFTWARE\\Microsoft\\InetStp\\:String) [Get-ItemProperty], ItemNotFo \n undException\n + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetItemPropertyCommand\n \nYou cannot call a method on a null-valued expression.\nAt line:1 char:97\n+ (Get-ItemProperty HKLM:\\SOFTWARE\\Microsoft\\InetStp\\ -Name VersionString).VersionString.SubString <<<< (8,3)\n + CategoryInfo : InvalidOperation: (SubString:String) [], RuntimeException\n + FullyQualifiedErrorId : InvokeMethodOnNull\n \n",
34
- "interfaces": "Local Area Connection 2,Local Area Connection",
35
- "ipaddress": "10.20.1.101",
36
- "ipaddress6": "fe80::2c34:c353:1aaa:a872%13",
37
- "ipaddress6_Local Area Connection": "fe80::50f8:86eb:f103:75b%12",
38
- "ipaddress6_Local Area Connection 2": "fe80::2c34:c353:1aaa:a872%13",
39
- "ipaddress_Local Area Connection": "10.0.2.15",
40
- "ipaddress_Local Area Connection 2": "10.20.1.101",
41
- "is_admin": true,
42
- "is_pe": false,
43
- "is_virtual": true,
44
- "kernel": "windows",
45
- "kernelmajversion": "6.1",
46
- "kernelrelease": "6.1.7600",
47
- "kernelversion": "6.1.7600",
48
- "macaddress": "08:00:27:7B:C7:40",
49
- "macaddress_Local Area Connection": "08:00:27:AB:52:FB",
50
- "macaddress_Local Area Connection 2": "08:00:27:7B:C7:40",
51
- "manufacturer": "innotek GmbH",
52
- "memory": {
53
- "system": {
54
- "available": "448.14 MiB",
55
- "available_bytes": 469909504,
56
- "capacity": "56.22%",
57
- "total": "1023.55 MiB",
58
- "total_bytes": 1073274880,
59
- "used": "575.41 MiB",
60
- "used_bytes": 603365376
61
- }
62
- },
63
- "memoryfree": "448.14 MiB",
64
- "memoryfree_mb": 448.140625,
65
- "memorysize": "1023.55 MiB",
66
- "memorysize_mb": 1023.5546875,
67
- "mtu_Local Area Connection": 1500,
68
- "mtu_Local Area Connection 2": 1500,
69
- "mysql_server_id": 8583088,
70
- "netmask": "255.255.255.0",
71
- "netmask6": "ffff:ffff:ffff:ffff::",
72
- "netmask6_Local Area Connection": "ffff:ffff:ffff:ffff::",
73
- "netmask6_Local Area Connection 2": "ffff:ffff:ffff:ffff::",
74
- "netmask_Local Area Connection": "255.255.255.0",
75
- "netmask_Local Area Connection 2": "255.255.255.0",
76
- "network": "10.20.1.0",
77
- "network6": "fe80::%13",
78
- "network6_Local Area Connection": "fe80::%12",
79
- "network6_Local Area Connection 2": "fe80::%13",
80
- "network_Local Area Connection": "10.0.2.0",
81
- "network_Local Area Connection 2": "10.20.1.0",
82
- "networking": {
83
- "domain": "pdx.puppetlabs.demo",
84
- "fqdn": "server2008r2a.pdx.puppetlabs.demo",
85
- "hostname": "server2008r2a",
86
- "interfaces": {
87
- "Local Area Connection": {
88
- "dhcp": "10.0.2.2",
89
- "ip": "10.0.2.15",
90
- "ip6": "fe80::50f8:86eb:f103:75b%12",
91
- "mac": "08:00:27:AB:52:FB",
92
- "mtu": 1500,
93
- "netmask": "255.255.255.0",
94
- "netmask6": "ffff:ffff:ffff:ffff::",
95
- "network": "10.0.2.0",
96
- "network6": "fe80::%12"
97
- },
98
- "Local Area Connection 2": {
99
- "ip": "10.20.1.101",
100
- "ip6": "fe80::2c34:c353:1aaa:a872%13",
101
- "mac": "08:00:27:7B:C7:40",
102
- "mtu": 1500,
103
- "netmask": "255.255.255.0",
104
- "netmask6": "ffff:ffff:ffff:ffff::",
105
- "network": "10.20.1.0",
106
- "network6": "fe80::%13"
107
- }
108
- },
109
- "ip": "10.20.1.101",
110
- "ip6": "fe80::2c34:c353:1aaa:a872%13",
111
- "mac": "08:00:27:7B:C7:40",
112
- "mtu": 1500,
113
- "netmask": "255.255.255.0",
114
- "netmask6": "ffff:ffff:ffff:ffff::",
115
- "network": "10.20.1.0",
116
- "network6": "fe80::%13"
117
- },
118
- "operatingsystem": "windows",
119
- "operatingsystemmajrelease": "2008 R2",
120
- "operatingsystemrelease": "2008 R2",
121
- "os": {
122
- "architecture": "x64",
123
- "family": "windows",
124
- "hardware": "x86_64",
125
- "name": "windows",
126
- "release": {
127
- "full": "2008 R2",
128
- "major": "2008 R2"
129
- },
130
- "windows": {
131
- "system32": "C:\\Windows\\system32"
132
- }
133
- },
134
- "osfamily": "windows",
135
- "path": "C:/Program Files/Puppet Labs/Puppet/facter/bin;C:\\Program Files\\Puppet Labs\\Puppet\\puppet\\bin;C:\\Program Files\\Puppet Labs\\Puppet\\facter\\bin;C:\\Program Files\\Puppet Labs\\Puppet\\hiera\\bin;C:\\Program Files\\Puppet Labs\\Puppet\\mcollective\\bin;C:\\Program Files\\Puppet Labs\\Puppet\\bin;C:\\Program Files\\Puppet Labs\\Puppet\\sys\\ruby\\bin;C:\\Program Files\\Puppet Labs\\Puppet\\sys\\tools\\bin;%SystemRoot%\\system32\\WindowsPowerShell\\v1.0\\;C:\\Windows\\system32;C:\\Windows;C:\\Windows\\System32\\Wbem;C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\;C:\\Program Files\\Puppet Labs\\Puppet\\bin;C:\\ProgramData\\chocolatey\\bin;",
136
- "pe_concat_basedir": "C:/ProgramData/PuppetLabs/puppet/cache/pe_concat",
137
- "physicalprocessorcount": 1,
138
- "platform_symlink_writable": false,
139
- "processor0": "Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz",
140
- "processorcount": 1,
141
- "processors": {
142
- "count": 1,
143
- "isa": "x64",
144
- "models": [
145
- "Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz"
146
- ],
147
- "physicalcount": 1
148
- },
149
- "productname": "VirtualBox",
150
- "puppet_files_dir_present": false,
151
- "puppet_vardir": "C:/ProgramData/PuppetLabs/puppet/cache",
152
- "puppetversion": "4.2.1",
153
- "ruby": {
154
- "platform": "x64-mingw32",
155
- "sitedir": "C:/Program Files/Puppet Labs/Puppet/sys/ruby/lib/ruby/site_ruby/2.1.0",
156
- "version": "2.1.6"
157
- },
158
- "rubyplatform": "x64-mingw32",
159
- "rubysitedir": "C:/Program Files/Puppet Labs/Puppet/sys/ruby/lib/ruby/site_ruby/2.1.0",
160
- "rubyversion": "2.1.6",
161
- "serialnumber": "0",
162
- "staging_http_get": "powershell",
163
- "staging_windir": "C:\\ProgramData\\staging",
164
- "system32": "C:\\Windows\\system32",
165
- "choco_install_path": "C:\\ProgramData\\chocolatey",
166
- "system_uptime": {
167
- "days": 0,
168
- "hours": 0,
169
- "seconds": 266,
170
- "uptime": "0:04 hours"
171
- },
172
- "timezone": "Pacific Daylight Time",
173
- "uptime": "0:04 hours",
174
- "uptime_days": 0,
175
- "uptime_hours": 0,
176
- "uptime_seconds": 266,
177
- "virtual": "virtualbox",
178
- "clientcert": "server2008r2a.pdx.puppetlabs.demo",
179
- "clientversion": "4.2.1",
180
- "clientnoop": false
181
- },
182
- "timestamp": "2015-09-27T23:37:41.296750000-07:00",
183
- "expiration": "2015-09-28T00:07:41.296750000-07:00"
184
- }
1
+ {
2
+ "name": "server2008r2a.pdx.puppetlabs.demo",
3
+ "values": {
4
+ "agent_specified_environment": "production",
5
+ "aio_agent_build": "1.2.2",
6
+ "aio_agent_version": "1.2.2",
7
+ "architecture": "x64",
8
+ "common_appdata": "C:\\ProgramData",
9
+ "concat_basedir": "C:/ProgramData/PuppetLabs/puppet/cache/concat",
10
+ "custom_auth_conf": "false",
11
+ "datacenter": "portland",
12
+ "dhcp_servers": {
13
+ "Local Area Connection": "10.0.2.2"
14
+ },
15
+ "dmi": {
16
+ "manufacturer": "innotek GmbH",
17
+ "product": {
18
+ "name": "VirtualBox",
19
+ "serial_number": "0"
20
+ }
21
+ },
22
+ "domain": "pdx.puppetlabs.demo",
23
+ "env_windows_installdir": "C:\\Program Files\\Puppet Labs\\Puppet",
24
+ "facterversion": "3.0.2",
25
+ "fqdn": "server2008r2a.pdx.puppetlabs.demo",
26
+ "hardwareisa": "x64",
27
+ "hardwaremodel": "x86_64",
28
+ "hostname": "server2008r2a",
29
+ "id": "SERVER2008R2A\\vagrant",
30
+ "identity": {
31
+ "user": "SERVER2008R2A\\vagrant"
32
+ },
33
+ "iis_version": "Get-ItemProperty : Cannot find path 'HKLM:\\SOFTWARE\\Microsoft\\InetStp\\' because it does not exist.\nAt line:1 char:18\n+ (Get-ItemProperty <<<< HKLM:\\SOFTWARE\\Microsoft\\InetStp\\ -Name VersionString).VersionString.SubString(8,3)\n + CategoryInfo : ObjectNotFound: (HKLM:\\SOFTWARE\\Microsoft\\InetStp\\:String) [Get-ItemProperty], ItemNotFo \n undException\n + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetItemPropertyCommand\n \nYou cannot call a method on a null-valued expression.\nAt line:1 char:97\n+ (Get-ItemProperty HKLM:\\SOFTWARE\\Microsoft\\InetStp\\ -Name VersionString).VersionString.SubString <<<< (8,3)\n + CategoryInfo : InvalidOperation: (SubString:String) [], RuntimeException\n + FullyQualifiedErrorId : InvokeMethodOnNull\n \n",
34
+ "interfaces": "Local Area Connection 2,Local Area Connection",
35
+ "ipaddress": "10.20.1.101",
36
+ "ipaddress6": "fe80::2c34:c353:1aaa:a872%13",
37
+ "ipaddress6_Local Area Connection": "fe80::50f8:86eb:f103:75b%12",
38
+ "ipaddress6_Local Area Connection 2": "fe80::2c34:c353:1aaa:a872%13",
39
+ "ipaddress_Local Area Connection": "10.0.2.15",
40
+ "ipaddress_Local Area Connection 2": "10.20.1.101",
41
+ "is_admin": true,
42
+ "is_pe": false,
43
+ "is_virtual": true,
44
+ "kernel": "windows",
45
+ "kernelmajversion": "6.1",
46
+ "kernelrelease": "6.1.7600",
47
+ "kernelversion": "6.1.7600",
48
+ "macaddress": "08:00:27:7B:C7:40",
49
+ "macaddress_Local Area Connection": "08:00:27:AB:52:FB",
50
+ "macaddress_Local Area Connection 2": "08:00:27:7B:C7:40",
51
+ "manufacturer": "innotek GmbH",
52
+ "memory": {
53
+ "system": {
54
+ "available": "448.14 MiB",
55
+ "available_bytes": 469909504,
56
+ "capacity": "56.22%",
57
+ "total": "1023.55 MiB",
58
+ "total_bytes": 1073274880,
59
+ "used": "575.41 MiB",
60
+ "used_bytes": 603365376
61
+ }
62
+ },
63
+ "memoryfree": "448.14 MiB",
64
+ "memoryfree_mb": 448.140625,
65
+ "memorysize": "1023.55 MiB",
66
+ "memorysize_mb": 1023.5546875,
67
+ "mtu_Local Area Connection": 1500,
68
+ "mtu_Local Area Connection 2": 1500,
69
+ "mysql_server_id": 8583088,
70
+ "netmask": "255.255.255.0",
71
+ "netmask6": "ffff:ffff:ffff:ffff::",
72
+ "netmask6_Local Area Connection": "ffff:ffff:ffff:ffff::",
73
+ "netmask6_Local Area Connection 2": "ffff:ffff:ffff:ffff::",
74
+ "netmask_Local Area Connection": "255.255.255.0",
75
+ "netmask_Local Area Connection 2": "255.255.255.0",
76
+ "network": "10.20.1.0",
77
+ "network6": "fe80::%13",
78
+ "network6_Local Area Connection": "fe80::%12",
79
+ "network6_Local Area Connection 2": "fe80::%13",
80
+ "network_Local Area Connection": "10.0.2.0",
81
+ "network_Local Area Connection 2": "10.20.1.0",
82
+ "networking": {
83
+ "domain": "pdx.puppetlabs.demo",
84
+ "fqdn": "server2008r2a.pdx.puppetlabs.demo",
85
+ "hostname": "server2008r2a",
86
+ "interfaces": {
87
+ "Local Area Connection": {
88
+ "dhcp": "10.0.2.2",
89
+ "ip": "10.0.2.15",
90
+ "ip6": "fe80::50f8:86eb:f103:75b%12",
91
+ "mac": "08:00:27:AB:52:FB",
92
+ "mtu": 1500,
93
+ "netmask": "255.255.255.0",
94
+ "netmask6": "ffff:ffff:ffff:ffff::",
95
+ "network": "10.0.2.0",
96
+ "network6": "fe80::%12"
97
+ },
98
+ "Local Area Connection 2": {
99
+ "ip": "10.20.1.101",
100
+ "ip6": "fe80::2c34:c353:1aaa:a872%13",
101
+ "mac": "08:00:27:7B:C7:40",
102
+ "mtu": 1500,
103
+ "netmask": "255.255.255.0",
104
+ "netmask6": "ffff:ffff:ffff:ffff::",
105
+ "network": "10.20.1.0",
106
+ "network6": "fe80::%13"
107
+ }
108
+ },
109
+ "ip": "10.20.1.101",
110
+ "ip6": "fe80::2c34:c353:1aaa:a872%13",
111
+ "mac": "08:00:27:7B:C7:40",
112
+ "mtu": 1500,
113
+ "netmask": "255.255.255.0",
114
+ "netmask6": "ffff:ffff:ffff:ffff::",
115
+ "network": "10.20.1.0",
116
+ "network6": "fe80::%13"
117
+ },
118
+ "operatingsystem": "windows",
119
+ "operatingsystemmajrelease": "2008 R2",
120
+ "operatingsystemrelease": "2008 R2",
121
+ "os": {
122
+ "architecture": "x64",
123
+ "family": "windows",
124
+ "hardware": "x86_64",
125
+ "name": "windows",
126
+ "release": {
127
+ "full": "2008 R2",
128
+ "major": "2008 R2"
129
+ },
130
+ "windows": {
131
+ "system32": "C:\\Windows\\system32"
132
+ }
133
+ },
134
+ "osfamily": "windows",
135
+ "path": "C:/Program Files/Puppet Labs/Puppet/facter/bin;C:\\Program Files\\Puppet Labs\\Puppet\\puppet\\bin;C:\\Program Files\\Puppet Labs\\Puppet\\facter\\bin;C:\\Program Files\\Puppet Labs\\Puppet\\hiera\\bin;C:\\Program Files\\Puppet Labs\\Puppet\\mcollective\\bin;C:\\Program Files\\Puppet Labs\\Puppet\\bin;C:\\Program Files\\Puppet Labs\\Puppet\\sys\\ruby\\bin;C:\\Program Files\\Puppet Labs\\Puppet\\sys\\tools\\bin;%SystemRoot%\\system32\\WindowsPowerShell\\v1.0\\;C:\\Windows\\system32;C:\\Windows;C:\\Windows\\System32\\Wbem;C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\;C:\\Program Files\\Puppet Labs\\Puppet\\bin;C:\\ProgramData\\chocolatey\\bin;",
136
+ "pe_concat_basedir": "C:/ProgramData/PuppetLabs/puppet/cache/pe_concat",
137
+ "physicalprocessorcount": 1,
138
+ "platform_symlink_writable": false,
139
+ "processor0": "Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz",
140
+ "processorcount": 1,
141
+ "processors": {
142
+ "count": 1,
143
+ "isa": "x64",
144
+ "models": [
145
+ "Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz"
146
+ ],
147
+ "physicalcount": 1
148
+ },
149
+ "productname": "VirtualBox",
150
+ "puppet_files_dir_present": false,
151
+ "puppet_vardir": "C:/ProgramData/PuppetLabs/puppet/cache",
152
+ "puppetversion": "4.2.1",
153
+ "ruby": {
154
+ "platform": "x64-mingw32",
155
+ "sitedir": "C:/Program Files/Puppet Labs/Puppet/sys/ruby/lib/ruby/site_ruby/2.1.0",
156
+ "version": "2.1.6"
157
+ },
158
+ "rubyplatform": "x64-mingw32",
159
+ "rubysitedir": "C:/Program Files/Puppet Labs/Puppet/sys/ruby/lib/ruby/site_ruby/2.1.0",
160
+ "rubyversion": "2.1.6",
161
+ "serialnumber": "0",
162
+ "staging_http_get": "powershell",
163
+ "staging_windir": "C:\\ProgramData\\staging",
164
+ "system32": "C:\\Windows\\system32",
165
+ "choco_install_path": "C:\\ProgramData\\chocolatey",
166
+ "system_uptime": {
167
+ "days": 0,
168
+ "hours": 0,
169
+ "seconds": 266,
170
+ "uptime": "0:04 hours"
171
+ },
172
+ "timezone": "Pacific Daylight Time",
173
+ "uptime": "0:04 hours",
174
+ "uptime_days": 0,
175
+ "uptime_hours": 0,
176
+ "uptime_seconds": 266,
177
+ "virtual": "virtualbox",
178
+ "clientcert": "server2008r2a.pdx.puppetlabs.demo",
179
+ "clientversion": "4.2.1",
180
+ "clientnoop": false
181
+ },
182
+ "timestamp": "2015-09-27T23:37:41.296750000-07:00",
183
+ "expiration": "2015-09-28T00:07:41.296750000-07:00"
184
+ }