Skip to content

Commit 7f28186

Browse files
committed
(FM-4969) updated lvm_helper
1 parent e22038e commit 7f28186

File tree

4 files changed

+12
-12
lines changed

4 files changed

+12
-12
lines changed

tests/beaker/lib/lvm_helper.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
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}")

tests/beaker/tests/aix/create_lv_with_param_max_range_aix.rb renamed to tests/beaker/tests/aix/create_lv_with_param_max_range.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
require 'lvm_helper'
33
require 'securerandom'
44

5-
test_name "FM-4969 - C97367 - create logical volume with parameter min 'range' aix"
5+
test_name "FM-4969 - C97367 - create logical volume with parameter max 'range'"
66

77
#initilize
88
pv = 'hdisk1'
@@ -13,7 +13,7 @@
1313
teardown do
1414
confine_block(:except, :roles => %w{master dashboard database}) do
1515
agents.each do |agent|
16-
remove_all(agent, pv, vg, lv, 'aix')
16+
remove_all(agent, pv, vg, lv, aix = true)
1717
end
1818
end
1919
end

tests/beaker/tests/aix/create_lv_with_param_min_range_aix.rb renamed to tests/beaker/tests/aix/create_lv_with_param_min_range.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
require 'lvm_helper'
33
require 'securerandom'
44

5-
test_name "FM-4969 - C97372 - create logical volume with parameter min 'range' aix"
5+
test_name "FM-4969 - C97372 - create logical volume with parameter min 'range'"
66

77
#initilize
88
pv = 'hdisk1'
@@ -13,7 +13,7 @@
1313
teardown do
1414
confine_block(:except, :roles => %w{master dashboard database}) do
1515
agents.each do |agent|
16-
remove_all(agent, pv, vg, lv, 'aix')
16+
remove_all(agent, pv, vg, lv, aix = true)
1717
end
1818
end
1919
end

tests/beaker/tests/aix/create_lv_with_param_type.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
require 'lvm_helper'
33
require 'securerandom'
44

5-
test_name "FM-4969 - C97368 - create logical volume with param 'type' aix"
5+
test_name "FM-4969 - C97368 - create logical volume with param 'type'"
66

77
#initilize
88
pv = 'hdisk1'
@@ -13,7 +13,7 @@
1313
teardown do
1414
confine_block(:except, :roles => %w{master dashboard database}) do
1515
agents.each do |agent|
16-
remove_all(agent, pv, vg, lv, 'aix')
16+
remove_all(agent, pv, vg, lv, aix = true)
1717
end
1818
end
1919
end
@@ -28,7 +28,7 @@
2828
ensure => present,
2929
volume_group => '#{vg}',
3030
initial_size => '5M',
31-
type => 'jfs',
31+
type => 'jfs',
3232
}
3333
MANIFEST
3434

0 commit comments

Comments
 (0)