summaryrefslogtreecommitdiffstats
path: root/cucumber/features/support/helpers
diff options
context:
space:
mode:
authorPhilip Hands <phil@hands.com>2016-06-10 09:18:18 +0200
committerPhilip Hands <phil@hands.com>2016-06-10 11:22:01 +0200
commit012cc4bf7e20d7a60191c1221a39d99046363cec (patch)
treec6915f6c3baefac3e741e5ad10f9ad5e3cf723af /cucumber/features/support/helpers
parent67ebfb43d4c95a915b1bdc24d6dd4429dfa1e380 (diff)
downloadjenkins.debian.net-012cc4bf7e20d7a60191c1221a39d99046363cec.tar.xz
lvc: job-specific net name, and don't hardwire UUID
Diffstat (limited to 'cucumber/features/support/helpers')
-rw-r--r--cucumber/features/support/helpers/vm_helper.rb11
1 files changed, 9 insertions, 2 deletions
diff --git a/cucumber/features/support/helpers/vm_helper.rb b/cucumber/features/support/helpers/vm_helper.rb
index 3f172136..dd8ce936 100644
--- a/cucumber/features/support/helpers/vm_helper.rb
+++ b/cucumber/features/support/helpers/vm_helper.rb
@@ -15,8 +15,15 @@ class VMNet
rexml = REXML::Document.new(net_xml)
rexml.elements['network'].add_element('name')
rexml.elements['network/name'].text = @net_name
- rexml.elements['network'].add_element('uuid')
- rexml.elements['network/uuid'].text = LIBVIRT_NETWORK_UUID
+ # PGH
+ begin
+ old_net = @virt.lookup_network_by_name(@net_name)
+ rexml.elements['network'].add_element('uuid')
+ rexml.elements['network/uuid'].text = old_net.uuid
+ old_net.undefine
+ rescue
+ end
+ update(rexml.to_s)
update(rexml.to_s)
rescue Exception => e
destroy_and_undefine