pdqtest 0.4.3 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 638a3b448f2f304f4a58b2f33818dc46a7ac60a7
4
- data.tar.gz: d2f055964d056dae276f1e199388fa8758eadd3a
3
+ metadata.gz: 1c69b57c8fc39f020f891c0723296a260f1edbb0
4
+ data.tar.gz: 2d0db562865e6b6a64b53c021a52f9c59aa9e3c7
5
5
  SHA512:
6
- metadata.gz: 629ecab2db96008de2fc3ae38a628b0170e9fe57383d3623e6a45eac97fa2a58f4b3df0cb0241cd7ecc82e129cfdc0724ca3a1f464e68873b92d5bd06bbf6afd
7
- data.tar.gz: 186f823452f0f8aecbbb049aff0e1218c30e0b04b1a437adf92cee2b20422279659a5f5d5f2d45a7265477d64a058621c0a893359b266243fbbdb02935c637d3
6
+ metadata.gz: c381af3af819891d19fea87d3564a18852983210a79e240771dd8097909b2d10be0e51f9f1aa8e7d41b5a22947d452165ef9c4eabca6860502dee702ac8ebfa2
7
+ data.tar.gz: 135bf38bc95d618c069179f7aaf80ce53fae001e6859bc8f5c02464b95ba6e2c8635fcc737554d9b7e7eede1a3a74ce42d22fc89ebe110cb80f19f15f740e71f
@@ -5,7 +5,9 @@ module PDQTest
5
5
  STATUS = 2
6
6
  ENV='export TERM=xterm LC_ALL=C PATH=/usr/local/bats/bin:/opt/puppetlabs/puppet/bin:$PATH;'
7
7
  IMAGE_NAME='geoffwilliams/pdqtest-centos:2017-05-04-0'
8
-
8
+ HIERA_YAML_CONTAINER = '/etc/puppetlabs/puppet/hiera.yaml'
9
+ HIERA_YAML_HOST = '/spec/fixtures/hiera.yaml'
10
+ HIERA_DIR = '/spec/fixtures/hieradata'
9
11
 
10
12
  def self.wrap_cmd(cmd)
11
13
  ['bash', '-c', "#{ENV} #{cmd}"]
@@ -17,18 +19,29 @@ module PDQTest
17
19
 
18
20
  def self.new_container(test_dir)
19
21
  pwd = Dir.pwd
22
+ hiera_yaml_host = File.join(pwd, HIERA_YAML_HOST)
23
+ hiera_dir = File.join(pwd, HIERA_DIR)
24
+
25
+ # hiera.yaml *must* exist on the host or we will get errors from Docker
26
+ if ! File.exists?(hiera_yaml_host)
27
+ File.write(hiera_yaml_host, '# hiera configuration for testing')
28
+ end
20
29
  container = ::Docker::Container.create(
21
30
  'Image' => IMAGE_NAME,
22
31
  'Volumes' => {
23
- test_dir => {pwd => 'rw'},
24
- '/cut' => {pwd => 'rw'}, # DEPRECATED -FOR REMOVAL
25
- '/sys/fs/cgroup' => {'/sys/fs/cgroup' => 'ro'},
32
+ test_dir => {pwd => 'rw'},
33
+ HIERA_YAML_CONTAINER => {hiera_yaml_host => 'ro'},
34
+ HIERA_DIR => {hiera_dir => 'ro'},
35
+ '/cut' => {pwd => 'rw'}, # DEPRECATED -FOR REMOVAL
36
+ '/sys/fs/cgroup' => {'/sys/fs/cgroup' => 'ro'},
26
37
  },
27
38
  'HostConfig' => {
28
39
  "Binds": [
29
40
  "/sys/fs/cgroup:/sys/fs/cgroup:ro",
30
41
  "#{pwd}:/cut:rw", # DEPRECATED -FOR REMOVAL
31
42
  "#{pwd}:#{test_dir}:rw",
43
+ "#{hiera_yaml_host}:#{HIERA_YAML_CONTAINER}:rw",
44
+ "#{hiera_dir}:#{HIERA_DIR}:rw",
32
45
  ],
33
46
  },
34
47
  )
@@ -15,7 +15,9 @@ module PDQTest
15
15
  EXAMPLES_DIR = 'examples'
16
16
  GEMFILE = 'Gemfile'
17
17
  GEMFILE_LINE = "gem 'pdqtest', '#{PDQTest::VERSION}'"
18
-
18
+ HIERA_DIR = File.join(SPEC_DIR, 'fixtures', 'hieradata')
19
+ HIERA_YAML = 'hiera.yaml'
20
+ HIERA_TEST = 'test.yaml'
19
21
 
20
22
 
21
23
  def self.should_replace_file(target, skeleton)
@@ -88,6 +90,8 @@ module PDQTest
88
90
  install_skeleton('.gitignore', 'dot_gitignore')
89
91
  install_skeleton('.rspec', 'dot_rspec')
90
92
  install_skeleton('Makefile', 'Makefile')
93
+ install_skeleton(File.join(SPEC_DIR, 'fixtures', HIERA_YAML), HIERA_YAML)
94
+ install_skeleton(File.join(HIERA_DIR, HIERA_TEST), HIERA_TEST)
91
95
 
92
96
  install_acceptance()
93
97
  install_gemfile()
@@ -1,3 +1,3 @@
1
1
  module PDQTest
2
- VERSION = "0.4.3"
2
+ VERSION = "0.5.0"
3
3
  end
data/res/skeleton/Gemfile CHANGED
@@ -8,7 +8,6 @@ gem 'facter', '2.4.6'
8
8
  gem 'rubocop', '0.47.1'
9
9
  gem 'rspec-puppet-facts', '1.7.0'
10
10
 
11
- # Workaround for PDOC-160
11
+ # Workaround for PDOC-160 (until gem published)
12
12
  gem 'puppet-strings',
13
- :git => 'https://github.com/declarativesystems/puppet-strings',
14
- :ref => 'no_dates'
13
+ :git => 'https://github.com/puppetlabs/puppet-strings',
@@ -0,0 +1,7 @@
1
+ ---
2
+ :backends:
3
+ - yaml
4
+ :yaml:
5
+ :datadir: 'spec/fixtures/hieradata'
6
+ :hierarchy:
7
+ - 'default'
@@ -1 +1,4 @@
1
1
  require 'puppetlabs_spec_helper/module_spec_helper'
2
+ RSpec.configure do |c|
3
+ c.hiera_config = File.expand_path(File.join(__FILE__, '../fixtures/hiera.yaml'))
4
+ end
@@ -0,0 +1,3 @@
1
+ # test.yaml (for testing)
2
+ ---
3
+ message: "this is a test message from pdqtest/hiera"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pdqtest
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.3
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Geoff Williams
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-05-08 00:00:00.000000000 Z
11
+ date: 2017-06-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -245,10 +245,12 @@ files:
245
245
  - res/skeleton/dot_gitignore
246
246
  - res/skeleton/dot_rspec
247
247
  - res/skeleton/dot_travis.yml
248
+ - res/skeleton/hiera.yaml
248
249
  - res/skeleton/init.bats
249
250
  - res/skeleton/init__before.bats
250
251
  - res/skeleton/init__setup.sh
251
252
  - res/skeleton/spec_helper.rb
253
+ - res/skeleton/test.yaml
252
254
  - res/templates/examples_init.pp.erb
253
255
  - res/templates/rspec.rb.erb
254
256
  homepage: https://github.com/GeoffWilliams/pdqtest