Skip to content

Commit

Permalink
add tests/beaker/tests/create_filesystem_with_fs_label.rb
Browse files Browse the repository at this point in the history
  • Loading branch information
unki committed Dec 6, 2020
1 parent 6c91421 commit 8f615c8
Showing 1 changed file with 56 additions and 0 deletions.
56 changes: 56 additions & 0 deletions tests/beaker/tests/create_filesystem_with_fs_label.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
require 'master_manipulator'
require 'lvm_helper'
require 'securerandom'

test_name "FM-4615 - C96570 - create filesystem with parameter 'use_fs_label'"

# initilize
pv = '/dev/sdc'
vg = ('VolumeGroup_' + SecureRandom.hex(2))
lv = ('fslabel' + SecureRandom.hex(3))

# Teardown
teardown do
confine_block(:except, roles: ['master', 'dashboard', 'database']) do
agents.each do |agent|
remove_all(agent, pv, vg, lv)
end
end
end

pp = <<-MANIFEST
physical_volume {'#{pv}':
ensure => present,
}
->
volume_group {'#{vg}':
ensure => present,
physical_volumes => '#{pv}',
}
->
logical_volume{'#{lv}':
ensure => present,
volume_group => '#{vg}',
size => '20M',
use_fs_label => true,
createfs => true,
fs_type => 'ext4',
options => '-b 4096 -E stride=32,stripe-width=64',
}
MANIFEST

step 'Inject "site.pp" on Master'
site_pp = create_site_pp(master, manifest: pp)
inject_site_pp(master, get_site_pp_path(master), site_pp)

step 'Run Puppet Agent to create logical volumes'
confine_block(:except, roles: ['master', 'dashboard', 'database']) do
agents.each do |agent|
on(agent, puppet('agent -t --environment production'), acceptable_exit_codes: [0, 2]) do |result|
assert_no_match(%r{Error:}, result.stderr, 'Unexpected error was detected!')
end

step "Verify the logical volume has correct format type: #{lv}"
is_correct_format?(agent, vg, lv, 'ext4')
end
end

0 comments on commit 8f615c8

Please sign in to comment.