Skip to content

Commit 92fa8dc

Browse files
committed
(FM-4614) verify details of logical volume
1 parent ac91d2f commit 92fa8dc

File tree

5 files changed

+33
-3
lines changed

5 files changed

+33
-3
lines changed

tests/beaker/lib/lvm_helper.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ def remove_all(agent, pv=nil, vg=nil, lv=nil)
6464
on(agent, "lvremove /dev/#{vg}/#{logical_volume} --force")
6565
end
6666
else
67+
#note: in some test cases, for example, the test case 'create_vg_property_logical_volume'
68+
# the logical volume must be unmount before being able to delete it
6769
on(agent, "umount /dev/#{vg}/#{lv}", :acceptable_exit_codes => [0,1])
6870
on(agent, "lvremove /dev/#{vg}/#{lv} --force")
6971
end

tests/beaker/pre-suite/02_add_extra_hdd.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
test_name 'FM-4614 - Cxx - Add extra hard drive for LVM testing'
1+
test_name 'FM-4614 - C97274 - add extra hard drives for LVM testing'
22

33
# Get the auth_token from ENV
44
auth_tok = ENV['AUTH_TOKEN']

tests/beaker/tests/create_lv_with_param_stripes.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,5 +45,10 @@
4545

4646
step "Verify the logical volume is created: #{lv}"
4747
verify_if_created?(agent, 'logical_volume', lv, vg)
48+
49+
step "Verify the logical volume is striped on #{pv[0]} and #{pv[1]}"
50+
on(agent, "lvs -a -o segtype,devices,vg_name,lv_name") do |result|
51+
assert_match(/striped\s+#{pv[0]}.\d.,#{pv[1]}.\d.\s+#{vg}\s+#{lv}/, result.stdout, "Unexpected error was detected")
52+
end
4853
end
4954
end

tests/beaker/tests/create_lv_with_param_stripesize.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,5 +46,10 @@
4646

4747
step "Verify the logical volume is created: #{lv}"
4848
verify_if_created?(agent, 'logical_volume', lv, vg)
49+
50+
step "Verify the stripesize is 256 KB"
51+
on(agent, "lvdisplay -vm /dev/#{vg}/#{lv}") do |result|
52+
assert_match(/Stripe size\s+256.00 KiB/, result.stdout, "Unexpected error was detected")
53+
end
4954
end
5055
end

tests/beaker/tests/create_lv_with_property_mirrorlog.rb

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
test_name "FM-4614 - C96579 - create logical volume with property 'mirrorlog'"
66

77
#initilize
8-
pv = '/dev/sdc'
8+
pv = ['/dev/sdc', '/dev/sdd']
99
vg = "VolumeGroup_" + SecureRandom.hex(2)
1010
lv = ["LogicalVolume_" + SecureRandom.hex(3), \
1111
"LogicalVolume_" + SecureRandom.hex(3), \
@@ -23,27 +23,30 @@
2323
pp = <<-MANIFEST
2424
volume_group {'#{vg}':
2525
ensure => present,
26-
physical_volumes => '#{pv}'
26+
physical_volumes => #{pv}
2727
}
2828
->
2929
logical_volume{'#{lv[0]}':
3030
ensure => present,
3131
volume_group => '#{vg}',
3232
size => '20M',
33+
mirror => '1',
3334
mirrorlog => 'core',
3435
}
3536
->
3637
logical_volume{'#{lv[1]}':
3738
ensure => present,
3839
volume_group => '#{vg}',
3940
size => '40M',
41+
mirror => '1',
4042
mirrorlog => 'disk',
4143
}
4244
->
4345
logical_volume{'#{lv[2]}':
4446
ensure => present,
4547
volume_group => '#{vg}',
4648
size => '100M',
49+
mirror => '1',
4750
mirrorlog => 'mirrored',
4851
}
4952
MANIFEST
@@ -63,5 +66,20 @@
6366
verify_if_created?(agent, 'logical_volume', lv[0], vg)
6467
verify_if_created?(agent, 'logical_volume', lv[1], vg)
6568
verify_if_created?(agent, 'logical_volume', lv[2], vg)
69+
70+
step 'verify mirrorlog core (stored in mem):'
71+
on(agent, "lvs -a -o mirror_log /dev/#{vg}/#{lv[0]}") do |result|
72+
assert_match(/\s+/, result.stdout, "Unexpected error was detected")
73+
end
74+
75+
step 'verify mirrorlog disk (stored in disk):'
76+
on(agent, "lvs -a -o mirror_log /dev/#{vg}/#{lv[1]}") do |result|
77+
assert_match(/#{lv}_mlog/, result.stdout, "Unexpected error was detected")
78+
end
79+
80+
step 'verify mirrorlog mirrored (stored in disk):'
81+
on(agent, "lvs -a -o mirror_log /dev/#{vg}/#{lv[2]}") do |result|
82+
assert_match(/#{lv}_mlog/, result.stdout, "Unexpected error was detected")
83+
end
6684
end
6785
end

0 commit comments

Comments
 (0)