beaker 1.17.3 → 1.17.4
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 +8 -8
- data/HISTORY.md +43 -2
- data/lib/beaker/host.rb +14 -2
- data/lib/beaker/hypervisor/aws_sdk.rb +9 -9
- data/lib/beaker/version.rb +1 -1
- data/spec/beaker/host_spec.rb +60 -0
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
---
|
|
2
2
|
!binary "U0hBMQ==":
|
|
3
3
|
metadata.gz: !binary |-
|
|
4
|
-
|
|
4
|
+
NWRiY2Y3ZGRkNGNhY2YyNDQxOWQxYmI0MTRkZDQ0MmUyZTllM2E1ZQ==
|
|
5
5
|
data.tar.gz: !binary |-
|
|
6
|
-
|
|
6
|
+
ZTRmNzY0ZjI2NDRlOWNiOTJmZDM4ZDFmYmRkYWJiNmE4MWFkZDQyMQ==
|
|
7
7
|
SHA512:
|
|
8
8
|
metadata.gz: !binary |-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
YmJmNDJlMWU3ZWI0YzVhZjY1M2I0MGU0ODg4Y2EwMjVhZDY3ZTYzOGM1OTYx
|
|
10
|
+
ZDEyNjYzMTE0MWI2NzI4YTQyNjAxZGI1YTYzM2UwYzEwYzU1YTA2NGZmNDQ1
|
|
11
|
+
NjE1YThkNDMyNTlmMGM4ZjI5YWIyNDQyYmVjMzJkMGRkMzhkNzg=
|
|
12
12
|
data.tar.gz: !binary |-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
NWVmMjg1YTc4MzA3MDhiNTM4NWM0MDk4NmM2NTMzZTBmNjgxMTRjMWRmMmQw
|
|
14
|
+
YzBhYWM0M2IzZWU2OGNkZDE2ZTMyZDc2Yzc3MTk5ZTdjMDdkY2VkNjMxYWQ4
|
|
15
|
+
MGFjZTc1OWQ1NWM1MmI5MzRiNzQ3NGFlMWRhMzc5YjM0MTMyMzU=
|
data/HISTORY.md
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
# beaker - History
|
|
2
2
|
## Tags
|
|
3
|
-
* [LATEST - 20 Aug, 2014 (
|
|
3
|
+
* [LATEST - 20 Aug, 2014 (1e6a4a8f)](#LATEST)
|
|
4
|
+
* [beaker1.17.3 - 20 Aug, 2014 (f8a536c1)](#beaker1.17.3)
|
|
4
5
|
* [beaker1.17.2 - 15 Aug, 2014 (c6f1f64a)](#beaker1.17.2)
|
|
5
6
|
* [beaker1.17.1 - 12 Aug, 2014 (72e60299)](#beaker1.17.1)
|
|
6
7
|
* [beaker1.17.0 - 12 Aug, 2014 (fb482b56)](#beaker1.17.0)
|
|
@@ -55,7 +56,47 @@
|
|
|
55
56
|
* [pe1.2 - 6 Sep, 2011 (ba3dadd2)](#pe1.2)
|
|
56
57
|
|
|
57
58
|
## Details
|
|
58
|
-
### <a name = "LATEST">LATEST - 20 Aug, 2014 (
|
|
59
|
+
### <a name = "LATEST">LATEST - 20 Aug, 2014 (1e6a4a8f)
|
|
60
|
+
|
|
61
|
+
* (GEM) version bump for 1.17.4 (1e6a4a8f)
|
|
62
|
+
|
|
63
|
+
* Merge pull request #411 from anodelman/ec2 (2b4c9049)
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
```
|
|
67
|
+
Merge pull request #411 from anodelman/ec2
|
|
68
|
+
|
|
69
|
+
(MAINT) kill zombies after provided number of hours
|
|
70
|
+
```
|
|
71
|
+
* Merge pull request #409 from cyberious/ScpCopyIgnoreFix (e59632eb)
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
```
|
|
75
|
+
Merge pull request #409 from cyberious/ScpCopyIgnoreFix
|
|
76
|
+
|
|
77
|
+
QENG-1080 do_scp_to now checks for source path of absolute and prunes accordingly
|
|
78
|
+
```
|
|
79
|
+
* (MAINT) kill zombies after provided number of hours (3f3c3b27)
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
```
|
|
83
|
+
(MAINT) kill zombies after provided number of hours
|
|
84
|
+
|
|
85
|
+
- was always using the default 3 hours
|
|
86
|
+
```
|
|
87
|
+
* QENG-1080 Fixed issue where we appended the source path to the target path, we now check for absolute path prior (cdd9c7b8)
|
|
88
|
+
|
|
89
|
+
### <a name = "beaker1.17.3">beaker1.17.3 - 20 Aug, 2014 (f8a536c1)
|
|
90
|
+
|
|
91
|
+
* Merge pull request #410 from anodelman/make-gem (f8a536c1)
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
```
|
|
95
|
+
Merge pull request #410 from anodelman/make-gem
|
|
96
|
+
|
|
97
|
+
create beaker 1.17.3 gem
|
|
98
|
+
```
|
|
99
|
+
* (HISTORY) update history for 1.17.3 gem (0d6006c4)
|
|
59
100
|
|
|
60
101
|
* (GEM) version bump for 1.17.3 gem (92584d1e)
|
|
61
102
|
|
data/lib/beaker/host.rb
CHANGED
|
@@ -291,13 +291,25 @@ module Beaker
|
|
|
291
291
|
|
|
292
292
|
# create necessary directory structure on host
|
|
293
293
|
required_dirs = (dir_source.map{ | dir | File.dirname(dir) }).uniq
|
|
294
|
+
require 'pathname'
|
|
295
|
+
source_path = Pathname.new(source)
|
|
294
296
|
required_dirs.each do |dir|
|
|
295
|
-
|
|
297
|
+
dir_path = Pathname.new(dir)
|
|
298
|
+
if dir_path.absolute?
|
|
299
|
+
mkdir_p(File.join(target,dir_path.relative_path_from(source_path)))
|
|
300
|
+
else
|
|
301
|
+
mkdir_p( File.join(target, dir) )
|
|
302
|
+
end
|
|
296
303
|
end
|
|
297
304
|
|
|
298
305
|
# copy each file to the host
|
|
299
306
|
dir_source.each do |s|
|
|
300
|
-
|
|
307
|
+
s_path = Pathname.new(s)
|
|
308
|
+
if s_path.absolute?
|
|
309
|
+
file_path = File.join(target,s_path.relative_path_from(source_path))
|
|
310
|
+
else
|
|
311
|
+
file_path = File.join(target, s)
|
|
312
|
+
end
|
|
301
313
|
result = connection.scp_to(s, file_path, options, $dry_run)
|
|
302
314
|
end
|
|
303
315
|
end
|
|
@@ -101,15 +101,15 @@ module Beaker
|
|
|
101
101
|
@logger.debug "Reviewing: #{region.name}"
|
|
102
102
|
@ec2.regions[region.name].instances.each do |instance|
|
|
103
103
|
if (instance.key_name =~ /#{key}/)
|
|
104
|
-
@logger.debug "Examining #{instance.id} (keyname: #{
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
104
|
+
@logger.debug "Examining #{instance.id} (keyname: #{instance.key_name}, launch time: #{instance.launch_time}, status: #{instance.status})"
|
|
105
|
+
if ((time_now - instance.launch_time) > max_age*60*60) and instance.status.to_s !~ /terminated/
|
|
106
|
+
@logger.debug "Kill! #{instance.id}: #{instance.key_name} (Current status: #{instance.status})"
|
|
107
|
+
begin
|
|
108
|
+
instance.terminate()
|
|
109
|
+
kill_count += 1
|
|
110
|
+
rescue AWS::EC2::Errors => e
|
|
111
|
+
@logger.debug "Failed to remove instance: #{instance.id}, #{e}"
|
|
112
|
+
end
|
|
113
113
|
end
|
|
114
114
|
end
|
|
115
115
|
end
|
data/lib/beaker/version.rb
CHANGED
data/spec/beaker/host_spec.rb
CHANGED
|
@@ -246,6 +246,66 @@ module Beaker
|
|
|
246
246
|
host.do_scp_to *args
|
|
247
247
|
end
|
|
248
248
|
|
|
249
|
+
context "using an ignore array with an absolute source path" do
|
|
250
|
+
source_path = '/repos/puppetlabs-inifile'
|
|
251
|
+
target_path = '/etc/puppetlabs/modules/inifile'
|
|
252
|
+
before :each do
|
|
253
|
+
test_dir = "#{source_path}/tests"
|
|
254
|
+
other_test_dir = "#{source_path}/tests2"
|
|
255
|
+
|
|
256
|
+
files = [
|
|
257
|
+
'00_EnvSetup.rb', '035_StopFirewall.rb', '05_HieraSetup.rb',
|
|
258
|
+
'01_TestSetup.rb', '03_PuppetMasterSanity.rb',
|
|
259
|
+
'06_InstallModules.rb','02_PuppetUserAndGroup.rb',
|
|
260
|
+
'04_ValidateSignCert.rb', '07_InstallCACerts.rb' ]
|
|
261
|
+
|
|
262
|
+
@fileset1 = files.shuffle.map {|file| test_dir + '/' + file }
|
|
263
|
+
@fileset2 = files.shuffle.map {|file| other_test_dir + '/' + file }
|
|
264
|
+
|
|
265
|
+
create_files( @fileset1 )
|
|
266
|
+
create_files( @fileset2 )
|
|
267
|
+
end
|
|
268
|
+
it 'can take an ignore list that excludes all files and not call scp_to', :use_fakefs => true do
|
|
269
|
+
logger = host[:logger]
|
|
270
|
+
conn = double(:connection)
|
|
271
|
+
@options = { :logger => logger }
|
|
272
|
+
host.instance_variable_set :@connection, conn
|
|
273
|
+
args = [ source_path, target_path, {:ignore => ['tests', 'tests2']} ]
|
|
274
|
+
|
|
275
|
+
logger.should_receive(:debug)
|
|
276
|
+
host.should_receive( :mkdir_p ).exactly(0).times
|
|
277
|
+
conn.should_receive(:scp_to).exactly(0).times
|
|
278
|
+
|
|
279
|
+
host.do_scp_to *args
|
|
280
|
+
end
|
|
281
|
+
it 'can take an ignore list that excludes a single file and scp the rest', :use_fakefs => true do
|
|
282
|
+
exclude_file = '07_InstallCACerts.rb'
|
|
283
|
+
logger = host[:logger]
|
|
284
|
+
conn = double(:connection)
|
|
285
|
+
@options = { :logger => logger }
|
|
286
|
+
host.instance_variable_set :@connection, conn
|
|
287
|
+
args = [ source_path, target_path, {:ignore => [exclude_file]} ]
|
|
288
|
+
|
|
289
|
+
Dir.stub( :glob ).and_return( @fileset1 + @fileset2 )
|
|
290
|
+
|
|
291
|
+
logger.should_receive(:debug)
|
|
292
|
+
host.should_receive( :mkdir_p ).with("#{target_path}/tests")
|
|
293
|
+
host.should_receive( :mkdir_p ).with("#{target_path}/tests2")
|
|
294
|
+
(@fileset1 + @fileset2).each do |file|
|
|
295
|
+
if file !~ /#{exclude_file}/
|
|
296
|
+
file_args = [ file, File.join(target_path, file.gsub(source_path,'')), {:ignore => [exclude_file]} ]
|
|
297
|
+
conn_args = file_args + [ nil ]
|
|
298
|
+
conn.should_receive(:scp_to).with( *conn_args ).and_return(Beaker::Result.new(host, 'output!'))
|
|
299
|
+
else
|
|
300
|
+
file_args = [ file, File.join(target_path, file.gsub(source_path,'')), {:ignore => [exclude_file]} ]
|
|
301
|
+
conn_args = file_args + [ nil ]
|
|
302
|
+
conn.should_not_receive(:scp_to).with( *conn_args )
|
|
303
|
+
end
|
|
304
|
+
end
|
|
305
|
+
|
|
306
|
+
host.do_scp_to *args
|
|
307
|
+
end
|
|
308
|
+
end
|
|
249
309
|
context "using an ignore array" do
|
|
250
310
|
|
|
251
311
|
before :each do
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: beaker
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.17.
|
|
4
|
+
version: 1.17.4
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Puppetlabs
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2014-08-
|
|
11
|
+
date: 2014-08-21 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: minitest
|