From 012cc4bf7e20d7a60191c1221a39d99046363cec Mon Sep 17 00:00:00 2001 From: Philip Hands Date: Fri, 10 Jun 2016 09:18:18 +0200 Subject: lvc: job-specific net name, and don't hardwire UUID --- cucumber/features/support/config.rb | 4 ++-- cucumber/features/support/helpers/vm_helper.rb | 11 +++++++++-- cucumber/features/support/hooks.rb | 2 +- 3 files changed, 12 insertions(+), 5 deletions(-) (limited to 'cucumber/features/support') diff --git a/cucumber/features/support/config.rb b/cucumber/features/support/config.rb index 2d13abdd..33380bb0 100644 --- a/cucumber/features/support/config.rb +++ b/cucumber/features/support/config.rb @@ -68,8 +68,8 @@ PATIENCE = ENV['PATIENCE'] || 1 CONFIGURED_KEYSERVER_HOSTNAME = 'hkps.pool.sks-keyservers.net' LIBVIRT_DOMAIN_NAME = "lvcVM-" + JOB_NAME #LIBVIRT_DOMAIN_UUID = "203552d5-819c-41f3-800e-2c8ef2546%03d" % $executor_number -LIBVIRT_NETWORK_NAME = "DebianToasterNet" -LIBVIRT_NETWORK_UUID = "f2305af3-2a64-4f16-afe6-b9dbf02a597e" +LIBVIRT_NETWORK_NAME = "lvcNET" +#LIBVIRT_NETWORK_UUID = "f2305af3-2a64-4f16-afe6-b9dbf02a597e" MISC_FILES_DIR = "/srv/jenkins/cucumber/features/misc_files" SERVICES_EXPECTED_ON_ALL_IFACES = [ 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 diff --git a/cucumber/features/support/hooks.rb b/cucumber/features/support/hooks.rb index 684861f6..cad7fb75 100644 --- a/cucumber/features/support/hooks.rb +++ b/cucumber/features/support/hooks.rb @@ -105,7 +105,7 @@ at_exit do VM.remove_all_snapshots $vmstorage.clear_pool end - $vmnet.destroy_and_undefine + #$vmnet.destroy_and_undefine $virt.close end # The artifacts directory is empty (and useless) if it contains -- cgit v1.2.3-70-g09d2