Skip to content

Commit 518dd5d

Browse files
authored
Merge pull request #46 from mhashizume/PA-5022/main/beaker-deprecated
Update deprecated Beaker methods
2 parents b183038 + 9c84fd7 commit 518dd5d

File tree

6 files changed

+29
-29
lines changed

6 files changed

+29
-29
lines changed

spec/acceptance/pending/dataset.rb

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,19 @@
1212

1313
def moresetup(agent)
1414
# This should fail if /tstzones already exists.
15-
on agent, 'mkdir /tstzones'
16-
on agent, 'mkfile 64m /tstzones/dsk'
17-
on agent, 'zpool create tstpool /tstzones/dsk'
15+
on(agent, 'mkdir /tstzones')
16+
on(agent, 'mkfile 64m /tstzones/dsk')
17+
on(agent, 'zpool create tstpool /tstzones/dsk')
1818

19-
on agent, 'zfs create tstpool/xx'
20-
on agent, 'zfs create tstpool/yy'
21-
on agent, 'zfs create tstpool/zz'
19+
on(agent, 'zfs create tstpool/xx')
20+
on(agent, 'zfs create tstpool/yy')
21+
on(agent, 'zfs create tstpool/zz')
2222
end
2323

2424
def moreclean(agent)
25-
on agent, 'zfs destroy -r tstpool', acceptable_exit_codes: [0, 1]
26-
on agent, 'zpool destroy tstpool', acceptable_exit_codes: [0, 1]
27-
on agent, 'rm -f /tstzones/dsk'
25+
on(agent, 'zfs destroy -r tstpool', acceptable_exit_codes: [0, 1])
26+
on(agent, 'zpool destroy tstpool', acceptable_exit_codes: [0, 1])
27+
on(agent, 'rm -f /tstzones/dsk')
2828
end
2929

3030
teardown do
@@ -42,31 +42,31 @@ def moreclean(agent)
4242
#-----------------------------------
4343
step 'Zone: dataset - make it configured'
4444
# Make it configured
45-
apply_manifest_on(agent, 'zone {tstzone : ensure=>configured, path=>"/tstzones/mnt" }') do
45+
apply_manifest_on(agent, 'zone {tstzone : ensure=>configured, path=>"/tstzones/mnt" }') do |result|
4646
assert_match(%r{ensure: created}, result.stdout, "err: #{agent}")
4747
end
4848
step 'Zone: dataset - basic test, a single data set'
49-
apply_manifest_on(agent, 'zone {tstzone : ensure=>configured, dataset=>"tstpool/xx", path=>"/tstzones/mnt" }') do
49+
apply_manifest_on(agent, 'zone {tstzone : ensure=>configured, dataset=>"tstpool/xx", path=>"/tstzones/mnt" }') do |result|
5050
assert_match(%r{defined 'dataset' as .'tstpool.xx'.}, result.stdout, "err: #{agent}")
5151
end
5252
step 'Zone: dataset - basic test, a single data set should change to another'
53-
apply_manifest_on(agent, 'zone {tstzone : ensure=>configured, dataset=>"tstpool/yy", path=>"/tstzones/mnt" }') do
53+
apply_manifest_on(agent, 'zone {tstzone : ensure=>configured, dataset=>"tstpool/yy", path=>"/tstzones/mnt" }') do |result|
5454
assert_match(%r{dataset changed tstpool/xx to \['tstpool/yy'\]}, result.stdout, "err: #{agent}")
5555
end
5656
step 'Zone: dataset - basic test, idempotency'
57-
apply_manifest_on(agent, 'zone {tstzone : ensure=>configured, dataset=>"tstpool/yy", path=>"/tstzones/mnt" }') do
58-
assert_no_match(%r{dataset changed tstpool/xx to \['tstpool/yy'\]}, result.stdout, "err: #{agent}")
57+
apply_manifest_on(agent, 'zone {tstzone : ensure=>configured, dataset=>"tstpool/yy", path=>"/tstzones/mnt" }') do |result|
58+
refute_match(%r{dataset changed tstpool/xx to \['tstpool/yy'\]}, result.stdout, "err: #{agent}")
5959
end
6060
step 'Zone: dataset - array test, should change to an array'
61-
apply_manifest_on(agent, 'zone {tstzone : ensure=>configured, dataset=>["tstpool/yy","tstpool/zz"], path=>"/tstzones/mnt" }') do
61+
apply_manifest_on(agent, 'zone {tstzone : ensure=>configured, dataset=>["tstpool/yy","tstpool/zz"], path=>"/tstzones/mnt" }') do |result|
6262
assert_match(%r{dataset changed tstpool/yy to \['tstpool/yy', 'tstpool/zz'\]}, result.stdout, "err: #{agent}")
6363
end
6464
step 'Zone: dataset - array test, should change one single element'
65-
apply_manifest_on(agent, 'zone {tstzone : ensure=>configured, dataset=>["tstpool/xx","tstpool/zz"], path=>"/tstzones/mnt" }') do
65+
apply_manifest_on(agent, 'zone {tstzone : ensure=>configured, dataset=>["tstpool/xx","tstpool/zz"], path=>"/tstzones/mnt" }') do |result|
6666
assert_match(%r{dataset changed tstpool/yy,tstpool/zz to \['tstpool/xx', 'tstpool/zz'\]}, result.stdout, "err: #{agent}")
6767
end
6868
step 'Zone: dataset - array test, should remove elements'
69-
apply_manifest_on(agent, 'zone {tstzone : ensure=>configured, dataset=>[], path=>"/tstzones/mnt" }') do
69+
apply_manifest_on(agent, 'zone {tstzone : ensure=>configured, dataset=>[], path=>"/tstzones/mnt" }') do |result|
7070
assert_match(%r{dataset changed tstpool/zz,tstpool/xx to \[\]}, result.stdout, "err: #{agent}")
7171
end
7272
end

spec/acceptance/pending/ticket_4840_should_create_zone_with_zpool.rb

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@
1010
extend Puppet::Acceptance::ZoneUtils
1111

1212
def poolsetup(agent)
13-
on agent, 'mkdir /tstzones'
14-
on agent, 'mkfile 2500m /tstzones/dsk'
15-
on agent, 'zpool create tstpool /tstzones/dsk'
13+
on(agent, 'mkdir /tstzones')
14+
on(agent, 'mkfile 2500m /tstzones/dsk')
15+
on(agent, 'zpool create tstpool /tstzones/dsk')
1616
end
1717

1818
def poolclean(agent)
19-
on agent, 'zfs destroy -r tstpool', acceptable_exit_codes: [0, 1]
20-
on agent, 'zpool destroy tstpool', acceptable_exit_codes: [0, 1]
21-
on agent, 'rm -rf /ztstpool', acceptable_exit_codes: [0, 1]
19+
on(agent, 'zfs destroy -r tstpool', acceptable_exit_codes: [0, 1])
20+
on(agent, 'zpool destroy tstpool', acceptable_exit_codes: [0, 1])
21+
on(agent, 'rm -rf /ztstpool', acceptable_exit_codes: [0, 1])
2222
end
2323

2424
teardown do
@@ -50,7 +50,7 @@ def poolclean(agent)
5050
iptype => exclusive,
5151
ip => net1,
5252
require => File["/ztstpool/mnt"],
53-
})) do
53+
})) do |result|
5454
assert_match(%r{ensure: created}, result.stdout, "err: #{agent}")
5555
end
5656
end

spec/acceptance/tests/zone_configured_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def config_inherit_string(agent)
2727

2828
step 'Zone: steps - verify (create)'
2929
on(agent, 'zoneadm -z tstzone verify') do |result|
30-
assert_no_match(%r{could not verify}, result.stdout, "err: #{agent}")
30+
refute_match(%r{could not verify}, result.stdout, "err: #{agent}")
3131
end
3232

3333
step 'Zone: steps - configured -> installed'

spec/acceptance/tests/zone_ensure_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343

4444
# should be idempotent
4545
apply_manifest_on(agent, running_manifest) do |result|
46-
assert_no_match(%r{created|changed|removed}, result.stdout, "err: #{agent}")
46+
refute_match(%r{created|changed|removed}, result.stdout, "err: #{agent}")
4747
end
4848

4949
step 'Zone: ensure can remove'
@@ -52,7 +52,7 @@
5252
assert_match(%r{ensure: removed}, result.stdout, "err: #{agent}")
5353
end
5454
on(agent, 'zoneadm list -cp') do |result|
55-
assert_no_match(%r{tstzone}, result.stdout, "err: #{agent}")
55+
refute_match(%r{tstzone}, result.stdout, "err: #{agent}")
5656
end
5757
end
5858
end

spec/acceptance/tests/zone_ip_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@
9494
ip => ["ip.if.1:1.1.1.1", "ip.if.2:1.1.1.3"]
9595
}
9696
MANIFEST
97-
assert_no_match(%r{ip changed}, result.stdout, "err: #{agent}")
97+
refute_match(%r{ip changed}, result.stdout, "err: #{agent}")
9898
end
9999
end
100100
end

spec/acceptance/tests/zone_running_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def config_inherit_string(agent)
3636

3737
step 'Zone: statemachine - ensure zone is correct'
3838
on(agent, 'zoneadm -z tstzone verify') do |result|
39-
assert_no_match(%r{could not verify}, result.stdout, "err: #{agent}")
39+
refute_match(%r{could not verify}, result.stdout, "err: #{agent}")
4040
end
4141

4242
step 'Zone: statemachine - ensure zone is running'

0 commit comments

Comments
 (0)