simp-beaker-helpers 1.8.8 → 1.8.9

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b1d313d1a89d6d6f450edd38bcd7414ae4b7f56d
4
- data.tar.gz: e9ed6ecf0d27944cd51c5fa6b9d6148ae3da740b
3
+ metadata.gz: c6c57afa93ab55a9de6cb0e80911855e700db41d
4
+ data.tar.gz: a2379476a363a111aaa5170eb1e7a0337d511ebf
5
5
  SHA512:
6
- metadata.gz: b574baf7e3fcac90f4e641ea33f03e2f9d1487068b9333cc9438320410c6e4a2897288ae8a541a1c8daaa2162173605d2aafe037a57fd2771e3c2007304792df
7
- data.tar.gz: 382360a5c8010e48c2586f6850271590d2f29cfec201f98210f9ea43e51737b752b5d022b544af79a067c8edc1f6a39d81df88a7b47d9505a417244c9b7c6d1a
6
+ metadata.gz: 45c36c003498f9bf9ac6a26daf06d4680eb752eb7eb2fb4b2b6706cbb97d7ce4264b9232d5d9952069c9fb6b8f1bd50e5a9427977d2b686886c086d41af8bb13
7
+ data.tar.gz: 913e8f4d117e9c6f7508aa55138db9f4eccb439b2fdeb5086400519469763a84c77ca2cd553055d921e6f0a8f7c1e2ebaee0b0d85f6f343477568b4be78bee63
data/README.md CHANGED
@@ -12,6 +12,7 @@ Methods to assist beaker acceptance tests for SIMP.
12
12
  * [YUM Repo Support](#yum_repo_support)
13
13
  5. [Methods](#methods)
14
14
  * [`copy_fixture_modules_to`](#copy_fixture_modules_to)
15
+ * [`copy_to`](#copy_to)
15
16
  * [`fix_errata_on`](#fix_errata_on)
16
17
  * PKI
17
18
  * [`run_fake_pki_ca_on`](#run_fake_pki_ca_on)
@@ -145,6 +146,17 @@ yum_repos:
145
146
 
146
147
  ## Methods
147
148
 
149
+ #### `copy_to`
150
+
151
+ Abstracts copying files and directories in the most efficient manner possible.
152
+
153
+ * If your system is a ``docker`` container it uses ``docker cp``
154
+ * If your system is anything else:
155
+ * Attempts to use ``rsync`` if it is present on both sides
156
+ * Falls back to ``scp``
157
+
158
+ All copy semantics are consistent with what you would expect from ``scp_to``
159
+
148
160
  #### `copy_fixture_modules_to`
149
161
 
150
162
  Copies the local fixture modules (under `spec/fixtures/modules`) onto a list of
@@ -32,11 +32,16 @@ module Simp::BeakerHelpers
32
32
  end
33
33
 
34
34
  %x(tar #{exclude_list.join(' ')} -hcf - -C "#{File.dirname(src)}" "#{File.basename(src)}" | docker exec -i "#{sut.hostname}" tar -C "#{dest}" -xf -)
35
- elsif @has_rsync
35
+ elsif @has_rsync && sut.check_for_command('rsync')
36
36
  # This makes rsync_to work like beaker and scp usually do
37
37
  exclude_hack = %(__-__' -L --exclude '__-__)
38
- opts[:ignore] ||= []
39
- opts[:ignore] << exclude_hack
38
+
39
+ # There appears to be a single copy of 'opts' that gets passed around
40
+ # through all of the different hosts so we're going to make a local deep
41
+ # copy so that we don't destroy the world accidentally.
42
+ _opts = Marshal.load(Marshal.dump(opts))
43
+ _opts[:ignore] ||= []
44
+ _opts[:ignore] << exclude_hack
40
45
 
41
46
  if File.directory?(src)
42
47
  dest = File.join(dest, File.basename(src)) if File.directory?(src)
@@ -45,7 +50,7 @@ module Simp::BeakerHelpers
45
50
 
46
51
  # End rsync hackery
47
52
 
48
- rsync_to(sut, src, dest, opts)
53
+ rsync_to(sut, src, dest, _opts)
49
54
  else
50
55
  scp_to(sut, src, dest, opts)
51
56
  end
@@ -170,7 +175,11 @@ module Simp::BeakerHelpers
170
175
 
171
176
  %x(tar -ch #{excludes} -f #{tarfile} *)
172
177
 
173
- copy_to(sut, tarfile, target_module_path, opts)
178
+ if File.exist?(tarfile)
179
+ copy_to(sut, tarfile, target_module_path, opts)
180
+ else
181
+ fail("Error: module tar file '#{tarfile}' could not be created at #{mod_root}")
182
+ end
174
183
 
175
184
  on(sut, "cd #{target_module_path} && tar -xf #{File.basename(tarfile)}")
176
185
  ensure
@@ -1,5 +1,5 @@
1
1
  module Simp; end
2
2
 
3
3
  module Simp::BeakerHelpers
4
- VERSION = '1.8.8'
4
+ VERSION = '1.8.9'
5
5
  end
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.8.8
4
+ version: 1.8.9
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: 2017-10-02 00:00:00.000000000 Z
12
+ date: 2017-10-30 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: beaker
@@ -93,7 +93,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
93
93
  version: '0'
94
94
  requirements: []
95
95
  rubyforge_project:
96
- rubygems_version: 2.6.13
96
+ rubygems_version: 2.6.14
97
97
  signing_key:
98
98
  specification_version: 4
99
99
  summary: beaker helper methods for SIMP