~ubuntu-cloud-archive/ubuntu/precise/nova/trunk

« 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, Adam Gandelman, Chuck Short
  • Date: 2012-04-12 14:14:29 UTC
  • Revision ID: package-import@ubuntu.com-20120412141429-dt69y6cd5e0uqbmk
Tags: 2012.1-0ubuntu2
[ Adam Gandelman ]
* debian/rules: Properly create empty doc/build/man dir for builds that
  skip doc building
* debian/control: Set 'Conflicts: nova-compute-hypervisor' for the various
  nova-compute-$type packages. (LP: #975616)
* debian/control: Set 'Breaks: nova-api' for the various nova-api-$service
  sub-packages. (LP: #966115)

[ Chuck Short ]
* Resynchronize with stable/essex:
  - b1d11b8 Use project_id in ec2.cloud._format_image()
  - 6e988ed Fixes image publication using deprecated auth. (LP: #977765)
  - 6e988ed Populate image properties with project_id again
  - 3b14c74 Fixed bug 962840, added a test case.
  - d4e96fe Allow unprivileged RADOS users to access rbd volumes.
  - 4acfab6 Stop libvirt test from deleting instances dir
  - 155c7b2 fix bug where nova ignores glance host in imageref
* debian/nova.conf: Enabled ec2_private_dns_show_ip so that juju can
  connect to openstack instances.
* debian/patches/fix-docs-build-without-network.patch: Fix docs build
  when there is no network access.

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
-- 
 
68
1.7.9.1
 
69