22#
33# ==== Attributes
44#
5- # * +resource_type+ - resorce type, i.e 'physical_volume', 'volume_group', 'logical_volume', or 'filesystem'
5+ # * +resource_type+ - resorce type, i.e 'physical_volume', 'volume_group', 'logical_volume', 'filesystem',
6+ # * 'aix_physical_volume', 'aix_volume_group', or 'aix_logical_volume'.
67# * +resource_name+ - The name of resource type, i.e '/dev/sdb' for physical volume, vg_1234 for volume group
78# * +vg+ - volume group name associated with logical volume (if any)
89# * +properties+ - a matching string or regular expression in logical volume properties
@@ -26,7 +27,7 @@ def verify_if_created?(agent, resource_type, resource_name, vg=nil, properties=n
2627 assert_match ( /#{ resource_name } / , result . stdout , 'Unexpected error was detected' )
2728 end
2829 when 'logical_volume'
29- fail_test "Error: missing volume group that the logical volume is associated with" unless vg
30+ raise ArgumentError , 'Missing volume group that the logical volume is associated with' unless vg
3031 on ( agent , "lvdisplay /dev/#{ vg } /#{ resource_name } " ) do |result |
3132 assert_match ( /#{ resource_name } / , result . stdout , 'Unexpected error was detected' )
3233 if properties
@@ -39,11 +40,10 @@ def verify_if_created?(agent, resource_type, resource_name, vg=nil, properties=n
3940 end
4041 when 'aix_volume_group'
4142 on ( agent , "lsvg" ) do |result |
42- #assert_match(/#{resource_name}\s+^a-z0-9$\s+#{vg}/, result.stdout, 'Unexpected error was detected')
4343 assert_match ( /#{ resource_name } / , result . stdout , 'Unexpected error was detected' )
4444 end
4545 when 'aix_logical_volume'
46- fail_test "Error: missing volume group that the logical volume is associated with" unless vg
46+ raise ArgumentError , 'Missing volume group that the logical volume is associated with' unless vg
4747 on ( agent , "lslv #{ resource_name } " ) do |result |
4848 assert_match ( /#{ resource_name } / , result . stdout , 'Unexpected error was detected' )
4949 if properties
@@ -96,7 +96,7 @@ def is_correct_format?(agent, volume_group, logical_volume, format_type)
9696# ==== Examples
9797#
9898# remove_all(agent, '/dev/sdb', 'VolumeGroup_1234', 'LogicalVolume_fa13')
99- def remove_all ( agent , pv = nil , vg = nil , lv = nil , aix = nil )
99+ def remove_all ( agent , pv = nil , vg = nil , lv = nil , aix = false )
100100 if aix
101101 step 'remove aix volume group, physical/logical volume '
102102 on ( agent , "reducevg -d -f #{ vg } #{ pv } " )
0 commit comments