Beispiel #1
0
    def test_vhd_util_call(self):
        mox = self.mox
        mox.StubOutWithMock(utils, "execute")

        utils.execute("vhd-util", "coalesce", "-n", "vhdfile").AndReturn(("ignored", "ignored"))

        mox.ReplayAll()

        image_utils.coalesce_vhd("vhdfile")
        mox.VerifyAll()
Beispiel #2
0
    def test_vhd_util_call(self):
        mox = self.mox
        mox.StubOutWithMock(utils, 'execute')

        utils.execute('vhd-util', 'coalesce', '-n', 'vhdfile').AndReturn(
            ('ignored', 'ignored'))

        mox.ReplayAll()

        image_utils.coalesce_vhd('vhdfile')
        mox.VerifyAll()
Beispiel #3
0
    def test_vhd_util_call(self):
        mox = self.mox
        mox.StubOutWithMock(utils, 'execute')

        utils.execute(
            'vhd-util', 'coalesce', '-n', 'vhdfile'
        ).AndReturn(('ignored', 'ignored'))

        mox.ReplayAll()

        image_utils.coalesce_vhd('vhdfile')
        mox.VerifyAll()
Beispiel #4
0
    def test_chain_of_two_vhds(self):
        self.mox.StubOutWithMock(image_utils, 'get_vhd_size')
        self.mox.StubOutWithMock(image_utils, 'temporary_dir')
        self.mox.StubOutWithMock(image_utils, 'resize_vhd')
        self.mox.StubOutWithMock(image_utils, 'coalesce_vhd')
        self.mox.StubOutWithMock(image_utils, 'temporary_file')

        image_utils.get_vhd_size('0.vhd').AndReturn(1024)
        image_utils.temporary_dir().AndReturn(fake_context('tdir'))
        image_utils.resize_vhd('1.vhd', 1024, 'tdir/vhd-util-resize-journal')
        image_utils.coalesce_vhd('0.vhd')
        self.mox.ReplayAll()

        result = image_utils.coalesce_chain(['0.vhd', '1.vhd'])
        self.mox.VerifyAll()
        self.assertEqual('1.vhd', result)
Beispiel #5
0
    def test_chain_of_two_vhds(self):
        self.mox.StubOutWithMock(image_utils, 'get_vhd_size')
        self.mox.StubOutWithMock(image_utils, 'temporary_dir')
        self.mox.StubOutWithMock(image_utils, 'resize_vhd')
        self.mox.StubOutWithMock(image_utils, 'coalesce_vhd')
        self.mox.StubOutWithMock(image_utils, 'temporary_file')

        image_utils.get_vhd_size('0.vhd').AndReturn(1024)
        image_utils.temporary_dir().AndReturn(fake_context('tdir'))
        image_utils.resize_vhd('1.vhd', 1024, 'tdir/vhd-util-resize-journal')
        image_utils.coalesce_vhd('0.vhd')
        self.mox.ReplayAll()

        result = image_utils.coalesce_chain(['0.vhd', '1.vhd'])
        self.mox.VerifyAll()
        self.assertEquals('1.vhd', result)
Beispiel #6
0
    def test_chain_of_two_vhds(self):
        self.mox.StubOutWithMock(image_utils, "get_vhd_size")
        self.mox.StubOutWithMock(image_utils, "temporary_dir")
        self.mox.StubOutWithMock(image_utils, "resize_vhd")
        self.mox.StubOutWithMock(image_utils, "coalesce_vhd")
        self.mox.StubOutWithMock(image_utils, "temporary_file")

        image_utils.get_vhd_size("0.vhd").AndReturn(1024)
        image_utils.temporary_dir().AndReturn(fake_context("tdir"))
        image_utils.resize_vhd("1.vhd", 1024, "tdir/vhd-util-resize-journal")
        image_utils.coalesce_vhd("0.vhd")
        self.mox.ReplayAll()

        result = image_utils.coalesce_chain(["0.vhd", "1.vhd"])
        self.mox.VerifyAll()
        self.assertEqual("1.vhd", result)