Commit 3c052427 authored by Ken Barber's avatar Ken Barber

PDB-407 Fedora 20 Acceptance Testing

This adds a fedora 20 image to the acceptance testing image list, and modifies
any tests that need modification for these tests to pass.
Signed-off-by: 's avatarKen Barber <ken@bob.sh>
parent f24c37f0
......@@ -18,5 +18,6 @@ group :test do
end
group :acceptance do
gem 'beaker', '~> 1.0'
# gem 'beaker', '~> 1.0'
gem 'beaker', :git => 'git://github.com/kbarber/beaker', :branch => 'maint/master/support-fedora-when-determining-ip'
end
HOSTS:
fedora-20-1:
roles:
- master
- agent
- dashboard
- database
vmname: fedora-20-x86_64-west
platform: fedora-20-x86_64
amisize: c1.medium
hypervisor: blimpy
snapshot: foss
fedora-20-2:
roles:
- agent
vmname: fedora-20-x86_64-west
platform: fedora-20-x86_64
amisize: c1.medium
hypervisor: blimpy
snapshot: foss
CONFIG:
nfs_server: none
consoleport: 443
......@@ -151,7 +151,12 @@ module PuppetDBExtensions
def get_os_family(host)
on(host, "which yum", :silent => true)
if result.exit_code == 0
:redhat
on(host, "ls /etc/fedora-release", :silent => true)
if result.exit_code == 2
:redhat
else
:fedora
end
else
:debian
end
......@@ -241,7 +246,7 @@ module PuppetDBExtensions
when :debian
result = on host, "dpkg-query --showformat \"\\${Version}\" --show puppetdb"
result.stdout.strip
when :redhat
when :redhat, :fedora
result = on host, "rpm -q puppetdb --queryformat \"%{VERSION}-%{RELEASE}\""
result.stdout.strip
else
......@@ -360,7 +365,7 @@ module PuppetDBExtensions
when :debian
preinst = "debian/puppetdb.preinst install"
postinst = "debian/puppetdb.postinst"
when :redhat
when :redhat, :fedora
preinst = "dev/redhat/redhat_dev_preinst install"
postinst = "dev/redhat/redhat_dev_postinst install"
else
......@@ -784,7 +789,7 @@ module PuppetDBExtensions
case os
when :debian
on host, "apt-get install -y puppet puppetmaster-common"
when :redhat
when :redhat, :fedora
on host, "yum install -y puppet"
else
raise ArgumentError, "Unsupported OS '#{os}'"
......@@ -859,7 +864,7 @@ module PuppetDBExtensions
os = os_families[host.name]
case os
when :redhat
when :redhat, :fedora
on host, "yum install -y git-core ruby"
when :debian
on host, "apt-get install -y git ruby"
......
......@@ -7,7 +7,7 @@ def uninstall_package(host, os_families, pkg_name)
case os
when :debian
on(host, "apt-get -f -y purge #{pkg_name} ")
when :redhat
when :redhat, :fedora
on(host, "yum -y remove #{pkg_name}")
else
raise ArgumentError, "Unsupported OS family: '#{os}'"
......
......@@ -59,7 +59,7 @@ if (test_config[:use_proxies])
case test_config[:os_families][database.name]
when :debian
setup_apt_proxy()
when :redhat
when :redhat, :fedora
setup_yum_proxy()
else
raise ArgumentError, "Unsupported OS family: '#{config[:os_families][database.name]}'"
......
......@@ -32,6 +32,24 @@ failovermethod=priority
enabled=1
gpgcheck=0
REPO
when :fedora
create_remote_file host, '/etc/yum.repos.d/puppetlabs-dependencies.repo', <<-REPO.gsub(' '*8, '')
[puppetlabs-dependencies]
name=Puppet Labs Dependencies - $basearch
baseurl=http://yum.puppetlabs.com/fedora/f$releasever/dependencies/$basearch
gpgkey=http://yum.puppetlabs.com/RPM-GPG-KEY-puppetlabs
enabled=1
gpgcheck=1
REPO
create_remote_file host, '/etc/yum.repos.d/puppetlabs-products.repo', <<-REPO.gsub(' '*8, '')
[puppetlabs-products]
name=Puppet Labs Products - $basearch
baseurl=http://yum.puppetlabs.com/fedora/f$releasever/products/$basearch
gpgkey=http://yum.puppetlabs.com/RPM-GPG-KEY-puppetlabs
enabled=1
gpgcheck=1
REPO
else
raise ArgumentError, "Unsupported OS '#{os}'"
end
......
......@@ -2,7 +2,7 @@ step "Install other dependencies on database" do
os = test_config[:os_families][database.name]
case os
when :redhat
when :redhat, :fedora
# Our teardown script does some heinous magic with unzip to dig
# into the puppetdb jar. Redhat doesn't ship with unzip.
on database, "yum install -y unzip"
......@@ -18,6 +18,8 @@ step "Install other dependencies on database" do
on database, "apt-get install -y --force-yes openjdk-6-jre-headless rake"
when :redhat
on database, "yum install -y java-1.6.0-openjdk rubygem-rake"
when :fedora
on database, "yum install -y java-1.7.0-openjdk rubygem-rake"
else
raise ArgumentError, "Unsupported OS '#{os}'"
end
......@@ -38,7 +40,7 @@ step "Install rubygems and sqlite3 on master" do
os = test_config[:os_families][master.name]
case os
when :redhat
when :redhat, :fedora
if master['platform'].include? 'el-5'
on master, "yum install -y rubygems sqlite-devel rubygem-activerecord ruby-devel.x86_64"
on master, "gem install sqlite3"
......
......@@ -15,14 +15,21 @@ if (test_config[:install_type] == :package)
Log.notify("APT LIST FILE CONTENTS:\n#{result.stdout}\n")
on database, "apt-get update"
when :redhat
# TODO: this code assumes that we are always running a 64-bit CentOS. Will
# break with Fedora.
result = on database, "facter operatingsystemmajrelease"
el_version = result.stdout.chomp
yum_repo_url = "#{test_config[:package_repo_url]}/repo_configs/rpm/pl-puppetdb-#{test_config[:git_ref]}-el-#{el_version}-x86_64.repo"
yum_repo_file_path = "/etc/yum.repos.d/puppetlabs-prerelease.repo"
on database, "curl \"#{yum_repo_url}\" | #{sed_cmd} > #{yum_repo_file_path}"
result = on database, "cat #{yum_repo_file_path}"
Log.notify("Yum REPO DEFINITION:\n\n#{result.stdout}\n\n")
when :fedora
result = on database, "facter operatingsystemmajrelease"
version = result.stdout.chomp
yum_repo_url = "#{test_config[:package_repo_url]}/repo_configs/rpm/pl-puppetdb-#{test_config[:git_ref]}-fedora-#{version}-x86_64.repo"
yum_repo_file_path = "/etc/yum.repos.d/puppetlabs-prerelease.repo"
on database, "curl \"#{yum_repo_url}\" | #{sed_cmd} > #{yum_repo_file_path}"
result = on database, "cat #{yum_repo_file_path}"
Log.notify("Yum REPO DEFINITION:\n\n#{result.stdout}\n\n")
else
......
......@@ -6,7 +6,7 @@ step "Install development build of PuppetDB on the PuppetDB server" do
raise "No PUPPETDB_REPO_PUPPETDB set" unless test_config[:repo_puppetdb]
case os
when :redhat
when :redhat, :fedora
on database, "yum install -y git-core ruby rubygem-rake"
when :debian
on database, "apt-get install -y git-core ruby rake"
......@@ -44,7 +44,7 @@ step "Install development build of PuppetDB on the PuppetDB server" do
# That leaves the case where we're on a redhat box and we're running the
# tests as :install only (as opposed to :upgrade). In that case we need
# to start the service ourselves here.
if test_config[:install_mode] == :install and os == :redhat
if test_config[:install_mode] == :install and [:redhat, :fedora].include?(os)
start_puppetdb(database)
else
# make sure it got started by the package install/upgrade
......
......@@ -142,3 +142,9 @@ AMI:
:pe: ami-f5d76b9c
:foss: ami-f5d76b9c
:region: us-east-1
fedora-20-x86_64-west:
:image:
:pe: ami-c0b9daf0
:foss: ami-c0b9daf0
:region: us-west-2
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment