beaker 2.28.0 → 2.29.0

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
- YWE3MmE2YzFiZGU2MDMwMDI1YTUyNTMxMDZhYmQ1OTY0NTRkMTk3Yg==
4
+ MzFmNmVhOTYzNjFkNjM3NjNmYTBjMDk3Njc1NGYwYmE2MGQ0NzM2ZA==
5
5
  data.tar.gz: !binary |-
6
- MDkxZmJjOTA5OWU4NDMyMmM4NjMxM2U5OTc5ZmY4NzFmNzM2YzA2ZQ==
6
+ ZGIzM2M4YzE1MzZkYWNiNDNiMGYxMDc2ZmI0MTVkZmEzN2I4OThmOA==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- ODNhOTgzNmEyZjIyMTI4OTE3OWE1MGEwOWQwNmQ3ZjA4YzliOGI0YTQ0Yzdi
10
- YmI1MjQ2Yzg0NDg5ZjYxYzZkYjMyZDYzNjNlZjgwNjdjMjAzNGQ3MWNhNWVh
11
- MjAxMmQzNDA1YTc2YjU0M2VlZjNhZmQ0ZjZhMWI1ZWYxZjQxZGQ=
9
+ NTA5Yjk4YWNkOWRmMjE5OGNlMGQ1NGQ2OTgwNWVhZjYyZjI5YjA1OTgxZWYx
10
+ NjM1ZjMxYzU2Yzg0MDViOWZkZjQzNzJhYjA2NmY5ZjU1MjMxNmMyMWU1MDli
11
+ M2U0NmI3Njk4OGU1YzIwYTM4NjVmOThhNmZjYzU0ODE0NTkzZDg=
12
12
  data.tar.gz: !binary |-
13
- Y2U5YmIxNDMzNmY2NjdjODg3NDgxNmY4MDFlYTcwOGU4NGE2ZDc4MGJhMmI1
14
- NGVjMjM4OGE3MmM5ZjQ0NTBhZDFkMGQ1MzZmNmZlMWIzZjM2NDFjZDdjNmM1
15
- NjExNjQ2OTA3MzJkMjU1MGE2NGVkYmFiNjgzMzMyYTBiZDNlY2M=
13
+ OTVlN2UzYjljMWQxNjU4ODE0ZTlkYmY0NDg0NmNlZTliOTUyOGE5ZWU2MTQ5
14
+ NGE5OTRlYWE5NjRkZWY2N2IzOTFmNTY4ZjVjMjk2MDRhZjU0ZjRiMWU4ZGNh
15
+ ZWJjNTEzY2ZjYTVmYTEzZTZiOWY2ZTc4MTc3YTk4OWMxMWI3ZjI=
data/HISTORY.md CHANGED
@@ -1,6 +1,7 @@
1
1
  # default - History
2
2
  ## Tags
3
- * [LATEST - 4 Nov, 2015 (aadc0fcc)](#LATEST)
3
+ * [LATEST - 18 Nov, 2015 (5ae7782f)](#LATEST)
4
+ * [2.28.0 - 4 Nov, 2015 (89829551)](#2.28.0)
4
5
  * [2.27.0 - 21 Oct, 2015 (0378d13a)](#2.27.0)
5
6
  * [2.26.0 - 13 Oct, 2015 (427a512b)](#2.26.0)
6
7
  * [2.25.0 - 1 Oct, 2015 (51d4cb1a)](#2.25.0)
@@ -100,7 +101,105 @@
100
101
  * [pe1.2 - 6 Sep, 2011 (ba3dadd2)](#pe1.2)
101
102
 
102
103
  ## Details
103
- ### <a name = "LATEST">LATEST - 4 Nov, 2015 (aadc0fcc)
104
+ ### <a name = "LATEST">LATEST - 18 Nov, 2015 (5ae7782f)
105
+
106
+ * (GEM) update beaker version to 2.29.0 (5ae7782f)
107
+
108
+ * Merge pull request #1011 from developerinlondon/feature/BKR-625-add-mounting-folder-option (4bc5750e)
109
+
110
+
111
+ ```
112
+ Merge pull request #1011 from developerinlondon/feature/BKR-625-add-mounting-folder-option
113
+
114
+ (BKR-625) Added ability to mount a folder.
115
+ ```
116
+ * Merge pull request #1010 from dylanratcliffe/bkr-624/fix-line_prefix_length (e48e8752)
117
+
118
+
119
+ ```
120
+ Merge pull request #1010 from dylanratcliffe/bkr-624/fix-line_prefix_length
121
+
122
+ (BKR-624) Added a setter for line_prefix
123
+ ```
124
+ * (BKR-624) Modified `step_in` and `step_out` methods so that you can set (e72689b5)
125
+
126
+
127
+ ```
128
+ (BKR-624) Modified `step_in` and `step_out` methods so that you can set
129
+ `line_prefix` explicitly and they will still work.
130
+ ```
131
+ * BKR-625: Added ability to mount a folder. (e047bd84)
132
+
133
+
134
+ ```
135
+ BKR-625: Added ability to mount a folder.
136
+
137
+ Without this patch there is no way to mount a local folder inside the beaker nodes.
138
+
139
+ With this patch folders can be mounted similar to below:
140
+
141
+
142
+ HOSTS:
143
+ ubuntu-1404-x64-master:
144
+ roles:
145
+ - master
146
+ - agent
147
+ - dashboard
148
+ - database
149
+ platform: ubuntu-1404-x86_64
150
+ hypervisor: vagrant
151
+ box: puppetlabs/ubuntu-14.04-64-nocm
152
+ box_url: https://vagrantcloud.com/puppetlabs/boxes/ubuntu-14.04-64-nocm
153
+ mount_folders:
154
+ folder1:
155
+ from: ./
156
+ to: /vagrant/folder1
157
+ tmp:
158
+ from: /tmp
159
+ to: /vagrant/tmp
160
+ ip: 192.168.20.20
161
+ ubuntu-1404-x64-agent:
162
+ roles:
163
+ - agent
164
+ platform: ubuntu-1404-x86_64
165
+ hypervisor: vagrant
166
+ box: puppetlabs/ubuntu-14.04-64-nocm
167
+ box_url: https://vagrantcloud.com/puppetlabs/boxes/ubuntu-14.04-64-nocm
168
+ ip: 192.168.21.21
169
+ CONFIG:
170
+ nfs_server: none
171
+ consoleport: 443
172
+
173
+
174
+
175
+ In the above beaker will mount the folders ./ to /vagrant/folder1 and the folder /tmp to /vagrant/tmp
176
+
177
+ This relates to the new feature ticket opened on puppetlab here: https://tickets.puppetlabs.com/browse/BKR-625
178
+ ```
179
+ * Merge pull request #1007 from adrienthebo/bkr-517-print-exception-class-message (5780f563)
180
+
181
+
182
+ ```
183
+ Merge pull request #1007 from adrienthebo/bkr-517-print-exception-class-message
184
+
185
+ (BRK-617) Print exception message for test cases
186
+ ```
187
+ * (BRK-617) Print exception message for test cases (788b9cda)
188
+
189
+
190
+ ```
191
+ (BRK-617) Print exception message for test cases
192
+
193
+ Some exceptions implement the `#inspect` method to only print the class
194
+ name or otherwise change the output to not include the error message in
195
+ question, which makes such exceptions very challenging to deubg. This
196
+ commit changes the test case exception printing method to explicitly
197
+ print the exception class and message so that there's always relevant
198
+ context available when an exception is raised.
199
+ ```
200
+ ### <a name = "2.28.0">2.28.0 - 4 Nov, 2015 (89829551)
201
+
202
+ * (HISTORY) update beaker history for gem release 2.28.0 (89829551)
104
203
 
105
204
  * (GEM) update beaker version to 2.28.0 (aadc0fcc)
106
205
 
@@ -0,0 +1,40 @@
1
+ When using the Vagrant Hypervisor, beaker can mount specific local directories as synced_folders inside the vagrant box.
2
+ This is done by using the 'mount_folders' option in the nodeset file.
3
+
4
+ Example hosts file:
5
+
6
+ HOSTS:
7
+ ubuntu-1404-x64-master:
8
+ roles:
9
+ - master
10
+ - agent
11
+ - dashboard
12
+ - database
13
+ platform: ubuntu-1404-x86_64
14
+ hypervisor: vagrant
15
+ box: puppetlabs/ubuntu-14.04-64-nocm
16
+ box_url: https://vagrantcloud.com/puppetlabs/boxes/ubuntu-14.04-64-nocm
17
+ mount_folders:
18
+ folder1:
19
+ from: ./
20
+ to: /vagrant/folder1
21
+ tmp:
22
+ from: /tmp
23
+ to: /vagrant/tmp
24
+ ip: 192.168.20.20
25
+ ubuntu-1404-x64-agent:
26
+ roles:
27
+ - agent
28
+ platform: ubuntu-1404-x86_64
29
+ hypervisor: vagrant
30
+ box: puppetlabs/ubuntu-14.04-64-nocm
31
+ box_url: https://vagrantcloud.com/puppetlabs/boxes/ubuntu-14.04-64-nocm
32
+ ip: 192.168.21.21
33
+ CONFIG:
34
+ nfs_server: none
35
+ consoleport: 443
36
+
37
+ In the above beaker will mount the folders ./ to /vagrant/folder1 and the folder /tmp to /vagrant/tmp
38
+
39
+ ## Supported Virtualization Providers ##
40
+ * [Vagrant](Vagrant-Support.md)
@@ -35,6 +35,12 @@ module Beaker
35
35
  v_file << " v.vm.synced_folder '.', '/vagrant', disabled: true\n" if host['synced_folder'] == 'disabled'
36
36
  v_file << " v.vm.network :private_network, ip: \"#{host['ip'].to_s}\", :netmask => \"#{host['netmask'] ||= "255.255.0.0"}\", :mac => \"#{randmac}\"\n"
37
37
 
38
+ unless host['mount_folders'].nil?
39
+ host['mount_folders'].each do |name, folder|
40
+ v_file << " v.vm.synced_folder '#{folder[:from]}', '#{folder[:to]}', create: true\n"
41
+ end
42
+ end
43
+
38
44
  if /windows/i.match(host['platform'])
39
45
  v_file << " v.vm.network :forwarded_port, guest: 3389, host: 3389, id: 'rdp', auto_correct: true\n"
40
46
  v_file << " v.vm.network :forwarded_port, guest: 5985, host: 5985, id: 'winrm', auto_correct: true\n"
data/lib/beaker/logger.rb CHANGED
@@ -78,7 +78,6 @@ module Beaker
78
78
  end
79
79
 
80
80
  @last_result = nil
81
- @line_prefix_length = 0
82
81
  @line_prefix = ''
83
82
 
84
83
  @destinations = []
@@ -118,7 +117,6 @@ module Beaker
118
117
  dests.each {|dest| add_destination(dest)}
119
118
  end
120
119
 
121
-
122
120
  # Turn on/off STDOUT logging
123
121
  # @param [Boolean] off If true, disable STDOUT logging, if false enable STDOUT logging
124
122
  def quiet(off = true)
@@ -238,17 +236,14 @@ module Beaker
238
236
  #
239
237
  # @return nil
240
238
  def step_in
241
- @line_prefix_length += 2
242
- @line_prefix = ' ' * @line_prefix_length
239
+ self.line_prefix = self.line_prefix + ' '
243
240
  end
244
241
 
245
242
  # Sets the step level appropriately for logging to be indented correctly
246
243
  #
247
244
  # @return nil
248
245
  def step_out
249
- @line_prefix_length -= 2
250
- @line_prefix_length = 0 if @line_prefix_length < 0
251
- @line_prefix = ' ' * @line_prefix_length
246
+ self.line_prefix = self.line_prefix.chop.chop
252
247
  end
253
248
 
254
249
  # Custom reporting for messages generated by host SUTs.
@@ -160,7 +160,7 @@ module Beaker
160
160
  #
161
161
  # @param exception [Exception] exception to fail with
162
162
  def log_and_fail_test(exception)
163
- logger.error(exception.inspect)
163
+ logger.error("#{exception.class}: #{exception.message}")
164
164
  bt = exception.backtrace
165
165
  logger.pretty_backtrace(bt).each_line do |line|
166
166
  logger.error(line)
@@ -1,5 +1,5 @@
1
1
  module Beaker
2
2
  module Version
3
- STRING = '2.28.0'
3
+ STRING = '2.29.0'
4
4
  end
5
5
  end
@@ -14,7 +14,12 @@ module Beaker
14
14
  let( :vagrant ) { Beaker::Vagrant.new( @hosts, options ) }
15
15
 
16
16
  before :each do
17
- @hosts = make_hosts()
17
+ @hosts = make_hosts({
18
+ :mount_folders => {
19
+ :test_temp => {:from => './', :to => '/temp'},
20
+ :test_tmp => {:from => '../', :to => '/tmp'}
21
+ }
22
+ })
18
23
  end
19
24
 
20
25
  it "stores the vagrant file in $WORKINGDIR/.vagrant/beaker_vagrant_files/sample.cfg" do
@@ -41,6 +46,8 @@ Vagrant.configure("2") do |c|
41
46
  v.vm.box_url = 'http://address.for.my.box.vm1'
42
47
  v.vm.box_check_update = 'true'
43
48
  v.vm.network :private_network, ip: "ip.address.for.vm1", :netmask => "255.255.0.0", :mac => "0123456789"
49
+ v.vm.synced_folder './', '/temp', create: true
50
+ v.vm.synced_folder '../', '/tmp', create: true
44
51
  v.vm.provider :virtualbox do |vb|
45
52
  vb.customize ['modifyvm', :id, '--memory', '1024', '--cpus', '1']
46
53
  end
@@ -51,6 +58,8 @@ Vagrant.configure("2") do |c|
51
58
  v.vm.box_url = 'http://address.for.my.box.vm2'
52
59
  v.vm.box_check_update = 'true'
53
60
  v.vm.network :private_network, ip: "ip.address.for.vm2", :netmask => "255.255.0.0", :mac => "0123456789"
61
+ v.vm.synced_folder './', '/temp', create: true
62
+ v.vm.synced_folder '../', '/tmp', create: true
54
63
  v.vm.provider :virtualbox do |vb|
55
64
  vb.customize ['modifyvm', :id, '--memory', '1024', '--cpus', '1']
56
65
  end
@@ -61,6 +70,8 @@ Vagrant.configure("2") do |c|
61
70
  v.vm.box_url = 'http://address.for.my.box.vm3'
62
71
  v.vm.box_check_update = 'true'
63
72
  v.vm.network :private_network, ip: "ip.address.for.vm3", :netmask => "255.255.0.0", :mac => "0123456789"
73
+ v.vm.synced_folder './', '/temp', create: true
74
+ v.vm.synced_folder '../', '/tmp', create: true
64
75
  v.vm.provider :virtualbox do |vb|
65
76
  vb.customize ['modifyvm', :id, '--memory', '1024', '--cpus', '1']
66
77
  end
@@ -47,10 +47,10 @@ module Beaker
47
47
 
48
48
  context '#prefix_log_line' do
49
49
  def prefix_log_line_test_compare_helper(in_test, out_answer, step_in_loop=1)
50
- logger.instance_variable_set( :@line_prefix_length, 0 )
50
+ logger.line_prefix = ''
51
51
  step_in_loop.times { logger.step_in() }
52
52
  expect( logger.prefix_log_line(in_test) ).to be === out_answer
53
- logger.instance_variable_set( :@line_prefix_length, 0 )
53
+ logger.line_prefix = ''
54
54
  end
55
55
 
56
56
  it 'can be successfully called with a arrays' do
@@ -86,33 +86,63 @@ module Beaker
86
86
 
87
87
  context '#step_* methods' do
88
88
  it 'steps in correctly (simple case)' do
89
- logger.instance_variable_set( :@line_prefix_length, 0 )
89
+ logger.line_prefix = ''
90
90
  logger.step_in()
91
- expect( logger.instance_variable_get( :@line_prefix_length ) ).to be === 2
92
91
  expect( logger.line_prefix ).to be === ' '
93
- logger.instance_variable_set( :@line_prefix_length, 0 )
92
+ logger.line_prefix = ''
94
93
  end
95
94
 
96
95
  it 'sets length correctly in mixed scenario ' do
97
- logger.instance_variable_set( :@line_prefix_length, 0 )
96
+ logger.line_prefix = ''
98
97
  logger.step_in()
99
98
  logger.step_in()
100
99
  logger.step_out()
101
100
  logger.step_in()
102
101
  logger.step_in()
103
102
  logger.step_out()
104
- expect( logger.instance_variable_get( :@line_prefix_length ) ).to be === 4
105
103
  expect( logger.line_prefix ).to be === ' '
106
- logger.instance_variable_set( :@line_prefix_length, 0 )
104
+ logger.line_prefix = ''
107
105
  end
108
106
 
109
107
  it 'can be unevenly stepped out, will remain at base: 0' do
110
- logger.instance_variable_set( :@line_prefix_length, 0 )
108
+ logger.line_prefix = ''
111
109
  logger.step_in()
112
110
  10.times { logger.step_out() }
113
- expect( logger.instance_variable_get( :@line_prefix_length ) ).to be === 0
114
111
  expect( logger.line_prefix ).to be === ''
115
112
  end
113
+
114
+ it 'can handle arbitrary strings as prefixes' do
115
+ logger.line_prefix = ''
116
+ logger.line_prefix = 'Some string:'
117
+ expect( logger.line_prefix ).to be === 'Some string:'
118
+ logger.line_prefix = ''
119
+ end
120
+
121
+ it 'can handle stepping in with arbitrary strings' do
122
+ logger.line_prefix = ''
123
+ logger.line_prefix = 'Some string:'
124
+ logger.step_in()
125
+ logger.step_in()
126
+ expect( logger.line_prefix ).to be === 'Some string: '
127
+ logger.line_prefix = ''
128
+ end
129
+
130
+ it 'can handle stepping out with arbitrary strings' do
131
+ logger.line_prefix = ''
132
+ logger.line_prefix = 'Some string:'
133
+ 10.times { logger.step_out() }
134
+ expect( logger.line_prefix ).to be === ''
135
+ logger.line_prefix = ''
136
+ end
137
+
138
+ it 'can handle stepping in and out with arbitrary strings' do
139
+ logger.line_prefix = ''
140
+ logger.line_prefix = 'Some string:'
141
+ 10.times { logger.step_in() }
142
+ 10.times { logger.step_out() }
143
+ expect( logger.line_prefix ).to be === 'Some string:'
144
+ logger.line_prefix = ''
145
+ end
116
146
  end
117
147
 
118
148
  context 'new' 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: 2.28.0
4
+ version: 2.29.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Puppetlabs
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-11-04 00:00:00.000000000 Z
11
+ date: 2015-11-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
@@ -546,6 +546,7 @@ files:
546
546
  - docs/hosts/eos.md
547
547
  - docs/hypervisors/README.md
548
548
  - docs/hypervisors/aws.md
549
+ - docs/hypervisors/vagrant.md
549
550
  - docs/vSphere-Support.md
550
551
  - ext/completion/beaker-completion.bash
551
552
  - lib/beaker.rb