예제 #1
0
파일: test_pxe.py 프로젝트: gilmeir/nova
    def test_cache_image(self):
        self.mox.StubOutWithMock(os, "makedirs")
        self.mox.StubOutWithMock(os, "unlink")
        self.mox.StubOutWithMock(os.path, "exists")
        os.makedirs(pxe.get_image_dir_path(self.instance)).AndReturn(True)
        disk_path = os.path.join(pxe.get_image_dir_path(self.instance), "disk")
        os.unlink(disk_path).AndReturn(None)
        os.path.exists(disk_path).AndReturn(True)
        os.path.exists(pxe.get_image_file_path(self.instance)).AndReturn(True)
        self.mox.ReplayAll()

        image_meta = utils.get_test_image_info(self.context, self.instance)
        self.driver._cache_image(self.context, self.instance, image_meta)
        self.mox.VerifyAll()
예제 #2
0
    def test_cache_image(self):
        self.mox.StubOutWithMock(os, 'makedirs')
        self.mox.StubOutWithMock(os, 'unlink')
        self.mox.StubOutWithMock(os.path, 'exists')
        os.makedirs(pxe.get_image_dir_path(self.instance)).AndReturn(True)
        disk_path = os.path.join(pxe.get_image_dir_path(self.instance), 'disk')
        os.unlink(disk_path).AndReturn(None)
        os.path.exists(disk_path).AndReturn(True)
        os.path.exists(pxe.get_image_file_path(self.instance)).\
                AndReturn(True)
        self.mox.ReplayAll()

        image_meta = utils.get_test_image_info(self.context, self.instance)
        self.driver._cache_image(self.context, self.instance, image_meta)
        self.mox.VerifyAll()
예제 #3
0
파일: test_pxe.py 프로젝트: beride/nova
    def test_destroy_images(self):
        self._create_node()
        self.mox.StubOutWithMock(os, 'unlink')

        os.unlink(pxe.get_image_file_path(self.instance))
        os.unlink(pxe.get_image_dir_path(self.instance))
        self.mox.ReplayAll()

        self.driver.destroy_images(self.context, self.node, self.instance)
        self.mox.VerifyAll()
예제 #4
0
파일: test_pxe.py 프로젝트: ameade/nova
    def test_destroy_images(self):
        self._create_node()
        self.mox.StubOutWithMock(os, 'unlink')

        os.unlink(pxe.get_image_file_path(self.instance))
        os.unlink(pxe.get_image_dir_path(self.instance))
        self.mox.ReplayAll()

        self.driver.destroy_images(self.context, self.node, self.instance)
        self.mox.VerifyAll()
예제 #5
0
    def test_destroy_images(self):
        self._create_node()
        self.mox.StubOutWithMock(bm_utils, 'unlink_without_raise')
        self.mox.StubOutWithMock(bm_utils, 'rmtree_without_raise')

        bm_utils.unlink_without_raise(pxe.get_image_file_path(self.instance))
        bm_utils.rmtree_without_raise(pxe.get_image_dir_path(self.instance))
        self.mox.ReplayAll()

        self.driver.destroy_images(self.context, self.node, self.instance)
        self.mox.VerifyAll()
예제 #6
0
    def test_destroy_images(self):
        self._create_node()
        self.mox.StubOutWithMock(bm_utils, 'unlink_without_raise')
        self.mox.StubOutWithMock(bm_utils, 'rmtree_without_raise')

        bm_utils.unlink_without_raise(pxe.get_image_file_path(self.instance))
        bm_utils.rmtree_without_raise(pxe.get_image_dir_path(self.instance))
        self.mox.ReplayAll()

        self.driver.destroy_images(self.context, self.node, self.instance)
        self.mox.VerifyAll()
예제 #7
0
    def test_cache_image(self):
        self.mox.StubOutWithMock(os, 'makedirs')
        self.mox.StubOutWithMock(os.path, 'exists')
        os.makedirs(pxe.get_image_dir_path(self.instance)).\
                AndReturn(True)
        os.path.exists(pxe.get_image_file_path(self.instance)).\
                AndReturn(True)
        self.mox.ReplayAll()

        image_meta = utils.get_test_image_info(
                self.context, self.instance)
        self.driver._cache_image(
                self.context, self.instance, image_meta)
        self.mox.VerifyAll()
예제 #8
0
 def test_image_dir_path(self):
     self.assertEqual(
             pxe.get_image_dir_path(self.instance),
             os.path.join(CONF.instances_path, 'instance-00000001'))
예제 #9
0
 def test_image_dir_path(self):
     self.assertEqual(
         os.path.join(CONF.instances_path, 'instance-00000001'),
         pxe.get_image_dir_path(self.instance))
예제 #10
0
파일: test_pxe.py 프로젝트: gilmeir/nova
 def test_image_dir_path(self):
     self.assertEqual(os.path.join(CONF.instances_path, "instance-00000001"), pxe.get_image_dir_path(self.instance))