Skip to content

Commit 7593dbd

Browse files
committed
(FM-4614) updated lib
1 parent e771e77 commit 7593dbd

33 files changed

+151
-105
lines changed

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,6 @@ group :system_tests do
2525
gem 'beaker', *location_for(beaker_version)
2626
end
2727
gem 'beaker-puppet_install_helper', :require => false
28-
gem 'master_manipulator', '1.1.2', :require => false
28+
gem 'master_manipulator', '~> 1.2', :require => false
2929
end
3030
# vim:ft=ruby

tests/beaker/configs/redhat-6-64mda.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ CONFIG:
2020
datastore: instance0
2121
folder: Delivery/Quality Assurance/Enterprise/Dynamic
2222
resourcepool: delivery/Quality Assurance/Enterprise/Dynamic
23-
pooling_api: http://vcloud.delivery.puppetlabs.net/
23+
pooling_api: http://vcloud.delivery.puppetlabs.net/

tests/beaker/lib/lvm_helper.rb

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
# ==== Examples
1515
#
1616
# verify_if_created?(agent, 'physical_volume', /dev/sdb')
17-
def verify_if_created?(agent, resource_type, resource_name)
17+
def verify_if_created?(agent, resource_type, resource_name, vg=nil, properties=nil)
1818
case resource_type
1919
when 'physical_volume'
2020
on(agent, "pvdisplay") do |result|
@@ -25,13 +25,15 @@ def verify_if_created?(agent, resource_type, resource_name)
2525
assert_match(/#{resource_name}/, result.stdout, 'Unexpected error was detected')
2626
end
2727
when 'logical_volume'
28-
on(agent, "lvdisplay") do |result|
28+
on(agent, "lvdisplay /dev/#{vg}/#{resource_name}") do |result|
2929
assert_match(/#{resource_name}/, result.stdout, 'Unexpected error was detected')
30+
if properties
31+
assert_match(/#{properties}/, result.stdout, 'Unexpected error was detected')
32+
end
3033
end
3134
end
3235
end
3336

34-
3537
# Clean the box after each test, make sure the newly created logical volumes, volume groups,
3638
# and physical volumes are removed at the end of each test to make the server ready for the
3739
# next test case.

tests/beaker/pre-suite/00_pe_install.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
require 'master_manipulator'
2-
test_name 'FM-3808 - Cxx - Install Puppet Enterprise'
2+
test_name 'FM-4614 - Cxx - Install Puppet Enterprise'
33

44
# Init
55
step 'Install PE'

tests/beaker/pre-suite/01_lvm_module_install.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@
1212
staging[:version] = ENV['MODULE_VERSION'] if ENV['MODULE_VERSION']
1313

1414
# in CI install from staging forge, otherwise from local
15-
install_dev_puppet_module_on(master, options[:forge_host] ? staging : local)
15+
install_dev_puppet_module_on(master, options[:forge_host] ? staging : local)

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
test_name 'Add extra hard drive for LVM testing'
2-
1+
test_name 'FM-4614 - Cxx - Add extra hard drive for LVM testing'
32

43
# Get the auth_token from ENV
54
auth_tok = ENV['AUTH_TOKEN']
5+
fail_test "AUTH_TOKEN must be set" unless auth_tok
66

77
# On the PE agent where LVM running
88
confine_block(:except, :roles => %w{master dashboard database}) do
@@ -31,4 +31,4 @@
3131
assert_match(/\/dev\/sdd/, result.stdout, "Unexpected errors is detected")
3232
end
3333
end
34-
end
34+
end

tests/beaker/test_run_scripts/integration_tests.sh

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@ if [ $SCRIPT_BASE_PATH = "test_run_scripts" ]; then
99
cd ../
1010
fi
1111

12-
# Work-around for RE-5005
13-
export SSL_CERT_FILE=/usr/local/etc/openssl/cert.pem
14-
1512
export pe_dist_dir="http://enterprise.delivery.puppetlabs.net/2015.3/ci-ready"
1613
export GEM_SOURCE=http://rubygems.delivery.puppetlabs.net
1714

tests/beaker/tests/create_lv_with_param_alloc.rb

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

5-
test_name "FM-4579 - C96574 - create logical volume without parameter 'alloc'"
5+
test_name "FM-4614 - C96574 - create logical volume parameter 'alloc'"
66

77
#initilize
88
pv = '/dev/sdc'
9-
vg = ("VolumeGroup_" + SecureRandom.hex(2))
10-
lv = [("LogicalVolume_" + SecureRandom.hex(3)), ("LogicalVolume_" + SecureRandom.hex(3)), \
11-
("LogicalVolume_" + SecureRandom.hex(3)), ("LogicalVolume_" + SecureRandom.hex(3)), ("LogicalVolume_" + SecureRandom.hex(3))]
9+
vg = "VolumeGroup_" + SecureRandom.hex(2)
10+
lv = ["LogicalVolume_" + SecureRandom.hex(3), "LogicalVolume_" + SecureRandom.hex(3), \
11+
"LogicalVolume_" + SecureRandom.hex(3), "LogicalVolume_" + SecureRandom.hex(3), \
12+
"LogicalVolume_" + SecureRandom.hex(3)]
1213

1314
# Teardown
1415
teardown do
@@ -72,11 +73,15 @@
7273
step 'Run Puppet Agent to create logical volumes'
7374
confine_block(:except, :roles => %w{master dashboard database}) do
7475
agents.each do |agent|
75-
on(agent, puppet('agent -t --graph --environment production'), :acceptable_exit_codes => [0,2]) do |result|
76+
on(agent, puppet('agent -t --environment production'), :acceptable_exit_codes => [0,2]) do |result|
7677
assert_no_match(/Error:/, result.stderr, 'Unexpected error was detected!')
7778
end
7879

79-
step "Verify the logical volume is created: #{lv}"
80-
verify_if_created?(agent, 'logical_volume', lv)
80+
step "Verify the logical volumes are successfully created: #{lv}"
81+
verify_if_created?(agent, 'logical_volume', lv[0], vg, "Allocation\s+anywhere")
82+
verify_if_created?(agent, 'logical_volume', lv[1], vg, "Allocation\s+contiguous")
83+
verify_if_created?(agent, 'logical_volume', lv[2], vg, "Allocation\s+cling")
84+
verify_if_created?(agent, 'logical_volume', lv[3], vg, "Allocation\s+inherit")
85+
verify_if_created?(agent, 'logical_volume', lv[4], vg, "Allocation\s+normal")
8186
end
8287
end

tests/beaker/tests/create_lv_with_param_extents.rb

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

5-
test_name "FM-4579 - C96575 - create logical volume with parameter 'extents'"
5+
test_name "FM-4614 - C96575 - create logical volume with parameter 'extents'"
66

77
#initilize
88
pv = '/dev/sdc'
9-
vg = ("VolumeGroup_" + SecureRandom.hex(2))
10-
lv = ("LogicalVolume_" + SecureRandom.hex(3))
9+
vg = "VolumeGroup_" + SecureRandom.hex(2)
10+
lv = "LogicalVolume_" + SecureRandom.hex(3)
1111

1212
# Teardown
1313
teardown do
@@ -27,7 +27,7 @@
2727
logical_volume{'#{lv}':
2828
ensure => present,
2929
volume_group => '#{vg}',
30-
extents => '2',
30+
extents => '50',
3131
}
3232
MANIFEST
3333

@@ -38,11 +38,11 @@
3838
step 'Run Puppet Agent to create logical volumes'
3939
confine_block(:except, :roles => %w{master dashboard database}) do
4040
agents.each do |agent|
41-
on(agent, puppet('agent -t --graph --environment production'), :acceptable_exit_codes => [0,2]) do |result|
41+
on(agent, puppet('agent -t --environment production'), :acceptable_exit_codes => [0,2]) do |result|
4242
assert_no_match(/Error:/, result.stderr, 'Unexpected error was detected!')
4343
end
4444

45-
step "Verify the logical volume is created: #{lv}"
46-
verify_if_created?(agent, 'logical_volume', lv)
45+
step "Verify the logical volume is created and with extents is 50: #{lv}"
46+
verify_if_created?(agent, 'logical_volume', lv, vg, "Current LE\s+50")
4747
end
4848
end

tests/beaker/tests/create_lv_with_param_initial_size.rb

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

5-
test_name "FM-4579 - C96576 - create logical volume with parameter 'initial_size'"
5+
test_name "FM-4614 - C96576 - create logical volume with parameter 'initial_size'"
66

77
#initilize
88
pv = '/dev/sdc'
9-
vg = ("VolumeGroup_" + SecureRandom.hex(2))
10-
lv = ("LogicalVolume_" + SecureRandom.hex(3))
9+
vg = "VolumeGroup_" + SecureRandom.hex(2)
10+
lv = "LogicalVolume_" + SecureRandom.hex(3)
1111

1212
# Teardown
1313
teardown do
@@ -43,6 +43,6 @@
4343
end
4444

4545
step "Verify the logical volume is created: #{lv}"
46-
verify_if_created?(agent, 'logical_volume', lv)
46+
verify_if_created?(agent, 'logical_volume', lv, vg, "LV Size\s+20.00 MiB")
4747
end
4848
end

0 commit comments

Comments
 (0)