Skip to content

Commit b7f9a82

Browse files
authored
Merge pull request #69 from mhashizume/PA-5022/main/beaker-deprecated
Update deprecated Beaker methods
2 parents 0ef4e11 + 63c1d31 commit b7f9a82

File tree

10 files changed

+110
-104
lines changed

10 files changed

+110
-104
lines changed

spec/acceptance/tests/zfs/basic_tests_spec.rb

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -24,35 +24,35 @@
2424
solaris_agents.each do |agent|
2525
it 'can create and clean up an idempotent resource' do
2626
# ZFS: basic - ensure it is created
27-
apply_manifest_on(agent, 'zfs {"tstpool/tstfs": ensure=>present}') do
28-
assert_match(%r{ensure: created}, @result.stdout, "err: #{agent}")
27+
apply_manifest_on(agent, 'zfs {"tstpool/tstfs": ensure=>present}') do |result|
28+
assert_match(%r{ensure: created}, result.stdout, "err: #{agent}")
2929
end
3030

3131
# ZFS: idempotence - create
32-
apply_manifest_on(agent, 'zfs {"tstpool/tstfs": ensure=>present}') do
33-
assert_no_match(%r{ensure: created}, @result.stdout, "err: #{agent}")
32+
apply_manifest_on(agent, 'zfs {"tstpool/tstfs": ensure=>present}') do |result|
33+
refute_match(%r{ensure: created}, result.stdout, "err: #{agent}")
3434
end
3535

3636
# ZFS: cleanup for next test
37-
apply_manifest_on(agent, 'zfs {"tstpool/tstfs": ensure=>absent}') do
38-
assert_match(%r{ensure: removed}, @result.stdout, "err: #{agent}")
37+
apply_manifest_on(agent, 'zfs {"tstpool/tstfs": ensure=>absent}') do |result|
38+
assert_match(%r{ensure: removed}, result.stdout, "err: #{agent}")
3939
end
4040
end
4141

4242
it 'can create and clean up a resource with a mount point' do
4343
# ZFS: create with a mount point
44-
apply_manifest_on(agent, 'zfs {"tstpool/tstfs": ensure=>present, mountpoint=>"/ztstpool/mnt"}') do
45-
assert_match(%r{ensure: created}, @result.stdout, "err: #{agent}")
44+
apply_manifest_on(agent, 'zfs {"tstpool/tstfs": ensure=>present, mountpoint=>"/ztstpool/mnt"}') do |result|
45+
assert_match(%r{ensure: created}, result.stdout, "err: #{agent}")
4646
end
4747

4848
# ZFS: change mount point and verify
49-
apply_manifest_on(agent, 'zfs {"tstpool/tstfs": ensure=>present, mountpoint=>"/ztstpool/mnt2"}') do
50-
assert_match(%r{mountpoint changed '.ztstpool.mnt'.* to '.ztstpool.mnt2'}, @result.stdout, "err: #{agent}")
49+
apply_manifest_on(agent, 'zfs {"tstpool/tstfs": ensure=>present, mountpoint=>"/ztstpool/mnt2"}') do |result|
50+
assert_match(%r{mountpoint changed '.ztstpool.mnt'.* to '.ztstpool.mnt2'}, result.stdout, "err: #{agent}")
5151
end
5252

5353
# ZFS: ensure can be removed
54-
apply_manifest_on(agent, 'zfs { "tstpool/tstfs": ensure=>absent}') do
55-
assert_match(%r{ensure: removed}, @result.stdout, "err: #{agent}")
54+
apply_manifest_on(agent, 'zfs { "tstpool/tstfs": ensure=>absent}') do |result|
55+
assert_match(%r{ensure: removed}, result.stdout, "err: #{agent}")
5656
end
5757
end
5858
end

spec/acceptance/tests/zfs/should_be_idempotent_spec.rb

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,23 +18,23 @@
1818
solaris_agents.each do |agent|
1919
it 'creates and updates a resource in an idempotent way' do
2020
# ZFS: create with a mount point
21-
apply_manifest_on(agent, 'zfs {"tstpool/tstfs": ensure=>present, mountpoint=>"/ztstpool/mnt"}') do
22-
assert_match(%r{ensure: created}, @result.stdout, "err: #{agent}")
21+
apply_manifest_on(agent, 'zfs {"tstpool/tstfs": ensure=>present, mountpoint=>"/ztstpool/mnt"}') do |result|
22+
assert_match(%r{ensure: created}, result.stdout, "err: #{agent}")
2323
end
2424

2525
# ZFS: idempotence - create
26-
apply_manifest_on(agent, 'zfs {"tstpool/tstfs": ensure=>present}') do
27-
assert_no_match(%r{ensure: created}, @result.stdout, "err: #{agent}")
26+
apply_manifest_on(agent, 'zfs {"tstpool/tstfs": ensure=>present}') do |result|
27+
refute_match(%r{ensure: created}, result.stdout, "err: #{agent}")
2828
end
2929

3030
# ZFS: change mount point and verify
31-
apply_manifest_on(agent, 'zfs {"tstpool/tstfs": ensure=>present, mountpoint=>"/ztstpool/mnt2"}') do
32-
assert_match(%r{mountpoint changed '.ztstpool.mnt'.* to '.ztstpool.mnt2'}, @result.stdout, "err: #{agent}")
31+
apply_manifest_on(agent, 'zfs {"tstpool/tstfs": ensure=>present, mountpoint=>"/ztstpool/mnt2"}') do |result|
32+
assert_match(%r{mountpoint changed '.ztstpool.mnt'.* to '.ztstpool.mnt2'}, result.stdout, "err: #{agent}")
3333
end
3434

3535
# ZFS: change mount point and verify idempotence
36-
apply_manifest_on(agent, 'zfs {"tstpool/tstfs": ensure=>present, mountpoint=>"/ztstpool/mnt2"}') do
37-
assert_no_match(%r{changed}, @result.stdout, "err: #{agent}")
36+
apply_manifest_on(agent, 'zfs {"tstpool/tstfs": ensure=>present, mountpoint=>"/ztstpool/mnt2"}') do |result|
37+
refute_match(%r{changed}, result.stdout, "err: #{agent}")
3838
end
3939
end
4040
end

spec/acceptance/tests/zfs/should_create_spec.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@
1818
solaris_agents.each do |agent|
1919
it 'creates a zfs resource' do
2020
# ZFS: ensure it is created
21-
apply_manifest_on(agent, 'zfs {"tstpool/tstfs": ensure=>present}') do
22-
assert_match(%r{ensure: created}, @result.stdout, "err: #{agent}")
21+
apply_manifest_on(agent, 'zfs {"tstpool/tstfs": ensure=>present}') do |result|
22+
assert_match(%r{ensure: created}, result.stdout, "err: #{agent}")
2323
end
2424

2525
# verify
26-
on(agent, 'zfs list') do
27-
assert_match(%r{tstpool.tstfs}, @result.stdout, "err: #{agent}")
26+
on(agent, 'zfs list') do |result|
27+
assert_match(%r{tstpool.tstfs}, result.stdout, "err: #{agent}")
2828
end
2929
end
3030
end

spec/acceptance/tests/zfs/should_query_spec.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,18 @@
1818
solaris_agents.each do |agent|
1919
it 'can query and report both managed and unmanaged resources' do
2020
# ZFS: basic - ensure it is created
21-
apply_manifest_on(agent, 'zfs {"tstpool/tstfs": ensure=>present}') do
22-
assert_match(%r{ensure: created}, @result.stdout, "err: #{agent}")
21+
apply_manifest_on(agent, 'zfs {"tstpool/tstfs": ensure=>present}') do |result|
22+
assert_match(%r{ensure: created}, result.stdout, "err: #{agent}")
2323
end
2424

2525
# query one.
26-
on(agent, 'puppet resource zfs tstpool/tstfs') do
27-
assert_match(%r{ensure *=> *'present'}, @result.stdout, "err: #{agent}")
26+
on(agent, 'puppet resource zfs tstpool/tstfs') do |result|
27+
assert_match(%r{ensure *=> *'present'}, result.stdout, "err: #{agent}")
2828
end
2929

3030
# query all.
31-
on(agent, 'puppet resource zfs') do
32-
assert_match(%r{tstpool.tstfs}, @result.stdout, "err: #{agent}")
31+
on(agent, 'puppet resource zfs') do |result|
32+
assert_match(%r{tstpool.tstfs}, result.stdout, "err: #{agent}")
3333
end
3434
end
3535
end

spec/acceptance/tests/zfs/should_remove_spec.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@
1818
solaris_agents.each do |agent|
1919
it 'can remove resources' do
2020
# ZFS: create
21-
on agent, 'zfs create tstpool/tstfs'
21+
on(agent, 'zfs create tstpool/tstfs')
2222

2323
# ZFS: ensure can be removed.
24-
apply_manifest_on(agent, 'zfs { "tstpool/tstfs": ensure=>absent}') do
25-
assert_match(%r{ensure: removed}, @result.stdout, "err: #{agent}")
24+
apply_manifest_on(agent, 'zfs { "tstpool/tstfs": ensure=>absent}') do |result|
25+
assert_match(%r{ensure: removed}, result.stdout, "err: #{agent}")
2626
end
2727
end
2828
end

spec/acceptance/tests/zpool/basic_tests_spec.rb

Lines changed: 57 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -18,81 +18,81 @@
1818
solaris_agents.each do |agent|
1919
it 'can create an idempotent zpool resource' do
2020
# ZPool: create zpool disk
21-
apply_manifest_on(agent, "zpool{ tstpool: ensure=>present, disk=>'/ztstpool/dsk1' }") do
22-
assert_match(%r{ensure: created}, @result.stdout, "err: #{agent}")
21+
apply_manifest_on(agent, "zpool{ tstpool: ensure=>present, disk=>'/ztstpool/dsk1' }") do |result|
22+
assert_match(%r{ensure: created}, result.stdout, "err: #{agent}")
2323
end
2424

2525
# ZPool: zpool should be idempotent
26-
apply_manifest_on(agent, "zpool{ tstpool: ensure=>present, disk=>'/ztstpool/dsk1' }") do
27-
assert_no_match(%r{ensure: created}, @result.stdout, "err: #{agent}")
26+
apply_manifest_on(agent, "zpool{ tstpool: ensure=>present, disk=>'/ztstpool/dsk1' }") do |result|
27+
refute_match(%r{ensure: created}, result.stdout, "err: #{agent}")
2828
end
2929

3030
# ZPool: remove zpool
31-
apply_manifest_on(agent, 'zpool{ tstpool: ensure=>absent }') do
32-
assert_match(%r{ensure: removed}, @result.stdout, "err: #{agent}")
31+
apply_manifest_on(agent, 'zpool{ tstpool: ensure=>absent }') do |result|
32+
assert_match(%r{ensure: removed}, result.stdout, "err: #{agent}")
3333
end
3434
end
3535

3636
it 'can create a zpool resource with a disk array' do
3737
# ZPool: create zpool with a disk array
38-
apply_manifest_on(agent, "zpool{ tstpool: ensure=>present, disk=>['/ztstpool/dsk1','/ztstpool/dsk2'] }") do
39-
assert_match(%r{ensure: created}, @result.stdout, "err: #{agent}")
38+
apply_manifest_on(agent, "zpool{ tstpool: ensure=>present, disk=>['/ztstpool/dsk1','/ztstpool/dsk2'] }") do |result|
39+
assert_match(%r{ensure: created}, result.stdout, "err: #{agent}")
4040
end
4141

4242
# ZPool: verify disk array was created
43-
on agent, 'zpool list -H' do
44-
assert_match(%r{tstpool}, @result.stdout, "err: #{agent}")
43+
on(agent, 'zpool list -H') do |result|
44+
assert_match(%r{tstpool}, result.stdout, "err: #{agent}")
4545
end
4646

4747
# ZPool: verify puppet resource reports on the disk array
48-
on(agent, puppet('resource zpool tstpool')) do
49-
assert_match(%r{ensure\s+=> 'present'}, @result.stdout, "err: #{agent}")
50-
assert_match(%r{disk +=> .'.+dsk1 .+dsk2'.}, @result.stdout, "err: #{agent}")
48+
on(agent, puppet('resource zpool tstpool')) do |result|
49+
assert_match(%r{ensure\s+=> 'present'}, result.stdout, "err: #{agent}")
50+
assert_match(%r{disk +=> .'.+dsk1 .+dsk2'.}, result.stdout, "err: #{agent}")
5151
end
5252

5353
# ZPool: remove zpool in preparation for mirror tests
54-
apply_manifest_on(agent, 'zpool{ tstpool: ensure=>absent }') do
55-
assert_match(%r{ensure: removed}, @result.stdout, "err: #{agent}")
54+
apply_manifest_on(agent, 'zpool{ tstpool: ensure=>absent }') do |result|
55+
assert_match(%r{ensure: removed}, result.stdout, "err: #{agent}")
5656
end
5757
end
5858

5959
it 'can create a mirrored zpool resource with 3 virtual devices' do
6060
# ZPool: create mirrored zpool with 3 virtual devices
61-
apply_manifest_on(agent, "zpool{ tstpool: ensure=>present, mirror=>['/ztstpool/dsk1 /ztstpool/dsk2 /ztstpool/dsk3'] }") do
62-
assert_match(%r{ensure: created}, @result.stdout, "err: #{agent}")
61+
apply_manifest_on(agent, "zpool{ tstpool: ensure=>present, mirror=>['/ztstpool/dsk1 /ztstpool/dsk2 /ztstpool/dsk3'] }") do |result|
62+
assert_match(%r{ensure: created}, result.stdout, "err: #{agent}")
6363
end
6464

6565
# ZPool: verify mirrors were created
66-
on agent, 'zpool status -v tstpool' do
66+
on(agent, 'zpool status -v tstpool') do |result|
6767
# NAME STATE READ WRITE CKSUM
6868
# tstpool ONLINE 0 0 0
6969
# mirror-0 ONLINE 0 0 0
7070
# /ztstpool/dsk1 ONLINE 0 0 0
7171
# /ztstpool/dsk2 ONLINE 0 0 0
7272
# /ztstpool/dsk3 ONLINE 0 0 0
73-
assert_match(%r{tstpool.*\n\s+mirror.*\n\s*/ztstpool/dsk1.*\n\s*/ztstpool/dsk2.*\n\s*/ztstpool/dsk3}m, @result.stdout, "err: #{agent}")
73+
assert_match(%r{tstpool.*\n\s+mirror.*\n\s*/ztstpool/dsk1.*\n\s*/ztstpool/dsk2.*\n\s*/ztstpool/dsk3}m, result.stdout, "err: #{agent}")
7474
end
7575

7676
# ZPool: verify puppet resource reports on the mirror
77-
on(agent, puppet('resource zpool tstpool')) do
78-
assert_match(%r{ensure\s+=> 'present'}, @result.stdout, "err: #{agent}")
79-
assert_match(%r{mirror\s+=> \['/ztstpool/dsk1 /ztstpool/dsk2 /ztstpool/dsk3'\]}, @result.stdout, "err: #{agent}")
77+
on(agent, puppet('resource zpool tstpool')) do |result|
78+
assert_match(%r{ensure\s+=> 'present'}, result.stdout, "err: #{agent}")
79+
assert_match(%r{mirror\s+=> \['/ztstpool/dsk1 /ztstpool/dsk2 /ztstpool/dsk3'\]}, result.stdout, "err: #{agent}")
8080
end
8181

8282
# ZPool: remove zpool in preparation for multiple mirrors
83-
apply_manifest_on(agent, 'zpool{ tstpool: ensure=>absent }') do
84-
assert_match(%r{ensure: removed}, @result.stdout, "err: #{agent}")
83+
apply_manifest_on(agent, 'zpool{ tstpool: ensure=>absent }') do |result|
84+
assert_match(%r{ensure: removed}, result.stdout, "err: #{agent}")
8585
end
8686
end
8787

8888
it 'can create two mirrored zpools each with two virtual devices' do
8989
# ZPool: create 2 mirrored zpools each with 2 virtual devices
90-
apply_manifest_on(agent, "zpool{ tstpool: ensure=>present, mirror=>['/ztstpool/dsk1 /ztstpool/dsk2', '/ztstpool/dsk3 /ztstpool/dsk5'] }") do
91-
assert_match(%r{ensure: created}, @result.stdout, "err: #{agent}")
90+
apply_manifest_on(agent, "zpool{ tstpool: ensure=>present, mirror=>['/ztstpool/dsk1 /ztstpool/dsk2', '/ztstpool/dsk3 /ztstpool/dsk5'] }") do |result|
91+
assert_match(%r{ensure: created}, result.stdout, "err: #{agent}")
9292
end
9393

9494
# ZPool: verify both mirrors were created
95-
on agent, 'zpool status -v tstpool' do
95+
on(agent, 'zpool status -v tstpool') do |result|
9696
# NAME STATE READ WRITE CKSUM
9797
# tstpool ONLINE 0 0 0
9898
# mirror-0 ONLINE 0 0 0
@@ -101,58 +101,64 @@
101101
# mirror-1 ONLINE 0 0 0
102102
# /ztstpool/dsk3 ONLINE 0 0 0
103103
# /ztstpool/dsk5 ONLINE 0 0 0
104-
assert_match(%r{tstpool.*\n\s+mirror.*\n\s*/ztstpool/dsk1.*\n\s*/ztstpool/dsk2.*\n\s+mirror.*\n\s*/ztstpool\/dsk3.*\n\s*/ztstpool/dsk5}m, @result.stdout, "err: #{agent}")
104+
assert_match(%r{tstpool.*\n\s+mirror.*\n\s*/ztstpool/dsk1.*\n\s*/ztstpool/dsk2.*\n\s+mirror.*\n\s*/ztstpool\/dsk3.*\n\s*/ztstpool/dsk5}m, result.stdout, "err: #{agent}")
105105
end
106106

107107
# ZPool: verify puppet resource reports on both mirrors
108-
on(agent, puppet('resource zpool tstpool')) do
109-
assert_match(%r{ensure\s+=> 'present'}, @result.stdout, "err: #{agent}")
110-
assert_match(%r{mirror\s+=> \['/ztstpool/dsk1 /ztstpool/dsk2', '/ztstpool/dsk3 /ztstpool/dsk5'\]}, @result.stdout, "err: #{agent}")
108+
on(agent, puppet('resource zpool tstpool')) do |result|
109+
assert_match(%r{ensure\s+=> 'present'}, result.stdout, "err: #{agent}")
110+
assert_match(%r{mirror\s+=> \['/ztstpool/dsk1 /ztstpool/dsk2', '/ztstpool/dsk3 /ztstpool/dsk5'\]}, result.stdout, "err: #{agent}")
111111
end
112112

113113
# ZPool: remove zpool in preparation for raidz test
114-
apply_manifest_on(agent, 'zpool{ tstpool: ensure=>absent }') do
115-
assert_match(%r{ensure: removed}, @result.stdout, "err: #{agent}")
114+
apply_manifest_on(agent, 'zpool{ tstpool: ensure=>absent }') do |result|
115+
assert_match(%r{ensure: removed}, result.stdout, "err: #{agent}")
116116
end
117117
end
118118

119119
it 'can create raidz pool consisting of three virtual devices' do
120120
# ZPool: create raidz pool consisting of 3 virtual devices
121-
apply_manifest_on(agent, "zpool{ tstpool: ensure=>present, raidz=>['/ztstpool/dsk1 /ztstpool/dsk2 /ztstpool/dsk3'] }") do
122-
assert_match(%r{ensure: created}, @result.stdout, "err: #{agent}")
121+
apply_manifest_on(agent, "zpool{ tstpool: ensure=>present, raidz=>['/ztstpool/dsk1 /ztstpool/dsk2 /ztstpool/dsk3'] }") do |result|
122+
pp "THIS IS THE RESULT: #{result} THIS IS THE RESULT'S CLASS #{result.class}"
123+
pp "THIS IS THE RESULT METHODS #{result.methods.sort}"
124+
pp "RESULT.STDOUT IS #{result.stdout} RESULT.STDERR IS #{result.stderr}"
125+
assert_match(%r{ensure: created}, result.stdout, "err: #{agent}")
123126
end
124127

125128
# ZPool: verify raidz pool was created
126-
on agent, 'zpool status -v tstpool' do
129+
on(agent, 'zpool status -v tstpool') do |result|
127130
# NAME STATE READ WRITE CKSUM
128131
# tstpool ONLINE 0 0 0
129132
# raidz1-0 ONLINE 0 0 0
130133
# /ztstpool/dsk1 ONLINE 0 0 0
131134
# /ztstpool/dsk2 ONLINE 0 0 0
132135
# /ztstpool/dsk3 ONLINE 0 0 0
133-
assert_match(%r{tstpool.*\n\s+raidz.*\n\s*/ztstpool/dsk1.*\n\s*/ztstpool/dsk2.*\n\s*/ztstpool/dsk3}m, @result.stdout, "err: #{agent}")
136+
assert_match(%r{tstpool.*\n\s+raidz.*\n\s*/ztstpool/dsk1.*\n\s*/ztstpool/dsk2.*\n\s*/ztstpool/dsk3}m, result.stdout, "err: #{agent}")
134137
end
135138

136139
# ZPool: verify puppet reports on the raidz pool
137-
on(agent, puppet('resource zpool tstpool')) do
138-
assert_match(%r{ensure\s+=> 'present'}, @result.stdout, "err: #{agent}")
139-
assert_match(%r{raidz\s+=> \['/ztstpool/dsk1 /ztstpool/dsk2 /ztstpool/dsk3'\]}, @result.stdout, "err: #{agent}")
140+
on(agent, puppet('resource zpool tstpool')) do |result|
141+
assert_match(%r{ensure\s+=> 'present'}, result.stdout, "err: #{agent}")
142+
assert_match(%r{raidz\s+=> \['/ztstpool/dsk1 /ztstpool/dsk2 /ztstpool/dsk3'\]}, result.stdout, "err: #{agent}")
140143
end
141144

142145
# ZPool: remove zpool in preparation for multiple raidz pools
143-
apply_manifest_on(agent, 'zpool{ tstpool: ensure=>absent }') do
144-
assert_match(%r{ensure: removed}, @result.stdout, "err: #{agent}")
146+
apply_manifest_on(agent, 'zpool{ tstpool: ensure=>absent }') do |result|
147+
assert_match(%r{ensure: removed}, result.stdout, "err: #{agent}")
145148
end
146149
end
147150

148151
it 'can create two raidz zpools each with two virtual devices' do
149152
# ZPool: create 2 mirrored zpools each with 2 virtual devices
150-
apply_manifest_on(agent, "zpool{ tstpool: ensure=>present, raidz=>['/ztstpool/dsk1 /ztstpool/dsk2', '/ztstpool/dsk3 /ztstpool/dsk5'] }") do
151-
assert_match(%r{ensure: created}, @result.stdout, "err: #{agent}")
153+
apply_manifest_on(agent, "zpool{ tstpool: ensure=>present, raidz=>['/ztstpool/dsk1 /ztstpool/dsk2', '/ztstpool/dsk3 /ztstpool/dsk5'] }") do |result|
154+
pp "THIS IS THE RESULT: #{result} THIS IS THE RESULT'S CLASS #{result.class}"
155+
pp "THIS IS THE RESULT METHODS #{result.methods.sort}"
156+
pp "RESULT.STDOUT IS #{result.stdout} RESULT.STDERR IS #{result.stderr}"
157+
assert_match(%r{ensure: created}, result.stdout, "err: #{agent}")
152158
end
153159

154160
# ZPool: verify both raidz were created
155-
on agent, 'zpool status -v tstpool' do
161+
on(agent, 'zpool status -v tstpool') do |result|
156162
# NAME STATE READ WRITE CKSUM
157163
# tstpool ONLINE 0 0 0
158164
# raidz1-0 ONLINE 0 0 0
@@ -161,18 +167,18 @@
161167
# raidz1-1 ONLINE 0 0 0
162168
# /ztstpool/dsk3 ONLINE 0 0 0
163169
# /ztstpool/dsk5 ONLINE 0 0 0
164-
assert_match(%r{tstpool.*\n\s+raidz.*\n\s*/ztstpool/dsk1.*\n\s*/ztstpool/dsk2.*\n\s+raidz.*\n\s*/ztstpool/dsk3.*\n\s*/ztstpool/dsk5}m, @result.stdout, "err: #{agent}")
170+
assert_match(%r{tstpool.*\n\s+raidz.*\n\s*/ztstpool/dsk1.*\n\s*/ztstpool/dsk2.*\n\s+raidz.*\n\s*/ztstpool/dsk3.*\n\s*/ztstpool/dsk5}m, result.stdout, "err: #{agent}")
165171
end
166172

167173
# ZPool: verify puppet resource reports on both raidz
168-
on(agent, puppet('resource zpool tstpool')) do
169-
assert_match(%r{ensure\s+=> 'present'}, @result.stdout, "err: #{agent}")
170-
assert_match(%r{raidz\s+=> \['/ztstpool/dsk1 /ztstpool/dsk2', '/ztstpool/dsk3 /ztstpool/dsk5'\]}, @result.stdout, "err: #{agent}")
174+
on(agent, puppet('resource zpool tstpool')) do |result|
175+
assert_match(%r{ensure\s+=> 'present'}, result.stdout, "err: #{agent}")
176+
assert_match(%r{raidz\s+=> \['/ztstpool/dsk1 /ztstpool/dsk2', '/ztstpool/dsk3 /ztstpool/dsk5'\]}, result.stdout, "err: #{agent}")
171177
end
172178

173179
# ZPool: remove
174-
apply_manifest_on(agent, 'zpool { tstpool: ensure => absent }') do
175-
assert_match(%(ensure: removed), @result.stdout, "err: #{agent}")
180+
apply_manifest_on(agent, 'zpool { tstpool: ensure => absent }') do |result|
181+
assert_match(%(ensure: removed), result.stdout, "err: #{agent}")
176182
end
177183
end
178184
end

0 commit comments

Comments
 (0)