Skip to content

Commit ca8e62e

Browse files
committed
(FM-4614) LVM automated test
1 parent 9e8ae0a commit ca8e62e

36 files changed

+1641
-0
lines changed

Gemfile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,12 @@ gem 'puppet-lint-unquoted_string-check', :require => false
1919
if RUBY_VERSION < '2.0'
2020
gem 'mime-types', '<3.0', :require => false
2121
end
22+
23+
group :system_tests do
24+
if beaker_version = ENV['BEAKER_VERSION']
25+
gem 'beaker', *location_for(beaker_version)
26+
end
27+
gem 'beaker-puppet_install_helper', :require => false
28+
gem 'master_manipulator', '1.1.2', :require => false
29+
end
2230
# vim:ft=ruby
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
2+
HOSTS:
3+
pemaster:
4+
roles:
5+
- master
6+
- dashboard
7+
- database
8+
- agent
9+
vmname: centos-7-x86-64-west
10+
user: ec2-user
11+
platform: el-7-x86_64
12+
hypervisor: ec2
13+
amisize: m3.large
14+
snapshot: pe
15+
peagent:
16+
roles:
17+
- agent
18+
- frictionless
19+
vmname: centos-7-x86-64-west
20+
user: ec2-user
21+
platform: el-7-x86_64
22+
hypervisor: ec2
23+
amisize: m3.large
24+
volume_size: 50
25+
snapshot: pe
26+
CONFIG:
27+
nfs_server: none
28+
consoleport: 443
29+
pe_dir: puppetlabs-websphere_application_server/beaker/files
30+
pe_ver: 2015.2.3

tests/beaker/configs/full_env.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
HOSTS:
2+
puppet-centos:
3+
roles:
4+
- master
5+
- database
6+
- dashboard
7+
- agent
8+
platform: el-6-x86_64
9+
box : puppetlabs/centos-6.6-64-nocm
10+
hypervisor : vagrant
11+
app-centos:
12+
roles:
13+
- agent
14+
platform: el-6-x86_64
15+
box : puppetlabs/centos-6.6-64-nocm
16+
hypervisor : vagrant
17+
dmgr-centos:
18+
roles:
19+
- agent
20+
platform: el-6-x86_64
21+
box : puppetlabs/centos-6.6-64-nocm
22+
hypervisor : vagrant
23+
ihs-centos:
24+
roles:
25+
- agent
26+
platform: el-6-x86_64
27+
box : puppetlabs/centos-6.6-64-nocm
28+
hypervisor : vagrant
29+
CONFIG:
30+
pe_dir: http://neptune.delivery.puppetlabs.net/3.8/ci-ready/

tests/beaker/configs/fusion.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
HOSTS:
2+
puppet:
3+
roles:
4+
- master
5+
- dashboard
6+
- database
7+
- agent
8+
platform: el-6-x86_64
9+
snapshot: master_ankeny
10+
hypervisor : fusion
11+
websphere:
12+
roles:
13+
- agent
14+
- frictionless
15+
platform: el-6-x86_64
16+
snapshot: agent_ankeny
17+
hypervisor : fusion
18+
19+
CONFIG:
20+
ssh:
21+
auth_methods: ["password", "publickey"]
22+
password: puppet
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
HOSTS:
2+
redhat-6-x86_64:
3+
roles:
4+
- master
5+
- dashboard
6+
- database
7+
- agent
8+
platform: el-6-x86_64
9+
template: redhat-6-x86_64
10+
hypervisor: vcloud
11+
redhat-6-x86_64-agent:
12+
roles:
13+
- agent
14+
platform: el-6-x86_64
15+
template: redhat-6-x86_64
16+
hypervisor: vcloud
17+
CONFIG:
18+
nfs_server: none
19+
consoleport: 443
20+
datastore: instance0
21+
folder: Delivery/Quality Assurance/Enterprise/Dynamic
22+
resourcepool: delivery/Quality Assurance/Enterprise/Dynamic
23+
pooling_api: http://vcloud.delivery.puppetlabs.net/

tests/beaker/lib/lvm_helper.rb

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Verify if a physical volume, volume group, logical volume, or filesystem resource type is created
2+
#
3+
# ==== Attributes
4+
#
5+
# * +resource_type+ - resorce type, i.e 'physical_volume', 'volume_group', 'logical_volume', or 'filesystem'
6+
# * +resource_name+ - The name of resource type, i.e '/dev/sdb' for physical volume, vg_1234 for volume group
7+
#
8+
# ==== Returns
9+
#
10+
# +nil+
11+
#
12+
# ==== Raises
13+
# assert_match failure message
14+
# ==== Examples
15+
#
16+
# verify_if_created?(agent, 'physical_volume', /dev/sdb')
17+
def verify_if_created?(agent, resource_type, resource_name)
18+
case resource_type
19+
when 'physical_volume'
20+
on(agent, "pvdisplay") do |result|
21+
assert_match(/#{resource_name}/, result.stdout, 'Unexpected error was detected')
22+
end
23+
when 'volume_group'
24+
on(agent, "vgdisplay") do |result|
25+
assert_match(/#{resource_name}/, result.stdout, 'Unexpected error was detected')
26+
end
27+
when 'logical_volume'
28+
on(agent, "lvdisplay") do |result|
29+
assert_match(/#{resource_name}/, result.stdout, 'Unexpected error was detected')
30+
end
31+
end
32+
end
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
require 'master_manipulator'
2+
test_name 'FM-3808 - Cxx - Install Puppet Enterprise'
3+
4+
# Init
5+
step 'Install PE'
6+
install_pe
7+
8+
step 'Disable Node Classifier'
9+
disable_node_classifier(master)
10+
11+
step 'Disable Environment Caching'
12+
disable_env_cache(master)
13+
14+
step 'Restart Puppet Server'
15+
restart_puppet_server(master)
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
test_name 'FM-4614 - C97171 - Install the LVM module'
2+
3+
step 'Install LVM Module Dependencies'
4+
on(master, puppet('module install puppetlabs-stdlib'))
5+
6+
step 'Install LVM Module'
7+
on(master, puppet('module install puppetlabs-lvm'))
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
test_name 'Add extra hard drive for LVM testing'
2+
3+
4+
# Get the auth_token from ENV
5+
auth_tok = ENV['AUTH_TOKEN']
6+
7+
# On the PE agent where LVM running
8+
confine_block(:except, :roles => %w{master dashboard database}) do
9+
agents.each do |agent|
10+
step 'adding an extra disk'
11+
on(agent, "curl -X POST -H X-AUTH-TOKEN:#{auth_tok} --url vcloud/api/v1/vm/#{agent[:vmhostname]}/disk/1")
12+
sleep(120)
13+
14+
step 'rescan the SCSI bus on the host to make the newly added hdd recognized'
15+
on(agent, "echo \"- - -\" >/sys/class/scsi_host/host0/scan")
16+
17+
18+
#on(agent, "curl -X POST -H X-AUTH-TOKEN:c00nem2oao477lyc1olnr2k6zgquchxl --url vcloud/api/v1/vm/#{agent[:vmhostname]}/disk/4")
19+
on(agent, "curl -X POST -H X-AUTH-TOKEN:#{auth_tok} --url vcloud/api/v1/vm/#{agent[:vmhostname]}/disk/1")
20+
sleep(120)
21+
22+
step 'rescan the SCSI bus on the host to make the newly added hdd recognized'
23+
on(agent, "echo \"- - -\" >/sys/class/scsi_host/host0/scan")
24+
25+
step 'Verify the newly add hdd recognized:'
26+
on(agent, "fdisk -l") do |result|
27+
assert_match(/\/dev\/sdc/, result.stdout, "Unexpected errors is detected")
28+
assert_match(/\/dev\/sdd/, result.stdout, "Unexpected errors is detected")
29+
end
30+
end
31+
end
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#!/bin/bash
2+
3+
# Init
4+
SCRIPT_PATH=$(pwd)
5+
BASENAME_CMD="basename ${SCRIPT_PATH}"
6+
SCRIPT_BASE_PATH=`eval ${BASENAME_CMD}`
7+
8+
if [ $SCRIPT_BASE_PATH = "test_run_scripts" ]; then
9+
cd ../
10+
fi
11+
12+
# Work-around for RE-5005
13+
export SSL_CERT_FILE=/usr/local/etc/openssl/cert.pem
14+
15+
export pe_dist_dir="http://enterprise.delivery.puppetlabs.net/2015.3/ci-ready"
16+
export GEM_SOURCE=http://rubygems.delivery.puppetlabs.net
17+
18+
bundle install --without build development test --path .bundle/gems
19+
20+
bundle exec beaker \
21+
--preserve-host \
22+
--host configs/redhat-6-64mda.yml \
23+
--debug \
24+
--pre-suite pre-suite \
25+
--tests tests \
26+
--keyfile ~/.ssh/id_rsa-acceptance \
27+
--load-path lib

0 commit comments

Comments
 (0)