Class: Beaker::Aixer
- Inherits:
-
Hypervisor
- Object
- Hypervisor
- Beaker::Aixer
- Defined in:
- lib/beaker/hypervisor/aixer.rb
Constant Summary
Constants inherited from Hypervisor
Constants included from HostPrebuiltSteps
HostPrebuiltSteps::APT_CFG, HostPrebuiltSteps::DEBIAN_PACKAGES, HostPrebuiltSteps::ETC_HOSTS_PATH, HostPrebuiltSteps::ETC_HOSTS_PATH_SOLARIS, HostPrebuiltSteps::IPS_PKG_REPO, HostPrebuiltSteps::NTPSERVER, HostPrebuiltSteps::ROOT_KEYS_SCRIPT, HostPrebuiltSteps::ROOT_KEYS_SYNC_CMD, HostPrebuiltSteps::SLEEPWAIT, HostPrebuiltSteps::SLES_PACKAGES, HostPrebuiltSteps::TRIES, HostPrebuiltSteps::UNIX_PACKAGES, HostPrebuiltSteps::WINDOWS_PACKAGES
Instance Method Summary collapse
- #cleanup ⇒ Object
-
#initialize(aix_hosts, options) ⇒ Aixer
constructor
A new instance of Aixer.
- #provision ⇒ Object
Methods inherited from Hypervisor
#configure, create, #generate_host_name, #validate
Methods included from HostPrebuiltSteps
#add_el_extras, #apt_get_update, #copy_file_to_remote, #copy_ssh_to_root, #disable_iptables, #disable_se_linux, #enable_root_login, #epel_info_for!, #get_domain_name, #get_ip, #hack_etc_hosts, #package_proxy, #proxy_config, #set_etc_hosts, #sync_root_keys, #timesync, #validate_host
Methods included from DSL::Patterns
Constructor Details
#initialize(aix_hosts, options) ⇒ Aixer
Returns a new instance of Aixer.
4 5 6 7 8 9 10 11 12 13 14 15 |
# File 'lib/beaker/hypervisor/aixer.rb', line 4 def initialize(aix_hosts, ) @options = @logger = [:logger] @hosts = aix_hosts #aix machines are reverted to known state, not a snapshot @fog_file = nil if File.exists?( @options[:dot_fog] ) @fog_file = YAML.load_file( @options[:dot_fog] ) end raise "Cant load #{@options[:dot_fog]} config" unless @fog_file end |
Instance Method Details
#cleanup ⇒ Object
43 44 45 |
# File 'lib/beaker/hypervisor/aixer.rb', line 43 def cleanup @logger.notify "No cleanup for aix boxes" end |
#provision ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/beaker/hypervisor/aixer.rb', line 17 def provision # Running the rake task on rpm-builder hypername = @fog_file[:default][:aix_hypervisor_server] hyperopts = @options.dup hyperopts['HOSTS'] = { hypername => { 'platform' => 'el-6-x86_64' } } @logger.notify "Connecting to hypervisor at #{hypername}" hypervisor = Beaker::Host.create( hypername, hyperopts ) hypervisor[:user] = @fog_file[:default][:aix_hypervisor_username] || hypervisor[:user] hypervisor[:ssh][:keys] = [@fog_file[:default][:aix_hypervisor_keyfile]] || hypervisor[:ssh][:keys] @hosts.each do |host| vm_name = host['vmname'] || host.name @logger.notify "Reverting #{vm_name} to aix clean state" start = Time.now # Restore AIX image, ID'd by the hostname hypervisor.exec(Command.new("cd pe-aix && rake restore:#{host.name}")) time = Time.now - start @logger.notify "Spent %.2f seconds reverting" % time end hypervisor.close end |