Sha256: 2859dbb19dc2a1c01a90f387a0d5e99c01a223c8c15e416ea881bc1ad7a1ce3c

Contents?: true

Size: 1.63 KB

Versions: 5

Compression:

Stored size: 1.63 KB

Contents

test_name 'confirm unix-specific package methods work'
confine :except, :platform => %w(windows solaris osx)

current_dir  = File.dirname(__FILE__)
pkg_fixtures = File.expand_path(File.join(current_dir, '../../fixtures/package'))
pkg_name     = 'puppetserver'

def clean_file(host, file)
  unless file.nil?
    filename = pkg_file(host, file)

    if !filename.nil? && host.file_exist?(filename)
      on(host, "rm -rf #{filename}")
    end
  end
end

def pkg_file(host, pkg_name)
  if host['platform'] =~ /debian|ubuntu/
    "/etc/apt/sources.list.d/#{pkg_name}.list"
  elsif host['platform'] =~ /el/
    "/etc/yum.repos.d/#{pkg_name}.repo"
  else
    nil
  end
end

step '#update_apt_if_needed : can execute without raising an error'
hosts.each do |host|
  host.update_apt_if_needed
end

step '#deploy_apt_repo : deploy puppet-server nightly repo'
hosts.each do |host|

  if host['platform'] =~ /debian|ubuntu/
    clean_file(host, pkg_name)
    host.deploy_apt_repo(pkg_fixtures, pkg_name, 'latest')
    assert(host.file_exist?(pkg_file(host, pkg_name)), 'apt file should exist')
    clean_file(host, pkg_name)
  end

end

step '#deploy_yum_repo : deploy puppet-server nightly repo'
hosts.each do |host|

  if host['platform'] =~ /el/
    clean_file(host, pkg_name)
    host.deploy_yum_repo(pkg_fixtures, pkg_name, 'latest')
    assert(host.file_exist?(pkg_file(host, pkg_name)), 'yum file should exist')
    clean_file(host, pkg_name)
  end

end

step '#deploy_package_repo : deploy puppet-server nightly repo'
hosts.each do |host|
  next if host['platform'] =~ /fedora/
  host.deploy_package_repo(pkg_fixtures, pkg_name, 'latest')
  clean_file(host, pkg_name)
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
beaker-2.49.0 acceptance/tests/base/packages_unix.rb
beaker-2.48.1 acceptance/tests/base/packages_unix.rb
beaker-2.48.0 acceptance/tests/base/packages_unix.rb
beaker-2.47.1 acceptance/tests/base/packages_unix.rb
beaker-2.47.0 acceptance/tests/base/packages_unix.rb