beaker 1.17.1 → 1.17.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ODE0YzQ4ODExNWQ2NjRhZDcwZmI0MmZjNWE1YTkyMDlkOTQzNDUyYw==
4
+ ZTBjNDZkNTNjYTM2YTcxMDYxNGVkODBlYzk4ZGY3ZjhiZWE0NGI4Yw==
5
5
  data.tar.gz: !binary |-
6
- MzliNzczZTJjZGVlMjNlNjJhMjYyMTFkMGQ4YjlhMTIwNTFkMzBlNg==
6
+ YmU5OTVmYmI5MmU5ODZhZDE3Njg3MWVlOGYyNTM2NTg0ZGMxYzdlNg==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- MTdmODVkY2ZlYTI2YjRjNTJkNTlmNjEzYTk3NWYzYWI5NDhmMzNjYWE2N2E3
10
- YmE1ODI4NDgxOWUzMWZkNzhlZDlhY2IyYTEzMGIxODA1Yzg1Mzg3ZTczYTcz
11
- NTgyMzIzZGQ3YTRlZDI3ODhhNDYyOWIzMTYwNGE0MjM4YmRiOWU=
9
+ YjFhMDMxMTFmYjFjMDg1ZjIyOTc2NjQ1MDllNGZiYjVkMDM3YTQxZThkMjgw
10
+ ODk2ODc0MTE4OGE4ZTBlOWUwMTdlZjIyOTNmOTQ2N2FjOTliNTVlNDZlMTU5
11
+ NzVlZWY3MjBjODhhMzdiNWRmNmM3ZGRiNzIwZTg4ZjU2NWQxZDY=
12
12
  data.tar.gz: !binary |-
13
- MzE3ZGQxMjc4Yjk0YjYwMmJlNWI0ODcwNGE4YjBmNzkzMmEwMjk5MjJjZjRl
14
- MjVmMDY0YjEzYjgzODM0YmM2MDgyZjEwMDZlMjJlMjQ1MjlmYThiMDUxZjc3
15
- ODM2NzhlZWU0MzJhMDUyZWYzMmM5ODRhYzk1ZDVhZjQxMDExYjc=
13
+ NzEzMTg0NzdmZDA3NTI0MjM0OTVhZWRhYWQ0MTgxMGRjMDcyOGRlNDMwODQ0
14
+ ZjE5MjY2Mjg2OGZjY2VmZmExMTEzNTRmNjkwZDNmYjY0NDUwNTI1NjA1MDBl
15
+ NGM3MjM4N2ZmMDE3YTY3ZGMyN2I5MWUwMjczZWJiZWU3NGY5MWI=
data/HISTORY.md CHANGED
@@ -1,6 +1,7 @@
1
1
  # beaker - History
2
2
  ## Tags
3
- * [LATEST - 12 Aug, 2014 (0cb4134e)](#LATEST)
3
+ * [LATEST - 15 Aug, 2014 (f6227484)](#LATEST)
4
+ * [beaker1.17.1 - 12 Aug, 2014 (72e60299)](#beaker1.17.1)
4
5
  * [beaker1.17.0 - 12 Aug, 2014 (fb482b56)](#beaker1.17.0)
5
6
  * [beaker1.16.0 - 17 Jul, 2014 (c1267696)](#beaker1.16.0)
6
7
  * [beaker1.15.0 - 8 Jul, 2014 (82bb4ef9)](#beaker1.15.0)
@@ -53,9 +54,97 @@
53
54
  * [pe1.2 - 6 Sep, 2011 (ba3dadd2)](#pe1.2)
54
55
 
55
56
  ## Details
56
- ### <a name = "LATEST">LATEST - 12 Aug, 2014 (0cb4134e)
57
+ ### <a name = "LATEST">LATEST - 15 Aug, 2014 (f6227484)
57
58
 
58
- * (HISTORY) update HISTORY.md for 1.17.1 gem (0cb4134e)
59
+ * (GEM) update version number for 1.17.2 (f6227484)
60
+
61
+ * Merge pull request #406 from anodelman/ec2 (5799458b)
62
+
63
+
64
+ ```
65
+ Merge pull request #406 from anodelman/ec2
66
+
67
+ (QENG-1090) beaker: exception when waiting for instance running in ec2
68
+ ```
69
+ * Merge pull request #403 from anodelman/win-fix (956aa18c)
70
+
71
+
72
+ ```
73
+ Merge pull request #403 from anodelman/win-fix
74
+
75
+ (QENG-1081) Beaker Fails During Pre-suite in the "install_pe"...
76
+ ```
77
+ * Merge pull request #405 from anodelman/utf-8-encoding (410490e4)
78
+
79
+
80
+ ```
81
+ Merge pull request #405 from anodelman/utf-8-encoding
82
+
83
+ (QENG-1087) beaker - failure in XML output
84
+ ```
85
+ * Merge pull request #404 from anodelman/fix-default (cc38a7f4)
86
+
87
+
88
+ ```
89
+ Merge pull request #404 from anodelman/fix-default
90
+
91
+ (QENG-1086) The master-start-curl-retries is preset to...
92
+ ```
93
+ * (QENG-1090) beaker: exception when waiting for instance running in ec2 (ae64c8e9)
94
+
95
+
96
+ ```
97
+ (QENG-1090) beaker: exception when waiting for instance running in ec2
98
+
99
+ - correctly capture AWS::EC2::Errors::InvalidInstanceID::NotFound when
100
+ checking status of newly created instance, deal with it as another
101
+ case that requires a retry
102
+ ```
103
+ * (QENG-1087) beaker - failure in XML output (5a392c1a)
104
+
105
+
106
+ ```
107
+ (QENG-1087) beaker - failure in XML output
108
+
109
+ - caused by improperly stripping unsupported unicode characters from xml
110
+ output
111
+ - add inclusion of 'jcode' for ruby 1.8 (included with Ruby and adds
112
+ lots of useful Unicode-oriented features to String and Regexp)
113
+ - tested on 1.9 and 1.8 and correctly replaced invalid unicode with
114
+ escaped hex value
115
+ ```
116
+ * (QENG-1086) The master-start-curl-retries is preset to... (77610212)
117
+
118
+
119
+ ```
120
+ (QENG-1086) The master-start-curl-retries is preset to...
121
+
122
+ ...0, which causes default hosts not to retry verifying a bounced master.
123
+
124
+ - host value being overwritten by default presets
125
+ ```
126
+ * (QENG-1081) Beaker Fails During Pre-suite in the "install_pe"... (f08d67b1)
127
+
128
+
129
+ ```
130
+ (QENG-1081) Beaker Fails During Pre-suite in the "install_pe"...
131
+
132
+ ... Function on Windows
133
+
134
+ - when using an array of hosts the command object was overwritten and
135
+ thus the platform specific information was lost
136
+ ```
137
+ ### <a name = "beaker1.17.1">beaker1.17.1 - 12 Aug, 2014 (72e60299)
138
+
139
+ * Merge pull request #399 from anodelman/make-gem (72e60299)
140
+
141
+
142
+ ```
143
+ Merge pull request #399 from anodelman/make-gem
144
+
145
+ create beaker 1.17.1 gem
146
+ ```
147
+ * (HISTORY) update HISTORY.md for 1.17.1 gem (21480832)
59
148
 
60
149
  * (GEM) create beaker 1.17.1 gem (07b67f32)
61
150
 
data/lib/beaker.rb CHANGED
@@ -33,6 +33,12 @@ module Beaker
33
33
  # Shared methods and helpers
34
34
  require 'beaker/shared'
35
35
 
36
+ # utf-8 support in ruby 1.8
37
+ if RUBY_VERSION.to_f < 1.9
38
+ require 'jcode'
39
+ $KCODE="u"
40
+ end
41
+
36
42
  # Add pry support when available
37
43
  begin
38
44
  require 'pry'
@@ -78,16 +78,16 @@ module Beaker
78
78
  # @raise [FailTest] Raises an exception if *command* obviously fails.
79
79
  def on(host, command, opts = {}, &block)
80
80
  block_on host do | host |
81
+ cur_command = command
81
82
  if command.is_a? Command
82
- command = command.cmd_line(host)
83
+ cur_command = command.cmd_line(host)
83
84
  end
84
85
  cmd_opts = {}
85
86
  #add any additional environment variables to the command
86
87
  if opts[:environment]
87
88
  cmd_opts['ENV'] = opts[:environment]
88
89
  end
89
- command = Command.new(command.to_s, [], cmd_opts)
90
- @result = host.exec(command, opts)
90
+ @result = host.exec(Command.new(cur_command.to_s, [], cmd_opts), opts)
91
91
 
92
92
  # Also, let additional checking be performed by the caller.
93
93
  if block_given?
@@ -19,7 +19,6 @@ module Unix
19
19
  h.merge({
20
20
  'user' => 'root',
21
21
  'group' => 'pe-puppet',
22
- 'master-start-curl-retries' => 120,
23
22
  'jvm-puppet-confdir' => '/etc/puppetlabs/jvm-puppet/conf.d',
24
23
  'puppetservice' => 'pe-httpd',
25
24
  'puppetpath' => '/etc/puppetlabs/puppet',
@@ -40,7 +39,6 @@ module Unix
40
39
  h.merge({
41
40
  'user' => 'root',
42
41
  'group' => 'puppet',
43
- 'master-start-curl-retries' => 120,
44
42
  'jvm-puppet-confdir' => '/etc/jvm-puppet/conf.d',
45
43
  'puppetservice' => 'puppetmaster',
46
44
  'puppetpath' => '/etc/puppet',
@@ -223,12 +223,16 @@ module Beaker
223
223
  # exponential backoff for each poll.
224
224
  # TODO: should probably be a in a shared method somewhere
225
225
  for tries in 1..10
226
- if instance.status == status
227
- # Always sleep, so the next command won't cause a throttle
228
- backoff_sleep(tries)
229
- break
230
- elsif tries == 10
231
- raise "Instance never reached state #{status}"
226
+ begin
227
+ if instance.status == status
228
+ # Always sleep, so the next command won't cause a throttle
229
+ backoff_sleep(tries)
230
+ break
231
+ elsif tries == 10
232
+ raise "Instance never reached state #{status}"
233
+ end
234
+ rescue AWS::EC2::Errors::InvalidInstanceID::NotFound => e
235
+ @logger.debug("Instance #{name} not yet available (#{e})")
232
236
  end
233
237
  backoff_sleep(tries)
234
238
  end
@@ -97,7 +97,7 @@ module Beaker
97
97
  :forge_host => 'vulcan-acceptance.delivery.puppetlabs.net',
98
98
  :log_level => 'verbose',
99
99
  :trace_limit => 10,
100
- :"master-start-curl-retries" => 0,
100
+ :"master-start-curl-retries" => 120,
101
101
  :options_file => nil,
102
102
  :type => 'pe',
103
103
  :provision => true,
@@ -155,12 +155,33 @@ module Beaker
155
155
  text.gsub(/(\e|\^\[)\[(\d*;)*\d*m/, '')
156
156
  end
157
157
 
158
+ # Determine if the provided number falls in the range of accepted xml unicode values
159
+ # See http://www.w3.org/TR/xml/#charsets for valid for valid character specifications.
160
+ # @param [Integer] int The number to check against
161
+ # @return [Boolean] True, if the number corresponds to a valid xml unicode character, otherwise false
162
+ def is_valid_xml(int)
163
+ return ( int == 0x9 or
164
+ int == 0xA or
165
+ ( int >= 0x0020 and int <= 0xD7FF ) or
166
+ ( int >= 0xE000 and int <= 0xFFFD ) or
167
+ ( int >= 0x100000 and int <= 0x10FFFF )
168
+ )
169
+ end
170
+
158
171
  # Escape invalid XML UTF-8 codes from provided string, see http://www.w3.org/TR/xml/#charsets for valid
159
172
  # character specification
160
173
  # @param [String] string The string to remove invalid codes from
161
174
  def escape_invalid_xml_chars string
162
- re = /\u0009|\u000A|\u000D|[\u0020-\uD7FF]|[\uE000-\uFFFD]|[\u10000-\u10FFFF]/
163
- return string.chars.map{|i| i =~ re ? i : "\\#{i.unpack("U*").join}"}.join
175
+ escaped_string = ""
176
+ string.chars.each do |i|
177
+ char_as_codestring = i.unpack("U*").join
178
+ if is_valid_xml(char_as_codestring.to_i)
179
+ escaped_string << i
180
+ else
181
+ escaped_string << "\\#{char_as_codestring}"
182
+ end
183
+ end
184
+ escaped_string
164
185
  end
165
186
 
166
187
  # Remove color codes and invalid XML characters from provided string
@@ -1,5 +1,5 @@
1
1
  module Beaker
2
2
  module Version
3
- STRING = '1.17.1'
3
+ STRING = '1.17.2'
4
4
  end
5
5
  end
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.1
4
+ version: 1.17.2
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-12 00:00:00.000000000 Z
11
+ date: 2014-08-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: minitest