[Qa-jenkins-scm] [jenkins.debian.net] 06/08: lvc: job-specific net name, and don't hardwire UUID

Holger Levsen holger at layer-acht.org
Fri Jun 10 09:30:14 UTC 2016


This is an automated email from the git hooks/post-receive script.

holger pushed a commit to branch master
in repository jenkins.debian.net.

commit 012cc4bf7e20d7a60191c1221a39d99046363cec
Author: Philip Hands <phil at hands.com>
Date:   Fri Jun 10 09:18:18 2016 +0200

    lvc: job-specific net name, and don't hardwire UUID
---
 cucumber/features/domains/default.xml          |  2 +-
 cucumber/features/domains/default_net.xml      |  2 +-
 cucumber/features/support/config.rb            |  4 ++--
 cucumber/features/support/helpers/vm_helper.rb | 11 +++++++++--
 cucumber/features/support/hooks.rb             |  2 +-
 5 files changed, 14 insertions(+), 7 deletions(-)

diff --git a/cucumber/features/domains/default.xml b/cucumber/features/domains/default.xml
index 34bcfbf..5eec9b7 100644
--- a/cucumber/features/domains/default.xml
+++ b/cucumber/features/domains/default.xml
@@ -33,7 +33,7 @@
     <controller type='virtio-serial' index='0'/>
     <interface type='network'>
       <!-- <mac address='52:54:00:ac:dd:ee'/> -->
-      <source network='DebianToasterNet'/>
+      <source network='lvcNET'/>
       <model type='virtio'/>
       <link state='up'/>
     </interface>
diff --git a/cucumber/features/domains/default_net.xml b/cucumber/features/domains/default_net.xml
index 88e7a17..35a1c61 100644
--- a/cucumber/features/domains/default_net.xml
+++ b/cucumber/features/domains/default_net.xml
@@ -1,5 +1,5 @@
 <network>
-  <name>DebianToasterNet</name>
+  <name>lvcNET</name>
   <forward mode='nat'/>
   <bridge name='virbr10' stp='on' delay='0' />
   <ip address='10.2.1.1' netmask='255.255.255.0'>
diff --git a/cucumber/features/support/config.rb b/cucumber/features/support/config.rb
index 2d13abd..33380bb 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 3f17213..dd8ce93 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 684861f..cad7fb7 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

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/qa/jenkins.debian.net.git



More information about the Qa-jenkins-scm mailing list