summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTails developers <amnesia@boum.org>2015-02-05 13:05:15 +0100
committerTails developers <amnesia@boum.org>2015-02-05 14:36:52 +0100
commitf48617c4f67ec264b6cdd4b2cff5b3b4b62d1f63 (patch)
tree7c6cec973b2372da2c895e95001f4ae593255539
parentf3db7b117ae41f7ba47c569245e93c77b9bcb941 (diff)
Improve encapsulation.
-rw-r--r--features/support/helpers/vm_helper.rb9
1 files changed, 3 insertions, 6 deletions
diff --git a/features/support/helpers/vm_helper.rb b/features/support/helpers/vm_helper.rb
index 4ae08de..92a56bf 100644
--- a/features/support/helpers/vm_helper.rb
+++ b/features/support/helpers/vm_helper.rb
@@ -3,7 +3,7 @@ require 'rexml/document'
class VMNet
- attr_reader :net_name, :net, :bridge_name
+ attr_reader :net_name, :net, :ip, :mac, :bridge_name
def initialize(virt, xml_path)
@virt = virt
@@ -29,6 +29,8 @@ class VMNet
clean_up
@net = @virt.define_network_xml(xml)
@net.create
+ @ip = net_xml.elements['network/ip/dhcp/host/'].attributes['ip']
+ @mac = net_xml.elements['network/ip/dhcp/host/'].attributes['mac']
@bridge_name = @net.bridge_name
end
@@ -55,11 +57,6 @@ class VM
@storage = storage
default_domain_xml = File.read("#{@xml_path}/default.xml")
update(default_domain_xml)
-
- net_xml = REXML::Document.new(@vmnet.net.xml_desc)
- @ip = net_xml.elements['network/ip/dhcp/host/'].attributes['ip']
- @mac = net_xml.elements['network/ip/dhcp/host/'].attributes['mac']
-
@display = Display.new(@domain_name, x_display)
set_cdrom_boot($tails_iso)
plug_network