~ubuntu-branches/ubuntu/saucy/nova/saucy-proposed

« back to all changes in this revision

Viewing changes to debian/patches/upstream/0002-Stop-libvirt-test-from-deleting-instances-dir.patch

  • Committer: Package Import Robot
  • Author(s): Chuck Short
  • Date: 2012-05-24 13:12:53 UTC
  • mfrom: (1.1.55)
  • Revision ID: package-import@ubuntu.com-20120524131253-ommql08fg1en06ut
Tags: 2012.2~f1-0ubuntu1
* New upstream release.
* Prepare for quantal:
  - Dropped debian/patches/upstream/0006-Use-project_id-in-ec2.cloud._format_image.patch
  - Dropped debian/patches/upstream/0005-Populate-image-properties-with-project_id-again.patch
  - Dropped debian/patches/upstream/0004-Fixed-bug-962840-added-a-test-case.patch
  - Dropped debian/patches/upstream/0003-Allow-unprivileged-RADOS-users-to-access-rbd-volumes.patch
  - Dropped debian/patches/upstream/0002-Stop-libvirt-test-from-deleting-instances-dir.patch
  - Dropped debian/patches/upstream/0001-fix-bug-where-nova-ignores-glance-host-in-imageref.patch 
  - Dropped debian/patches/0001-fix-useexisting-deprecation-warnings.patch
* debian/control: Add python-keystone as a dependency. (LP: #907197)
* debian/patches/kombu_tests_timeout.patch: Refreshed.
* debian/nova.conf, debian/nova-common.postinst: Convert to new ini
  file configuration
* debian/patches/nova-manage_flagfile_location.patch: Refreshed

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
From 4acfab6a7b368d34295afdace678563e1c3fa058 Mon Sep 17 00:00:00 2001
2
 
From: Vishvananda Ishaya <vishvananda@gmail.com>
3
 
Date: Thu, 5 Apr 2012 17:00:25 -0700
4
 
Subject: [PATCH 2/5] Stop libvirt test from deleting instances dir
5
 
 
6
 
 * fixes bug 974293
7
 
 
8
 
Change-Id: Id41ab20193a70246ad2e3e1cc18edf47059d312d
9
 
---
10
 
 nova/tests/test_libvirt.py |   37 ++++++++++++-------------------------
11
 
 1 files changed, 12 insertions(+), 25 deletions(-)
12
 
 
13
 
diff --git a/nova/tests/test_libvirt.py b/nova/tests/test_libvirt.py
14
 
index 6b0f668..4ce91cb 100644
15
 
--- a/nova/tests/test_libvirt.py
16
 
+++ b/nova/tests/test_libvirt.py
17
 
@@ -2148,25 +2148,8 @@ class LibvirtConnectionTestCase(test.TestCase):
18
 
     """Test for nova.virt.libvirt.connection.LibvirtConnection."""
19
 
     def setUp(self):
20
 
         super(LibvirtConnectionTestCase, self).setUp()
21
 
-
22
 
         self.libvirtconnection = connection.LibvirtConnection(read_only=True)
23
 
 
24
 
-        self.temp_path = os.path.join(flags.FLAGS.instances_path,
25
 
-                                      'instance-00000001/', '')
26
 
-        try:
27
 
-            os.makedirs(self.temp_path)
28
 
-        except Exception:
29
 
-            print 'testcase init error'
30
 
-            pass
31
 
-
32
 
-    def tearDown(self):
33
 
-        super(LibvirtConnectionTestCase, self).tearDown()
34
 
-
35
 
-        try:
36
 
-            shutil.rmtree(flags.FLAGS.instances_path)
37
 
-        except Exception:
38
 
-            pass
39
 
-
40
 
     def _create_instance(self, params=None):
41
 
         """Create a test instance"""
42
 
         if not params:
43
 
@@ -2374,11 +2357,15 @@ class LibvirtConnectionTestCase(test.TestCase):
44
 
         self.stubs.Set(self.libvirtconnection, '_create_new_domain',
45
 
                        fake_create_new_domain)
46
 
 
47
 
-        ins_ref = self._create_instance()
48
 
-        libvirt_xml_path = os.path.join(flags.FLAGS.instances_path,
49
 
-                                        ins_ref['name'], 'libvirt.xml')
50
 
-        f = open(libvirt_xml_path, 'w')
51
 
-        f.close()
52
 
-
53
 
-        ref = self.libvirtconnection.finish_revert_migration(ins_ref, None)
54
 
-        self.assertTrue(isinstance(ref, eventlet.event.Event))
55
 
+        with utils.tempdir() as tmpdir:
56
 
+            self.flags(instances_path=tmpdir)
57
 
+            ins_ref = self._create_instance()
58
 
+            os.mkdir(os.path.join(tmpdir, ins_ref['name']))
59
 
+            libvirt_xml_path = os.path.join(tmpdir,
60
 
+                                            ins_ref['name'],
61
 
+                                            'libvirt.xml')
62
 
+            f = open(libvirt_xml_path, 'w')
63
 
+            f.close()
64
 
+
65
 
+            ref = self.libvirtconnection.finish_revert_migration(ins_ref, None)
66
 
+            self.assertTrue(isinstance(ref, eventlet.event.Event))
67
 
1.7.9.1
68