1212
1313def 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' )
2222end
2323
2424def 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' )
2828end
2929
3030teardown 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
7272end
0 commit comments