simp-beaker-helpers 1.0.11 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +8 -8
  2. data/README.md +21 -8
  3. data/lib/simp/beaker_helpers.rb +31 -6
  4. metadata +2 -3
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- OTBhZjRkNWY5MGMxNmE4ZTRkNDI2YmQyYThmNTU3NWY1Y2U5ZDM5Yg==
4
+ OTk4ZmEwOTk2ODBkMDc5MDUwYThhNDE1OTZlNDllNDUxYWFjY2U4Zg==
5
5
  data.tar.gz: !binary |-
6
- MDc0YmJlOTZkYjZkNWJjNmUxNWRjNmE1YTEyNjUzOTEyMWU2MTg0Nw==
6
+ NmE3ZGZkNzg1ZDUxNjkzZjUzYjUzNDdmNTZmZTJkNzFhYTQ4OTc4Yw==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- NTA1YjIyMTA2ZmRlMDQ5ZDMyZGFmNWRiMTdmZWQwZGJjZmZkYzQ5MWI5MWYw
10
- NWRkMzNmOTVkNTMwOTJlMDg4NjUxMDNlNGYwYjNiOGYyNWQ4NDEyYWViZDNh
11
- NDA5N2RiM2UxODQwN2U5MDE5NzA3OGQzOGEzNWE3Y2I2OWYxODU=
9
+ N2IzYTU4NDlhOTBmZmEzZDZjYTQ5YjkxNDNiNWJmYjIzOWMxNjJkMGFmMTBj
10
+ ODhkOTc1ZDk2NzdkZTNlMDllNmE4MmYyMDFlZTY0Njc1NjhiNWExNDcyMzg5
11
+ MzFlNjllMjZlMzc5ZmU4MDA2Mjg0NjgzMjk0ZWQ3ZWI4M2IzNDQ=
12
12
  data.tar.gz: !binary |-
13
- ZjI5MmE3YTc4MDAzMGEwMjYzOGQxMjBhMTAzOTJjZWEyMzcyMGIxOWQwNjk4
14
- ZTM4YTU2NGM0MTRjYmViMzk0M2RlN2Q1YjY2ZDAwMWQyZGQxMmRkOThjZjRi
15
- Yjk5YjUwNjYyZDRhNDFkZjk2ZGVhNTM5OWYzYzhlZDY1MTk0ZDI=
13
+ ZjhkN2QwZTNiNjFhNDZlOGJhYmVkMzFmMThjNGZkNDcxOTJlNjUyNGYzYzhk
14
+ MjE4NTdhODc5MmM0Y2EzMDU1MmRlMmVlMzNkZTdjY2NiODFiMGIyZGQ3N2Zi
15
+ MTQyOGE1ZGQ3ODc5MjM1YmU5ZDcxNzRjOTFlYmJiNGQ5ZmU4NmY=
data/README.md CHANGED
@@ -6,7 +6,9 @@ Methods to assist beaker acceptance tests for SIMP.
6
6
  1. [Overview](#overview)
7
7
  2. [Setup](#setup)
8
8
  * [Beginning with simp-beaker-helpers](#beginning-with-simp-beaker-helpers)
9
- 3. [Methods](#methods)
9
+ 3. [Nodeset Enhancements](#nodeset-enhancements)
10
+ * [YUM Repo Support](#yum_repo_support)
11
+ 4. [Methods](#methods)
10
12
  * [`copy_fixture_modules_to`](#copy_fixture_modules_to)
11
13
  * [`fix_errata_on`](#fix_errata_on)
12
14
  * PKI
@@ -19,14 +21,14 @@ Methods to assist beaker acceptance tests for SIMP.
19
21
  * Hiera
20
22
  * [`set_hieradata_on`](#set_hieradata_on)
21
23
  * [`clear_temp_hieradata`](#clear_temp_hieradata)
22
- 4. [Environment variables](#environment-variables)
24
+ 5. [Environment variables](#environment-variables)
23
25
  * [`BEAKER_fips`](#beaker_fips)
24
26
  * [`BEAKER_spec_prep`](#beaker_spec_prep)
25
27
  * [`BEAKER_stringify_facts`](#beaker_stringify_facts)
26
28
  * [`BEAKER_use_fixtures_dir_for_modules`](#beaker_use_fixtures_dir_for_modules)
27
- 5. [Examples](#examples)
29
+ 6. [Examples](#examples)
28
30
  * [Prep OS, Generate and copy PKI certs to each SUT](#prep-os-generate-and-copy-pki-certs-to-each-sut)
29
- 6. [License](#license)
31
+ 7. [License](#license)
30
32
 
31
33
  ## Overview
32
34
 
@@ -45,6 +47,21 @@ Add this to your project's `spec/spec_helper_acceptance.rb`:
45
47
  require 'simp/beaker_helpers'
46
48
  include Simp::BeakerHelpers
47
49
  ```
50
+ ## Nodeset Enhancements
51
+
52
+ ### YUM Repo Support
53
+
54
+ Nodes in your nodesets will create YUM repository entries according to the
55
+ following Hash:
56
+
57
+ ```yaml
58
+ yum_repos:
59
+ <repo_name>:
60
+ url: <URL>
61
+ gpgkeys:
62
+ - <URL to GPGKEY1>
63
+ - <URL to GPGKEY2>
64
+ ```
48
65
 
49
66
  ## Methods
50
67
 
@@ -142,13 +159,9 @@ SIMP acceptance tests enable [FIPS mode](https://access.redhat.com/documentation
142
159
  **NOTE:** FIPS mode is only enabled on RedHat family hosts
143
160
 
144
161
  #### `BEAKER_spec_prep`
145
- #
146
-
147
-
148
162
  #### `BEAKER_stringify_facts`
149
163
  #### `BEAKER_use_fixtures_dir_for_modules`
150
164
 
151
-
152
165
  ## Examples
153
166
 
154
167
  ### Prep OS, Generate and copy PKI certs to each SUT
@@ -1,7 +1,7 @@
1
1
  module Simp; end
2
2
 
3
3
  module Simp::BeakerHelpers
4
- VERSION = '1.0.11'
4
+ VERSION = '1.2.0'
5
5
 
6
6
  # use the `puppet fact` face to look up facts on an SUT
7
7
  def pfact_on(sut, fact_name)
@@ -155,6 +155,30 @@ DEFAULT_KERNEL_TITLE=`/sbin/grubby --info=\\\${DEFAULT_KERNEL_INFO} | grep -m1 t
155
155
  end
156
156
 
157
157
 
158
+ # Collect all 'yum_repos' entries from the host nodeset.
159
+ # The acceptable format is as follows:
160
+ # yum_repos:
161
+ # <repo_name>:
162
+ # url: <URL>
163
+ # gpgkeys:
164
+ # - <URL to GPGKEY1>
165
+ # - <URL to GPGKEY2>
166
+ def enable_yum_repos_on( suts = hosts )
167
+ Array(suts).each do |sut|
168
+ if sut['yum_repos']
169
+ sut['yum_repos'].each_pair do |repo, metadata|
170
+ repo_manifest = <<-EOS
171
+ yumrepo { #{repo}:
172
+ baseurl => '#{metadata[:url]}',
173
+ gpgkey => '#{metadata[:gpgkeys].join(" ")}'
174
+ }
175
+ EOS
176
+ apply_manifest_on(sut, repo_manifest, :catch_failures => true)
177
+ end
178
+ end
179
+ end
180
+ end
181
+
158
182
  # Apply known OS fixes we need to run Beaker on each SUT
159
183
  def fix_errata_on( suts = hosts )
160
184
 
@@ -168,11 +192,13 @@ DEFAULT_KERNEL_TITLE=`/sbin/grubby --info=\\\${DEFAULT_KERNEL_INFO} | grep -m1 t
168
192
  # at least have the host defaults:
169
193
  #
170
194
  # :hieradatadir is used as a canary here; it isn't the only missing key
171
- unless sut.host_hash.key? :hieradatadir
195
+ unless sut.host_hash.key? :hieradatadir
172
196
  configure_type_defaults_on(sut)
173
197
  end
174
198
 
175
199
  if fact_on(sut, 'osfamily') == 'RedHat'
200
+ enable_yum_repos_on(sut)
201
+
176
202
  # net-tools required for netstat utility being used by be_listening
177
203
  if fact_on(sut, 'operatingsystemmajrelease') == '7'
178
204
  pp = <<-EOS
@@ -180,17 +206,16 @@ DEFAULT_KERNEL_TITLE=`/sbin/grubby --info=\\\${DEFAULT_KERNEL_INFO} | grep -m1 t
180
206
  EOS
181
207
  apply_manifest_on(sut, pp, :catch_failures => false)
182
208
  end
183
- end
184
209
 
210
+ # Clean up YUM prior to starting our test runs.
211
+ on(sut, 'yum clean all')
212
+ end
185
213
  end
186
214
 
187
215
  # Configure and reboot SUTs into FIPS mode
188
216
  unless ENV['BEAKER_fips'] == 'no'
189
217
  enable_fips_mode_on(suts)
190
218
  end
191
-
192
- # Clean up YUM prior to starting our test runs.
193
- on(suts, 'yum clean all')
194
219
  end
195
220
 
196
221
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simp-beaker-helpers
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.11
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Tessmer
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-11-18 00:00:00.000000000 Z
12
+ date: 2016-03-24 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: beaker
@@ -88,4 +88,3 @@ test_files:
88
88
  - spec/acceptance/pfacter_spec.rb
89
89
  - spec/acceptance/pki_tests_spec.rb
90
90
  - spec/spec_helper_acceptance.rb
91
- has_rdoc: