|
| 1 | +require 'master_manipulator' |
| 2 | +require 'lvm_helper' |
| 3 | +require 'securerandom' |
| 4 | + |
| 5 | +test_name "FM-4615 - C96570 - create filesystem with parameter 'use_fs_label'" |
| 6 | + |
| 7 | +# initilize |
| 8 | +pv = '/dev/sdc' |
| 9 | +vg = ('VolumeGroup_' + SecureRandom.hex(2)) |
| 10 | +lv = ('fslabel' + SecureRandom.hex(3)) |
| 11 | + |
| 12 | +# Teardown |
| 13 | +teardown do |
| 14 | + confine_block(:except, roles: ['master', 'dashboard', 'database']) do |
| 15 | + agents.each do |agent| |
| 16 | + remove_all(agent, pv, vg, lv) |
| 17 | + end |
| 18 | + end |
| 19 | +end |
| 20 | + |
| 21 | +pp = <<-MANIFEST |
| 22 | +physical_volume {'#{pv}': |
| 23 | + ensure => present, |
| 24 | +} |
| 25 | +-> |
| 26 | +volume_group {'#{vg}': |
| 27 | + ensure => present, |
| 28 | + physical_volumes => '#{pv}', |
| 29 | +} |
| 30 | +-> |
| 31 | +logical_volume{'#{lv}': |
| 32 | + ensure => present, |
| 33 | + volume_group => '#{vg}', |
| 34 | + size => '20M', |
| 35 | + use_fs_label => true, |
| 36 | + createfs => true, |
| 37 | + fs_type => 'ext4', |
| 38 | + options => '-b 4096 -E stride=32,stripe-width=64', |
| 39 | +} |
| 40 | +MANIFEST |
| 41 | + |
| 42 | +step 'Inject "site.pp" on Master' |
| 43 | +site_pp = create_site_pp(master, manifest: pp) |
| 44 | +inject_site_pp(master, get_site_pp_path(master), site_pp) |
| 45 | + |
| 46 | +step 'Run Puppet Agent to create logical volumes' |
| 47 | +confine_block(:except, roles: ['master', 'dashboard', 'database']) do |
| 48 | + agents.each do |agent| |
| 49 | + on(agent, puppet('agent -t --environment production'), acceptable_exit_codes: [0, 2]) do |result| |
| 50 | + assert_no_match(%r{Error:}, result.stderr, 'Unexpected error was detected!') |
| 51 | + end |
| 52 | + |
| 53 | + step "Verify the logical volume has correct format type: #{lv}" |
| 54 | + is_correct_format?(agent, vg, lv, 'ext4') |
| 55 | + end |
| 56 | +end |
0 commit comments