]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
tests: add a UUID to the disk name when using libvirt
authorAndrew Schoen <aschoen@redhat.com>
Fri, 18 Nov 2016 17:09:20 +0000 (11:09 -0600)
committerAndrew Schoen <aschoen@redhat.com>
Fri, 18 Nov 2016 20:15:08 +0000 (14:15 -0600)
This will allow each testing scenario to have a unique names
for it's disks so there will not be conflicts when running tests
in parallel.

Signed-off-by: Andrew Schoen <aschoen@redhat.com>
Vagrantfile

index 9a8fcb2b0a2071f18385c9753a0ae980556c5128..33f7d57988eeb4f7d21f08c7b589b7284d3e882d 100644 (file)
@@ -2,7 +2,7 @@
 # vi: set ft=ruby :
 
 require 'yaml'
-require 'securerandom'
+require 'time'
 VAGRANTFILE_API_VERSION = '2'
 
 DEBUG = false
@@ -32,6 +32,7 @@ USER           = settings['ssh_username']
 
 ASSIGN_STATIC_IP = !(BOX == 'openstack' or BOX == 'linode')
 DISABLE_SYNCED_FOLDER = settings.fetch('vagrant_disable_synced_folder', false)
+DISK_UUID = Time.now.utc.to_i
 
 
 ansible_provision = proc do |ansible|
@@ -467,7 +468,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
         # always make /dev/sd{a/b/c} so that CI can ensure that
         # virtualbox and libvirt will have the same devices to use for OSDs
         (0..2).each do |d|
-          lv.storage :file, :device => "hd#{driverletters[d]}", :path => "disk-#{i}-#{d}.disk", :size => '12G', :bus => "ide"
+          lv.storage :file, :device => "hd#{driverletters[d]}", :path => "disk-#{i}-#{d}-#{DISK_UUID}.disk", :size => '12G', :bus => "ide"
         end
         lv.memory = MEMORY
         lv.random_hostname = true